# Is it possible to shorten "to-tag" 32 character to 16 character

**URL:** <https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417>\
**Category:** Asterisk SIP\
**Created:** [March 26, 2026, 6:56am UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417 "2026-03-26T06:56:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhs](https://avatars.discourse-cdn.com/v4/letter/h/5daacb/32.png) [@hhs](https://community.asterisk.org/u/hhs)\
**Post date:** [March 26, 2026, 6:56am UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417/1 "2026-03-26T06:56:43Z")

</div>

Hi everyone,

We have two SIP servers in our setup. One is an Asterisk server that we manage, and the other is a custom SIP server developed by another company.

We can successfully initiate calls from the custom SIP server without any issues. However, we are encountering a problem when terminating calls. The issue appears to be related to the **To-tag** value in SIP signaling.

Asterisk generates a 32-character To-tag and sends it to the custom server. However, the custom server seems to assume that the To-tag is only 16 characters long. As a result, when it sends a request to terminate the call, it includes only the first 16 characters of the To-tag. Because of this mismatch, Asterisk cannot match the dialog and responds with **“Call does not exist.”**

This behavior suggests that the issue originates from the custom SIP server. However, before escalating it to the vendor, I would like to confirm:

Is it possible to configure Asterisk to generate a shorter (e.g., 16-character) To-tag? If so, how can this be achieved?

Otherwise, we will need to coordinate with the vendor to resolve this incompatibility.

Thanks in advance for your help.

This is the output:

\<— Transmitting SIP response (864 bytes) to UDP:192.168.1.21:5060 —\>  
SIP/2.0 200 OK  
Via: SIP/2.0/UDP 192.168.1.21:5060;rport=5060;received=192.168.1.21;branch=z9hG4bK138199868  
Via: SIP/2.0/UDP 192.168.1.41:5060;rport=5060;branch=z9hG4bK1654394224319  
Record-Route: sip:192.168.1.21;lr  
Call-ID: TestCallID-172.16.61.61-rm86k4132p014  
From: “gorev\_39” sip:2039@sip.navcom-redzone.com;tag=tpo9n24200014  
To: “alm\_ans\_1” sip:2621@navcom-aa.com; **tag=3ae456f0-eec2-4703-8610-212d2f280158**  
CSeq: 1 INVITE  
Server: Asterisk PBX 20.2.1  
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER  
Contact: sip:0.0.0.0:5060  
Supported: 100rel, timer, replaces, norefersub  
Content-Type: application/sdp  
Content-Length: 153

v=0  
o=- 0 2 IN IP4 0.0.0.0  
s=Asterisk  
c=IN IP4 0.0.0.0  
t=0 0  
m=audio 12238 RTP/AVP 8  
a=rtpmap:8 PCMA/8000  
a=ptime:20  
a=maxptime:150  
a=inactive

\<— Received SIP request (430 bytes) from UDP:192.168.1.21:5060 —\>  
BYE [sip:2621@navcom-aa.com](mailto:sip:2621@navcom-aa.com) SIP/2.0  
v: SIP/2.0/UDP 192.168.1.21:5060;branch=z9hG4bK28452914  
v: SIP/2.0/UDP 192.168.1.41:5060;branch=z9hG4bK1654394224319;rport=5060  
Max-Forwards: 69  
t: alm\_ans\_1 sip:2621@navcom-aa.com:5060; **tag=3ae456f0-eec2-47**  
f: gorev\_39 sip:2039@sip.navcom-redzone.com;tag=tpo9n24200014  
Call-ID: TestCallID-172.16.61.61-rm86k4132p014  
CSeq: 2 BYE  
m: sip:2039@192.168.1.41:5060;transport=udp  
l: 0

\<— Transmitting SIP response (446 bytes) to UDP:192.168.1.21:5060 —\>  
SIP/2.0 481 Call/Transaction Does Not Exist  
Via: SIP/2.0/UDP 192.168.1.21:5060;received=192.168.1.21;branch=z9hG4bK28452914  
Via: SIP/2.0/UDP 192.168.1.41:5060;rport=5060;branch=z9hG4bK1654394224319  
Call-ID: TestCallID-172.16.61.61-rm86k4132p014  
From: “gorev\_39” sip:2039@sip.navcom-redzone.com;tag=tpo9n24200014  
To: “alm\_ans\_1” sip:2621@navcom-aa.com;tag=3ae456f0-eec2-47  
CSeq: 2 BYE  
Server: Asterisk PBX 20.2.1  
Content-Length: 0

---

<div class="post-metadata">

**Author:** ![omnipbx](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/omnipbx/32/8839_2.png) [@omnipbx](https://community.asterisk.org/u/omnipbx)\
**Post date:** [March 26, 2026, 8:15am UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417/2 "2026-03-26T08:15:14Z")

</div>

unset “caller\_name” and use “UUID compliant with RFC 4122“ in “tag”

---

<div class="post-metadata">

**Author:** ![omnipbx](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/omnipbx/32/8839_2.png) [@omnipbx](https://community.asterisk.org/u/omnipbx)\
**Post date:** [March 26, 2026, 8:15am UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417/3 "2026-03-26T08:15:17Z")

</div>

The upstream SIP server uses “SIP compact headers.”  
You can enable it globally:  
#sip.conf  
[general]  
compactheaders = yes

#pjsip.conf  
[system]  
compact\_headers=yes

However, there’s a 99% chance this won’t solve the problem.  
The “To” field is limited to 64 bytes on the upstream SIP server.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [March 26, 2026, 8:21am UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417/4 "2026-03-26T08:21:14Z")

</div>

> [@hhs](#):
>
> Is it possible to configure Asterisk to generate a shorter (e.g., 16-character) To-tag? If so, how can this be achieved?

There is no configuration option. It’s generated by the PJSIP library internally when creating a SIP dialog.

---

<div class="post-metadata">

**Author:** ![hhs](https://avatars.discourse-cdn.com/v4/letter/h/5daacb/32.png) [@hhs](https://community.asterisk.org/u/hhs)\
**Post date:** [March 26, 2026, 2:08pm UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417/5 "2026-03-26T14:08:27Z")

</div>

Is there a way to modify the source code so that it generates a 16-byte unique tag instead of a 32-byte one? If so, which part of the source code should be examined to implement this change?

Thanks

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [March 26, 2026, 2:09pm UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417/6 "2026-03-26T14:09:33Z")

</div>

Having not looked at this I don’t know specifically where, but it would be in the PJSIP library. Not in Asterisk itself.

---

<div class="post-metadata">

**Author:** ![seanbright](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/seanbright/32/9799_2.png) [@seanbright](https://community.asterisk.org/u/seanbright)\
**Post date:** [March 26, 2026, 2:24pm UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417/7 "2026-03-26T14:24:40Z")

</div>

> [@hhs](#):
>
> This behavior suggests that the issue originates from the custom SIP server.

Correct. RFC 3261 places no such restriction on the `to` tag.

---

<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:** [April 25, 2026, 2:24pm UTC](https://community.asterisk.org/t/is-it-possible-to-shorten-to-tag-32-character-to-16-character/112417/8 "2026-04-25T14:24:55Z")

</div>

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