Problem with API C#

Discussion in '3CX Phone System - General' started by itsystem, Oct 27, 2012.

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

    Joined:
    Jan 25, 2011
    Messages:
    15
    Likes Received:
    0
    Hello!
    I need develope API code for connection to 3CX Phone System, but face on with problem.
    I'm need run that code with help "Windows Form Application":
    Code:
    private void button1_Click(object sender, EventArgs e)
            {
                PBXConnection pbx = new PBXConnection();
                pbx.MakeCall("100", "101");
                
            }
    When I click button1, get this error:
    on this code string PBXConnection pbx = new PBXConnection();
    I also try change string to:
    Code:
     PBXConnection pbx = new PBXConnection("127.0.0.1", 5482, "admin", "admin");
    and
    Code:
     PBXConnection pbx = new PBXConnection("127.0.0.1", 5482, "", "");
    but result error as above

    Visual Studio Project run locally (the same PC where installed 3CX Phone System).

    3CXPhoneSystem.ini
    Code:
    [General]
    AppPath=C:\Program Files\3CX PhoneSystem\
    WebServer=""
    pbxSLNIC=127.0.0.1
    FirstRun=False
    LogLevel=2
    ;msNoRTPFilter=0
    ;Msusetickcount=1
    [ConfService]
    AppName=DBProvider
    ConfPort=5485
    DBPort=5480
    confUser=DBServ
    dbUser=phonesystem
    DBHost=localhost
    DBName=phonesystem
    DefFile=Objects.cls
    confNIC=0.0.0.0
    confPass=pass
    dbPassword=6Rz_Ti-7&C3kM4g{xE$8
    PhoneSystem.ApplicationName = “Form1”
    PhoneSystem.ApplicationName = “3CX_Dialer”
    [MediaServer]
    Receivers=4
    Priorityclass=128
    Senders=4
    ;Sender3=0;15;-1
    ;Sender2=0;15;-1
    ;Sender1=0;15;-1
    ;Sender0=0;15;-1
    ;Receiver2=0;15;-1
    ;Receiver0=0;15;-1
    ;Receiver3=0;15;-1
    ;Receiver1=0;15;-1
    [CallReports]
    DATABASE=phonesystem
    USERNAME=logsreader
    PORT=5480
    DRIVER=PostgreSQL Unicode
    ReadOnly=1
    SERVER=localhost
    PASSWORD=5Zy+b&W4Qp6!3}wF?R8d
    Help please! :(
     
  2. itsystem

    Joined:
    Jan 25, 2011
    Messages:
    15
    Likes Received:
    0
    8| Help Please!
     
  3. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    PBXConnection is useless without notifications provided by PhoneSystem.Root
    OMSamples provides sample how to use MakeCall

    :eek:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. itsystem

    Joined:
    Jan 25, 2011
    Messages:
    15
    Likes Received:
    0
    Of course, I will use notification provider, but I need only test MakeCall using my 3CX PS.
    Or PBXConnection() don't work without it???
     
  5. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    In current version you must initialize connection to configuration server first.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. itsystem

    Joined:
    Jan 25, 2011
    Messages:
    15
    Likes Received:
    0
    If are You can example please how this to do?
     
  7. SY

    SY Well-Known Member
    3CX Support

    Joined:
    Jan 26, 2007
    Messages:
    1,825
    Likes Received:
    2
    http://www.3cx.com/downloads/3CXCallControlAPI_v11.zip
    see folder OMSamples
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. itsystem

    Joined:
    Jan 25, 2011
    Messages:
    15
    Likes Received:
    0
    OK! Thank's!
     
  9. itsystem

    Joined:
    Jan 25, 2011
    Messages:
    15
    Likes Received:
    0
    Thank You for advice for initial connection. All work OK!
    But I need develop some application which will be automatic dial procedure from list of external number and connection it with IVR internal number for automatically notify external users about something.

    I wrote code which start dial and connection with IVR number, but I need as anything monitoring state of current call and when it end or droped start dial to next item from list.

    I tried to understand how to do it and see "MyListner class" and Notification Monitor sample but unfortunately I can't figure out how to do it.

    Please explain how to do it ????

    Thank You!!!
     
  10. itsystem

    Joined:
    Jan 25, 2011
    Messages:
    15
    Likes Received:
    0
    Help please!!! 8|
     
Thread Status:
Not open for further replies.