[OpenSIPS-Users] Contact param removal

Callum Guy callum.guy at x-on.co.uk
Tue Apr 11 16:00:21 UTC 2023

Hi All,

I'm looking for a clean way to de-register a WS location when I
receive a REGISTER with expires set as a contact param:

<sip:v2fera4b at rjeh4sth4ien.invalid;transport=ws>;expires=0

The issue is that a ul record is stored with the following contact and
the parameters are included in the matching process for registrar
module remove() method:

                    "AOR": "6190051 at rtc.example.net",
                    "Contacts": [
"sip:v2fera4b at rjeh4sth4ien.invalid;transport=ws",
                            "ContactID": "3803995821952764351",
                            "Expires": 92,
                            "Q": "0.8",
                            "Callid": "6ndu8fnhpm267tnfpj36",
                            "Cseq": 3,
                            "User-agent": "SoftPhone Linux Chrome (315e66c2)",
                            "Received": "sip:;transport=wss",
                            "State": "CS_NEW",
                            "Flags": 0,
                            "Cflags": "DST_WS SIP_PING_ENABLE TCP_NO_CONN",
                            "Socket": "wss:",
                            "Methods": 5439

To make this work I have demonstrated a method using regex to remove
the expires param and <> brackets, this is acceptable but I wanted to
reach out in case there was a cleaner way!

I only want to remove this individual contact address so a broader
match won't work in this situation.




*0333 332 0000  |  x-on.co.uk <https://www.x-on.co.uk>  |   ** 
<https://www.linkedin.com/company/x-on>   <https://www.facebook.com/XonTel> 
  <https://twitter.com/xonuk> **  |  **Practice Index Reviews 

*Our new office address: 22 Riduna 
Park, Melton IP12 1QT.*

is a trading name of Storacall Technology Ltd 
a limited company registered in
England and Wales.

Registered Office : 
Glebe Farm, Down Street, Dummer, Basingstoke, Hampshire, England RG25 2AD. 
Company Registration No. 2578478.

The information in this e-mail is 
confidential and for use by the addressee(s)
only. If you are not the 
intended recipient, please notify X-on immediately on +44(0)333 332 0000 
and delete the
message from your computer. If you are not a named addressee 
you must not use,
disclose, disseminate, distribute, copy, print or reply 
to this email. Views
or opinions expressed by an individual
within this 
email may not necessarily
reflect the views of X-on or its associated 
companies. Although X-on routinely
screens for viruses, addressees should 
scan this email and any attachments
viruses. X-on makes no 
representation or warranty as to the absence of viruses
in this email or 
any attachments.

More information about the Users mailing list