Custom context includes

Hi

I’m trying to configure a FreePBX and connecting now to a trunk. My provider uses the P-Preferred-Identity header for sending me the called number.

Now I’ve write a custom context in extensions_custom.conf

[from-trunk-sip-reventix-custom]
exten => s,1,Noop(Fixing DID using information from SIP header)
exten => s,n,Set(pseudodid=${CUT(CUT(SIP_HEADER(P-Preferred-Identity),@,1),:,2)})
exten => s,n,Goto(from-trunk,${pseudodid},1)

The generated context in extensions_additional.conf is:

[from-trunk-sip-reventix]
include => from-trunk-sip-reventix-custom
exten => _.,1,Set(GROUP()=OUT_1)
exten => _.,n,Goto(from-trunk,${EXTEN},1)

As far as I understand it, the custom context should be included, but when a call is coming in the following log occures:

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [@from-trunk-sip-reventix:1] Set(“SIP/reventix-00000021”, “GROUP()=OUT_1”) in new stack
– Executing [@from-trunk-sip-reventix:2] Goto(“SIP/reventix-00000021”, “from-trunk,,1”) in new stack
– Goto (from-trunk,,1)
– Executing [@from-trunk:1] Set(“SIP/reventix-00000021”, “__FROM_DID=”) in new stack
– Executing [@from-trunk:2] NoOp(“SIP/reventix-00000021”, "Received an unknown call with DID set to ") in new stack
– Executing [@from-trunk:3] Goto(“SIP/reventix-00000021”, “s,a2”) in new stack
– Goto (from-trunk,s,2)
– Executing [[email protected]:2] Answer(“SIP/reventix-00000021”, “”) in new stack
– Executing [[email protected]:3] Wait(“SIP/reventix-00000021”, “2”) in new stack
== Spawn extension (from-trunk, s, 3) exited non-zero on ‘SIP/reventix-00000021’
– Executing [[email protected]:1] Macro(“SIP/reventix-00000021”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/reventix-00000021”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“SIP/reventix-00000021”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] Hangup(“SIP/reventix-00000021”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/reventix-00000021’ in macro ‘hangupcall’
== Spawn extension (from-trunk, h, 1) exited non-zero on ‘SIP/reventix-00000021’

The files are all loaded correctly.
Has anybody an idea what this could be?

Greeting Arronax

Your custom dialplan is trying to match on [font=Courier]s[/font] while the generated one is matching on [font=Courier]_.[/font]. However, looking at your trace it’s executing [font=Courier]<sipnum>@from-trunk-sip-reventix[/font] (I assume you’ve replaced an account-wide DID or similar with <sipnum>) so you might be better off matching that.