Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Call-ID garbled when start with 's' #3549

Open
CzyerChen opened this issue Dec 25, 2024 · 0 comments
Open

[BUG]Call-ID garbled when start with 's' #3549

CzyerChen opened this issue Dec 25, 2024 · 0 comments

Comments

@CzyerChen
Copy link

OpenSIPS version you are running

version: opensips 3.4.9 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: cd02af8d9
main.c compiled on 15:28:56 Nov  6 2024 with gcc 9

Describe the bug

When using Sipp to test or produce freeswitch simulation, and the Call-ID field is set to the beginning of s, for example, s1001, opensips starts and debug mode is enabled, and you will see that the printed signaling content $ci is garbled data.

To Reproduce

  1. Start OpenSIPS
  2. Start traffic with special headers
  3. Inspect traces
  4. Notice the Call-ID has wrong format in logs, and opensips failed to process messages within dialog.

sipp:

sipp ip:5060 -sf uac.xml -d 10000 -s phonenum  -r 1 -rp 1000 -m 1 -cid_str as%u-%p@%s  --- Call-ID like [email protected], testcase passed.

sipp ip:5060 -sf uac.xml -d 10000 -s phonenum  -r 1 -rp 1000 -m 1 -cid_str a%u-%p@%s  --- Call-ID like [email protected], testcase passed.

sipp ip:5060 -sf uac.xml -d 10000 -s phonenum  -r 1 -rp 1000 -m 1 -cid_str %u-%p@%ss  --- Call-ID like [email protected], testcase passed.

sipp ip:5060 -sf uac.xml -d 10000 -s phonenum  -r 1 -rp 1000 -m 1 -cid_str s%u-%p@%s  --- Call-ID like [email protected], testcase failed.

logs in file:
correct in INVITE:
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.5.1:5061
From: "sipp" <sip:[email protected]:5061>;tag=1
To: <sip:[email protected]:5060>
Call-ID: [email protected]
Cseq: 1 INVITE
Contact: <sip:[email protected]:5061>
Content-Type: application/sdp
Content-Length:   139

v=0
o=user1 53655765 2353687637 IN IP4 192.168.5.1
s=-
t=0 0
c=IN IP4 192.168.5.188
m=audio 6000 RTP/AVP 0
a=rtpmap:0 PCMU/8000

Garbled in reply:

SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.5.1:5060;branch=z9hG4bKb37.1c94a6b.0
From: <sip:[email protected]>;tag=1
To: <sip:[email protected]>;tag=4
Call-ID: ?H???????
CSeq: 1 INVITE
Contact: <sip:192.168.5.1:5081;transport=UDP>
Content-Type: application/sdp
Content-Length:   195

sipp uac.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<scenario name="Basic UAC scenario">
 <send>
  <![CDATA[  
  INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port]
  From: "sipp" <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
  To: <sip:[service]@[remote_ip]:[remote_port]>
  Call-ID: [call_id]
  Cseq: 1 INVITE
  Contact: <sip:sipp@[local_ip]:[local_port]>
  Content-Type: application/sdp
  Content-Length: [len]
  
  v=0
  o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
  s=-
  t=0 0
  c=IN IP[media_ip_type] [media_ip]
  m=audio [media_port] RTP/AVP 0
  a=rtpmap:0 PCMU/8000
  ]]>
 </send>

 <recv response="100" optional="true">
 </recv>

 <recv response="180" optional="true">
 </recv>


 <recv response="200">
 </recv>

 <send>
  <![CDATA[
  ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port]
  From: "sipp" <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
  To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
  Call-ID: [call_id]
  Cseq: 1 ACK
  Content-Length: 0
  ]]>
 </send>

<pause milliseconds="10000"/>

 <send retrans="500">
  <![CDATA[
  BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port]
  From: "sipp" <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
  To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
  Call-ID: [call_id]
  Cseq: 2 BYE
  Content-Length: 0
  ]]>
 </send>

Expected behavior

Not garbled in reply.

Relevant System Logs

DBG:dialog:get_dlg_by_callid: input ci=(14)
rm=[INVITE],ci=[?H???????],rs=[180]
rm=[INVITE],ci=[?H???????],rs=[200]

OS/environment information

  • Operating System: CentOS 7.9
  • OpenSIPS installation: 3.4.9
  • other relevant information:

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant