Setting Ring Tones on Inbound Routes - Not working

FreePBX Version 14.0.3.20

I am trying to set the ringtone on inbound calls to a Sangoma phone by setting the Alert Info field to “(Sangoma) Ring 1”. I can see in the asterisk CLI that the Alert-Info is added to the sip header. When I look at the actual sip invite message, the Alert-Info is not being added to the SIP Header. I have tried using the phone configured as both sip and pjsip extensions. No Luck.

PJSIP/305-000006ca Internal Gosub(func-apply-sipheaders,s,1) start
– Executing [[email protected]:1] NoOp(“PJSIP/305-000006ca”, “Applying SIP Headers to channel”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/305-000006ca”, “SIPHEADERKEYS=Alert-Info”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/305-000006ca”, “0?Set(Rheader=1)”) in new stack
– Executing [[email protected]:4] While(“PJSIP/305-000006ca”, “1”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/305-000006ca”, “sipheader=ring1”) in new stack
– Executing [[email protected]:6] ExecIf(“PJSIP/305-000006ca”, “0?Set(Addheader=1)”) in new stack
– Executing [[email protected]:7] ExecIf(“PJSIP/305-000006ca”, “0?SIPAddHeader(Alert-Info:ring1)”) in new stack
– Executing [[email protected]:8] ExecIf(“PJSIP/305-000006ca”, “0?Set(PJSIP_HEADER(add,Alert-Info)=ring1)”) in new stack
– Executing [[email protected]:9] EndWhile(“PJSIP/305-000006ca”, “”) in new stack
– Executing [[email protected]:4] While(“PJSIP/305-000006ca”, “0”) in new stack
– Executing [[email protected]:10] ExecIf(“PJSIP/305-000006ca”, “0?SIPRemoveHeader(Alert-Info:)”) in new stack
– Executing [[email protected]:11] ExecIf(“PJSIP/305-000006ca”, “0?Set(PJSIP_HEADER(remove,Alert-Info)=)”) in new stack
– Executing [[email protected]:12] Return(“PJSIP/305-000006ca”, “”) in new stack
== Spawn extension (from-internal, 305, 1) exited non-zero on ‘PJSIP/305-000006ca’
– PJSIP/305-000006ca Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
– Called PJSIP/305/sip:[email protected]:51009
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
== Using SIP RTP Audio CoS mark 5
– Connected line update to PJSIP/Bandwidth_B-000006c9 prevented.
– PJSIP/305-000006ca is ringing
– PJSIP/305-000006ca is ringing

Which phones are you using?

Sangoma S700

I can see in the phone’s pcap capture that it is not receiving the Alert-Info

Looks like it is a bug in the dialplan. I believe that the line below from the function func-apply-sipheaders should use != instead of =

exten => s,n,ExecIf($["${HASH(SIPHEADERS,${sipkey})}" = “”]?Set(Addheader=1))

[func-apply-sipheaders]
include => func-apply-sipheaders-custom
exten => s,1,Noop(Applying SIP Headers to channel)
exten => s,n,Set(SIPHEADERKEYS=${HASHKEYS(SIPHEADERS)})
exten => s,n,ExecIf($["${HASH(SIPHEADERS,Alert-Info)}" = “unset”]?Set(Rheader=1))
exten => s,n,While($["${SET(sipkey=${SHIFT(SIPHEADERKEYS)})}" != “”])
exten => s,n,Set(sipheader=${HASH(SIPHEADERS,${sipkey})})
exten => s,n,ExecIf($["${HASH(SIPHEADERS,${sipkey})}" = “”]?Set(Addheader=1))
exten => s,n,ExecIf($["${Addheader}" = “1”]?SIPAddHeader(${sipkey}:${sipheader}))
exten => s,n,ExecIf($["${Addheader}" = “1”]?Set(PJSIP_HEADER(add,${sipkey})=${sipheader}))
exten => s,n,EndWhile
exten => s,n,ExecIf($["${Rheader}" = “1”]?SIPRemoveHeader(Alert-Info:))
exten => s,n,ExecIf($["${Rheader}" = “1”]?Set(PJSIP_HEADER(remove,Alert-Info)=))
exten => s,n,Return()

If you’re right about the ‘!=’ error, you need to submit a bug report on this.

Bug Submitted.

https://issues.freepbx.org/browse/FREEPBX-18336

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