Hello again,
I am not a SIP expert, and I’m new to Kamailio, really enjoying learning it, but I’ve hit a blocker and I’m pretty sure I’ve missed something really simple.
I’m looking to implement the Redirect Server from here: https://tools.ietf.org/html/rfc3665#section-3.6 https://tools.ietf.org/html/rfc3665#section-3.6 (the Avaya Session Manager being Alice), Kamailio as the Redirect Server. My configuration is working fine, and I can see the 302 going back (to Avaya SM), I then get the ACK I’m expecting.
The incoming SIP request contains a number of fields, including a Contact header, which I’m told SM needs on the return. But the send_reply() or sl_send_reply() doesn’t return the Contact header, and I am unable to manually set it, or any other header, using any of the append_hf(), append_to_reply() etc. mechanisms. I’m executing a msg_apply_changes() which succeeds, but no Contact header is returned.
I’ve tried an sl_send_reply(“100”, “Trying”) before any other processing, and Wireshark confirms that the SIP response is basically identical to the 302 response sent after processing… The goal is to run this stateless, I’m assuming this is possible - it certainly feels like it should be.
I’ve re-read the intros & tutorials, and other reading material such as this http://kamailio.org/docs/ser-getting-started/SER-GettingStarted.pdf http://kamailio.org/docs/ser-getting-started/SER-GettingStarted.pdf but, this, even my best Google-fu has left me utterly stumped…
The sl_send_reply documentation https://kamailio.org/docs/modules/5.2.x/modules/sl.html#sl_send_reply https://kamailio.org/docs/modules/5.2.x/modules/sl.html#sl_send_reply states “If the code is in the range 300-399 (redirect reply), the current destination set is appended to the reply as Contact headers” but the Contact header is definitely not being set when I use this.
Apologies in advance if eyes are rolling and this is really obvious, or (and?) that my lack of SIP knowledge is shining through - any tips or guidance would be appreciated. I certainly feel overwhelmed by the number of modules and the interplay between them.
If the answers to this, and other things along these lines are contained in the admin book, that’s fab, I’ve just filled the form out :)
Cheers - Robert...
Can you post how you are doing this?
Something like this should work...
append_to_reply("Contact: sip:fred@10.11.12.13\r\n"); sl_send_reply("302","moved"); exit;
Regards,
Fred Posner https://qxork.com
Hi Fred,
I’m at home at the moment, so don’t have access to the config file - but that’s exactly what I’m doing. Literally, that. I do have a msg_apply_changes() that I’ve experimented with. Doesn’t seem to make a difference.
This is why I’m sure I’m doing something daft. I’ll post the config tomorrow.
Thanks - Robert...
On 30 Nov 2017, at 21:46, Fred Posner fred@palner.com wrote:
Can you post how you are doing this?
Something like this should work...
append_to_reply("Contact: sip:fred@10.11.12.13\r\n"); sl_send_reply("302","moved"); exit;
Regards,
Fred Posner https://qxork.com
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Thu, Nov 30, 2017 at 09:39:24PM +0000, Robert wrote:
I???ve re-read the intros & tutorials, and other reading material such as this http://kamailio.org/docs/ser-getting-started/SER-GettingStarted.pdf http://kamailio.org/docs/ser-getting-started/SER-GettingStarted.pdf but, this, even my best Google-fu has left me utterly stumped???
The sl_send_reply documentation https://kamailio.org/docs/modules/5.2.x/modules/sl.html#sl_send_reply https://kamailio.org/docs/modules/5.2.x/modules/sl.html#sl_send_reply states ???If the code is in the range 300-399 (redirect reply), the current destination set is appended to the reply as Contact headers??? but the Contact header is definitely not being set when I use this.
Apologies in advance if eyes are rolling and this is really obvious, or (and?) that my lack of SIP knowledge is shining through - any tips or guidance would be appreciated. I certainly feel overwhelmed by the number of modules and the interplay between them.
The next line in the documentation mentions this: "The destination set contains the request URI (R-URI), if it is modified compared to the received one, plus the branches added to the request (e.g., after an append_branch() or lookup("location")). "
All you need to do is manipulatie $ru or its parts:
$rU="auser"; $rd="domain.example.org";
send_reply("302", "Redirect"); exit;
Though I'm using send_reply and not sl_send_reply, tm/sl stats point out all 3xx messages are handled by sl.