Problem with API C#

Status
Not open for further replies.

itsystem

Joined
Jan 25, 2011
Messages
15
Reaction score
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:
Exception of type 'TCX.PBXAPI.PBXIsNotConnected' was thrown.
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! :(
 
8| Help Please!
 
PBXConnection is useless without notifications provided by PhoneSystem.Root
OMSamples provides sample how to use MakeCall

:o
 
Of course, I will use notification provider, but I need only test MakeCall using my 3CX PS.
Or PBXConnection() don't work without it???
 
itsystem said:
Or PBXConnection() don't work without it???
In current version you must initialize connection to configuration server first.
 
If are You can example please how this to do?
 
http://www.3cx.com/downloads/3CXCallControlAPI_v11.zip
see folder OMSamples
 
OK! Thank's!
 
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!!!
 
Help please!!! 8|
 
Status
Not open for further replies.

Members Online Now

Forum statistics

Threads
111,843
Messages
589,328
Members
164,680
Latest member
JV J