Set Contact SIP headers from extensions.conf

Hi all,

I’ve got a problem using the extensions.conf and pjsip.conf
I’d like to set the Contact headers into the SIP INVITE of my endpoint dynamically.
I’ve tried to play with contact_user but I can’t set it into my entensions.conf.
Is there a possibility to set this parameter into the extensions.conf file ?
Or pass a variable from the extensions.conf to the pjsip.conf to set it ?

exten => _06XXXXXXXX,n,Dial(PJSIP/default_endpoint/sip:${EXTEN}@10.20.30.40:5060)

[default_endpoint]
type=endpoint
transport=transport-udp
disallow=all
allow=ulaw
direct_media=no

There is no ability to configure such a thing from the dialplan explicitly. The only dynamic way is to enable the option to use callerid for Contact, and set the callerid.

Why? Nothing except the sending Asterisk should care about what is in the Contact header. Even contact_user sounds like it is a work round for broken peers.

Thanks for your quick reply !
I’ve tried to play with CALLERID, but I can’t change the Contat Sip Herders ….
example : exten => _06XXXXXXXX,n,Set(CALLERID(contact)=TEST)

You can’t set the contact like that. The option uses the callerid number[1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_res_pjsip#Asterisk13Configuration_res_pjsip-global_use_callerid_contact