[SR-Users] Manipulating contacts header results in a malformed SIP packet

2020-03-18 Thread Andrew White
Hi all, Hope everyone is well, and looking forward to seeing you all whenever Kamailio World ends up being! I’m currently dealing with an issue which I’m unsure if it’s due to my own implementation, or a bug. When attempting to manipulate the Contact header via app_ruby, the SIP message I sen

Re: [SR-Users] Manipulating contacts header results in a malformed SIP packet

2020-03-18 Thread Alex Balashov
Hi Andrew, The Content-Length header, if present, is the header that must appear last in a SIP message, per RFC 3261 § 7.5 So, any method of manipulation of the Contact must manipulate it in place. A common favourite - if you absolutely must manipulate the Contact - is to substitute it. You can

Re: [SR-Users] Manipulating contacts header results in a malformed SIP packet

2020-03-18 Thread Andrew White
Hey Alex, Thanks so much for the prompt reply! The substitute and arbitrary position options look useful. In these cases, will Kamailio automatically recalculate the Content-Length, or do I need to manually rewrite this somehow? I did read that in researching before emailing, from similar thre

Re: [SR-Users] Manipulating contacts header results in a malformed SIP packet

2020-03-18 Thread Alex Balashov
Hi Andrew, On Thu, Mar 19, 2020 at 01:53:53PM +1100, Andrew White wrote: > The substitute and arbitrary position options look useful. In these > cases, will Kamailio automatically recalculate the Content-Length, or > do I need to manually rewrite this somehow? The Content-Length pertains to the

Re: [SR-Users] Manipulating contacts header results in a malformed SIP packet

2020-03-18 Thread Andrew White
Hey Alex, Thanks, that does make a lot of sense. I’ve certainly gotten myself into some situations before using the powerful and dangerous toolset that is Kamailio! I will look into the PBX doing this, however it’s a bit tricky, as it’s not aware of the specific requirements of the next hop, or

Re: [SR-Users] Manipulating contacts header results in a malformed SIP packet

2020-03-18 Thread Sergey Safarov
Looks as not expected here sip:4.5.6.7:5060;alias=10.100.1.1~5060~1Content-Type: application/sdp About contact header. Yes it is really important header. If your carrier want specific Contact header format, then I recommend try use other provider. Contact header used also for RURI headers. So yo

Re: [SR-Users] Manipulating contacts header results in a malformed SIP packet

2020-03-20 Thread Bastian Triller
You're using set_contact_alias(), which already changes the Contact header. Try msg_apply_changes() before your 2nd Contact header change. On Thu, Mar 19, 2020 at 5:11 AM Sergey Safarov wrote: > Looks as not expected here > > sip:4.5.6.7:5060;alias=10.100.1.1~5060~1Content-Type: application/sdp

Re: [SR-Users] Manipulating contacts header results in a malformed SIP packet

2020-03-23 Thread Henning Westerholt
lf Of Alex Balashov Sent: Thursday, March 19, 2020 2:49 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Manipulating contacts header results in a malformed SIP packet Hi Andrew, The Content-Length header, if present, is the header that must appear last in a SIP message, pe