API set user status

Discussion in '3CX Phone System - General' started by jharrell, Jul 23, 2009.

Thread Status:
Not open for further replies.
  1. jharrell

    Joined:
    Jun 23, 2009
    Messages:
    23
    Likes Received:
    1
    We are having good success using the polycom microbrowser to display the 3cx UserStatus of the extension on the idle display and display a live directory with extension status.

    However we would really like to replace the current soft keys that dial *60 and *61 to set the away/available UserStatus with a web page that does a flip/flop and shows the result that way the user gets more immediate response and no clunky "busy" tone along with a single key instead of two discrete.

    We have it working except that the 3cx assistant does not update the extension status unless it is "refreshed", this can be reproduced by setting the extension status in the 3cx admin web page as well(must use the same API).

    Again the extension status is getting set, the assistant simply isn't updating, is there a particular method that must be called, or is it simply not exposed in the current API?

    Here is the c# code:

    private Extension GetExtensionByNumber(string Number)
    {
    PhoneSystem.ApplicationName = "Polycom";
    PhoneSystem.CfgServerPort=5485;
    foreach( Extension ext in PhoneSystem.Root.GetExtensions())
    {
    if (ext.SIPID==Number)
    {
    return ext;
    }
    }
    return null;
    }

    private void SetAvailable(string Number,bool Available)
    {
    Extension ext = GetExtensionByNumber(Number);
    if(ext!=null)
    {
    if(Available)
    {
    ext.UserStatus=UserStatusType.Available;
    }
    else
    {
    ext.UserStatus=UserStatusType.Away;
    }
    ext.Save();
    }
    }
     
Thread Status:
Not open for further replies.