Handling inbound calls containing cpc=ordinary

Superfecta can do this. Configure the Trunk Provided lookup source, and in the field marked ‘Ignore Keywords’, add the exact text that you want to strip off. Whatever remains will be used as the CallerID Name for the call. If there is nothing left, Superfecta will continue searching whatever other lookup sources you have configured.

Dear Lorne Gaetz,

thank you very much for your reply!

Unfortunately, I seem to be unable to get superfecta to cut cpc=ordinary. I did install the superfecta module and enable superfecata in relevant inbound routes (default scheme or all schemes does not seem to make a difference, as there is only one scheme). In the superfecta menu, I did pick some locally relevant sources to try to lookup phonebook entries, which works via the debug button after manually entering phone numers. Then, putting the “trunk provided” source at the top, I did try many entries to the ingore keywords field, e.g., ;cpc=ordinary, the same without the “;” or just “cpc” or just “ordinary”. In all cases, the ;cpc=ordinary is still passed on to the extensions.

Is there an obvious mistake in my steps?

Regards,

Michael Schefczyk

In the asterisk log in /var/log/asterisk/full find the lines when Superfecta runs with one of these calls and post the sanitized output here.

I suspect that there might be an issue with the field length in superfecta. The test call below is from +49351 …, where +49 is the international code. The rest of the number is longer than the North American numbering plan would specify. The eigth line below truncates the leading “+4” and the tenth line classifies the truncated number as invalid.

> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:1] Set("SIP/Telekom-000000bb", "__FROM_DID=4595640") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:2] Set("SIP/Telekom-000000bb", "CIDSFSCHEME=YmFzZV9EZWZhdWx0") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:3] AGI("SIP/Telekom-000000bb", "/var/www/html/admin/modules/superfecta/agi/superfecta.agi") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- Launched AGI Script /var/www/html/admin/modules/superfecta/agi/superfecta.agi
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  /var/www/html/admin/modules/superfecta/agi/superfecta.agi: CID Superfecta is Answering the Channel
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  /var/www/html/admin/modules/superfecta/agi/superfecta.agi: CID Superfecta: Scheme is Default
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  /var/www/html/admin/modules/superfecta/agi/superfecta.agi: CID Superfecta: The DID passed from Asterisk is: 4595640
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  /var/www/html/admin/modules/superfecta/agi/superfecta.agi: CID Superfecta: The number passed from Asterisk is: 935146336882;cpc=ordinary
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  /var/www/html/admin/modules/superfecta/agi/superfecta.agi: CID Superfecta: The CID name passed from Asterisk is: unknown
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  /var/www/html/admin/modules/superfecta/agi/superfecta.agi: CID Superfecta: Not a valid number
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- <SIP/Telekom-000000bb>AGI Script /var/www/html/admin/modules/superfecta/agi/superfecta.agi completed, returning 0
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:4] Set("SIP/Telekom-000000bb", "CALLERID(name)=") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:5] Gosub("SIP/Telekom-000000bb", "sub-record-check,s,1(in,4595640,dontcare)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:1] GotoIf("SIP/Telekom-000000bb", "0?initialized") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:2] Set("SIP/Telekom-000000bb", "__REC_STATUS=INITIALIZED") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:3] Set("SIP/Telekom-000000bb", "NOW=1437722086") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:4] Set("SIP/Telekom-000000bb", "__DAY=24") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:5] Set("SIP/Telekom-000000bb", "__MONTH=07") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:6] Set("SIP/Telekom-000000bb", "__YEAR=2015") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:7] Set("SIP/Telekom-000000bb", "__TIMESTR=20150724-091446") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:8] Set("SIP/Telekom-000000bb", "__FROMEXTEN=unknown") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:9] Set("SIP/Telekom-000000bb", "__MON_FMT=wav") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:10] NoOp("SIP/Telekom-000000bb", "Recordings initialized") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:11] ExecIf("SIP/Telekom-000000bb", "0?Set(ARG3=dontcare)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:12] Set("SIP/Telekom-000000bb", "REC_POLICY_MODE_SAVE=") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:13] ExecIf("SIP/Telekom-000000bb", "0?Set(REC_STATUS=NO)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:14] GotoIf("SIP/Telekom-000000bb", "2?checkaction") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (sub-record-check,s,17)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:17] GotoIf("SIP/Telekom-000000bb", "1?sub-record-check,in,1") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (sub-record-check,in,1)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [in@sub-record-check:1] NoOp("SIP/Telekom-000000bb", "Inbound Recording Check to 4595640") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [in@sub-record-check:2] Set("SIP/Telekom-000000bb", "FROMEXTEN=unknown") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [in@sub-record-check:3] ExecIf("SIP/Telekom-000000bb", "27?Set(FROMEXTEN=+4935146336882;cpc=ordinary)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [in@sub-record-check:4] Gosub("SIP/Telekom-000000bb", "recordcheck,1(dontcare,in,4595640)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/Telekom-000000bb", "Starting recording check against dontcare") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [recordcheck@sub-record-check:2] Goto("SIP/Telekom-000000bb", "dontcare") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (sub-record-check,recordcheck,3)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [recordcheck@sub-record-check:3] Return("SIP/Telekom-000000bb", "") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [in@sub-record-check:5] Return("SIP/Telekom-000000bb", "") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:6] Gosub("SIP/Telekom-000000bb", "app-blacklist-check,s,1()") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@app-blacklist-check:1] GotoIf("SIP/Telekom-000000bb", "0?blacklisted") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@app-blacklist-check:2] Set("SIP/Telekom-000000bb", "CALLED_BLACKLIST=1") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@app-blacklist-check:3] Return("SIP/Telekom-000000bb", "") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:7] Set("SIP/Telekom-000000bb", "CDR(did)=4595640") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:8] ExecIf("SIP/Telekom-000000bb", "1 ?Set(CALLERID(name)=+4935146336882;cpc=ordinary)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:9] Set("SIP/Telekom-000000bb", "CHANNEL(musicclass)=default") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:10] Set("SIP/Telekom-000000bb", "__MOHCLASS=default") in new stack
> [2015-07-24 09:14:46] WARNING[15664][C-00000051] func_channel.c: Unknown or unavailable item requested: 'reversecharge'
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:11] GotoIf("SIP/Telekom-000000bb", "0?macro-hangupcall") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:12] Set("SIP/Telekom-000000bb", "__CALLINGPRES_SV=allowed_not_screened") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:13] Set("SIP/Telekom-000000bb", "CALLERPRES()=allowed_not_screened") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [4595640@from-trunk:14] Goto("SIP/Telekom-000000bb", "ext-group,10,1") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (ext-group,10,1)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:1] Macro("SIP/Telekom-000000bb", "user-callerid,") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:1] Set("SIP/Telekom-000000bb", "TOUCH_MONITOR=1437722086.211") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:2] Set("SIP/Telekom-000000bb", "AMPUSER=+4935146336882;cpc=ordinary") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:3] GotoIf("SIP/Telekom-000000bb", "0?report") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:4] ExecIf("SIP/Telekom-000000bb", "1?Set(REALCALLERIDNUM=+4935146336882;cpc=ordinary)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:5] Set("SIP/Telekom-000000bb", "AMPUSER=") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:6] GotoIf("SIP/Telekom-000000bb", "0?limit") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:7] Set("SIP/Telekom-000000bb", "AMPUSERCIDNAME=") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:8] GotoIf("SIP/Telekom-000000bb", "1?report") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (macro-user-callerid,s,16)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:16] GotoIf("SIP/Telekom-000000bb", "0?continue") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:17] ExecIf("SIP/Telekom-000000bb", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:18] Set("SIP/Telekom-000000bb", "__TTL=64") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:19] GotoIf("SIP/Telekom-000000bb", "1?continue") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (macro-user-callerid,s,30)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:30] Set("SIP/Telekom-000000bb", "CALLERID(number)=+4935146336882;cpc=ordinary") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:31] Set("SIP/Telekom-000000bb", "CALLERID(name)=+4935146336882;cpc=ordinary") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:32] Set("SIP/Telekom-000000bb", "CDR(cnum)=+4935146336882;cpc=ordinary") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:33] Set("SIP/Telekom-000000bb", "CDR(cnam)=+4935146336882;cpc=ordinary") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-user-callerid:34] Set("SIP/Telekom-000000bb", "CHANNEL(language)=de") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:2] Macro("SIP/Telekom-000000bb", "blkvm-setifempty,") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-blkvm-setifempty:1] GotoIf("SIP/Telekom-000000bb", "1?init") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (macro-blkvm-setifempty,s,4)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-blkvm-setifempty:4] Set("SIP/Telekom-000000bb", "__BLKVM_CHANNEL=SIP/Telekom-000000bb") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-blkvm-setifempty:5] Set("SIP/Telekom-000000bb", "SHARED(BLKVM,SIP/Telekom-000000bb)=TRUE") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-blkvm-setifempty:6] Set("SIP/Telekom-000000bb", "GOSUB_RETVAL=TRUE") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-blkvm-setifempty:7] MacroExit("SIP/Telekom-000000bb", "") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:3] GotoIf("SIP/Telekom-000000bb", "1?skipov") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (ext-group,10,6)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:6] Set("SIP/Telekom-000000bb", "RRNODEST=") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:7] Set("SIP/Telekom-000000bb", "__NODEST=10") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:8] GosubIf("SIP/Telekom-000000bb", "0?sub-rgsetcid,s,1()") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:9] Gosub("SIP/Telekom-000000bb", "sub-record-check,s,1(rg,10,dontcare)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:1] GotoIf("SIP/Telekom-000000bb", "27?initialized") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (sub-record-check,s,10)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:10] NoOp("SIP/Telekom-000000bb", "Recordings initialized") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:11] ExecIf("SIP/Telekom-000000bb", "0?Set(ARG3=dontcare)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:12] Set("SIP/Telekom-000000bb", "REC_POLICY_MODE_SAVE=") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:13] ExecIf("SIP/Telekom-000000bb", "0?Set(REC_STATUS=NO)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:14] GotoIf("SIP/Telekom-000000bb", "2?checkaction") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (sub-record-check,s,17)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:17] GotoIf("SIP/Telekom-000000bb", "0?sub-record-check,rg,1") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:18] NoOp("SIP/Telekom-000000bb", "Generic rg Recording Check - +4935146336882;cpc=ordinary 10") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:19] Gosub("SIP/Telekom-000000bb", "recordcheck,1(dontcare,rg,10)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/Telekom-000000bb", "Starting recording check against dontcare") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [recordcheck@sub-record-check:2] Goto("SIP/Telekom-000000bb", "dontcare") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (sub-record-check,recordcheck,3)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [recordcheck@sub-record-check:3] Return("SIP/Telekom-000000bb", "") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@sub-record-check:20] Return("SIP/Telekom-000000bb", "") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:10] Set("SIP/Telekom-000000bb", "RingGroupMethod=ringall") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [10@ext-group:11] Macro("SIP/Telekom-000000bb", "dial,20,Ttr,13-18-31-32") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-dial:1] GotoIf("SIP/Telekom-000000bb", "0?dial") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-dial:2] Set("SIP/Telekom-000000bb", "CHANNEL(musicclass)=default") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-dial:3] AGI("SIP/Telekom-000000bb", "dialparties.agi") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  dialparties.agi: Starting New Dialparties.agi
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  dialparties.agi: Caller ID name is '+4935146336882;cpc=ordinary' number is '+4935146336882;cpc=ordinary'
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:  dialparties.agi: Methodology of ring is  'ringall'
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Added extension 13 to extension map
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Added extension 18 to extension map
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Added extension 31 to extension map
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Added extension 32 to extension map
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Extension 13 cf is disabled
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Extension 18 cf is disabled
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Extension 31 cf is disabled
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Extension 32 cf is disabled
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Extension 13 do not disturb is disabled
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Extension 18 do not disturb is disabled
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Extension 31 do not disturb is disabled
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Extension 32 do not disturb is disabled
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: DbDel CALLTRACE/13 - Caller ID is not defined
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: DbDel CALLTRACE/18 - Caller ID is not defined
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: DbDel CALLTRACE/31 - Caller ID is not defined
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: DbDel CALLTRACE/32 - Caller ID is not defined
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- dialparties.agi: Filtered ARG3: 13-18-31-32
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] res_agi.c:     -- <SIP/Telekom-000000bb>AGI Script dialparties.agi completed, returning 0
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-dial:7] Dial("SIP/Telekom-000000bb", "SIP/13&SIP/18&SIP/31&SIP/32,20,TtrM(auto-blkvm)") in new stack
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP VIDEO TOS bits 136
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP VIDEO CoS mark 6
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP RTP TOS bits 184
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP RTP CoS mark 5
> [2015-07-24 09:14:46] WARNING[15664][C-00000051] app_dial.c: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP VIDEO TOS bits 136
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP VIDEO CoS mark 6
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP RTP TOS bits 184
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP RTP CoS mark 5
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP VIDEO TOS bits 136
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP VIDEO CoS mark 6
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP RTP TOS bits 184
> [2015-07-24 09:14:46] VERBOSE[15664][C-00000051] netsock2.c:   == Using SIP RTP CoS mark 5
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- Called SIP/13
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- Called SIP/31
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- Called SIP/32
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- SIP/32-000000be connected line has changed. Saving it until answer for SIP/Telekom-000000bb
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- SIP/31-000000bd connected line has changed. Saving it until answer for SIP/Telekom-000000bb
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- SIP/13-000000bc connected line has changed. Saving it until answer for SIP/Telekom-000000bb
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- SIP/13-000000bc is ringing
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- SIP/32-000000be is ringing
> [2015-07-24 09:14:47] VERBOSE[15664][C-00000051] app_dial.c:     -- SIP/31-000000bd is ringing
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] app_dial.c:     -- SIP/13-000000bc connected line has changed. Saving it until answer for SIP/Telekom-000000bb
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] app_dial.c:     -- SIP/13-000000bc answered SIP/Telekom-000000bb
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-auto-blkvm:1] Set("SIP/13-000000bc", "__MACRO_RESULT=") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-auto-blkvm:2] Set("SIP/13-000000bc", "CFIGNORE=") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-auto-blkvm:3] Set("SIP/13-000000bc", "MASTER_CHANNEL(CFIGNORE)=") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-auto-blkvm:4] Set("SIP/13-000000bc", "FORWARD_CONTEXT=from-internal") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-auto-blkvm:5] Set("SIP/13-000000bc", "MASTER_CHANNEL(FORWARD_CONTEXT)=from-internal") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-auto-blkvm:6] Macro("SIP/13-000000bc", "blkvm-clr,") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-blkvm-clr:1] Set("SIP/13-000000bc", "SHARED(BLKVM,SIP/Telekom-000000bb)=") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-blkvm-clr:2] Set("SIP/13-000000bc", "GOSUB_RETVAL=") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-blkvm-clr:3] MacroExit("SIP/13-000000bc", "") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-auto-blkvm:7] ExecIf("SIP/13-000000bc", "0?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=13)") in new stack
> [2015-07-24 09:14:49] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-auto-blkvm:8] ExecIf("SIP/13-000000bc", "0?Set(MASTER_CHANNEL(CONNECTEDLINE(name))=S10VoIPDRS)") in new stack
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [h@macro-dial:1] Macro("SIP/Telekom-000000bb", "hangupcall") in new stack
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-hangupcall:1] ExecIf("SIP/Telekom-000000bb", "0?Set(CDR(recordingfile)=.wav)") in new stack
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-hangupcall:2] GotoIf("SIP/Telekom-000000bb", "1?theend") in new stack
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] pbx.c:     -- Goto (macro-hangupcall,s,4)
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] pbx.c:     -- Executing [s@macro-hangupcall:4] Hangup("SIP/Telekom-000000bb", "") in new stack
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] app_macro.c:   == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/Telekom-000000bb' in macro 'hangupcall'
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] pbx.c:   == Spawn extension (macro-dial, h, 1) exited non-zero on 'SIP/Telekom-000000bb'
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] app_macro.c:   == Spawn extension (macro-dial, s, 7) exited non-zero on 'SIP/Telekom-000000bb' in macro 'dial'
> [2015-07-24 09:17:51] VERBOSE[15664][C-00000051] pbx.c:   == Spawn extension (ext-group, 10, 11) exited non-zero on 'SIP/Telekom-000000bb

Okay, I misunderstood what you were initially reporting, I thought the unwanted characters were in the CID Name not the CID number, so that’s why the above didn’t work. Gotta say your phone provider has weird ideas, it should be them that fixes this mess.

The only way I can see this working is to create your own context that cleans up the CID Name and then send it to FreePBX inbound route. In the file /etc/asterisk/extensions_custom.conf place these lines:

[cid-cleanup]
exten => _.,1,noop(entering user defined context [cid-cleanup] in extensions_custom.conf)
exten => _.,n,noop(Received CID number: ${CALLERID(number)})
exten => _.,n,set(CALLERID(number)=${CUT(CALLERID(number),\;,1)})
exten => _.,n,noop(Proceeding with CID number: ${CALLERID(number)})
exten => _.,n,goto(from-trunk,${EXTEN},1)

Then change the context of your trunk from whatever it is now to cid-cleanup and reload. What this does is examine the incoming CID and strips everything after the first semi-colon then directs the call to your inbound routes.

1 Like

Dear Lorne Gaetz,

Thank you very much! As far as I can tell with two half week days of testing, your cid-cleanup context does the job completely.

There is one related issue with my phone provider (Deutsche Telekom, i.e., incumbent carrier here, strongly pushing for all VoIP without really willing to actively address all related issues :wink:): They deliver incoming national calls at random sometimes with the contry code and sometimes without. So a call from Hamburg may be +4940… or 040… with variable number length thereafter. The superfecta phonebook sources available do fail if the number is +4940… but work if the number is 040…

Is there a way to address this within superfecta or should one include this in the cleanup context to match a leading +49 and replace it by “0” if the former is matched? You have published similar examples in the pbx in a flash forum, albeit for fixed length north american numbers, I think. The details do look complicated for an outsider - could you please be so kind to drop the necessary lines for this case also?

Regards,

Michael Schefczyk

Superfecta can alter CID number prior to doing lookups. You enter all the dial patterns in the CID field for each scheme, so to change 4940 numbers to 040, you would need a dial pattern like:

0+49|40X.

And you also need dial patterns for all the other cases you need, so you also need to add:

X.

Then use the debug field to test the full range of numbers to ensure the CID rules are working.

Dear Lorne Gaetz,

Again, thank you very much! Initially I thought that superfecta could not cut away the “+49” and replace it by a zero because of the “+” which is also a command, but this is not the case. So far, I think that the following two lines do the job for the “+49”-case:

+49|0+.
.

Regards,

Michael

1 Like

Dear All,

in hindsight: My original problem with cpc=ordinary was resolved completely and it does stay fixed. That was a superb step.

What does not quite work yet is to get FreePBX to look up directory entires via Superfecta. When entering numbers with and without the country code manually and pressing the debug botton, Superfecta does work perfectly - based on the CID rules above and using trunk provided and DeTeMedien sources. In real operations, however, I frequently get incorrect lookups, probably connected to the CID rules not working in the same manner as when pressing the debug button. Any further help would be very welcome.

Regards,

Michael Schefczyk

The debug and a live call should always produce the same result, provided you are using the same Superfecta scheme for both. Check the Superfecta lines in the log during a call that pulls the incorrect CID and see if there are clues there as to what is happening.

Dear Lorne Gaetz,

I am still trying to get to a stable mode where superfecta does look up inbound German numbers in the DeTeMedien directory. Unfortunately, a second challenge came up before really solving the first one.

By now, all incoming numbers via Deutsche Telekom are tagged +49… as far as I can see. So if a number is +493514595640, I need to convert it to 03514595640 to get DeTeMedien to look it up. With the country code, the lookup just fails.

With FreePBX 12 and superfecta 2.11.17 it was possible to achieve this - at least in the debug window - by entering the following CID rule:

+49|0+.
.

With FreePBX 13 and superfecta 13.0.3.3, this does not seem to work anymore. The above CID rule does resolve the number if it is 03514595640 (i.e. based on the trivial second line) but - unlike superfecta 2.11.17 - not if it is +493514595640.

I sense that the “+” seems to be ignored by the current version of superfecta. However, I cannot get the lookup to work even with the following modified rule:

+49|0+.
49|0+.
.

Is there a change in the superfecta logic from version 12 to 13 that I would have to consider?

Regards,

Michael

Hi Michael,

Why not just fix a little bit @lgaetz dial plan? try this fix:

[cid-cleanup]
exten => _.,1,noop(entering user defined context [cid-cleanup] in extensions_custom.conf)
exten => _.,n,noop(Received CID number: ${CALLERID(number)})
exten => _.,n,set(CALLERID(number)=${CUT(CALLERID(number),\;,1)})
exten => _.,n,noop(Proceeding with CID number: ${CALLERID(number)})
exten => _.,n,goto(from-trunk,0${EXTEN:3},1)

Thank you,

Daniel Friedman
Trixton LTD

Hi Daniel,

Thank you very much! If I enter this, calls are unfortunately no longer completed. The CDR destination becomes “s [from-trunk]” and this ends in a playback saying that the number is not in service.

In superfecta, the problem seems to be the “+” indeed. It is still easy there to make a rule converting 0049351… to 0351… but I do fail trying to make rules containing a “+” in the current version. If I understand your approach correctly, the aim is to cut the first three characters and add a zero, right? That would work with German numbers but it would make international calls indistinguishable from national calls and mess up international calls from countries with country codes shorter or longern than two digits. A simple solution to this might be to cut the first character (i. e. the “+”) and add two zeros (+49… -> 0049…). That would make it possible to identifiy and also ring back numbers from all countries. Then, superfecta could easily do the rest for German numbers as stated above. If I did get your approach to work, taking it this small step further would have probably been easy, but …

Regards,

Michael

Hi Michael,

Yes, if it would help you, you can remove the + and add 00 like this:

[cid-cleanup]
exten => _.,1,noop(entering user defined context [cid-cleanup] in extensions_custom.conf)
exten => _.,n,noop(Received CID number: ${CALLERID(number)})
exten => _.,n,set(CALLERID(number)=${CUT(CALLERID(number),\;,1)})
exten => _.,n,noop(Proceeding with CID number: ${CALLERID(number)})
exten => _.,n,goto(from-trunk,00${EXTEN:1},1)

Thank you,

Daniel Friedman
Trixton LTD.

Hi Daniel,

unfortunately, both variants lead to the playback “The number you have dialled is not in service.” for all inbound calls. I have also tried separately to (a) add only one or two zeros left of the dollar sign and to (b) add “:1” (or “:3”) right of EXTEN but in any case, calls do no longer get completed. It always results in the CDR destination “s [from-trunk]” and the above playback.

Can you detect why this happens?

Regards,

Michael

Hi,

Can you paste a log here?

Thank you,

Daniel Friedman
Trixton LTD.

Hi Daniel,

the asterisk log of an inbound call failing as described above looks as attached below. I think that this makes the problem (not the solution, though) obvious: I am calling 0211-6101757 from 0351-4595640. What we indeed do seem to modify is 6101757 via cut one off and add to zeros to 00101757.

[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [6101757@cid-cleanup:1] NoOp(“SIP/Telekom-00000015”, “entering user defined context [cid-cleanup] in extensions_custom.conf”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [6101757@cid-cleanup:2] NoOp(“SIP/Telekom-00000015”, “Received CID number: +493514595640”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [6101757@cid-cleanup:3] Set(“SIP/Telekom-00000015”, “CALLERID(number)=+493514595640”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [6101757@cid-cleanup:4] NoOp(“SIP/Telekom-00000015”, “Proceeding with CID number: +493514595640”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [6101757@cid-cleanup:5] Goto(“SIP/Telekom-00000015”, “from-trunk,00101757,1”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Goto (from-trunk,00101757,1)
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [00101757@from-trunk:1] Set(“SIP/Telekom-00000015”, “__FROM_DID=00101757”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [00101757@from-trunk:2] NoOp(“SIP/Telekom-00000015”, “Received an unknown call with DID set to 00101757”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [00101757@from-trunk:3] Goto(“SIP/Telekom-00000015”, “s,a2”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Goto (from-trunk,s,2)
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [s@from-trunk:2] Answer(“SIP/Telekom-00000015”, “”) in new stack
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [s@from-trunk:3] Log(“SIP/Telekom-00000015”, “WARNING,Friendly Scanner from 217.0.23.100”) in new stack
[2015-12-04 14:35:51] WARNING[22617][C-0000000c] Ext. s: Friendly Scanner from 217.0.23.100
[2015-12-04 14:35:51] VERBOSE[22617][C-0000000c] pbx.c: Executing [s@from-trunk:4] Wait(“SIP/Telekom-00000015”, “2”) in new stack
[2015-12-04 14:35:53] VERBOSE[22617][C-0000000c] pbx.c: Executing [s@from-trunk:5] Playback(“SIP/Telekom-00000015”, “ss-noservice”) in new stack
[2015-12-04 14:35:53] VERBOSE[22617][C-0000000c] file.c: <SIP/Telekom-00000015> Playing ‘ss-noservice.gsm’ (language ‘en’)
[2015-12-04 14:35:56] VERBOSE[22617][C-0000000c] pbx.c: Executing [h@from-trunk:1] Macro(“SIP/Telekom-00000015”, “hangupcall,”) in new stack
[2015-12-04 14:35:56] VERBOSE[22617][C-0000000c] pbx.c: Executing [s@macro-hangupcall:1] GotoIf(“SIP/Telekom-00000015”, “1?theend”) in new stack
[2015-12-04 14:35:56] VERBOSE[22617][C-0000000c] pbx.c: Goto (macro-hangupcall,s,3)
[2015-12-04 14:35:56] VERBOSE[22617][C-0000000c] pbx.c: Executing [s@macro-hangupcall:3] ExecIf(“SIP/Telekom-00000015”, “0?Set(CDR(recordingfile)=)”) in new stack
[2015-12-04 14:35:56] VERBOSE[22617][C-0000000c] pbx.c: Executing [s@macro-hangupcall:4] Hangup(“SIP/Telekom-00000015”, “”) in new stack
[2015-12-04 14:35:56] VERBOSE[22617][C-0000000c] app_macro.c: Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/Telekom-00000015’ in macro ‘hangupcall’
[2015-12-04 14:35:56] VERBOSE[22617][C-0000000c] pbx.c: Spawn extension (from-trunk, h, 1) exited non-zero on ‘SIP/Telekom-00000015’

Regards,

Michael

Hi Michael,

I am a little confused now. What exactly you need to do?
Is it adding two zeroes to the DID?

Because what you are getting now is: FROMDID=00101757 instead FROMDID=002116101757
Did I understood it correctly?

Thank you,

Daniel Friedman
Trixton LTD.

Hi Michael:

You are correct that the leading + character in the Caller ID Number prevents Superfecta rules from working. If this was my system, I would set it up such that incoming CID had no non-numeric characters. Since you already have a user defined context, add a line like this just before the goto line:

exten => _.,n,Set(CALLERID(number)=${FILTER(0123456789,${CALLERID(number)})})

This will ensure that the Caller ID number only has numeric characters, and then Superfecta dial patterns will work like they always have.

Hi Daniel & Lorne,

Thank you very much! I ended up with the following version of the clean-up. This version also adds two leading zeros which makes it possible to dial back and to resolve via superfecta without any further rules:

[cid-cleanup]
exten => _.,1,noop(entering user defined context [cid-cleanup] in extensions_custom.conf)
exten => _.,n,noop(Received CID number: ${CALLERID(number)})
exten => _.,n,set(CALLERID(number)=${CUT(CALLERID(number),\;,1)})
exten => _.,n,noop(Adding two leading zeros and cutting the +-sign)
exten => _.,n,set(CALLERID(number)=00${FILTER(0123456789,${CALLERID(number)})})
exten => _.,n,noop(Proceeding with CID number: ${CALLERID(number)})
exten => _.,n,goto(from-trunk,${EXTEN},1)

Finally, things seem to work as best as anyone could want with FreePBX 13!

Regards,

Michael

2 Likes