Adding custom SIP Header

I need to send a custom sip header to my grandstream phone so they can show a “in-call” soft button to park the call…

This is what I need to add to the SIP Invite of the phone: X-UCM-CallPark: #700

I tried to put it in extensions_custom.conf like that
[from-internal-custom]
exten => s,n,SIPAddHeader(X-UCM-CallPark: #700)

But it is not working in the trace in CLI I don’t see the command being processed when I place a call…

It’s the phone that need to receive that header…

As many of the forums and config files say, with FreePBX, editing a *.config file is not recommended as it will get overwritten the instant you apply a new configuration using the “Apply Config” button".

This may work for a raw Asterisk setup, but with FreePBX, most of the configuration files are automated and get constantly overwritten by the UI, especially SIP information.

You also never specified whether you are using PJSIP or CHAN_SIP as those are two separate entities that can be used for registration. If the phone is looking for port 5060, the default is PJSIP. You may also need to add the custom configuration in the appropriate pjsip config file.

I’m using Chan_SIP since I read the PJSIP is harder to add header to.

About the config file I was under the impression that using the _custom.conf files would not be overwritten… I’m using the GUI to edit that file in Admin -> Config Edit…

I was assuming you were editing it directly on the computer hosting FreePBX without the UI. Editing the custom_*.config files through the GUI should not get overwritten, but if I have done my research properly, using these custom files also means that the information in them will have less priority over the standard configuration.

Also, the CLI doesn’t always have all the information. You may need to run TCPDump on the machine directly to verify whether or not FreePBX is actually appending the header or not. I personally use a separate machine on a hub to do this to so that I can use Wireshark to view the resulting *.pcap easier.

Alternatively, is there any way to disable the header on the phone you are using? Have you looked into that?

I’ll do the TCP Dump from the phone directly…

I just found out that the new firmware could let me enable that feature, I’ll try it from the phone…

The information in the _custom config files is processed last, so if the ‘context steps’ you are trying to add are already defined, they will not be added again. To override the options in FreePBX (and set the precedence of your commands higher) add them to the “*_override*” config files.

That context is called when your extension is trying to make a call, so the phone is sending that header to the PBX in the SIP headers. I’m not sure that’s the right place for your experiment. A SIP Debug would probably go a long way to helping you find the place to add your request (see what’s getting sent to the phone and find out where Asterisk/FreePBX is sending that).