API Help

Discussion in '3CX Phone System - General' started by ChrisPriest, Feb 17, 2010.

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

    Joined:
    Feb 17, 2010
    Messages:
    20
    Likes Received:
    0
    Hi All,

    I'm trying to make use of the API, I am using C# running on the same PC as the phone system.

    I seem unable to establish a link to the phone system, I've tried the sample (modifying it to work with v8)

    The connection string is: mPbxConn = new PBXConnection("localhost", 5485, "<someuser>", "<somepassword>")

    But I always get an exception from this saying:

    ---------------------------
    TCX.PBXAPI.PBXIsNotConnected: Exception of type 'TCX.PBXAPI.PBXIsNotConnected' was thrown.

    at TCX.PBXAPI.PBXConnection..ctor(String pbxSLHost, Int32 pbxSLPort, String pbxSLuser, String pbxSLpassword)

    at HudSample.MyTree..ctor() in C:\CallControlAPI\MyTree.cs:line 57
    ----------------------------

    I have added PhoneSystem.ApplicationName="Hudsample" to the 3cxphonesystem.ini file.

    I can telnet to port 5485 OK, so I know the system is listening.

    Can anyone shed any light?

    Best Regards
    Chris
     
  2. vsefcik

    Joined:
    Nov 18, 2009
    Messages:
    19
    Likes Received:
    0
    I was able to get the sampe to run but I didn't modify the line "mPbxConn = new PBXConnection..." in MyTree.cs. I left that line as it was originally written (mPbxConn = new PBXConnection();). Instead, open the file Program.cs and add the line:
    PhoneSystem.CfgServerPort = 5485;

    after the line that reads:
    PhoneSystem.ApplicationName = "HudSample";
     
  3. ChrisPriest

    Joined:
    Feb 17, 2010
    Messages:
    20
    Likes Received:
    0
    That worked :) Thank you :)
     
  4. nico

    Joined:
    Jun 11, 2010
    Messages:
    1
    Likes Received:
    0
    Hello,
    Can you provide me this sample. I have the same problem, I writing my own application and I can't find sample what you talking about.

    Best regards,
    Nico
     
Thread Status:
Not open for further replies.