Hi All,
I'd like to use the Dispatcher Module along with 30X redirects, to monitor gateway availability with SIP options and to provide redundancy / fail over.
Some sources online suggest it's as easy as -
if ( method=="INVITE" ) { dst_select_domain("1","4"); sl_send_reply("300","Redirect"); exit; }
However when the 30X reply is sent, it contains no contact header.
Please could someone advise if it's possible to use the Dispatcher module with 302 redirects, and what they syntax is?
Thanks,
Matthew
Hello,
On 03/28/2016 02:39 PM, Marrold wrote:
I'd like to use the Dispatcher Module along with 30X redirects, to monitor gateway availability with SIP options and to provide redundancy / fail over.
Some sources online suggest it's as easy as -
if ( method=="INVITE" ) { dst_select_domain("1","4"); sl_send_reply("300","Redirect"); exit; }
However when the 30X reply is sent, it contains no contact header.
Please could someone advise if it's possible to use the Dispatcher module with 302 redirects, and what they syntax is?
The core functionality provided by the dispatcher module is simplify to modify the request URI ($ru) (ds_select_domain()) or the destination set ($du) (ds_select_dst()).
Thus, after running the operation, you would append the Contact yourself:
ds_select_domain("1", "4"); append_to_reply("Contact: <$ru>\r\n"); sl_send_reply("300", "Redirect");
-- Alex
Hi Alex,
That works, thanks. It turns out the following does work *without* appending the contact header-
ds_select_domain("1", "8") sl_send_reply("302","Redirect"); exit;
I was using ds_select_dst() originally which doesn't work with the above.
Thanks for pointing me in the right direction.
Matthew
On Mon, Mar 28, 2016 at 7:47 PM, Alex Balashov abalashov@evaristesys.com wrote:
Hello,
On 03/28/2016 02:39 PM, Marrold wrote:
I'd like to use the Dispatcher Module along with 30X redirects, to
monitor gateway availability with SIP options and to provide redundancy / fail over.
Some sources online suggest it's as easy as -
if ( method=="INVITE" ) { dst_select_domain("1","4"); sl_send_reply("300","Redirect"); exit; }
However when the 30X reply is sent, it contains no contact header.
Please could someone advise if it's possible to use the Dispatcher module with 302 redirects, and what they syntax is?
The core functionality provided by the dispatcher module is simplify to modify the request URI ($ru) (ds_select_domain()) or the destination set ($du) (ds_select_dst()).
Thus, after running the operation, you would append the Contact yourself:
ds_select_domain("1", "4"); append_to_reply("Contact: <$ru>\r\n"); sl_send_reply("300", "Redirect");
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) 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 03/28/2016 03:37 PM, Marrold wrote:
That works, thanks. It turns out the following does work *without* appending the contact header-
ds_select_domain("1", "8") sl_send_reply("302","Redirect");
Huh. I would not have expected that.
On 03/28/2016 03:40 PM, Alex Balashov wrote:
On 03/28/2016 03:37 PM, Marrold wrote:
That works, thanks. It turns out the following does work *without* appending the contact header-
ds_select_domain("1", "8") sl_send_reply("302","Redirect");
Huh. I would not have expected that.
Oh. Yeah. The documentation actually says that:
http://kamailio.org/docs/modules/4.3.x/modules/sl.html#sl_send_reply
-- Alex
Well spotted, I was studying the dispatcher docs but over looked sl.
Thanks
On Mon, Mar 28, 2016 at 8:42 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 03/28/2016 03:40 PM, Alex Balashov wrote:
On 03/28/2016 03:37 PM, Marrold wrote:
That works, thanks. It turns out the following does work *without*
appending the contact header-
ds_select_domain("1", "8") sl_send_reply("302","Redirect");
Huh. I would not have expected that.
Oh. Yeah. The documentation actually says that:
http://kamailio.org/docs/modules/4.3.x/modules/sl.html#sl_send_reply
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) 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
Just a point about using 302 redirect. It is expected to be handled by any SIP device.. but maybe you could find some (I found them on Spectralink DECT ) that could not handle 302 redirect and had to change way to use dispatching for that devices..
BR
2016-03-28 22:16 GMT+02:00 Marrold kamailio@marrold.co.uk:
Well spotted, I was studying the dispatcher docs but over looked sl.
Thanks
On Mon, Mar 28, 2016 at 8:42 PM, Alex Balashov abalashov@evaristesys.com wrote:
On 03/28/2016 03:40 PM, Alex Balashov wrote:
On 03/28/2016 03:37 PM, Marrold wrote:
That works, thanks. It turns out the following does work *without*
appending the contact header-
ds_select_domain("1", "8") sl_send_reply("302","Redirect");
Huh. I would not have expected that.
Oh. Yeah. The documentation actually says that:
http://kamailio.org/docs/modules/4.3.x/modules/sl.html#sl_send_reply
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC 1447 Peachtree Street NE, Suite 700 Atlanta, GA 30309 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) 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
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