Greetings,
I have a general question about the usage of SIP contact headers in the context of using Kamailio as a SIP proxy.
________________________________
[ A ] --> [ Kamailio B ] ---> [ C ]
Node A originates a SIP invite, containing a valid via header and URI while setting the contact address to a user@itself and delivers it to Kamailio B which is acting as a SIP proxy.
Kamailio B then uses dispatcher routing to direct the Invite to node C, adding a via line with its own information as well as a record-route header with its own proxy information but retaining the same contact address from A.
Node C establishes the call and then sends a re-invite to the Kamailio B proxy which is in turn sent to Node A. Node A responds with a 200 OK
The problem arises when Node C tries to send an Ack in response to this 200 OK. The ack is being sent to the Contact address, rather than the routing already established in the initial dialog.
________________________________
My question is: should kamailio be rewriting this contact address with its own? Is that the best practice? My understanding is that the contact header is more so related to future requests within the same dialog ONLY when a record-route is not used.
I would appreciate any clarification on the RFC or best practices in this scenario.
Thank you, Jack Davis
I seem to recall reading something stating that you shouldn't modify the contact header - But, I can't find the text.
Might suggest adding a Record-Route header instead of re-writing the contact header?
I'm curious as to what the list has to say about this question, I've considered doing the same thing.
On 03/02/2017 04:53 PM, Jack Davis wrote:
Greetings,
I have a general question about the usage of SIP contact headers in the context of using Kamailio as a SIP proxy.
[ A ] --> [ Kamailio B ] ---> [ C ]
Node A originates a SIP invite, containing a valid via header and URI while setting the contact address to a user@itself and delivers it to Kamailio B which is acting as a SIP proxy.
Kamailio B then uses dispatcher routing to direct the Invite to node C, adding a via line with its own information as well as a record-route header with its own proxy information but retaining the same contact address from A.
Node C establishes the call and then sends a re-invite to the Kamailio B proxy which is in turn sent to Node A. Node A responds with a 200 OK
The problem arises when Node C tries to send an Ack in response to this 200 OK. The ack is being sent to the Contact address, rather than the routing already established in the initial dialog.
My question is: should kamailio be rewriting this contact address with its own? Is that the best practice? My understanding is that the contact header is more so related to future requests within the same dialog ONLY when a record-route is not used.
I would appreciate any clarification on the RFC or best practices in this scenario.
Thank you, Jack Davis
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
No, Kamailio should definitely not be rewriting the Contact. That is set by the remote dialog parties only.
If the ACK is being sent directly to the host in the domain portion of the Contact address, that is because the endpoint is ignoring/not honouring Record-Route. That's radioactively wrong behaviour and should be fixed.
Reinvites do not alter the Route set, as clearly stated in RFC 3261 § 12.2:
Requests within a dialog MAY contain Record-Route and Contact header fields. However, these requests do not cause the dialog's route set to be modified, although they may modify the remote target URI.
-- Alex
For a SIP proxy, the preferred method is indeed to add a Record-Route
In the script, add record_route(); instruction.
Emmanuel IVèS
Le 2017-03-02 à 20:03, Robert Johnson a écrit :
I seem to recall reading something stating that you shouldn't modify the contact header - But, I can't find the text.
Might suggest adding a Record-Route header instead of re-writing the contact header?
I'm curious as to what the list has to say about this question, I've considered doing the same thing.
On 03/02/2017 04:53 PM, Jack Davis wrote:
Greetings,
I have a general question about the usage of SIP contact headers in the context of using Kamailio as a SIP proxy.
[ A ] --> [ Kamailio B ] ---> [ C ]
Node A originates a SIP invite, containing a valid via header and URI while setting the contact address to a user@itself and delivers it to Kamailio B which is acting as a SIP proxy.
Kamailio B then uses dispatcher routing to direct the Invite to node C, adding a via line with its own information as well as a record-route header with its own proxy information but retaining the same contact address from A.
Node C establishes the call and then sends a re-invite to the Kamailio B proxy which is in turn sent to Node A. Node A responds with a 200 OK
The problem arises when Node C tries to send an Ack in response to this 200 OK. The ack is being sent to the Contact address, rather than the routing already established in the initial dialog.
My question is: should kamailio be rewriting this contact address with its own? Is that the best practice? My understanding is that the contact header is more so related to future requests within the same dialog ONLY when a record-route is not used.
I would appreciate any clarification on the RFC or best practices in this scenario.
Thank you, Jack Davis
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thank you all for the replies.
I'm already utilizing a record-route header in the initial Invite before any re-invites occur.
Is the preferred method to also include a record-route header in the 200 OK that is given in response to the re-invite?
Thank you, Jack Davis
On Fri, Mar 3, 2017 at 2:14 PM, Emmanuel BUU emmanuel.buu@ives.fr wrote:
For a SIP proxy, the preferred method is indeed to add a Record-Route
In the script, add record_route(); instruction.
Emmanuel IVèS
Le 2017-03-02 à 20:03, Robert Johnson a écrit :
I seem to recall reading something stating that you shouldn't modify the contact header - But, I can't find the text.
Might suggest adding a Record-Route header instead of re-writing the contact header?
I'm curious as to what the list has to say about this question, I've considered doing the same thing.
On 03/02/2017 04:53 PM, Jack Davis wrote:
Greetings,
I have a general question about the usage of SIP contact headers in the context of using Kamailio as a SIP proxy.
[ A ] --> [ Kamailio B ] ---> [ C ]
Node A originates a SIP invite, containing a valid via header and URI while setting the contact address to a user@itself and delivers it to Kamailio B which is acting as a SIP proxy.
Kamailio B then uses dispatcher routing to direct the Invite to node C, adding a via line with its own information as well as a record-route header with its own proxy information but retaining the same contact address from A.
Node C establishes the call and then sends a re-invite to the Kamailio B proxy which is in turn sent to Node A. Node A responds with a 200 OK
The problem arises when Node C tries to send an Ack in response to this 200 OK. The ack is being sent to the Contact address, rather than the routing already established in the initial dialog.
My question is: should kamailio be rewriting this contact address with its own? Is that the best practice? My understanding is that the contact header is more so related to future requests within the same dialog ONLY when a record-route is not used.
I would appreciate any clarification on the RFC or best practices in this scenario.
Thank you, Jack Davis
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Fri, Mar 03, 2017 at 02:35:10PM -0600, Jack Davis wrote:
Is the preferred method to also include a record-route header in the 200 OK that is given in response to the re-invite?
No. Only initial INVITEs and their replies should have a Record-Route header. In-dialog requests and their replies contain Route headers that are constructed from that Record-Route set.
What kind of problems can arise from inserting said header?
I'm trying to find a way to get a pesky setup to start behaving, of course, without requiring them to make any changes.
Thank you, Jack Davis
On Fri, Mar 3, 2017 at 2:39 PM, Alex Balashov abalashov@evaristesys.com wrote:
On Fri, Mar 03, 2017 at 02:35:10PM -0600, Jack Davis wrote:
Is the preferred method to also include a record-route header in the 200
OK
that is given in response to the re-invite?
No. Only initial INVITEs and their replies should have a Record-Route header. In-dialog requests and their replies contain Route headers that are constructed from that Record-Route set.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Tue, Mar 07, 2017 at 03:44:31PM -0600, Jack Davis wrote:
What kind of problems can arise from inserting said header?
Theoretically, none. It should be ignored, as per the RFC. Moreover, the RFC doesn't _prohibit_ such a header in an in-dialog request, so you are probably clear to add it. Fundamentally, § 12.2 says:
Requests within a dialog MAY contain Record-Route and Contact header fields. However, these requests do not cause the dialog's route set to be modified...
I have certainly seen instances in the field where RRs in in-dialog requests are not ignored, however. That's on the endpoints, of course, but it can make things worse.
I'm trying to find a way to get a pesky setup to start behaving, of course, without requiring them to make any changes.
That's always a tough gig.
Thank you for the replies, this has been helpful.
So if I do want to go down this road and want to practically implement a solution, what is the best method of appending additional record route headers to a 200 OK response? I guess, specifically, adding them to the 200 OK response that is given by kamailio to a re-invite.
Thank you, Jack Davis
On Tue, Mar 7, 2017 at 3:49 PM, Alex Balashov abalashov@evaristesys.com wrote:
On Tue, Mar 07, 2017 at 03:44:31PM -0600, Jack Davis wrote:
What kind of problems can arise from inserting said header?
Theoretically, none. It should be ignored, as per the RFC. Moreover, the RFC doesn't _prohibit_ such a header in an in-dialog request, so you are probably clear to add it. Fundamentally, § 12.2 says:
Requests within a dialog MAY contain Record-Route and Contact header fields. However, these requests do not cause the dialog's route set to be modified...
I have certainly seen instances in the field where RRs in in-dialog requests are not ignored, however. That's on the endpoints, of course, but it can make things worse.
I'm trying to find a way to get a pesky setup to start behaving, of
course,
without requiring them to make any changes.
That's always a tough gig.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks Alex.
And objection duly noted, =) I'll just have to test it out and make sure it doesn't break any of my other clients.
Thank you, Jack Davis
On Tue, Mar 14, 2017 at 5:46 PM, Alex Balashov abalashov@evaristesys.com wrote:
append_to_reply("Record-Route: sip:...\r\n");
But I'd like to advise against it once more. :)
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
Hello,
I haven't followed closely the entire discussion, but for proper clarification, if one needs to add a header to a received SIP response that is forwarded, then it has to use append_hf(...) inside on/reply_route.
The append_to_reply() should be used for SIP responses to be generated by Kamailio.
Cheers, Daniel
On 14/03/2017 23:46, Alex Balashov wrote:
append_to_reply("Record-Route: sip:...\r\n");
But I'd like to advise against it once more. :)
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Wed, Mar 15, 2017 at 11:02:22AM +0100, Daniel-Constantin Mierla wrote:
I haven't followed closely the entire discussion, but for proper clarification, if one needs to add a header to a received SIP response that is forwarded, then it has to use append_hf(...) inside on/reply_route.
The append_to_reply() should be used for SIP responses to be generated by Kamailio.
This is absolutely true, and entirely the result of poor memory on my part. For some reason I misremembered that the OP was trying to generate a synthetic reply internally with attributes of the received reply.