P-Asserted-Identity with caller withheld "hidden" calls

Hi,
I have read and tested quite a few posts about how to insert a PAID Header, P-Asserted-Identity, and although I have it working for normal calls, I can’t get it working for caller withheld “hidden” calls.

I am using a fully up to date New Freepbx installation
PBX Firmware:12.7.6-1904-1.sng7
PBX Service Pack:1.0.0.0
Current Asterisk Version: 13.22.0

My trunks are setup as PJSIP trunks with
Trust RPID/PAI = Yes
Send RPID/PAI = Send P-Asserted-Identity header

Using this configuration with a normal outbound call, it shows this following line in the SIP (INVITE) header (I have replaced the outbound CID number with CID_NUMBER and my server IP address with IPADDRESS for security)

P-Asserted-Identity: sip:CID_NUMBER@IPADDRESS

I do not get any P-Asserted-Identity lines in the Wireshark if I dial out CallerWithheld.
My CallerWithheld outbound route is setup with a prefix of 141 and has “hidden” as the RouteCID which overrides the extension = yes.
Now when I dial out there is no P-Asserted-Identity: in the wireshark dump.

From reading other posts I realise I need to create some custom code in Config Edit - extensions_custom.conf

This one seemed nice and basic but didnt work, it didnt inject any P-Asserted-Identity: in the wireshark dump.
[macro-dialout-trunk-predial-hook]
exten => s,1,NoOp(Adding P-Asserted-Identity)
exten => s,n,SipAddHeader(P-Asserted-Identity: sip:${CALLERID(num)})
exten => s,n(done),MacroExit()

I then moved into more complicated ones like this one - I have commented some lines out as “pai-custom:continue” caused an error.
[macro-dialout-trunk-predial-hook]
;Call With a Hidden Number
exten => s,1,NoOp(The caller id name is: ${CALLERID(name)})
exten => s,n,NoOp(The caller id number is: ${CALLERID(num)})
exten => s,n,NoOp(The ampuser is: ${AMPUSER})
exten => s,n,NoOp(The real caller id is: ${REALCALLERIDNUM})
exten => s,n,NoOp(The outbound cli is: ${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
;exten => s,n,Set(real_cli=${IF($[ “${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)}” = “” ]?+442xxCID_NUMBER:${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})})
;exten => s,n,GotoIf($[ “${CALLERID(name)}” = “anonymous” | “${CALLERID(name)}” = “Anonymous” ]?pai-custom:continue)
;exten => s,n,SipAddHeader(P-Asserted-Identity: “${real_cli}” sip:${real_cli}@IPADDRESS\;user=phone)
;exten => s,n,SipAddHeader(Privacy: id)
exten => s,n,NoOp(Adding P-Asserted-Identity)
exten => s,n,SipAddHeader(P-Asserted-Identity: sip:${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n(done),MacroExit()
exten => s,n,MacroExit()

Using this context I can see the FreePBX logs showing the following lines, is something happening where the PAI info is being injected ok, but then being removed by another piece of code?

pbx.c: Executing [s@macro-outbound-callerid:21] ExecIf("PJSIP/4000-00000070", "0?Set(CALLERID(all)=)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:22] ExecIf("PJSIP/4000-00000070", "1?Set(CALLERID(all)=02xxCID_NUMBER)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:23] ExecIf("PJSIP/4000-00000070", "1?Set(CALLERID(all)=hidden)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:24] ExecIf("PJSIP/4000-00000070", "1?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:25] ExecIf("PJSIP/4000-00000070", "1?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:26] Set("PJSIP/4000-00000070", "CDR(outbound_cnum)=") in new stack
pbx.c: Executing [s@macro-outbound-callerid:27] Set("PJSIP/4000-00000070", "CDR(outbound_cnam)=hidden") in new stack
pbx.c: Executing [s@macro-dialout-trunk:14] GosubIf("PJSIP/4000-00000070", "0?sub-flp-4,s,1()") in new stack
pbx.c: Executing [s@macro-dialout-trunk:15] Set("PJSIP/4000-00000070", "OUTNUM=07xxMYMOBILE") in new stack
pbx.c: Executing [s@macro-dialout-trunk:16] Set("PJSIP/4000-00000070", "custom=PJSIP") in new stack
pbx.c: Executing [s@macro-dialout-trunk:17] ExecIf("PJSIP/4000-00000070", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
pbx.c: Executing [s@macro-dialout-trunk:18] ExecIf("PJSIP/4000-00000070", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
pbx.c: Executing [s@macro-dialout-trunk:19] Macro("PJSIP/4000-00000070", "dialout-trunk-predial-hook,") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:1] NoOp("PJSIP/4000-00000070", "The caller id name is: hidden") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:2] NoOp("PJSIP/4000-00000070", "The caller id number is: ") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:3] NoOp("PJSIP/4000-00000070", "The ampuser is: 4000") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:4] NoOp("PJSIP/4000-00000070", "The real caller id is: 4000") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:5] NoOp("PJSIP/4000-00000070", "The outbound cli is: 02xxCID_NUMBER") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:6] NoOp("PJSIP/4000-00000070", "Adding P-Asserted-Identity") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:7] SIPAddHeader("PJSIP/4000-00000070", "P-Asserted-Identity: sip:02xxCID_NUMBER") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:8] MacroExit("PJSIP/4000-00000070", "") in new stack
pbx.c: Executing [s@macro-dialout-trunk:20] GotoIf("PJSIP/4000-00000070", "0?skipcrm") in new stack
pbx.c: Executing [s@macro-dialout-trunk:21] Set("PJSIP/4000-00000070", "__CRM_DIRECTION=OUTBOUND") in new stack
pbx.c: Executing [s@macro-dialout-trunk:22] Set("PJSIP/4000-00000070", "__CRM_DESTINATION=07xxMYMOBILE") in new stack
pbx.c: Executing [s@macro-dialout-trunk:23] Set("PJSIP/4000-00000070", "__CRM_SOURCE=4000") in new stack
pbx.c: Executing [s@macro-dialout-trunk:24] AGI("PJSIP/4000-00000070", "sangomacrm.agi") in new stack
res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
res_agi.c: <PJSIP/4000-00000070>AGI Script sangomacrm.agi completed, returning 0
pbx.c: Executing [s@macro-dialout-trunk:25] Set("PJSIP/4000-00000070", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack
pbx.c: Executing [s@macro-dialout-trunk:26] NoOp("PJSIP/4000-00000070", "CRM Finished") in new stack
pbx.c: Executing [s@macro-dialout-trunk:27] GotoIf("PJSIP/4000-00000070", "0?bypass,1") in new stack
pbx.c: Executing [s@macro-dialout-trunk:28] ExecIf("PJSIP/4000-00000070", "1?Set(CONNECTEDLINE(num,i)=07xxMYMOBILE)") in new stack
pbx.c: Executing [s@macro-dialout-trunk:29] ExecIf("PJSIP/4000-00000070", "0?Set(CONNECTEDLINE(name,i)=CID:)") in new stack
pbx.c: Executing [s@macro-dialout-trunk:30] ExecIf("PJSIP/4000-00000070", "1?Set(CONNECTEDLINE(name,i)=CID:(Hidden))") in new stack
pbx.c: Executing [s@macro-dialout-trunk:31] GotoIf("PJSIP/4000-00000070", "0?customtrunk") in new stack

I was hoping to do this myself without having to bother the community but hitting my head against a wall and our main supplier is going to block all incorrect PAI calls soon so I need to get this fixed asap.
Hopefully its something quick you can help with,
Thanks
D

This is because your custom dialplan breaks what FreePBX already does. If you set the CallerID to “hidden” <> then FreePBX will make the CallerID (either From/RPID/PAI) hidden. Your code is setting the CallerID details with CALLERID vars that FreePBX doesn’t use until the very last check and assigns the proper CID to the call based on various settings.

Follow the tooltips and instructions on how to setup hidden callerID and then remove your custom macro calls to stop you from overriding everything.

Hi Tom, thanks for the speedy reply,
I have gone back to the FreePBX wiki to check on how to make an outbound call caller withheld.
https://wiki.freepbx.org/display/FPG/Outbound+Routes+Configuration+Examples#OutboundRoutesConfigurationExamples-4.RouteName:BlockCallerID
I can see they put a number after the “hidden”, so I have tested this (even though we have 100’s of CIDs we need to take into consideration).

In my outbound route I have the
Outbound CID now set to “hidden” <02xxCID_NUMBER>
and I have completely removed the [macro-dialout-trunk-predial-hook]

My wireshark dump doesnt show any P-Asserted-Identity
and my Logs show this

pbx.c: Executing [s@macro-outbound-callerid:21] ExecIf("PJSIP/4000-00000078", "0?Set(CALLERID(all)=)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:22] ExecIf("PJSIP/4000-00000078", "1?Set(CALLERID(all)=02xxCID_NUMBER)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:23] ExecIf("PJSIP/4000-00000078", "1?Set(CALLERID(all)=hidden <02xxCID_NUMBER>)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:24] ExecIf("PJSIP/4000-00000078", "1?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:25] ExecIf("PJSIP/4000-00000078", "1?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
pbx.c: Executing [s@macro-outbound-callerid:26] Set("PJSIP/4000-00000078", "CDR(outbound_cnum)=02xxCID_NUMBER") in new stack
pbx.c: Executing [s@macro-outbound-callerid:27] Set("PJSIP/4000-00000078", "CDR(outbound_cnam)=hidden") in new stack
pbx.c: Executing [s@macro-dialout-trunk:14] GosubIf("PJSIP/4000-00000078", "0?sub-flp-4,s,1()") in new stack
pbx.c: Executing [s@macro-dialout-trunk:15] Set("PJSIP/4000-00000078", "OUTNUM=07xxMYMOBILE") in new stack
pbx.c: Executing [s@macro-dialout-trunk:16] Set("PJSIP/4000-00000078", "custom=PJSIP") in new stack
pbx.c: Executing [s@macro-dialout-trunk:17] ExecIf("PJSIP/4000-00000078", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
pbx.c: Executing [s@macro-dialout-trunk:18] ExecIf("PJSIP/4000-00000078", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
pbx.c: Executing [s@macro-dialout-trunk:19] Macro("PJSIP/4000-00000078", "dialout-trunk-predial-hook,") in new stack
pbx.c: Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("PJSIP/4000-00000078", "") in new stack
pbx.c: Executing [s@macro-dialout-trunk:20] GotoIf("PJSIP/4000-00000078", "0?skipcrm") in new stack
pbx.c: Executing [s@macro-dialout-trunk:21] Set("PJSIP/4000-00000078", "__CRM_DIRECTION=OUTBOUND") in new stack
pbx.c: Executing [s@macro-dialout-trunk:22] Set("PJSIP/4000-00000078", "__CRM_DESTINATION=07xxMYMOBILE") in new stack
pbx.c: Executing [s@macro-dialout-trunk:23] Set("PJSIP/4000-00000078", "__CRM_SOURCE=4000") in new stack
pbx.c: Executing [s@macro-dialout-trunk:24] AGI("PJSIP/4000-00000078", "sangomacrm.agi") in new stack
res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
res_agi.c: <PJSIP/4000-00000078>AGI Script sangomacrm.agi completed, returning 0
pbx.c: Executing [s@macro-dialout-trunk:25] Set("PJSIP/4000-00000078", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack
pbx.c: Executing [s@macro-dialout-trunk:26] NoOp("PJSIP/4000-00000078", "CRM Finished") in new stack
pbx.c: Executing [s@macro-dialout-trunk:27] GotoIf("PJSIP/4000-00000078", "0?bypass,1") in new stack
pbx.c: Executing [s@macro-dialout-trunk:28] ExecIf("PJSIP/4000-00000078", "1?Set(CONNECTEDLINE(num,i)=07xxMYMOBILE)") in new stack
pbx.c: Executing [s@macro-dialout-trunk:29] ExecIf("PJSIP/4000-00000078", "0?Set(CONNECTEDLINE(name,i)=CID:02xxCID_NUMBER)") in new stack
pbx.c: Executing [s@macro-dialout-trunk:30] ExecIf("PJSIP/4000-00000078", "1?Set(CONNECTEDLINE(name,i)=CID:(Hidden)02xxCID_NUMBER)") in new stack
pbx.c: Executing [s@macro-dialout-trunk:31] GotoIf("PJSIP/4000-00000078", "0?customtrunk") in new stack

I would like the ability to use a variable to set the outbound CID to whatever the extensions Ourbound CID is as we have users across lots of different sites with multiple DDIs etc.

Thanks for the help so far.
D

That call trace is incomplete. Doesn’t show the start or the ending of the call.

This should be the full log of the call,
Thanks
D

Is preformatted text the best way to put it on forum posts?

[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [14107xxMYMOBILE@from-internal:1] Macro("PJSIP/4000-00000078", "user-callerid,LIMIT,EXTERNAL,") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:1] Set("PJSIP/4000-00000078", "TOUCH_MONITOR=1565015928.221") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:2] Set("PJSIP/4000-00000078", "AMPUSER=4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:3] GotoIf("PJSIP/4000-00000078", "0?report") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:4] ExecIf("PJSIP/4000-00000078", "1?Set(REALCALLERIDNUM=4000)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:5] Set("PJSIP/4000-00000078", "AMPUSER=4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:6] GotoIf("PJSIP/4000-00000078", "0?limit") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:7] Set("PJSIP/4000-00000078", "AMPUSERCIDNAME=Ext 4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:8] ExecIf("PJSIP/4000-00000078", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:9] GotoIf("PJSIP/4000-00000078", "0?report") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:10] Set("PJSIP/4000-00000078", "AMPUSERCID=4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:11] Set("PJSIP/4000-00000078", "__DIAL_OPTIONS=HhTtr") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:12] Set("PJSIP/4000-00000078", "CALLERID(all)="Ext 4000" <4000>") in new stack
[2019-08-05 14:38:48] WARNING[14592][C-00000071] ast_expr2.fl: ast_yyerror(): syntax error: syntax error, unexpected '>', expecting '-' or '!' or '(' or '<token>'; Input:
"LIMIT"="LIMIT" & 4 & 1 & >0 & 0>=
^
[2019-08-05 14:38:48] WARNING[14592][C-00000071] ast_expr2.fl: If you have questions, please refer to https://wiki.asterisk.org/wiki/display/AST/Channel+Variables
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:13] GotoIf("PJSIP/4000-00000078", "0?limit") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:14] ExecIf("PJSIP/4000-00000078", "1?Set(GROUP(concurrency_limit)=4000)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:15] ExecIf("PJSIP/4000-00000078", "0?Set(CHANNEL(language)=)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:16] NoOp("PJSIP/4000-00000078", "Macro Depth is 1") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:17] GotoIf("PJSIP/4000-00000078", "1?report2:macroerror") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (macro-user-callerid,s,18)
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:18] GotoIf("PJSIP/4000-00000078", "1?continue") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (macro-user-callerid,s,37)
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:37] Set("PJSIP/4000-00000078", "CALLERID(number)=4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:38] Set("PJSIP/4000-00000078", "CALLERID(name)=Ext 4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:39] GotoIf("PJSIP/4000-00000078", "0?cnum") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:40] Set("PJSIP/4000-00000078", "CDR(cnam)=Ext 4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:41] Set("PJSIP/4000-00000078", "CDR(cnum)=4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-user-callerid:42] Set("PJSIP/4000-00000078", "CHANNEL(language)=en_GB") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [14107xxMYMOBILE@from-internal:2] Gosub("PJSIP/4000-00000078", "sub-record-check,s,1(out,14107xxMYMOBILE,dontcare)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:1] GotoIf("PJSIP/4000-00000078", "0?initialized") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:2] Set("PJSIP/4000-00000078", "__REC_STATUS=INITIALIZED") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:3] Set("PJSIP/4000-00000078", "NOW=1565015928") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:4] Set("PJSIP/4000-00000078", "__DAY=05") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:5] Set("PJSIP/4000-00000078", "__MONTH=08") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:6] Set("PJSIP/4000-00000078", "__YEAR=2019") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:7] Set("PJSIP/4000-00000078", "__TIMESTR=20190805-143848") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:8] Set("PJSIP/4000-00000078", "__FROMEXTEN=4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:9] Set("PJSIP/4000-00000078", "__MON_FMT=wav") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:10] NoOp("PJSIP/4000-00000078", "Recordings initialized") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:11] ExecIf("PJSIP/4000-00000078", "0?Set(ARG3=dontcare)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:12] Set("PJSIP/4000-00000078", "REC_POLICY_MODE_SAVE=") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:13] ExecIf("PJSIP/4000-00000078", "0?Set(REC_STATUS=NO)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:14] GotoIf("PJSIP/4000-00000078", "3?checkaction") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (sub-record-check,s,17)
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@sub-record-check:17] GotoIf("PJSIP/4000-00000078", "1?sub-record-check,out,1") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (sub-record-check,out,1)
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [out@sub-record-check:1] NoOp("PJSIP/4000-00000078", "Outbound Recording Check from 4000 to 14107xxMYMOBILE") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [out@sub-record-check:2] Set("PJSIP/4000-00000078", "RECMODE=dontcare") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [out@sub-record-check:3] ExecIf("PJSIP/4000-00000078", "1?Goto(routewins)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (sub-record-check,out,7)
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [out@sub-record-check:7] Gosub("PJSIP/4000-00000078", "recordcheck,1(dontcare,out,14107xxMYMOBILE)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [recordcheck@sub-record-check:1] NoOp("PJSIP/4000-00000078", "Starting recording check against dontcare") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [recordcheck@sub-record-check:2] Goto("PJSIP/4000-00000078", "dontcare") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (sub-record-check,recordcheck,3)
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [recordcheck@sub-record-check:3] Return("PJSIP/4000-00000078", "") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [out@sub-record-check:8] Return("PJSIP/4000-00000078", "") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [14107xxMYMOBILE@from-internal:3] ExecIf("PJSIP/4000-00000078", "0 ?Set(CDR(accountcode)=)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [14107xxMYMOBILE@from-internal:4] Set("PJSIP/4000-00000078", "MOHCLASS=default") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [14107xxMYMOBILE@from-internal:5] ExecIf("PJSIP/4000-00000078", "1?Set(TRUNKCIDOVERRIDE="hidden" <02xxCID_NUMBER>)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [14107xxMYMOBILE@from-internal:6] Set("PJSIP/4000-00000078", "_NODEST=") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [14107xxMYMOBILE@from-internal:7] Macro("PJSIP/4000-00000078", "dialout-trunk,4,07xxMYMOBILE,,on") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:1] Set("PJSIP/4000-00000078", "DIAL_TRUNK=4") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:2] ExecIf("PJSIP/4000-00000078", "0?Set(DIAL_OPTIONS=Hhtr)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:3] GosubIf("PJSIP/4000-00000078", "0?sub-pincheck,s,1()") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:4] ExecIf("PJSIP/4000-00000078", "0?Set(CALLERID(num)=4000)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:5] GotoIf("PJSIP/4000-00000078", "0?disabletrunk,1") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:6] Set("PJSIP/4000-00000078", "DIAL_NUMBER=07xxMYMOBILE") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:7] Set("PJSIP/4000-00000078", "DIAL_TRUNK_OPTIONS=HhTtr") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:8] Set("PJSIP/4000-00000078", "OUTBOUND_GROUP=OUT_4") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:9] Set("PJSIP/4000-00000078", "DIAL_TRUNK_OPTIONS=T") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:10] GotoIf("PJSIP/4000-00000078", "0?nomax") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:11] GotoIf("PJSIP/4000-00000078", "0?chanfull") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:12] GotoIf("PJSIP/4000-00000078", "0?skipoutcid") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:13] Macro("PJSIP/4000-00000078", "outbound-callerid,4") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:1] NoOp("PJSIP/4000-00000078", "4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:2] NoOp("PJSIP/4000-00000078", "") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:3] NoOp("PJSIP/4000-00000078", "off") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:4] ExecIf("PJSIP/4000-00000078", "0?Set(CALLERPRES(name-pres)=)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:5] ExecIf("PJSIP/4000-00000078", "0?Set(CALLERPRES(num-pres)=)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:6] ExecIf("PJSIP/4000-00000078", "0?Set(REALCALLERIDNUM=4000)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:7] ExecIf("PJSIP/4000-00000078", "0?Set(AMPUSER=4000)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:8] GotoIf("PJSIP/4000-00000078", "1?normcid") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (macro-outbound-callerid,s,12)
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:12] Set("PJSIP/4000-00000078", "USEROUTCID=02xxCID_NUMBER") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:13] Set("PJSIP/4000-00000078", "EMERGENCYCID=") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:14] Set("PJSIP/4000-00000078", "TRUNKOUTCID=") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:15] GotoIf("PJSIP/4000-00000078", "1?trunkcid") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (macro-outbound-callerid,s,21)
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:21] ExecIf("PJSIP/4000-00000078", "0?Set(CALLERID(all)=)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:22] ExecIf("PJSIP/4000-00000078", "1?Set(CALLERID(all)=02xxCID_NUMBER)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:23] ExecIf("PJSIP/4000-00000078", "1?Set(CALLERID(all)=hidden <02xxCID_NUMBER>)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:24] ExecIf("PJSIP/4000-00000078", "1?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:25] ExecIf("PJSIP/4000-00000078", "1?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:26] Set("PJSIP/4000-00000078", "CDR(outbound_cnum)=02xxCID_NUMBER") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-outbound-callerid:27] Set("PJSIP/4000-00000078", "CDR(outbound_cnam)=hidden") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:14] GosubIf("PJSIP/4000-00000078", "0?sub-flp-4,s,1()") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:15] Set("PJSIP/4000-00000078", "OUTNUM=07xxMYMOBILE") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:16] Set("PJSIP/4000-00000078", "custom=PJSIP") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:17] ExecIf("PJSIP/4000-00000078", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:18] ExecIf("PJSIP/4000-00000078", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:19] Macro("PJSIP/4000-00000078", "dialout-trunk-predial-hook,") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("PJSIP/4000-00000078", "") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:20] GotoIf("PJSIP/4000-00000078", "0?skipcrm") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:21] Set("PJSIP/4000-00000078", "__CRM_DIRECTION=OUTBOUND") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:22] Set("PJSIP/4000-00000078", "__CRM_DESTINATION=07xxMYMOBILE") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:23] Set("PJSIP/4000-00000078", "__CRM_SOURCE=4000") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:24] AGI("PJSIP/4000-00000078", "sangomacrm.agi") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] res_agi.c: <PJSIP/4000-00000078>AGI Script sangomacrm.agi completed, returning 0
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:25] Set("PJSIP/4000-00000078", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:26] NoOp("PJSIP/4000-00000078", "CRM Finished") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:27] GotoIf("PJSIP/4000-00000078", "0?bypass,1") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:28] ExecIf("PJSIP/4000-00000078", "1?Set(CONNECTEDLINE(num,i)=07xxMYMOBILE)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:29] ExecIf("PJSIP/4000-00000078", "0?Set(CONNECTEDLINE(name,i)=CID:02xxCID_NUMBER)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:30] ExecIf("PJSIP/4000-00000078", "1?Set(CONNECTEDLINE(name,i)=CID:(Hidden)02xxCID_NUMBER)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:31] GotoIf("PJSIP/4000-00000078", "0?customtrunk") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-dialout-trunk:32] Dial("PJSIP/4000-00000078", "PJSIP/07xxMYMOBILE@Trunk1-A1,300,Tb(func-apply-sipheaders^s^1,(4))") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] app_stack.c: PJSIP/Trunk1-A1-00000079 Internal Gosub(func-apply-sipheaders,s,1(4)) start
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@func-apply-sipheaders:1] ExecIf("PJSIP/Trunk1-A1-00000079", "0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@func-apply-sipheaders:2] NoOp("PJSIP/Trunk1-A1-00000079", "Applying SIP Headers to channel PJSIP/Trunk1-A1-00000079") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@func-apply-sipheaders:3] Set("PJSIP/Trunk1-A1-00000079", "TECH=PJSIP") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@func-apply-sipheaders:4] Set("PJSIP/Trunk1-A1-00000079", "SIPHEADERKEYS=") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@func-apply-sipheaders:5] While("PJSIP/Trunk1-A1-00000079", "0") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] app_while.c: Jumping to priority 12
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] pbx.c: Executing [s@func-apply-sipheaders:13] Return("PJSIP/Trunk1-A1-00000079", "") in new stack
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] app_stack.c: Spawn extension (from-internal, 14107xxMYMOBILE, 1) exited non-zero on 'PJSIP/Trunk1-A1-00000079'
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] app_stack.c: PJSIP/Trunk1-A1-00000079 Internal Gosub(func-apply-sipheaders,s,1(4)) complete GOSUB_RETVAL=
[2019-08-05 14:38:48] VERBOSE[14592][C-00000071] app_dial.c: Called PJSIP/07xxMYMOBILE@Trunk1-A1
[2019-08-05 14:38:50] VERBOSE[14592][C-00000071] app_dial.c: PJSIP/Trunk1-A1-00000079 is making progress passing it to PJSIP/4000-00000078
[2019-08-05 14:38:50] VERBOSE[14592][C-00000071] app_dial.c: PJSIP/Trunk1-A1-00000079 is making progress passing it to PJSIP/4000-00000078
[2019-08-05 14:38:50] VERBOSE[14592][C-00000071] app_dial.c: PJSIP/Trunk1-A1-00000079 is making progress passing it to PJSIP/4000-00000078
[2019-08-05 14:38:50] VERBOSE[14592][C-00000071] app_dial.c: PJSIP/Trunk1-A1-00000079 is making progress passing it to PJSIP/4000-00000078
[2019-08-05 14:38:51] VERBOSE[14592][C-00000071] app_dial.c: PJSIP/Trunk1-A1-00000079 is ringing
[2019-08-05 14:38:51] VERBOSE[14592][C-00000071] app_dial.c: PJSIP/Trunk1-A1-00000079 is ringing
[2019-08-05 14:38:54] VERBOSE[14592][C-00000071] app_dial.c: PJSIP/Trunk1-A1-00000079 answered PJSIP/4000-00000078
[2019-08-05 14:38:54] VERBOSE[14611][C-00000071] bridge_channel.c: Channel PJSIP/Trunk1-A1-00000079 joined 'simple_bridge' basic-bridge <3c3fa249-1ca0-4bac-9715-31afc9c8b68a>
[2019-08-05 14:38:54] VERBOSE[14592][C-00000071] bridge_channel.c: Channel PJSIP/4000-00000078 joined 'simple_bridge' basic-bridge <3c3fa249-1ca0-4bac-9715-31afc9c8b68a>
[2019-08-05 14:38:56] VERBOSE[14611][C-00000071] bridge_channel.c: Channel PJSIP/Trunk1-A1-00000079 left 'simple_bridge' basic-bridge <3c3fa249-1ca0-4bac-9715-31afc9c8b68a>
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] bridge_channel.c: Channel PJSIP/4000-00000078 left 'simple_bridge' basic-bridge <3c3fa249-1ca0-4bac-9715-31afc9c8b68a>
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] app_macro.c: Spawn extension (macro-dialout-trunk, s, 32) exited non-zero on 'PJSIP/4000-00000078' in macro 'dialout-trunk'
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Spawn extension (from-internal, 14107xxMYMOBILE, 7) exited non-zero on 'PJSIP/4000-00000078'
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [h@from-internal:1] Macro("PJSIP/4000-00000078", "hangupcall") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-hangupcall:1] GotoIf("PJSIP/4000-00000078", "1?theend") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (macro-hangupcall,s,3)
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-hangupcall:3] ExecIf("PJSIP/4000-00000078", "0?Set(CDR(recordingfile)=)") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-hangupcall:4] NoOp("PJSIP/4000-00000078", "PJSIP/Trunk1-A1-00000079 montior file= ") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-hangupcall:5] GotoIf("PJSIP/4000-00000078", "1?skipagi") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx_builtins.c: Goto (macro-hangupcall,s,7)
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@macro-hangupcall:7] Hangup("PJSIP/4000-00000078", "") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] app_macro.c: Spawn extension (macro-hangupcall, s, 7) exited non-zero on 'PJSIP/4000-00000078' in macro 'hangupcall'
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/4000-00000078'
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] app_stack.c: PJSIP/4000-00000078 Internal Gosub(crm-hangup,s,1) start
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@crm-hangup:1] NoOp("PJSIP/4000-00000078", "Sending Hangup to CRM") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@crm-hangup:2] NoOp("PJSIP/4000-00000078", "HANGUP CAUSE: 16") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@crm-hangup:3] ExecIf("PJSIP/4000-00000078", "0?Set(__CRM_VOICEMAIL=)") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@crm-hangup:4] NoOp("PJSIP/4000-00000078", "MASTER CHANNEL: 1565015928.221 = 1565015928.221") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@crm-hangup:5] GotoIf("PJSIP/4000-00000078", "0?return") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@crm-hangup:6] Set("PJSIP/4000-00000078", "__CRM_HANGUP=1") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@crm-hangup:7] AGI("PJSIP/4000-00000078", "sangomacrm.agi") in new stack
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] res_agi.c: <PJSIP/4000-00000078>AGI Script sangomacrm.agi completed, returning 0
[2019-08-05 14:38:56] VERBOSE[14592][C-00000071] pbx.c: Executing [s@crm-hangup:8] Return("PJSIP/4000-00000078", "") in new stack![FreePBXpaiNewpost1|588x348](upload://5Yc1HzbwzUxOz6kpjS771k6r2g1.png)

and here is an image of the wireshark not showing any P-Asserted-Identity
FreePBXpaiNewpost1

Hi,
I’ve been out on an install but trying to get back to this issue now. Not sure if I am missing something as its still not working. Can anyone help with this?

Thanks
David

I have just read on another post P-Asserted-Identity on Call Forward problem that I may need to delete the
trustrpid=yes
sendrpid=pai
to get custom code working in a dial plan, is this what I am missing?
I cant test this at the minute but just looking any pointers to help solve this.
Thx
D

Finally found the answer here How do I modify the P-asserted Identity
It turns out the code I was using in the macro-dialout-trunk-predial-hook was for ChanSIP so was making no difference as I was using PJSIP trunks out to my provider.
When I changed back to ChanSIP trunks I used the following code in FreePBX - Config Edit
extensions_custom.conf
The NoOp lines give you some information in your FreePBX Asterisk Log Files to see which code gives you the right one to use in the SipAddHeader line.

[macro-dialout-trunk-predial-hook]
exten => s,1,NoOp(The caller id name is: ${CALLERID(name)})
exten => s,n,NoOp(The caller id number is: ${CALLERID(num)})
exten => s,n,NoOp(The ampuser is: ${AMPUSER})
exten => s,n,NoOp(The real caller id is: ${REALCALLERIDNUM})
exten => s,n,NoOp(The outbound cli is: ${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n,NoOp(Adding P-Asserted-Identity)
exten => s,n,SipAddHeader(P-Asserted-Identity: sip:${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n(done),MacroExit()

In my “caller withheld” outbound route my Route CID is “hidden”

This worked for me, hope it helps others,
Thx
D

PJSIP trunks have the option to Send CallerID as RPID, PAI or Both. So it would add the PAI automatically based on the CallerID settings of the User/Route/Trunk.

Chan_SIP uses sendrpid=pai and that will do the exact same thing. Again, I said this could all be done in the GUI and without this special code because you’re doing nothing special with it.

Did you try any of that?

Hi Tom,
Yes I had Trust RPID/PAI = Yes
and Send RPID/PAI = Send P-Asserted-Identity header
configured in the PJSIP trunks for the last couple of months but it didn’t send any PAI for hidden calls.

I wasnt sure where else in the PJSIP trunk to get this working. I would love to get this working in the PJSIP trunk gui but for now I’m happy to have it working with ChanSIP.

Im learning bit by bit and have another custom dial plan to try to figure out so cant spend any more time on this now I have working code. Perhaps I can look back at this when/if I need to move to PJSIP.

Thanks for all the help and pointers,
D

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.