Comma in CALLERID(name)

Running FPBX 2.8.1.4/Asterisk 1.6.2.15

Somewhere in the last few updates of FPBX Framework, I’ve begun having issues with commas in callerid name.

On incoming calls from another (Avaya) system via SIP trunk, macro-user-callerid runs and can see the full callerid name, (“TEST, Asterisk User” in the output below)but then ignores characters after the comma and only displays the first portion of the name. This was working previously, but I’m not sure at what point it began to behave this way.

I’m also finding that I can’t use a comma in the Caller ID name when adding a user in FPBX but I can’t say definitively that i was able to previously.

Any suggestions?

– Executing [[email protected]:1] Set(“SIP/AvayaSIP-000006d7”, “GROUP()=OUT_2”) in new stack
– Executing [[email protected]:2] Goto(“SIP/AvayaSIP-000006d7”, “from-trunk,61011,1”) in new stack
– Goto (from-trunk,61011,1)
– Executing [[email protected]:1] Macro(“SIP/AvayaSIP-000006d7”, “exten-vm,novm,61011”) in new stack
– Executing [[email protected]:1] Macro(“SIP/AvayaSIP-000006d7”, “user-callerid,”) in new stack
– Executing [[email protected]:1] Set(“SIP/AvayaSIP-000006d7”, “AMPUSER=54743”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/AvayaSIP-000006d7”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/AvayaSIP-000006d7”, “1?Set(REALCALLERIDNUM=54743)”) in new stack
– Executing [[email protected]:4] Set(“SIP/AvayaSIP-000006d7”, “AMPUSER=”) in new stack
– Executing [[email protected]:5] Set(“SIP/AvayaSIP-000006d7”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/AvayaSIP-000006d7”, “1?report”) in new stack
– Goto (macro-user-callerid,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/AvayaSIP-000006d7”, “0?continue”) in new stack
– Executing [[email protected]:10] Set(“SIP/AvayaSIP-000006d7”, “__TTL=64”) in new stack
– Executing [[email protected]:11] GotoIf(“SIP/AvayaSIP-000006d7”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,18)
– Executing [[email protected]:18] Set(“SIP/AvayaSIP-000006d7”, “CALLERID(number)=54743”) in new stack
– Executing [[email protected]:19] Set(“SIP/AvayaSIP-000006d7”, “CALLERID(name)=TEST, Asterisk User”) in new stack
– Executing [[email protected]:20] NoOp(“SIP/AvayaSIP-000006d7”, “Using CallerID “TEST” <54743>”) in new stack
– Executing [[email protected]:2] Set(“SIP/AvayaSIP-000006d7”, “RingGroupMethod=none”) in new stack
– Executing [[email protected]:3] Set(“SIP/AvayaSIP-000006d7”, “VMBOX=novm”) in new stack
– Executing [[email protected]:4] Set(“SIP/AvayaSIP-000006d7”, “__EXTTOCALL=61011”) in new stack
– Executing [[email protected]:5] Set(“SIP/AvayaSIP-000006d7”, “CFUEXT=”) in new stack
– Executing [[email protected]:6] Set(“SIP/AvayaSIP-000006d7”, “CFBEXT=”) in new stack
– Executing [[email protected]:7] Set(“SIP/AvayaSIP-000006d7”, “RT=”"") in new stack
– Executing [[email protected]:8] Macro(“SIP/AvayaSIP-000006d7”, “record-enable,61011,IN”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/AvayaSIP-000006d7”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] ExecIf(“SIP/AvayaSIP-000006d7”, “0?MacroExit()”) in new stack
– Executing [[email protected]:5] GotoIf(“SIP/AvayaSIP-000006d7”, “0?Group:OUT”) in new stack
– Goto (macro-record-enable,s,15)
– Executing [[email protected]:15] GotoIf(“SIP/AvayaSIP-000006d7”, “1?IN”) in new stack
– Goto (macro-record-enable,s,20)
– Executing [[email protected]:20] ExecIf(“SIP/AvayaSIP-000006d7”, “1?MacroExit()”) in new stack
– Executing [[email protected]:9] Macro(“SIP/AvayaSIP-000006d7”, “dial-one,tr,61011”) in new stack
– Executing [[email protected]:1] Set(“SIP/AvayaSIP-000006d7”, “DEXTEN=61011”) in new stack
– Executing [[email protected]:2] Set(“SIP/AvayaSIP-000006d7”, “DIALSTATUS_CW=”) in new stack
– Executing [[email protected]:3] GosubIf(“SIP/AvayaSIP-000006d7”, “0?screen,1”) in new stack
– Executing [[email protected]:4] GosubIf(“SIP/AvayaSIP-000006d7”, “0?cf,1”) in new stack
– Executing [[email protected]:5] GotoIf(“SIP/AvayaSIP-000006d7”, “1?skip1”) in new stack
– Goto (macro-dial-one,s,8)
– Executing [[email protected]:8] GotoIf(“SIP/AvayaSIP-000006d7”, “0?nodial”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/AvayaSIP-000006d7”, “0?continue”) in new stack
– Executing [[email protected]:10] Set(“SIP/AvayaSIP-000006d7”, “EXTHASCW=ENABLED”) in new stack
– Executing [[email protected]:11] GotoIf(“SIP/AvayaSIP-000006d7”, “0?next1:cwinusebusy”) in new stack
– Goto (macro-dial-one,s,23)
– Executing [[email protected]:23] GotoIf(“SIP/AvayaSIP-000006d7”, “1?next3:continue”) in new stack
– Goto (macro-dial-one,s,24)
– Executing [[email protected]:24] ExecIf(“SIP/AvayaSIP-000006d7”, “0?Set(DIALSTATUS_CW=BUSY)”) in new stack
– Executing [[email protected]:25] GotoIf(“SIP/AvayaSIP-000006d7”, “0?nodial”) in new stack
– Executing [[email protected]:26] GosubIf(“SIP/AvayaSIP-000006d7”, “1?dstring,1:dlocal,1”) in new stack
– Executing [[email protected]:1] Set(“SIP/AvayaSIP-000006d7”, “DSTRING=”) in new stack
– Executing [[email protected]:2] Set(“SIP/AvayaSIP-000006d7”, “DEVICES=61011”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/AvayaSIP-000006d7”, “0?Return()”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/AvayaSIP-000006d7”, “0?Set(DEVICES=1011)”) in new stack
– Executing [[email protected]:5] Set(“SIP/AvayaSIP-000006d7”, “LOOPCNT=1”) in new stack
– Executing [[email protected]:6] Set(“SIP/AvayaSIP-000006d7”, “ITER=1”) in new stack
– Executing [[email protected]:7] Set(“SIP/AvayaSIP-000006d7”, “THISDIAL=SIP/61011”) in new stack
– Executing [[email protected]:8] GosubIf(“SIP/AvayaSIP-000006d7”, “1?zap2dahdi,1”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/AvayaSIP-000006d7”, “0?Return()”) in new stack
– Executing [[email protected]:2] Set(“SIP/AvayaSIP-000006d7”, “NEWDIAL=”) in new stack
– Executing [[email protected]:3] Set(“SIP/AvayaSIP-000006d7”, “LOOPCNT2=1”) in new stack
– Executing [[email protected]:4] Set(“SIP/AvayaSIP-000006d7”, “ITER2=1”) in new stack
– Executing [[email protected]:5] Set(“SIP/AvayaSIP-000006d7”, “THISPART2=SIP/61011”) in new stack
– Executing [[email protected]:6] ExecIf(“SIP/AvayaSIP-000006d7”, “0?Set(THISPART2=DAHDI/61011)”) in new stack
– Executing [[email protected]:7] Set(“SIP/AvayaSIP-000006d7”, “NEWDIAL=SIP/61011&”) in new stack
– Executing [[email protected]:8] Set(“SIP/AvayaSIP-000006d7”, “ITER2=2”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/AvayaSIP-000006d7”, “0?begin2”) in new stack
– Executing [[email protected]:10] Set(“SIP/AvayaSIP-000006d7”, “THISDIAL=SIP/61011”) in new stack
– Executing [[email protected]:11] Return(“SIP/AvayaSIP-000006d7”, “”) in new stack
– Executing [[email protected]:9] Set(“SIP/AvayaSIP-000006d7”, “DSTRING=SIP/61011&”) in new stack
– Executing [[email protected]:10] Set(“SIP/AvayaSIP-000006d7”, “ITER=2”) in new stack
– Executing [[email protected]:11] GotoIf(“SIP/AvayaSIP-000006d7”, “0?begin”) in new stack
– Executing [[email protected]:12] Set(“SIP/AvayaSIP-000006d7”, “DSTRING=SIP/61011”) in new stack
– Executing [[email protected]:13] Return(“SIP/AvayaSIP-000006d7”, “”) in new stack
– Executing [[email protected]:27] GotoIf(“SIP/AvayaSIP-000006d7”, “0?nodial”) in new stack
– Executing [[email protected]:28] GotoIf(“SIP/AvayaSIP-000006d7”, “1?skiptrace”) in new stack
– Goto (macro-dial-one,s,30)
– Executing [[email protected]:30] Set(“SIP/AvayaSIP-000006d7”, “D_OPTIONS=tr”) in new stack
– Executing [[email protected]:31] ExecIf(“SIP/AvayaSIP-000006d7”, “0?SIPAddHeader(Alert-Info: )”) in new stack
– Executing [[email protected]:32] ExecIf(“SIP/AvayaSIP-000006d7”, “0?SIPAddHeader()”) in new stack
– Executing [[email protected]:33] ExecIf(“SIP/AvayaSIP-000006d7”, “0?Set(CHANNEL(musicclass)=)”) in new stack
– Executing [[email protected]:34] GosubIf(“SIP/AvayaSIP-000006d7”, “0?qwait,1”) in new stack
– Executing [[email protected]:35] Set(“SIP/AvayaSIP-000006d7”, “__CWIGNORE=”) in new stack
– Executing [[email protected]:36] Set(“SIP/AvayaSIP-000006d7”, “__KEEPCID=TRUE”) in new stack
– Executing [[email protected]:37] Dial(“SIP/AvayaSIP-000006d7”, “SIP/61011,tr”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called 61011
– SIP/d8 is ringing
== Spawn extension (macro-dial-one, s, 37) exited non-zero on ‘SIP/AvayaSIP-000006d7’ in macro ‘dial-one’
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘SIP/AvayaSIP-000006d7’ in macro ‘exten-vm’
== Spawn extension (from-trunk, 61011, 1) exited non-zero on ‘SIP/AvayaSIP-000006d7’
– Executing [[email protected]:1] Macro(“SIP/AvayaSIP-000006d7”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/AvayaSIP-000006d7”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [[email protected]:4] GotoIf(“SIP/AvayaSIP-000006d7”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] GotoIf(“SIP/AvayaSIP-000006d7”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] Hangup(“SIP/AvayaSIP-000006d7”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/AvayaSIP-000006d7’ in macro ‘hangupcall’
== Spawn extension (from-trunk, h, 1) exited non-zero on 'SIP/AvayaSIP-000006d7’
XXXXX*CLI>

I found the issue, it is a bug in Asterisk 1.6. (tested on 1.6.2.12)
This is my test dialplan:

[ext-test-custom]
exten => 8888,1,Answer()
exten => 8888,n,Set(CALLERID(all)=TEST, Asterisk User <54732>)
exten => 8888,n,Macro(user-callerid,)
exten => 8888,n,Set(CALLERID(number)=${CALLERID(number):0:40})
exten => 8888,n,Set(CALLERID(name)=${CALLERID(name):0:40})
exten => 8888,n,Noop(Using CallerID ${CALLERID(all)})
exten => 8888,n,Macro(hangupcall,)

When I dial 8888 I get this:

-- Executing [[email protected]:1] Answer("SIP/2476-00000000", "") in new stack
-- Executing [[email protected]:2] Set("SIP/2476-00000000", "CALLERID(all)=TEST, Asterisk User <54732>") in new stack
-- Executing [[email protected]:3] Macro("SIP/2476-00000000", "user-callerid,") in new stack
-- Executing [[email protected]:1] Set("SIP/2476-00000000", "AMPUSER=") in new stack
-- Executing [[email protected]:2] GotoIf("SIP/2476-00000000", "0?report") in new stack
-- Executing [[email protected]:3] ExecIf("SIP/2476-00000000", "1?Set(REALCALLERIDNUM=)") in new stack
-- Executing [[email protected]:4] Set("SIP/2476-00000000", "AMPUSER=") in new stack
-- Executing [[email protected]:5] Set("SIP/2476-00000000", "AMPUSERCIDNAME=") in new stack
-- Executing [[email protected]:6] GotoIf("SIP/2476-00000000", "1?report") in new stack
-- Goto (macro-user-callerid,s,10)
-- Executing [[email protected]:10] GotoIf("SIP/2476-00000000", "0?continue") in new stack
-- Executing [[email protected]:11] Set("SIP/2476-00000000", "__TTL=64") in new stack
-- Executing [[email protected]:12] GotoIf("SIP/2476-00000000", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [[email protected]:19] NoOp("SIP/2476-00000000", "Using CallerID "TEST" <>") in new stack
-- Executing [[email protected]:4] Set("SIP/2476-00000000", "CALLERID(number)=") in new stack
-- Executing [[email protected]:5] Set("SIP/2476-00000000", "CALLERID(name)=TEST") in new stack
-- Executing [[email protected]:6] NoOp("SIP/2476-00000000", "Using CallerID "TEST" <>") in new stack

Note that the text after the comma is missing.
Now I did the same test on 1.8:

-- Executing [[email protected]:1] Answer("SIP/2476-00000000", "") in new stack
-- Executing [[email protected]:2] Set("SIP/2476-00000000", "CALLERID(all)=TEST, Asterisk User <54732>") in new stack
-- Executing [[email protected]:3] Macro("SIP/2476-00000000", "user-callerid,") in new stack
-- Executing [[email protected]:1] Set("SIP/2476-00000000", "AMPUSER=54732") in new stack
-- Executing [[email protected]:2] GotoIf("SIP/2476-00000000", "0?report") in new stack
-- Executing [[email protected]:3] ExecIf("SIP/2476-00000000", "1?Set(REALCALLERIDNUM=54732)") in new stack
-- Executing [[email protected]:4] Set("SIP/2476-00000000", "AMPUSER=") in new stack
-- Executing [[email protected]:5] Set("SIP/2476-00000000", "AMPUSERCIDNAME=") in new stack
-- Executing [[email protected]:6] GotoIf("SIP/2476-00000000", "1?report") in new stack
-- Goto (macro-user-callerid,s,10)
-- Executing [[email protected]:10] GotoIf("SIP/2476-00000000", "0?continue") in new stack
-- Executing [[email protected]:11] Set("SIP/2476-00000000", "__TTL=64") in new stack
-- Executing [[email protected]:12] GotoIf("SIP/2476-00000000", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [[email protected]:19] Set("SIP/2476-00000000", "CALLERID(number)=54732") in new stack
-- Executing [[email protected]:20] Set("SIP/2476-00000000", "CALLERID(name)=TEST, Asterisk User") in new stack
-- Executing [[email protected]:21] NoOp("SIP/2476-00000000", "Using CallerID "TEST, Asterisk User" <54732>") in new stack
-- Executing [[email protected]:4] Set("SIP/2476-00000000", "CALLERID(number)=54732") in new stack
-- Executing [[email protected]:5] Set("SIP/2476-00000000", "CALLERID(name)=TEST, Asterisk User") in new stack
-- Executing [[email protected]:6] NoOp("SIP/2476-00000000", "Using CallerID "TEST, Asterisk User" <54732>") in new stack

It is working as it should.

So my guess is that you upgraded Asterisk when you upgraded FreePBX and the previous version of Asterisk did not have the bug.

Just to be sure I tested it without the modification that we did in 2.8:

[ext-test-custom]
exten => 8888,1,Answer()
exten => 8888,n,Set(CALLERID(all)=TEST, Asterisk User <54732>)
exten => 8888,n,Macro(user-callerid,)
exten => 8888,n,Set(CALLERID(number)=${CALLERID(number)})
exten => 8888,n,Set(CALLERID(name)=${CALLERID(name)})
exten => 8888,n,Noop(Using CallerID ${CALLERID(all)})
exten => 8888,n,Macro(hangupcall,)

Still the same issue on 1.6, and working in 1.8

Thanks for you post-

In attempting to isolate the issue, I tried to update the FPBX 2.7.0.0 (*1.6.2.11) box to 1.6.2.15, but ended up at 1.6.2.17.2 so I updated the FPBX 2.8.1.4 box to the same Asterisk version. Both are now at 1.6.2.17.2

No change in the behavior of the callerID. 2.7.0.0 passes it fine, 2.8.1.4 removes anything after the comma.

Any suggestions are appreciated!

Do you have the same version of Asterisk? Your first post show that you have Asterisk 1.6.2.15, is it the same version for both servers?

I’m an Asterisk Newb, so a fix is not obvious to me… I tried pasting the old version of the macro into extensions_custom.conf but that didn’t seem to work.

I had to know, so I rebuilt a box with an unaltered installation of AsteriskNOW 1.7…

Incoming callerid name with a comma is passed with no problem. I notice in particular the “user-callerid” macro seems to behave differently:


-- Executing [[email protected]:1] Set("SIP/AvayaSIP-00000005", "AMPUSER=54743") in new stack
-- Executing [[email protected]:2] GotoIf("SIP/AvayaSIP-00000005", "0?report") in new stack
-- Executing [[email protected]:3] ExecIf("SIP/AvayaSIP-00000005", "1?Set(REALCALLERIDNUM=54743)") in new stack
-- Executing [[email protected]:4] Set("SIP/AvayaSIP-00000005", "AMPUSER=") in new stack
-- Executing [[email protected]:5] Set("SIP/AvayaSIP-00000005", "AMPUSERCIDNAME=") in new stack
-- Executing [[email protected]:6] GotoIf("SIP/AvayaSIP-00000005", "1?report") in new stack
-- Goto (macro-user-callerid,s,9)
-- Executing [[email protected]:9] GotoIf("SIP/AvayaSIP-00000005", "0?continue") in new stack
-- Executing [[email protected]:10] Set("SIP/AvayaSIP-00000005", "__TTL=64") in new stack
-- Executing [[email protected]:11] GotoIf("SIP/AvayaSIP-00000005", "1?continue") in new stack
-- Goto (macro-user-callerid,s,18)
-- Executing [[email protected]:18] NoOp("SIP/AvayaSIP-00000005", "Using CallerID "TEST, Asterisk User" <54743>") in new stack

When I look at the macros between the two versions, there are a few lines that are different between the two, specifically lines 18, 19 & 20:


             OLD 

[macro-user-callerid]
include => macro-user-callerid-custom
exten => s,1,Set(AMPUSER=${IF($[“foo${AMPUSER}” = “foo”]?${CALLERID(number)}:${AMPUSER})})
exten => s,n,GotoIf($["${CHANNEL:0:5}" = “Local”]?report)
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" = “”]?Set(REALCALLERIDNUM=${CALLERID(number)}))
exten => s,n,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($[“x${AMPUSERCIDNAME:1:2}” = “x”]?report)
exten => s,n,Set(AMPUSERCID=${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = “1”]?${DB_RESULT}:${AMPUSER})})
exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSERCID}>)
exten => s,n(report),GotoIf($[ “${ARG1}” = “SKIPTTL” ]?continue)
exten => s,n(report2),Set(__TTL=${IF($[“foo${TTL}” = “foo”]?64:$[ ${TTL} - 1 ])})
exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
exten => s,n,Wait(${RINGTIMER})
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(im-sorry&an-error-has-occured&with&call-forwarding)
exten => s,n,Macro(hangupcall,)
exten => s,n,Congestion(20)
exten => s,n(continue),Noop(Using CallerID ${CALLERID(all)})
exten => h,1,Macro(hangupcall,)


                NEW

[macro-user-callerid]
include => macro-user-callerid-custom
exten => s,1,Set(AMPUSER=${IF($[“foo${AMPUSER}” = “foo”]?${CALLERID(number)}:${AMPUSER})})
exten => s,n,GotoIf($["${CHANNEL:0:5}" = “Local”]?report)
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" = “”]?Set(REALCALLERIDNUM=${CALLERID(number)}))
exten => s,n,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($[“x${AMPUSERCIDNAME:1:2}” = “x”]?report)
exten => s,n,Set(AMPUSERCID=${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = “1”]?${DB_RESULT}:${AMPUSER})})
exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSERCID}>)
exten => s,n(report),GotoIf($[ “${ARG1}” = “SKIPTTL” ]?continue)
exten => s,n(report2),Set(__TTL=${IF($[“foo${TTL}” = “foo”]?64:$[ ${TTL} - 1 ])})
exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
exten => s,n,Wait(${RINGTIMER})
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(im-sorry&an-error-has-occured&with&call-forwarding)
exten => s,n,Macro(hangupcall,)
exten => s,n,Congestion(20)
exten => s,n(continue),Set(CALLERID(number)=${CALLERID(number):0:40})
exten => s,n,Set(CALLERID(name)=${CALLERID(name):0:40})
exten => s,n,Noop(Using CallerID ${CALLERID(all)})
exten => h,1,Macro(hangupcall,)


Question is, what is my fix? Can I just paste the old version as “macro-user-callerid-custom” into extensions_custom.conf? The callerid name is important in my organization for reporting and needs to come through in the correct format. Any help or suggestions are greatly appreciated.

I’ve never been able to. I think this has come up before, and the reason is that a comma is a delimiter in the sql database.