Prefix CID in Queues

Hello!

We have a number of call queues that are supposed to prefix the caller ID with a 2 letter prefix. However, when the calls get to the phone, it only shows the actual caller ID name without the prefix.

The prefix is being added in extensions_additional.

The system is a trixbox 2.2 system with asterisk 1.2.18 and aastra 480i phones with the latest firmware and the XML scripts…
We disabled the XML scripts and the problem persists.

This did work, then something happend and it doesn’t work anymore. Any ideas on how to troubleshoot and/or fix?

mglaske,
there are a variety of reasons tha may be effecting the Callerid Name. Maybe someone else can dig through your attached traces or take a closer look at your system. Unfortunately I don’t have the cycles right now to do that as I have to prepare for the upcoming release. If you want some private paid consulting feel free to PM me - but hopefully some others will be able to take a closer look at the traces and point this in the right direction for you.

It’s almost like the $CALLERID(name) variable cannot be set, or it is not what is being sent to the SIP phone…

It looks like the statement runs fine, even though it is setting it to the Queue CID prefix without he Caller ID name, and I would expect to see on my phone (TEST:), but I don’t.

I am also unsure of why when the SETCID statement runs it shows that the ${CALLERID(name)} is empty.

what version of asterisk are you using? and what version of queues - it works on supported versions of asterisk (1.2).

Also - CLI output is sometimes more useful then log intially as there is additonal information revealed in the CLI then the log (or both together is best).

We are using Asterisk 1.2.18, and 2.2.9 of Queues.

I know it works, it was working when we initially setup the first few queues. But I can’t figure out what changed.

Here is the console output.

-- Accepting call from '6168934381' to '6163288375' on channel 0/1, span 1
-- Executing Set("Zap/1-1", "DID=6163288375") in new stack
-- Executing Goto("Zap/1-1", "s|1") in new stack
-- Goto (from-zaptel,s,1)
-- Executing NoOp("Zap/1-1", "Entering from-zaptel with DID == 6163288375") in new stack
-- Executing Ringing("Zap/1-1", "") in new stack
-- Executing Set("Zap/1-1", "DID=6163288375") in new stack
-- Executing NoOp("Zap/1-1", "DID is now 6163288375") in new stack
-- Executing GotoIf("Zap/1-1", "1?zapok:notzap") in new stack
-- Goto (from-zaptel,s,8)
-- Executing NoOp("Zap/1-1", "Is a Zaptel Channel") in new stack
-- Executing Set("Zap/1-1", "CHAN=1-1") in new stack
-- Executing Set("Zap/1-1", "CHAN=1") in new stack
-- Executing Macro("Zap/1-1", "from-zaptel-1|6163288375|1") in new stack

Jun 18 10:14:06 WARNING[19774]: app_macro.c:210 macro_exec: No such context ‘macro-from-zaptel-1’ for macro ‘from-zaptel-1’
– Executing NoOp(“Zap/1-1”, “Returned from Macro from-zaptel-1”) in new stack
– Executing Goto(“Zap/1-1”, “from-pstn|6163288375|1”) in new stack
– Goto (from-pstn,6163288375,1)
– Executing Set(“Zap/1-1”, “FROM_DID=6163288375”) in new stack
– Executing Gosub(“Zap/1-1”, “app-blacklist-check|s|1”) in new stack
– Executing LookupBlacklist(“Zap/1-1”, “”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?blacklisted”) in new stack
– Executing Return(“Zap/1-1”, “”) in new stack
– Executing Goto(“Zap/1-1”, “ext-queues|598|1”) in new stack
– Goto (ext-queues,598,1)
– Executing Answer(“Zap/1-1”, “”) in new stack
– Executing Set(“Zap/1-1”, “__BLKVM_OVERRIDE=BLKVM/598/Zap/1-1”) in new stack
– Executing Set(“Zap/1-1”, “__BLKVM_BASE=598”) in new stack
– Executing Set(“Zap/1-1”, “DB(BLKVM/598/Zap/1-1)=TRUE”) in new stack
– Executing Set(“Zap/1-1”, “_DIAL_OPTIONS=trM(auto-blkvm)”) in new stack
– Executing Set(“Zap/1-1”, “__NODEST=598”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?USERCID:SETCID”) in new stack
– Goto (ext-queues,598,9)
– Executing Set(“Zap/1-1”, “CALLERID(name)=TEST:”) in new stack
– Executing Set(“Zap/1-1”, “MONITOR_FILENAME=/var/spool/asterisk/monitor/q598-20070618-101406-1182176046.563”) in new stack
– Executing Playback(“Zap/1-1”, “custom/ESS-Q”) in new stack
– Playing ‘custom/ESS-Q’ (language ‘en’)
– Executing Queue(“Zap/1-1”, “598|t|||120”) in new stack
– Started music on hold, class ‘default’, on Zap/1-1
– Called Local/[email protected]/n
– Executing Macro(“Local/[email protected],2”, “exten-vm|1108|1108”) in new stack
– Executing Macro(“Local/[email protected],2”, “user-callerid”) in new stack
– Executing NoOp(“Local/[email protected],2”, “user-callerid: Cell Phone MI 6168934381”) in new stack
– Executing GotoIf(“Local/[email protected],2”, “1?report”) in new stack
– Goto (macro-user-callerid,s,11)
– Executing NoOp(“Local/[email protected],2”, “TTL: ARG1: 1108”) in new stack
– Executing GotoIf(“Local/[email protected],2”, “0?continue”) in new stack
– Executing Set(“Local/[email protected],2”, “_TTL=64”) in new stack
– Executing GotoIf(“Local/[email protected],2”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,21)
– Executing NoOp(“Local/[email protected],2”, “Using CallerID “Cell Phone MI” <6168934381>”) in new stack
– Executing Set(“Local/[email protected],2”, “FROMCONTEXT=exten-vm”) in new stack
– Executing Set(“Local/[email protected],2”, “VMBOX=1108”) in new stack
– Executing Set(“Local/[email protected],2”, “EXTTOCALL=1108”) in new stack
– Executing Set(“Local/[email protected],2”, “CFUEXT=”) in new stack
– Executing Set(“Local/[email protected],2”, “CFBEXT=”) in new stack
– Executing Set(“Local/[email protected],2”, “RT=15”) in new stack
– Executing Macro(“Local/[email protected],2”, “record-enable|1108|IN”) in new stack
– Executing GotoIf(“Local/[email protected],2”, “0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing DeadAGI(“Local/[email protected],2”, “recordingcheck|20070618-101410|1182176050.565”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20070618-101410|1182176050.565: Inbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“Local/[email protected],2”, “No recording needed”) in new stack
– Executing Macro(“Local/[email protected],2”, “dial|15|trM(auto-blkvm)|1108”) in new stack
– Executing DeadAGI(“Local/[email protected],2”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: priority is 1
dialparties.agi: Caller ID name is ‘Cell Phone MI’ number is '6168934381’
dialparties.agi: Methodology of ring is ‘none’
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ‘’
– dialparties.agi: Added extension 1108 to extension map
– dialparties.agi: Extension 1108 cf is disabled
– dialparties.agi: Extension 1108 do not disturb is disabled
> dialparties.agi: extnum: 1108
> dialparties.agi: exthascw: 1
> dialparties.agi: exthascfb: 0
> dialparties.agi: extcfb:
> dialparties.agi: exthascfu: 0
> dialparties.agi: extcfu:
– dialparties.agi: dbset CALLTRACE/1108 to 6168934381
> dialparties.agi: NODEST: 598 blkvm enabled macro already in dialopts: trM(auto-blkvm)
– AGI Script dialparties.agi completed, returning 0
– Executing Dial(“Local/[email protected],2”, “SIP/1108|15|trM(auto-blkvm)”) in new stack
– Called 1108
– Local/[email protected],1 is ringing
– SIP/1108-08e043f8 is ringing
asterisk1*CLI> exit


Here is the script from extensions_additional.conf

exten => 598,1,Answer
exten => 598,n,Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL})
exten => 598,n,Set(__BLKVM_BASE=${EXTEN})
exten => 598,n,Set(DB(${BLKVM_OVERRIDE})=TRUE)
exten => 598,n,Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm))
exten => 598,n,Set(__NODEST=${EXTEN})
exten => 598,n,GotoIf($["${CONTEXT}"=“from-internal”]?USERCID:SETCID)
exten => 598,n(USERCID),Macro(user-callerid,)
exten => 598,n(SETCID),Set(CALLERID(name)=TEST:${CALLERID(name)})
exten => 598,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH},%Y%m%d
-%H%M%S)}-${UNIQUEID})
exten => 598,n,Playback(custom/ESS-Q)
exten => 598,n,Queue(598|t|||120)
exten => 598,n,dbDel(${BLKVM_OVERRIDE})
exten => 598,n,Set(__NODEST=)
exten => 598,n,Goto(app-blackhole,hangup,1)
exten => 598*,1,Macro(agent-add,598,)
exten => 598**,1,Macro(agent-del,598,598)

I did some more research on the problem, and it appears to be something with the endpoint_additional.conf. There is a line in there that runs as part of an IF statement, called SETCID. It sppears to have had the variable changed from $CALLERIDNAME to $CALLERID(name), which is the new version, but when I watch the debug output from asterisk, it says that it is adding that command to the stack, but is adding:

Set(CALLERID(name)=TEST:) to the stack.

but the script says

Set(CALLERID(name)=TEST:${CALLERID(name)})

I don’t know if for some reason the context is wrong somwhere or what. My calls are coming in from zap channels on a PRI interface.

you mention endpoint_additional.conf - I’m assuming that was a typo and you meant to say extensions_additonal.conf (because otherwise you have something on your system that is not from FreepBX).

We use CID Name prefix as do many people and it does work. Is the issue that the phone is not displaying the name? Try it on another phone. I have encountered issues that the end points were not configured to display the callerid name, they only displayed the number (and looked up the name in their own directory like cell phones do).

Yes, that was a typo… Sorry…

The feature was working… It isn’t now. The phone displays the caller ID NAME (not number), without the prefix. Here is the asterisk output:

-- Accepting call from '6168934381' to '6163288375' on channel 0/1, span 1
-- Executing Set("Zap/1-1", "DID=6163288375") in new stack
-- Executing Goto("Zap/1-1", "s|1") in new stack
-- Goto (from-zaptel,s,1)
-- Executing NoOp("Zap/1-1", "Entering from-zaptel with DID == 6163288375") in new stack
-- Executing Ringing("Zap/1-1", "") in new stack
-- Executing Set("Zap/1-1", "DID=6163288375") in new stack
-- Executing NoOp("Zap/1-1", "DID is now 6163288375") in new stack
-- Executing GotoIf("Zap/1-1", "1?zapok:notzap") in new stack
-- Goto (from-zaptel,s,8)
-- Executing NoOp("Zap/1-1", "Is a Zaptel Channel") in new stack
-- Executing Set("Zap/1-1", "CHAN=1-1") in new stack
-- Executing Set("Zap/1-1", "CHAN=1") in new stack
-- Executing Macro("Zap/1-1", "from-zaptel-1|6163288375|1") in new stack

Jun 15 09:14:32 WARNING[20757]: app_macro.c:210 macro_exec: No such context ‘macro-from-zaptel-1’ for macro ‘from-zaptel-1’
– Executing NoOp(“Zap/1-1”, “Returned from Macro from-zaptel-1”) in new stack
– Executing Goto(“Zap/1-1”, “from-pstn|6163288375|1”) in new stack
– Goto (from-pstn,6163288375,1)
– Executing Set(“Zap/1-1”, “FROM_DID=6163288375”) in new stack
– Executing Gosub(“Zap/1-1”, “app-blacklist-check|s|1”) in new stack
– Executing LookupBlacklist(“Zap/1-1”, “”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?blacklisted”) in new stack
– Executing Return(“Zap/1-1”, “”) in new stack
– Executing Goto(“Zap/1-1”, “ext-queues|598|1”) in new stack
– Goto (ext-queues,598,1)
– Executing Answer(“Zap/1-1”, “”) in new stack
– Executing Set(“Zap/1-1”, “__BLKVM_OVERRIDE=BLKVM/598/Zap/1-1”) in new stack
– Executing Set(“Zap/1-1”, “__BLKVM_BASE=598”) in new stack
– Executing Set(“Zap/1-1”, “DB(BLKVM/598/Zap/1-1)=TRUE”) in new stack
– Executing Set(“Zap/1-1”, “_DIAL_OPTIONS=trM(auto-blkvm)”) in new stack
– Executing Set(“Zap/1-1”, “__NODEST=598”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?USERCID:SETCID”) in new stack
– Goto (ext-queues,598,9)
– Executing Set(“Zap/1-1”, “CALLERID(name)=TEST:”) in new stack
– Executing Set(“Zap/1-1”, “MONITOR_FILENAME=/var/spool/asterisk/monitor/q598-20070615-091432-1181913272.4617”) in new stack
– Executing Playback(“Zap/1-1”, “custom/ESS-Q”) in new stack
– Playing ‘custom/ESS-Q’ (language ‘en’)
– Executing Queue(“Zap/1-1”, “598|t|||120”) in new stack
– Started music on hold, class ‘default’, on Zap/1-1
– Called Local/[email protected]/n
– Executing Macro(“Local/[email protected],2”, “exten-vm|1108|1108”) in new stack
– Executing Macro(“Local/[email protected],2”, “user-callerid”) in new stack
– Executing NoOp(“Local/[email protected],2”, “user-callerid: Cell Phone MI 6168934381”) in new stack
– Executing GotoIf(“Local/[email protected],2”, “1?report”) in new stack
– Goto (macro-user-callerid,s,11)
– Executing NoOp(“Local/[email protected],2”, “TTL: ARG1: 1108”) in new stack
– Executing GotoIf(“Local/[email protected],2”, “0?continue”) in new stack
– Executing Set(“Local/[email protected],2”, “_TTL=64”) in new stack
– Executing GotoIf(“Local/[email protected],2”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,21)
– Executing NoOp(“Local/[email protected],2”, “Using CallerID “Cell Phone MI” <6168934381>”) in new stack
– Executing Set(“Local/[email protected],2”, “FROMCONTEXT=exten-vm”) in new stack
– Executing Set(“Local/[email protected],2”, “VMBOX=1108”) in new stack
– Executing Set(“Local/[email protected],2”, “EXTTOCALL=1108”) in new stack
– Executing Set(“Local/[email protected],2”, “CFUEXT=”) in new stack
– Executing Set(“Local/[email protected],2”, “CFBEXT=”) in new stack
– Executing Set(“Local/[email protected],2”, “RT=15”) in new stack
– Executing Macro(“Local/[email protected],2”, “record-enable|1108|IN”) in new stack
– Executing GotoIf(“Local/[email protected],2”, “0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing DeadAGI(“Local/[email protected],2”, “recordingcheck|20070615-091436|1181913276.4619”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20070615-091436|1181913276.4619: Inbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing NoOp(“Local/[email protected],2”, “No recording needed”) in new stack
– Executing Macro(“Local/[email protected],2”, “dial|15|trM(auto-blkvm)|1108”) in new stack
– Executing DeadAGI(“Local/[email protected],2”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: priority is 1
dialparties.agi: Caller ID name is ‘Cell Phone MI’ number is '6168934381’
dialparties.agi: Methodology of ring is ‘none’
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ‘’
– dialparties.agi: Added extension 1108 to extension map
– dialparties.agi: Extension 1108 cf is disabled
– dialparties.agi: Extension 1108 do not disturb is disabled
> dialparties.agi: extnum: 1108
> dialparties.agi: exthascw: 1
> dialparties.agi: exthascfb: 0
> dialparties.agi: extcfb:
> dialparties.agi: exthascfu: 0
> dialparties.agi: extcfu:
– dialparties.agi: dbset CALLTRACE/1108 to 6168934381
> dialparties.agi: NODEST: 598 blkvm enabled macro already in dialopts: trM(auto-blkvm)
– AGI Script dialparties.agi completed, returning 0
– Executing Dial(“Local/[email protected],2”, “SIP/1108|15|trM(auto-blkvm)”) in new stack
– Called 1108
– Local/[email protected],1 is ringing
– SIP/1108-09980b20 is ringing
– Hungup ‘Zap/27-1’
== Spawn extension (macro-dialout-trunk, s, 20) exited non-zero on ‘SIP/1105-b771ce58’ in macro ‘dialout-trunk’
== Spawn extension (macro-dialout-trunk, s, 20) exited non-zero on ‘SIP/1105-b771ce58’
– Executing Macro(“SIP/1105-b771ce58”, “hangupcall”) in new stack
– Executing ResetCDR(“SIP/1105-b771ce58”, “w”) in new stack
– Executing NoCDR(“SIP/1105-b771ce58”, “”) in new stack
Jun 15 09:14:37 NOTICE[20745]: cdr.c:443 ast_cdr_free: CDR on channel ‘SIP/1105-b771ce58’ not posted
Jun 15 09:14:37 NOTICE[20745]: cdr.c:445 ast_cdr_free: CDR on channel ‘SIP/1105-b771ce58’ lacks end
– Executing GotoIf(“SIP/1105-b771ce58”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing GotoIf(“SIP/1105-b771ce58”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing Wait(“SIP/1105-b771ce58”, “5”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/1105-b771ce58’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/1105-b771ce58’
– Channel 0/1, span 1 got hangup request
– Stopped music on hold on Zap/1-1
== Spawn extension (ext-queues, 598, 12) exited non-zero on ‘Zap/1-1’
== Spawn extension (macro-dial, s, 10) exited non-zero on ‘Local/[email protected],2’ in macro ‘dial’
== Spawn extension (macro-dial, s, 10) exited non-zero on ‘Local/[email protected],2’ in macro ‘exten-vm’
== Spawn extension (macro-dial, s, 10) exited non-zero on ‘Local/[email protected],2’
– Executing Macro(“Local/[email protected],2”, “hangupcall”) in new stack
– Executing ResetCDR(“Local/[email protected],2”, “w”) in new stack
– Hungup ‘Zap/1-1’
– Executing NoCDR(“Local/[email protected],2”, “”) in new stack
Jun 15 09:14:37 NOTICE[20760]: cdr.c:443 ast_cdr_free: CDR on channel ‘Local/[email protected],2’ not posted
Jun 15 09:14:37 NOTICE[20760]: cdr.c:445 ast_cdr_free: CDR on channel ‘Local/[email protected],2’ lacks end
– Executing GotoIf(“Local/[email protected],2”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing GotoIf(“Local/[email protected],2”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing Wait(“Local/[email protected],2”, “5”) in new stack


And it’s not just cell phones, it’s other calls as well…