API Challenge
Posted: Tue Nov 07, 2017 4:54 pm
I currently am using a .net web application that pops in a webform. I am trying to simulate the same function on the API that our fronters use to transfer calls to their counterparts. Normal flow is as follows: Call gets dialed and passed to the fronter agent and the webform pops up with the information from our CRM system. They will do a "Park - Customer Dial" with the extension for the closing agent and announce the callee to the closer then after the fronter is finished he clicks "Leave 3 Way Call" and the callee is with the closer and the fronter is presented with a dispo screen. All good and works well. With the new webform I am basically setting the extension for the closer by allowing them to select their name in a dropdown and the value is stored for the phone_number component of the API. I then call the transfer_conference function and the callee gets parked, the fronter is connected to the closer and once done I have a button that is titled "Finish Call" that sends the "LEAVE_3WAY_CALL" api function and what happens is the callee and the closer are connected but the fronter is also still there and cannot drop and dispo the call without hanging up and re-logging into the session. So it seems that the buttons work as specified however when trying to replicate it with the API calls it will not drop the fronter and send him to his dispo screen. I am not at the latest version of astguiclient, however, since the dialer screen buttons work as designed I am wondering if I need to update the astguiclient codebase or is there something im missing in the API call.
In Summary (this works fine, just cant get the api to leave 3 way correctly):
1) Call is connected to agent, he clicks "park customer dial" then enters the closers extension (located on another asterisk box connected via sip trunk with the following dialplan:)
a) exten => _1XXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _1XXX,2,Dial(${csopbxtrunk}/${EXTEN},,tTor)
exten => _1XXX,3,Hangup
2) Fronter talks to closer and tells him who he is going to talk to, info etc.. (Cust is on park)
3) Fronter Clicks "Leave 3 Way Call" then is sent to dispo screen and dispos call. (THIS IS WHERE THE API DOES THE UNEXPECTED AND ALL PERSONS ARE STILL ON THE CALL RATHER THAN DROPPING THE FRONTER)
4) Closer is still on the line with the client and completes the call.
The API calls are like so in the following order:
1) 192.168.0.223/agc/api.php?source=DEVTEST&user=6666&pass=1234&agent_user=6666&function=transfer_conference&value=PARK_CUSTOMER_DIAL&phone_number=1100
Then when he is done talking to closer:
2) 192.168.0.223/agc/api.php?source=DEVTEST&user=6666&pass=1234&agent_user=6666&function=transfer_conference&value=LEAVE_3WAY_CALL
Fronter and closer and client are connected after #2 and no way for fronter agent to leave the call without just hanging up the dialer line and re-logging in..
Updated signature to reflect versions - 3 server cluster (DB,WEB,DIALER) VERSION: 2.12-575a
BUILD: 161113-0900 - Asterisk 11.25.1-vici
THE VB CODE FOR THE 2 CALLS TO THE API FUNCTIONS ARE AS FOLLOWS:
Private Sub TransferCall()
Dim client = New HttpClient
Dim request = WebRequest.CreateHttp("http://192.168.0.223/agc/api.php")
request.Credentials = CredentialCache.DefaultCredentials
request.UserAgent = "value"
request.Method = HttpMethod.Post.Method
request.ContentType = "application/x-www-form-urlencoded"
Dim params = New Dictionary(Of String, String)
params.Add("source", Session("CAMPAIGN"))
params.Add("user", "6666")
params.Add("pass", "1234")
params.Add("agent_user", Session("FRONTER"))
params.Add("function", "transfer_conference")
params.Add("value", "PARK_CUSTOMER_DIAL")
params.Add("phone_number", cboCloser.SelectedValue)
'params.Add("consultave", "YES")
Dim stream = request.GetRequestStream()
Dim content = New FormUrlEncodedContent(params)
content.CopyToAsync(stream)
Dim result = request.GetResponseAsync().Result
Console.WriteLine(result.ToString)
End Sub
************************************************************
Private Sub Drop3Way()
Dim client = New HttpClient
Dim request = WebRequest.CreateHttp("http://192.168.0.223/agc/api.php")
request.Credentials = CredentialCache.DefaultCredentials
request.UserAgent = "value"
request.Method = HttpMethod.Post.Method
request.ContentType = "application/x-www-form-urlencoded"
Dim params = New Dictionary(Of String, String)
params.Add("source", Session("CAMPAIGN"))
params.Add("user", "6666")
params.Add("pass", "1234")
params.Add("agent_user", Session("FRONTER"))
params.Add("function", "transfer_conference")
params.Add("value", "LEAVE_3WAY_CALL")
Dim stream = request.GetRequestStream()
Dim content = New FormUrlEncodedContent(params)
content.CopyToAsync(stream)
Dim result = request.GetResponseAsync().Result
Console.WriteLine(result.ToString)
End Sub
Any pointers would be helpful, thanks in advance.
In Summary (this works fine, just cant get the api to leave 3 way correctly):
1) Call is connected to agent, he clicks "park customer dial" then enters the closers extension (located on another asterisk box connected via sip trunk with the following dialplan:)
a) exten => _1XXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _1XXX,2,Dial(${csopbxtrunk}/${EXTEN},,tTor)
exten => _1XXX,3,Hangup
2) Fronter talks to closer and tells him who he is going to talk to, info etc.. (Cust is on park)
3) Fronter Clicks "Leave 3 Way Call" then is sent to dispo screen and dispos call. (THIS IS WHERE THE API DOES THE UNEXPECTED AND ALL PERSONS ARE STILL ON THE CALL RATHER THAN DROPPING THE FRONTER)
4) Closer is still on the line with the client and completes the call.
The API calls are like so in the following order:
1) 192.168.0.223/agc/api.php?source=DEVTEST&user=6666&pass=1234&agent_user=6666&function=transfer_conference&value=PARK_CUSTOMER_DIAL&phone_number=1100
Then when he is done talking to closer:
2) 192.168.0.223/agc/api.php?source=DEVTEST&user=6666&pass=1234&agent_user=6666&function=transfer_conference&value=LEAVE_3WAY_CALL
Fronter and closer and client are connected after #2 and no way for fronter agent to leave the call without just hanging up the dialer line and re-logging in..
Updated signature to reflect versions - 3 server cluster (DB,WEB,DIALER) VERSION: 2.12-575a
BUILD: 161113-0900 - Asterisk 11.25.1-vici
THE VB CODE FOR THE 2 CALLS TO THE API FUNCTIONS ARE AS FOLLOWS:
Private Sub TransferCall()
Dim client = New HttpClient
Dim request = WebRequest.CreateHttp("http://192.168.0.223/agc/api.php")
request.Credentials = CredentialCache.DefaultCredentials
request.UserAgent = "value"
request.Method = HttpMethod.Post.Method
request.ContentType = "application/x-www-form-urlencoded"
Dim params = New Dictionary(Of String, String)
params.Add("source", Session("CAMPAIGN"))
params.Add("user", "6666")
params.Add("pass", "1234")
params.Add("agent_user", Session("FRONTER"))
params.Add("function", "transfer_conference")
params.Add("value", "PARK_CUSTOMER_DIAL")
params.Add("phone_number", cboCloser.SelectedValue)
'params.Add("consultave", "YES")
Dim stream = request.GetRequestStream()
Dim content = New FormUrlEncodedContent(params)
content.CopyToAsync(stream)
Dim result = request.GetResponseAsync().Result
Console.WriteLine(result.ToString)
End Sub
************************************************************
Private Sub Drop3Way()
Dim client = New HttpClient
Dim request = WebRequest.CreateHttp("http://192.168.0.223/agc/api.php")
request.Credentials = CredentialCache.DefaultCredentials
request.UserAgent = "value"
request.Method = HttpMethod.Post.Method
request.ContentType = "application/x-www-form-urlencoded"
Dim params = New Dictionary(Of String, String)
params.Add("source", Session("CAMPAIGN"))
params.Add("user", "6666")
params.Add("pass", "1234")
params.Add("agent_user", Session("FRONTER"))
params.Add("function", "transfer_conference")
params.Add("value", "LEAVE_3WAY_CALL")
Dim stream = request.GetRequestStream()
Dim content = New FormUrlEncodedContent(params)
content.CopyToAsync(stream)
Dim result = request.GetResponseAsync().Result
Console.WriteLine(result.ToString)
End Sub
Any pointers would be helpful, thanks in advance.