Custom extension config stopped working

I have a custom stanza in my extension_custom.conf to alter the CID for incoming calls.

[from-trunk-custom]
exten => _X.,1,NOOP("Entered [mod-CID]")
exten => _X.,n,ExecIf($[ "${CALLERID(num):0:3}" = "+32" ]?Set(CALLERID(num)=${CALLERID(num):3}))
exten => _X.,n,ExecIf($[ "${CALLERID(num):0:1}" = "+" ]?Set(CALLERID(num)=0${CALLERID(num):1}))
exten => _X.,n,ExecIf($[ "${FILTER(0123456789,${CALLERID(number)})}"="${CALLERID(number)}"]?Set(CALLERID(num)=0${CALLERID(num)}))
;exten => _X.,n,Set(CALLERID(num)=0${CALLERID(num)})
exten => _X.,n,goto(from-trunk,${EXTEN},1)

It’s included in the trunk configuration - Sip settings:

context=from-trunk-custom

This has always worked but I now noticed that it’s no longer included. If I checked the logs and it just goes to from-trunk and never uses the custom one, any idea what could be wrong here?

Don’t use from-trunk-custom if you search the forum you’ll see it’s not recommended to use that context.

Use something else.

Maybe mycustom-cid-trunk or anything that comes to mind.

I changed it to “from-trunk-custom-cid” but that doesn’t make any difference

You changed it in both places? Also try to use something else than starting with from-trunk-custom

Yup, and did a reload

See my edit. If it still doesn’t work, please post a pastebin call trace.

See wiki: https://wiki.freepbx.org/display/SUP/Providing+Great+Debug#ProvidingGreatDebug-AsteriskLogs-PartII

I named it “custom-cid” as well which doesn’t work either.
I looked a the call trace and it just never goes to the custom-context so I’m not sure how useful that trace is besides confirming it isn’t there. I think we should figure out why it is not included.

Can you show us a screenshot of the trunk config?

That’s the outgoing. Can you show us the incoming tab?

Incoming is empty and has always been like that.
Which is apparently not abnormal: [solved] Prepend zero on inbound calls from sip trunk

Um I won’t argue with that here. Can you add that context to the incoming tab and see what’s happening?

Done, no difference, it doesn’t show up in the call trace

Are you use calls are coming through this Trunk? It makes no sense.

I only have a single trunk so I’m pretty sure yes :slight_smile:

I figured it out after a lot of debugging and pondering :slight_smile:
So it went wrong after changing from chansip to pjsip because I switched the ports as well. (switched pjsip to 5060 instead of default on 5160 and vice versa for chan_sip). My provider was still using 5060 and therefore the calls came in (somehow) via pjsip and a non-existent trunk instead of the configured chansip trunk. The result was of course that the custom context was never used.

Thanks to @PitzKey as he suggested the calls were not coming through the trunk, it took some time but eventually it made the bell ring icw some other things I found in the log.

1 Like

It’s a type=friend config, so the incoming and outgoing share all the same settings. Since context=anything is meaningless on an outbound connection, it can only be applicable to an incoming connection.

1 Like

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