Setting CallerID NAME via AGI breaks Manual Dialing and Xfer

All installation and configuration problems and questions

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

Setting CallerID NAME via AGI breaks Manual Dialing and Xfer

Postby ajax1515 » Wed Nov 16, 2016 10:19 am

Hello,

So I'm having an interesting little problem. I've built a handful of custom agi's into my workflow and one of them seems to be creating an issue. This AGI get's called in the carrier dialplan like so:

Code: Select all
exten => _61NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _61NXXNXXXXXX,2,AGI(custom.agi,+${EXTEN:1})
exten => _61NXXNXXXXXX,3,Hangup


It does some logical operations and then uses php-agi to set the callerid number and name.

Code: Select all
$agi->exec("SET", "CALLERID(all)=\"$new_cid_name\"<$new_cid_number>");


Then it does some more logic and makes the dial...

It all works nicely and the name and number change as expected, except for one piece. When the CID NAME specifically is set, the Agent UI does not register that a MANUAL DIAL (Auto dials still behave normally) has connected. The connection happens and the Agent and the Dialed Party can speak no problem but the UI seems to lose track of the channel for some reason causing it to register a "Dial Timeout" even though the call is still going on. This effect also is seen on Transfers, the UI does not register that the 3rd party has connected thus making options like "Leave 3-way Call" and "Hang-up Lines" unusable.

My assumption is that somewhere Vicidial is using the callerid field "M4715982234234234..." to keep track of the channel, but all the tables seem to sync up... so I'm stuck.
ViciBox v.7.0.2-160325
VICIDIAL-VERSION: 2.12-550a BUILD: 160414-1013
Asterisk 11.22.0-vici
1 Database Server
MariaDB 10.1.6
2 Web Servers
Multiple Dial Servers
ajax1515
 
Posts: 70
Joined: Wed Sep 23, 2015 11:23 am

Re: Setting CallerID NAME via AGI breaks Manual Dialing and

Postby mflorell » Wed Nov 16, 2016 11:58 am

Yes, if you want to alter the CallerIDname, you have to do so on the other side of a loopback IAX trunk.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Setting CallerID NAME via AGI breaks Manual Dialing and

Postby ajax1515 » Wed Nov 16, 2016 12:34 pm

Thanks for your reply Matt, I figured that was going to be a problem... The callerid name and number need to get set before the DIAL happens though, so could you give me a little more detail on when exactly I can safely call the SET CALLERID application?

Also what if (in the agi script) I called SET CALLERID, then DIAL, then SET CALLERID again back to what it was originally? Would that solve the issue?
ViciBox v.7.0.2-160325
VICIDIAL-VERSION: 2.12-550a BUILD: 160414-1013
Asterisk 11.22.0-vici
1 Database Server
MariaDB 10.1.6
2 Web Servers
Multiple Dial Servers
ajax1515
 
Posts: 70
Joined: Wed Sep 23, 2015 11:23 am

Re: Setting CallerID NAME via AGI breaks Manual Dialing and

Postby mflorell » Wed Nov 16, 2016 12:47 pm

No, you can't just set the name to something else, then set it back, you will still have manager events with the non-VICIdial name, so that will break things.

Take a look at the [loopback-no-log] context in the vicidial-included extensions.conf, that is what you have to dial through to place calls with a custom cidname. As for the CIDnumber, you can do whatever you want with that.





[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()

exten => _999XX11112,1,Wait(2)
exten => _999XX11112,n,Answer()
exten => _999XX11112,n,Playback(ss-noservice)
exten => _999XX11112,n,Playback(vm-goodbye)
exten => _999XX11112,n,Hangup()




[default]

; dial a USA long distance outbound number through the loopback-no-log context
exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91NXXNXXXXXX,n,Dial(${TRUNKloop}/888${EXTEN:2},55,o)
exten => _91NXXNXXXXXX,n,Hangup()
exten => _888NXXNXXXXXX,1,Goto(loopback-no-log,91${EXTEN:3},1)
exten => _888NXXNXXXXXX,n,Hanguo()
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Setting CallerID NAME via AGI breaks Manual Dialing and

Postby ajax1515 » Wed Nov 16, 2016 3:23 pm

How would you recommend logging all the strings that get passed to FastAGI_log.pl?
ViciBox v.7.0.2-160325
VICIDIAL-VERSION: 2.12-550a BUILD: 160414-1013
Asterisk 11.22.0-vici
1 Database Server
MariaDB 10.1.6
2 Web Servers
Multiple Dial Servers
ajax1515
 
Posts: 70
Joined: Wed Sep 23, 2015 11:23 am

Re: Setting CallerID NAME via AGI breaks Manual Dialing and

Postby mflorell » Wed Nov 16, 2016 3:44 pm

They are already logged before they go to the loopback.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: Bing [Bot] and 133 guests