Caller ID & agent API, unable to hangup

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Caller ID & agent API, unable to hangup

Postby Two8nine » Wed Sep 26, 2018 2:44 pm

Vicidial version:
VERSION: 2.14-650a
BUILD: 180111-1544

Server: UCS C200 M2 (testing only)
Service Type: SIP
Location: Canada

I have purchased the manual(s).

Hi all.

I'm having a bit of an issue and hoping for some pointers. The setup we have requires two things, 1 -- we must output a caller id name, 2 -- we conduct all phone use through the agent/non-agent API's.

This works for the most part, we can make calls, monitor, record, etc. However, we usually (~90% of the time) cannot hang up calls. This reaches 100% if the length of the call is > 1 minute. I don't get any errors or any thing -- here is an example of the HTTP request prior to hangup:

INCALL,M9261428400000000236,236,186703,21,[Agent Name],AGENTS,1,LOGIN,,[phone number],,8600051

This is the request to hangup:

POST http://[Server IP]/agc/api.php?source=test&user=[USER]&pass=[Pass]&agent_user=[agent user]&function=external_pause&value=PAUSE HTTP/1.1
SUCCESS: external_pause function set - PAUSE|1537990297|[agent user]

However, the call does not actually hang up, and nothing is logged to the asterisk-r screen.

-------------------------------------------------

What appears to cause the issue is adding this line to the Carrier dial plan entry:

exten =>_9NXXNXXXXXX,2,Set(CALLERID(all)="[name to show]" <[outpulse number]>)

This works, in that the correct name and number show for those who receive the call, but also seems to inhibit the ability to hangup calls. My assumption was that the string normally shown in the name field (M9261428400000000236) is required to identify the call. Is this correct?

Is there another method to display both a name and number?

Appreciate the time.
Two8nine
 
Posts: 33
Joined: Wed May 24, 2017 10:11 am

Re: Caller ID & agent API, unable to hangup

Postby mflorell » Wed Sep 26, 2018 2:56 pm

If you want to send our CIDname, you have to use an IAX loopback trunk and set the CIDname on the other side of that trunk. VICIdial uses the CIDname to store the unique identifier of calls to be able to keep track of and control them. Changing the CIDname means that VICIdial can no longer keep track of the call.

If you go in the /etc/asterisk/extensions.conf file, you will see some example dialplan entries at the top that are commented out that we have used before to enable CIDname transmission for our Canadian clients:

[loopback-no-log]
; This context is to accept calls that have already been logged in another context in Vicidial
; and has been sent through one of the loopbacks. This is why this context is missing the h extension.
; Do not put any extensions in this context unless you specifically understand what this means.

;exten => _91NXXNXXXXXX,1,Dial(${TRUNKX}/${EXTEN:1},,To)
;exten => _91NXXNXXXXXX,n,Hangup()

; special Canadian PRI callerIDname settings FOR USE IN LOOPBACK CONTEXT ONLY
;exten => _91NXXNXXXXXX,1,Set(CALLERID(name)="ACME Widgets")
;exten => _91NXXNXXXXXX,n,AGI(agi-CANADA_PRI_CIDname.agi)
;exten => _91NXXNXXXXXX,n,Dial(${TRUNKX}/${EXTEN:1},,To)
;exten => _91NXXNXXXXXX,n,Hangup()
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Caller ID & agent API, unable to hangup

Postby Two8nine » Wed Sep 26, 2018 3:00 pm

Wow that was quick. Appreciate the response I'll give it a go.
Two8nine
 
Posts: 33
Joined: Wed May 24, 2017 10:11 am

Re: Caller ID & agent API, unable to hangup

Postby Two8nine » Thu Sep 27, 2018 9:33 am

Ok so I think I'm on the right (ish) track, but still having issues.

If I'm understanding what you are saying, I need to uncomment the following lines in extensions.conf, which I have done:

exten => _9NXXNXXXXXX,1,Dial(${TRUNKX}/${EXTEN:1},,To)
exten => _9NXXNXXXXXX,n,Hangup()

exten => _9NXXNXXXXXX,1,Set(CALLERID(name)="My Company")
exten => _9NXXNXXXXXX,n,AGI(agi-CANADA_PRI_CIDname.agi)
exten => _9NXXNXXXXXX,n,Dial(${MyCarrier}/${EXTEN:1},,To)
exten => _9NXXNXXXXXX,n,Hangup()

I have removed the '1' as my carrier prohibits dialing 1. (Unsure if that change still needs to be made here or only in carrier settings, but I get the same result either way.)

No other changes are made to extensions.conf.

In carrier settings, I've made this the dial entry. (Based on a response in a different thread from years ago.)

exten => _9NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9NXXNXXXXXX,2,Dial(${TRUNKloop}/888${EXTEN:2},55,o)
exten => _9NXXNXXXXXX,3,Hangup
exten => _888NXXNXXXXXX,1,Goto(loopback-no-log,9${EXTEN:3},1)

On attempting a call I get the error(s):

channel.c:6009 ast_request: No channel type registered for ''
app_dial.c:2455 dial_exec_full: Unable to create channel of type '' (cause 66 - Channel not implemented)
Two8nine
 
Posts: 33
Joined: Wed May 24, 2017 10:11 am

Re: Caller ID & agent API, unable to hangup

Postby Two8nine » Thu Sep 27, 2018 2:07 pm

Ok getting there.

I removed everything in the dial plan save the globals string, and just used the uncommented lines in extensions.conf. (With the '1's removed.) and some apparent typos fixed.

It now seems to work.

As a follow up question -- what would be the best method to have the outbound name change depending on the client we are calling for? Is there a way to set this by campaign and pass it in? Add a second extension like the 888 that supplies a different name and map the campaigns to that?

Once again appreciate the help. More of a UI/DB guy, this phone stuff is hard to wrap my head around.
Two8nine
 
Posts: 33
Joined: Wed May 24, 2017 10:11 am

Re: Caller ID & agent API, unable to hangup

Postby williamconley » Thu Sep 27, 2018 2:26 pm

Build a complete parallel copy (and test it before making any changes). Whatever your version of this line:
Code: Select all
exten => _888NXXNXXXXXX,1,Goto(loopback-no-log,9${EXTEN:3},1)


Make a dupe of that line with a single digit change (887 instead of 888?) and all the lines that it points to (in this case: 9${EXTEN:3} would remove the 888 and add the 9, so _9NXXNXXXXXX would be the target). Then use the new one without any changes to be sure your new copy works ...

Then change this line in the copy:

Code: Select all
exten => _91NXXNXXXXXX,1,Set(CALLERID(name)="ACME Widgets")


You CAN remove these entries from the .conf file and move them to your carrier settings (they can only exist in one place, but there's no reason that place can't be the "easy to modify" place!).

After this, you have a fairly easy method to create a new CID Name by using a new Dial Prefix in the campaign.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Caller ID & agent API, unable to hangup

Postby Two8nine » Fri Sep 28, 2018 8:34 am

Thanks again -- I will give this a go.
I plan on moving the lines over to the carrier settings as well -- just so happened to get it working in the conf file first, but figured out it had nothing to do with the location. (My issue was leaving the loopback set to 'TRUNKX' rather than the actual trunk.
Two8nine
 
Posts: 33
Joined: Wed May 24, 2017 10:11 am

Re: Caller ID & agent API, unable to hangup

Postby Two8nine » Fri Sep 28, 2018 1:31 pm

Apparently I spoke too soon. While I can make calls, my original problem has not changed. (Cannot hang up calls that are > 1 minute.)

Hoping someone can point me in the right direction here.

These are my carrier settings:

Carrier Name: BELLSIP

Registration String: None

Account entry:
[carrier]
host=192.168.10.119
fromuser=admin
secret=password
context=trunkinbound
type=friend
qualify=1000
dtmfmode=rfc2833
canreinvite=no
allow=ulaw
port=5060
insecure=invite

Globals String: BELLSIP=SIP/carrier

DialPlan entry:

exten => _9NXXNXXXXXX,1, AGI(agi://127.0.0.1:4577/call_log)
exten => _9NXXNXXXXXX,n,Dial(${TRUNKloop}/888${EXTEN:2},55,o)
exten => _9NXXNXXXXXX,n,Hangup()

exten => _888NXXNXXXXXX,1,Goto(loopback-no-log,9${EXTEN:3},1)
exten => _888NXXNXXXXXX,n,Hangup()

----------------------------------------------

The uncommented portion of the loopback portion of extensions.conf is:

exten => _9NXXNXXXXXX,1,Set(CALLERID(all)="name" <number>)
exten => _9NXXNXXXXXX,n,AGI(agi-CANADA_PRI_CIDname.agi)
exten => _9NXXNXXXXXX,n,Dial(${BELLSIP}/${EXTEN:1},,To)
exten => _9NXXNXXXXXX,n,Hangup()

-----------------------------------------------

This works, in that I can dial out via 888(number) and proceed as normal. If the call is very short, I can also hang up.

If the call is > 1 minute the only way to terminate the call is to forcibly log the agent out.
However, I still get no errors when using the API. These are some inputs and outputs when trying to hangup:

Status Prior to hangup:

INCALL,M9281321100000000275,275,186703,26,[Agent Name],AGENTS,1,LOGIN,DIAL,[PHONE NUMBER],,8600051
Sending the hangup request:
http://192.168.10.121/agc/api.php?source=test&user=[admin user]&pass=[admin password]&agent_user=102&function=external_hangup&value=1
SUCCESS: external_hangup function set - 1|102
Status post hangup request
INCALL,M9281321100000000275,275,186703,26,[Agent Name],AGENTS,1,LOGIN,DIAL,[PHONE NUMBER],,8600051

No activity occurs on the asterisk-r console during any of this. I can use the api to log the agent out normally, but this still does not end the call.

Have I missed something in setting up the loopback?
Two8nine
 
Posts: 33
Joined: Wed May 24, 2017 10:11 am

Re: Caller ID & agent API, unable to hangup

Postby Two8nine » Fri Sep 28, 2018 2:52 pm

Ok think I got it.

I was thinking I was to dial out as 888(num), but I actually just need to do 9(num) and the jump to 888 happens in the background right?

I changed the dialplan to this(as dialing with a 9 cut off the first digit of the phone number):

exten => _9NXXNXXXXXX,1, AGI(agi://127.0.0.1:4577/call_log)
exten => _9NXXNXXXXXX,n,Dial(${TRUNKloop}/888${EXTEN:1},55,o)
exten => _9NXXNXXXXXX,n,Hangup()

exten => _888NXXNXXXXXX,1,Goto(loopback-no-log,9${EXTEN:3},1)
exten => _888NXXNXXXXXX,n,Hangup()

Seems to work now.
Two8nine
 
Posts: 33
Joined: Wed May 24, 2017 10:11 am


Return to Support

Who is online

Users browsing this forum: No registered users and 70 guests