[asterisk-users] Changing the contact header

Kingsley Tart kingsley at dns99.co.uk
Tue Feb 21 07:46:11 CST 2023


Hi David,

I chanced upon your question while I was looking for the same thing
myself. I don't know whether this is still relevant to you, given that
it's over 2 years ago since you asked the question.

There's an option in the global section of pjsip.conf that defaults to
"no", but if you set it to yes, the user part of the Contact header
will be taken from the value of CALLERID(num):

I found this looking at the source code in res_pjsip.c - there's a load
of XML documentation at the top.

[global]
use_callerid_contact=yes

Cheers,
Kingsley.

On Wed, 2020-11-25 at 05:58 -0500, Dovid Bender wrote:
> Hi,
> 
> Is anyone aware of any way of changing the contact header on a call?
> We are sending 911 calls to a provider and they require that the
> contact be the call back number. I tried:
> Set(PJSIP_HEADER(update,contact)=<sip:foobar at 1.1.1.1:5090>)
> 
> But the came back with:
> No headers had been previously added to this session.
> 
> If I try to do:
> Set(PJSIP_HEADER(add,contact)=<sip:foobar at 1.1.1.1:5090>)
> Then Asterisk just adds a second contact header but does not replace
> the original (I also suspect adding a contact breaks the RFC?)
> 
> Is anyone aware of a way to modify the contact header?
> 
> TIA.
> 
> Dovid
> 




More information about the asterisk-users mailing list