• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

TCX.PBXAPI.PBXIsNotConnected

Status
Not open for further replies.

bertyhell

Joined
Jul 17, 2012
Messages
1
Reaction score
0
I'm trying to make a call from one extension to another using the 3CX Call Control API

evrytime i run my application i get this error:
Code:
Unexpected Exception: TCX.PBXAPI.PBXIsNotConnected: An exception has occured of the type:  TCX.PBXAPI.PBXIsNotConnected.
   at TCX.PBXAPI.PBXConnection..ctor(String pbxSLHost, Int32 pbxSLPort, String
pbxSLuser, String pbxSLpassword)
   at TestCSharp.Program.Main(String[] args) in ...\3CXCallControlAPI_v10\TestAPI\Program. 38

the code looks like this:
Code:
            PBXConnection Pbx = new PBXConnection("127.0.0.1", 5485, "admin", "0109Smart1910");

            Console.WriteLine("created PBXConnection object");

            while (true)
            {
                try
                {
                    Pbx.MakeCall("201", "202");
                }
                catch (Exception E)
                {
                    Console.WriteLine(E.ToString());
                }
                Console.WriteLine("done");
                Console.ReadKey();
            }


I adjusted the 3cxPhoneSystem.ini file like this:
Code:
[General]
AppPath=C:\Program Files\3CX PhoneSystem\
WebServer=""
pbxSLNIC=127.0.0.1
FirstRun=False
LogLevel=2
;msNoRTPFilter=0
;Msusetickcount=1
PBXUser=myusername
PBXPass=mypassword
[ConfService]
AppName=DBProvider
ConfPort=5485
DBPort=5480
confUser=myotherusername
dbUser=phonesystem
DBHost=localhost
DBName=phonesystem
DefFile=Objects.cls
confNIC=0.0.0.0
confPass=myotherpassword
dbPassword=mythirdpassword
PhoneSystem.ApplicationName="TestCSharp"
[MediaServer]

Any ideas what i'm doing wrong?
 
Why not use the CallNotifier instead?
It requires MyPhone to be installed... I use a few registry keys to determine 32 or 64 bit installations then the location of the CallNotifier program.

Here's my code:

Code:
 Try
            Dim CallNotifierPath As String = ""
            Dim regkey As Microsoft.Win32.RegistryKey

            If Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Hardware\Description\System\CentralProcessor\0").GetValue("Identifier").ToString.Contains("x86") Then
                regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\3CX\MyPhone", False)
                CallNotifierPath = regkey.GetValue("CallNotifier")

            Else
                regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Wow6432Node\3CX\MyPhone", False)
                CallNotifierPath = regkey.GetValue("CallNotifier")

            End If

            If CallNotifierPath = "" Then
                MsgBox("MyPhone must be installed locally to use this feature. Contact your helpdesk for support.", MsgBoxStyle.OkOnly, "Error")
                Exit Sub
            Else
                Shell(CallNotifierPath & " -cmd makecall:" & number, AppWinStyle.Hide, True)

            End If


            'Shell()
        Catch ex As Exception
            LogException("MAKE CALL: " & vbCrLf & ex.ToString)
        End Try
 
Are there any answers to the original question? I have tried everything and can't get it to work. TCX.PBXAPI.PBXIsNotConnected
 
Status
Not open for further replies.
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.