Asterisk Trunk Dial Options not working after latest upgrade of Freepbx

Hi all,

I’m not sure how to write it but after the latest upgrade of Freepbx modules my Asterisk Trunk Dial Options stopped to work.

I was using something like that: Tb(p-preferred-identity^trunk-name^1)

exten => trunk-name,1,NoOp(outbound CID: ${CALLERID(name)})
exten => trunk-name,n,Set(OUTCID=${IF($["${CALLERID(name):0:4}"="CID:"]?${CALLERID(name):4}:${CALLERID(name)})})
exten => trunk-name,n,Set(PJSIP_HEADER(add,P-Preferred-Identity)=sip:${OUTCID}
exten => trunk-name,n,Return()

This was working in the past.

Now I can see the following:

[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] pbx.c: Executing [[email protected]:31] Dial("PJSIP/41-000014c5", "PJSIP/[email protected],300,Tb(p-preferred-identity^trunk-name^1)b(func-apply-sipheaders^s^1)") in new stack
[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] app_stack.c: PJSIP/trunk-name-000014c6 Internal Gosub(func-apply-sipheaders,s,1) start
[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] pbx.c: Executing [[email protected]:1] ExecIf("PJSIP/trunk-name-000014c6", "0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)") in new stack
[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] pbx.c: Executing [[email protected]:2] NoOp("PJSIP/trunk-name-000014c6", "Applying SIP Headers to channel") in new stack
[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] pbx.c: Executing [[email protected]:3] Set("PJSIP/trunk-name-000014c6", "SIPHEADERKEYS=") in new stack
[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] pbx.c: Executing [[email protected]:4] While("PJSIP/trunk-name-000014c6", "0") in new stack
[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] app_while.c: Jumping to priority 8
[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] pbx.c: Executing [[email protected]:9] Return("PJSIP/trunk-name-000014c6", "") in new stack

Would be great if someone is able to help.

Best regards

Hi all,

so I found a solution for that.
I added a “,” behind my dial options. I’m quite sure that this should not be the right way to do but maybe someone can comment on that.

Best regards

This is a result of this ticket:

Outbound calls now call the func-apply-sipheaders sub which you can see is conflicting with your own specified subroutine. Do you have ‘Generate Diversion Headers’ enabled in Advanced Settings, and if so, does disabling this setting remove the dial option sub that conflicts with the one you have?

The comma trick works, because you are forcing the remaining dial options following the comma to be ignored, but they are still being written as a dial parameter so there may be unintended consequences.


thank you for the quick response.
Please note that ‘Generate Diversion Headers’ is disabled.

Also if I try to add a rule for testing into this ‘func-apply-sipheaders-custom’ is does not get triggered.

exten => s,n,NoOp(outbound CID: ${CALLERID(name)})

Best regards

I am having the same issue
Confirmed that “Generate Diversion Headers” is disabled.


this is the solution for the problem.

PJSIP and subroutines are not working any more. I understood that this is expected.
The right way is to make use out of the SIPHEADERS hash map. You can fill it within the [macro-dialout-trunk-predial-hook].

An example could be found here:

Best regards

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