Hello,
I'm using LCR module to send multiple choices.
Everything works fine so far , yet I have a problem that last gateway comes first, then gateways are ordered correctly.
Below is correct sorting of gateways:
First gateway : 192.168.26.4
Second gateway: 192.168.26.1
Third gateway : 192.168.26.6
Below is Invite response I'm getting, as you can see 192.168.26.6 (last gateway) is included as the first gateway , then 192.168.26.4 (first gateway) comes next.
Via: SIP/2.0/UDP 192.168.26.3:37066;branch=z9hG4bK-d8754z-885c37410729cc3b-1---d8754z-;rport= 37066;received=192.168.26.3
To: "9612"sip:9612@192.168.110.181;tag=b27e1a1d33761e85846fc98f5f3a7e58.8d8f
From: "5000"sip:5000@192.168.110.181;tag=aa37be29
CSeq: 1 INVITE
Call-ID: NTY0YjVmYzZiNzc3ZDA3ZDA3MmM0OGM1ZDBhZGZhNTM.
Contact: sip:9612@192.168.26.6, sip:9612@192.168.26.4, sip:9612@192.168.26.1, sip:9612@192.168.26.6
Below is routing block I'm using :
if (is_method("INVITE"))
{
if (!load_gws(1, $rU, $fu))
{
sl_send_reply("502", "Unable to load Gateways");
exit;
}
else while(next_gw())
{
append_branch();
}
sl_send_reply("300","Multiple Choices");
exit;
}
Appreciate your help.
Regards,
Ali
Hi Juha,
Yes I know , I gave 192.168.26.4 smaller priority , then 192.168.26.1 then 192.168.26.6. So in this way gateways must be ordered as 192.168.26.4 , 192.168.26.1 , 192.168.26.6. Yet I got them ordered as 192.168.26.6, 192.168.26.4 , 192.168.26.1 , 192.168.26.6. If as you're saying it's sorting issue , then why I got 192.168.26.6 gateway twice (at the first and at the end).
Regards, Ali
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Juha Heinanen Sent: Monday, June 01, 2015 10:17 AM To: Kamailio (SER) - Users Mailing List Subject: [SR-Users] Kamailio LCR Multiple choices
Ali Taher writes:
Everything works fine so far , yet I have a problem that last gateway comes first, then gateways are ordered correctly.
hard to say anything based on the information you gave. smaller tuple priority value means higher priority.
-- juha
_______________________________________________ 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
Ali Taher writes:
Yes I know , I gave 192.168.26.4 smaller priority , then 192.168.26.1 then 192.168.26.6. So in this way gateways must be ordered as 192.168.26.4 , 192.168.26.1 , 192.168.26.6. Yet I got them ordered as 192.168.26.6, 192.168.26.4 , 192.168.26.1 , 192.168.26.6. If as you're saying it's sorting issue , then why I got 192.168.26.6 gateway twice (at the first and at the end).
as i mentioned, it is not possible to say anything based on the above information. you need to check your lcr tables, especially lcr_rule_target table.
-- juha
Hi Juha,
Below are LCR tables input data
Lcr_gw table : (id, lcr_id, gw_name, ip_addr, hostname, port, params, uri_scheme, transport, strip, prefix, tag, flags, defunct) 1, 1, 'gw1', '192.168.26.4', '192.168.26.4', 5060, '', 1, 1, 0, null,null, 1,null 2, 1, 'gw2', '192.168.26.1', '192.168.26.1', 5060, '', 1, 1, 0, null,null, 1,null 3, 1, 'gw3', '192.168.26.6', '192.168.26.6', 5060, '', 1, 1, 0, null,null, 1,null
LCR_rule target: (id,lcr_id, prefix,from_uri,request_uri, stopper, enabled) 1, 1, '961', null,null, 1, 1
LCR_rule_target table : (id,lcr_id ,rule_id,gw_id,priority,weight) 1, 1, 1, 1, 1, 1 2, 1, 1, 2, 2, 2 3, 1, 1, 3, 3, 3
Thanks Ali
-----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Juha Heinanen Sent: Monday, June 01, 2015 11:32 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Kamailio LCR Multiple choices
Ali Taher writes:
Yes I know , I gave 192.168.26.4 smaller priority , then 192.168.26.1 then 192.168.26.6. So in this way gateways must be ordered as 192.168.26.4 , 192.168.26.1 , 192.168.26.6. Yet I got them ordered as 192.168.26.6, 192.168.26.4 , 192.168.26.1 , 192.168.26.6. If as you're saying it's sorting issue , then why I got 192.168.26.6 gateway twice (at the first and at the end).
as i mentioned, it is not possible to say anything based on the above information. you need to check your lcr tables, especially lcr_rule_target table.
-- juha
_______________________________________________ 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
execute in config:
load_gws(1);
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
and tell what came to syslog.
-- juha
Hi,
Below is the log I got (which is correct ordering)
2015-06-01T14:45:50.932170+03:00 ubuntu /usr/local/sbin/kamailio[58396]: INFO: <script>: r-uri is sip:9612@192.168.26.4 2015-06-01T14:45:50.932398+03:00 ubuntu /usr/local/sbin/kamailio[58396]: INFO: <script>: r-uri is sip:9612@192.168.26.1 2015-06-01T14:45:50.932549+03:00 ubuntu /usr/local/sbin/kamailio[58396]: INFO: <script>: r-uri is sip:9612@192.168.26.6 2015-06-01T14:45:50.932681+03:00 ubuntu /usr/local/sbin/kamailio[58396]: INFO: <script>: no more gateways>
It's weird that I'm getting last gateway at the first , than correct ordering come next.
Regards, Ali -----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Juha Heinanen Sent: Monday, June 01, 2015 1:01 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Kamailio LCR Multiple choices
execute in config:
load_gws(1);
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
and tell what came to syslog.
-- juha
_______________________________________________ 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
Hi,
Any help regarding the below ?
Thanks, Ali -----Original Message----- From: Ali Taher [mailto:ataher@vanrise.com] Sent: Monday, June 01, 2015 3:21 PM To: 'Kamailio (SER) - Users Mailing List' Cc: 'Ali Taher~Vanrise Technical Support' Subject: RE: [SR-Users] Kamailio LCR Multiple choices
Hi,
Below is the log I got (which is correct ordering)
2015-06-01T14:45:50.932170+03:00 ubuntu /usr/local/sbin/kamailio[58396]: INFO: <script>: r-uri is sip:9612@192.168.26.4 2015-06-01T14:45:50.932398+03:00 ubuntu /usr/local/sbin/kamailio[58396]: INFO: <script>: r-uri is sip:9612@192.168.26.1 2015-06-01T14:45:50.932549+03:00 ubuntu /usr/local/sbin/kamailio[58396]: INFO: <script>: r-uri is sip:9612@192.168.26.6 2015-06-01T14:45:50.932681+03:00 ubuntu /usr/local/sbin/kamailio[58396]: INFO: <script>: no more gateways>
It's weird that I'm getting last gateway at the first , than correct ordering come next.
Regards, Ali -----Original Message----- From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Juha Heinanen Sent: Monday, June 01, 2015 1:01 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Kamailio LCR Multiple choices
execute in config:
load_gws(1);
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
if (next_gw()) { xlog("L_INFO", "r-uri is <$ru>\n"); } else { xlog("L_INFO", "no more gateways>\n"); }
and tell what came to syslog.
-- juha
_______________________________________________ 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