Use of HTTP API

Status
Not open for further replies.

eQDoBBs

Forum User
Joined
Aug 14, 2012
Messages
38
Reaction score
3
Hi,

We are currently planning a migration to 3CX from Trixbox and a key feature is the ability to click a link in our vTiger based CRM system.

I have successfully updated the StartCall.php code to integrate to the HTTP API within 3CX via cURL, but I am having an issue with the URL.

The http://<IP>:5000/ivr/PbxAPI.aspx?func=make_call&from=<ext>&to=<telno>&pin=<pin> format of the URL is not the final string required by the API. When you populate the values and paste into the address bar of a browser your get redirected to a URl with an additional hash value - http://<IP>:5000/ivr/(S(we4n1mwqwzhrd10lax4zfbpn))/PbxAPI.aspx?func=make_call&from=<ext>&to=<telno>&pin=<pin> for example.

This hash changes on some kind of cycle and causes the link to fail to make the call. Is this hash addition necessary and is their something that can be done either in the cURL code or a setting within the 3CX API to remove the need for this?

thanks in advance for any help

Mark
 
I have used this code in my CRM:
Code:
 Public Sub MakeACall(ByVal number As String)
        'Find the path in the Registry
        'HKLM\Software\3CX\CRM\CallNotifierPath
        If number = "" Then Exit Sub

        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
        Catch ex As Exception
            MsgBox("Make call failed. Contact your helpdesk for support.", MsgBoxStyle.OkOnly, "Error")
            LogException("MAKE CALL: " & vbCrLf & ex.ToString)
        End Try
End Sub
 
Status
Not open for further replies.

Forum statistics

Threads
111,848
Messages
589,349
Members
164,682
Latest member
donjerrymandelsone@gmail.