Adding custom header to PJSIP trunk not working


since my provider requires the P-Preferred-Identity header to be added to REGISTER and INVITE requests in other for authentication to succeed, I added it to my PJSIP trunk by following the instructions in the post from @Igaetz written in July 2018 (can’t link it since I’m a new user)

However, it doesn’t seem to work at all, the custom header doesn’t appear in the request. I’ve checked the logs and can’t find any log messages regarding the custom header.

Content of /etc/asterisk/extensions_custom.conf:

exten => s,1,Noop(entering user defined context custom-sip-header in extensions_custom.conf)
exten => s,n,Set(HASH(__SIPHEADERS,P-Preferred-Identity)=sip:${CALLERID(number)}
exten => s,n,Return

Dial options of my trunk: TB(custom-sip-header^s^1)

Can anybody help me with this? Sorry if I’m missing something obvious, but I’m still a beginner with FreePBX.

Wrong option. b(custom-sip-headers^s^1) is what you want. B() runs the GoSub on the current channel. b() runs the GoSub on the created channel, which is where you want it.

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