TimmiORG
(TimmiORG)
February 9, 2018, 9:34am
1
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}@domain.com)
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 [s@macro-dialout-trunk:31] Dial("PJSIP/41-000014c5", "PJSIP/01757255009@trunk-name,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 [s@func-apply-sipheaders: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 [s@func-apply-sipheaders: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 [s@func-apply-sipheaders:3] Set("PJSIP/trunk-name-000014c6", "SIPHEADERKEYS=") in new stack
[2018-02-09 08:40:29] VERBOSE[14824][C-00001140] pbx.c: Executing [s@func-apply-sipheaders: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 [s@func-apply-sipheaders:9] Return("PJSIP/trunk-name-000014c6", "") in new stack
Would be great if someone is able to help.
Best regards
Timmi
TimmiORG
(TimmiORG)
February 9, 2018, 10:16am
2
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.
Tb(p-preferred-identity^trunk-name^1),
Best regards
Timmi
lgaetz
(Lorne Gaetz)
February 9, 2018, 1:08pm
3
This is a result of this ticket:
https://issues.freepbx.org/browse/FREEPBX-16018
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.
TimmiORG
(TimmiORG)
February 9, 2018, 2:10pm
4
Hi,
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.
[func-apply-sipheaders-custom]
exten => s,n,NoOp(outbound CID: ${CALLERID(name)})
Best regards
Timmi
I am having the same issue
Confirmed that “Generate Diversion Headers” is disabled.
TimmiORG
(TimmiORG)
March 17, 2018, 1:21pm
6
H,
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:
I noticed that something important has changed at this point. I don’t have a full understanding of “the new method”. Investigating and reading many docs I found a solution which seems to work for me:
There are functions which are adding these headers to the sip data stream. The function uses the SIPHEADERS variable to fetch custom/new/addtional headers. So I added the following code to the “old” [macro-dialout-trunk-predial-hook]:
[macro-dialout-trunk-predial-hook]
exten => s,1,NoOp(**********…
Best regards
Timmi
system
(system)
Closed
March 24, 2018, 1:21pm
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.