mainThe oSIP library - Support: sr #110953, invalid cseq check in...

 
 

sr #110953: invalid cseq check in __osip_transaction_matching_response_osip_to_xict_17_1_3

Submitter:  None
Submitted:  Fri 03 Nov 2023 01:40:19 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 03 Nov 2023 01:40:19 PM UTC, original submission:  

Hi,

in method __osip_transaction_matching_response_osip_to_xict_17_1_3, I see cseq are verified using:

  if (0 == strcmp(response->cseq->method, tr->cseq->method)) /* general case */
    return OSIP_SUCCESS;


I believe this isn't enough, and number should be checked too. This is correctly done in __osip_transaction_matching_request_osip_to_xist_17_2_3 with

  if (0 != osip_cseq_match(tr->cseq, request->cseq))
    return OSIP_UNDEFINED_ERROR;



My case comes from the following callflow:


client        server

    REGISTER (cseq: 1 REGISTER)
  ------------->

     401 (cseq: 1 REGISTER)
  <=============

     REGISTER (cseq: 2 REGISTER)
  ------------->

     200 (cseq: 2 REGISTER)
  <=============

 

By the time 200 is received, transaction cseq 1 still exists in my osip object (with state NICT_COMPLETED). __osip_find_transaction returns to me this transaction instead of transaction cseq 2.



regards,
Pierre






here are the SIP messages:

client -> server

REGISTER sip:192.168.19.77:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.45.10:5667;branch=z9hG4bK-1820820494
From: <sip:33666000667@192.168.45.10:5667>;tag=JrfSyzRHSOJk
To: <sip:33666000667@192.168.19.77:5060>
Call-ID: 4053280031878524976@192.168.45.10
CSeq: 1 REGISTER
Contact: <sip:33666000667@192.168.45.10:5667>
Max-Forwards: 70
User-Agent: ./sw_sip_phone / sw_sip_phone v99.9.r28
Content-Length: 0


server -> client

SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.45.10:5667;branch=z9hG4bK-1820820494;received=192.168.45.10
From: <sip:33666000667@192.168.45.10:5667>;tag=JrfSyzRHSOJk
To: <sip:33666000667@192.168.19.77:5060>;tag=as4d17848b
Call-ID: 4053280031878524976@192.168.45.10
CSeq: 1 REGISTER
Server: IPBX-2.11.0(16.7.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="79f963db"
Content-Length: 0

client -> server

REGISTER sip:192.168.19.77:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.45.10:5667;branch=z9hG4bK-1820820494
From: <sip:33666000667@192.168.45.10:5667>;tag=JrfSyzRHSOJk
To: <sip:33666000667@192.168.19.77:5060>
Call-ID: 4053280031878524976@192.168.45.10
CSeq: 2 REGISTER
Contact: <sip:33666000667@192.168.45.10:5667>
Authorization: Digest username="33666000667", realm="asterisk", nonce="79f963db", uri="sip:192.168.19.77:5060", response="c07ffc96249b0a3a40e321e7f0f4ca10", algorithm=MD5
Max-Forwards: 70
User-Agent: ./sw_sip_phone / sw_sip_phone v99.9.r28
Content-Length: 0

server -> client

SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.45.10:5667;branch=z9hG4bK-1820820494;received=192.168.45.10
From: <sip:33666000667@192.168.45.10:5667>;tag=JrfSyzRHSOJk
To: <sip:33666000667@192.168.19.77:5060>;tag=as4d17848b
Call-ID: 4053280031878524976@192.168.45.10
CSeq: 2 REGISTER
Server: IPBX-2.11.0(16.7.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 120
Contact: <sip:33666000667@192.168.45.10:5667>;expires=120
Date: Fri, 03 Nov 2023 13:30:45 GMT
Content-Length: 0


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code