# Pjsip: need to change "Contact" in SIP INVITE header

**URL:** <https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598>\
**Category:** Asterisk SIP\
**Created:** [May 10, 2022, 7:23am UTC](https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598 "2022-05-10T07:23:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ab.kumar819](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ab.kumar819](https://community.asterisk.org/u/ab.kumar819)\
**Post date:** [May 10, 2022, 7:23am UTC](https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598/1 "2022-05-10T07:23:33Z")

</div>

Hi team,

I need to change the “Contact” in SIP header.  
currently we are getting  
Contact: sip:asterisk@129.0.164.11:5060

but we need as like below  
Contact: sip:+8978@129.0.164.11:5060

please suggest me

---

<div class="post-metadata">

**Author:** ![EkFudrek](https://avatars.discourse-cdn.com/v4/letter/e/ce73a5/32.png) [@EkFudrek](https://community.asterisk.org/u/EkFudrek)\
**Post date:** [May 10, 2022, 8:29am UTC](https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598/2 "2022-05-10T08:29:08Z")

</div>

You can set the contact header in the address of record section (AOR) of your pjsip configuration.

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [May 10, 2022, 9:12am UTC](https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598/3 "2022-05-10T09:12:11Z")

</div>

The AOR contact field records what would have been received as Contact from the remote end if there were a registration, not what Asterisk sends in the Contact header.

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [May 10, 2022, 9:20am UTC](https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598/4 "2022-05-10T09:20:52Z")

</div>

Find a service provider that understands SIP. The only system to which the user part of the transmitted Contact header has any meaning is your own system. Any provider using it as an account name is broken.

It looks as though you may be able to work round their bug using contact\_user in the type=endpoint section. I seem to remember that this was added because this abuse of Contact is not uncommon. If that doesn’t work, it is back to finding a competent provider.

---

<div class="post-metadata">

**Author:** ![EkFudrek](https://avatars.discourse-cdn.com/v4/letter/e/ce73a5/32.png) [@EkFudrek](https://community.asterisk.org/u/EkFudrek)\
**Post date:** [May 10, 2022, 9:37am UTC](https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598/5 "2022-05-10T09:37:37Z")

</div>

You are right, actually I am using contact\_user in the type=registration section myself for a specific service provider. For the endpoint, the setting is not needed.

---

<div class="post-metadata">

**Author:** ![ab.kumar819](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ab.kumar819](https://community.asterisk.org/u/ab.kumar819)\
**Post date:** [May 10, 2022, 1:15pm UTC](https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598/6 "2022-05-10T13:15:40Z")

</div>

Thanks you team for your wonderful support, its working.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [June 9, 2022, 1:16pm UTC](https://community.asterisk.org/t/pjsip-need-to-change-contact-in-sip-invite-header/92598/7 "2022-06-09T13:16:14Z")

</div>

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