[Spce-user] LCR not working

Mark van Herpen mark at cambrium.nl
Wed Mar 25 11:29:18 EDT 2015


Hi all,

Does Sipwise use the lcr_rule table from kamailio?

Some more info I found:

MySQL query log doesn't show any queries on the lcr tables from kamailio.

Also, lcr.dump_rules in ngcp-sercmd proxy are having an empty prefix:
kamcmd> lcr.dump_rules
{
	lcr_id: 1
	rule_id: 5
	prefix:
	from_uri:
	request_uri:
	stopper: 0
}
{
	gw_index: 1
	priority: 1
	weight: 1
}
{
	lcr_id: 1
	rule_id: 4
	prefix:
	from_uri:
	request_uri:
	stopper: 0
}
{
	gw_index: 2
	priority: 1
	weight: 1
}
{
	lcr_id: 1
	rule_id: 3
	prefix:
	from_uri:
	request_uri:
	stopper: 0
}
{
	gw_index: 3
	priority: 1
	weight: 1
}
0

However, the lcr.dump_gws command is showing the peers..
kamcmd> lcr.dump_gws
{
	lcr_id: 1
	gw_id: 4
	gw_index: 1
	gw_name: <SNIP-PEERNAME1>
	scheme: sip
	ip_addr: <SNIP-PEERIP1>
	hostname:
	port: 5060
	params:
	transport: UDP
	strip: 0
	prefix:
	tag:
	flags: 4
	defunct_until: 0
}
{
	lcr_id: 1
	gw_id: 3
	gw_index: 2
	gw_name: <SNIP-PEERNAME2>
	scheme: sip
	ip_addr: <SNIP-PEERIP2>
	hostname:
	port: 5060
	params:
	transport: UDP
	strip: 0
	prefix:
	tag:
	flags: 3
	defunct_until: 0
}
{
	lcr_id: 1
	gw_id: 1
	gw_index: 3
	gw_name: <SNIP-PEERNAME3>
	scheme: sip
	ip_addr: <SNIP-PEERIP3>
	hostname:
	port: 5060
	params:
	transport: UDP
	strip: 0
	prefix:
	tag:
	flags: 1
	defunct_until: 0
}

Grtz,

Mark van Herpen

On 03/23/2015 01:26 PM, Mark van Herpen wrote:
> Hi all,
> 
> Tl;dr:
> I'm having troubles setting up Least Cost Routing in Sipwise, LCR isn't
> working although all config settings are in place I guess.
> The calls are working trough each peer, but the fees are ignored and
> it's balanced between the peers.
> 
> I'm using CE version 3.7.2.
> 
> lcr is enabled in /etc/ngcp-config/config.yml:
> max_gw_lcr: 128
> perform_peer_lcr: 'yes'
> 
> Fees:
> I've added 3 different Peering Groups, with the same priority. Each
> peering group has a Billing Profile. They have only 1 Fee Entry, with
> the same source pattern: .
> The destination is ^31
> The only difference between them is the onpeak follow rate and offpeak
> follow rate: peer 1 has 0.1, peer 2 has 0.2 peer 3 has 0.3
> The intervals are 1.
> 
> Peering Server:
> Each Peering Group has got a single peering server, with weight 1. They
> all have a single peering rule with an empty callee prefix, callee and
> caller pattern.
> 
> I can tell that LCR is enabled, because I placed some debug lines in the
> config file, /etc/kamailio/proxy/proxy.cfg, in
> #!ifdef ENABLE_PEER_LCR
> # re-order lcr list based on costs per peer-group
> lcr_rate("$avp(s:caller_cli_userprov)@$avp(s:acc_caller_domain)",
> "$rU@$rd");
> #!endif
> 
> A strange thing, dunno if it's relevant, but in the kamailio.lcr_rule
> table there are only three records with an empty prefix, and NULL for
> request and from uri:
> 
> mysql> use kamailio; select * from lcr_rule;
> Database changed
> +----+--------+--------+-------------+----------+---------+---------+----------+
> | id | lcr_id | prefix | request_uri | from_uri | stopper | enabled |
> group_id |
> +----+--------+--------+-------------+----------+---------+---------+----------+
> |  3 |      1 |        | NULL        | NULL     |       0 |       1 |
>      1 |
> |  4 |      1 |        | NULL        | NULL     |       0 |       1 |
>      2 |
> |  5 |      1 |        | NULL        | NULL     |       0 |       1 |
>      3 |
> +----+--------+--------+-------------+----------+---------+---------+----------+
> 
> When calling, an error is shown in the proxy.log file, a snippet:
> NOTICE: <script>: Call to SIP Peering -
> R=sip:316<SNIP-DESTNR>@<SNIP-HOSTNAME> ID=1540068188-268_b2b-1
> NOTICE: <script>: Load gws matching calling part
> 'sip:317<SNIP-SOURCENR>@<SNIP-SIPDOMAIN>' and called user
> '316<SNIP-DESTNR>' and called part
> 'sip:316<SNIP-DESTNR>@<SNIP-HOSTNAME>' -
> R=sip:316<SNIP-DESTNR>@<SNIP-HOSTNAME> ID=1540068188-268_b2b-1
> NOTICE: <script>: Setting acc source-leg for uuid
> '78f32851-08b3-4093-be2f-42987b69723a':
> '78f32851-08b3-4093-be2f-42987b69723a|317<SNIP-SOURCENR>|<SNIP-SIPDOMAIN>|317<SNIP-SOURCENR>|<SNIP-id>|sub01-cambriumvoice|3|||0|call|<SNIP-IPADDR>|1427112494.381625|||||||||||'
> - R=sip:316<SNIP-DESTNR>@<SNIP-PEERIP>:5060;transport=udp
> ID=1540068188-268_b2b-1
> NOTICE: <script>: Setting acc destination-leg for uuid '0':
> '0|||0|316<SNIP-DESTNR>|0|316<SNIP-DESTNR>|<SNIP-PEERIP>|316<SNIP-DESTNR>|<SNIP-HOSTNAME>|3|||||||||||'
> - R=sip:316<SNIP-DESTNR>@<SNIP-PEERIP>:5060;transport=udp
> ID=1540068188-268_b2b-1
> ERROR: dispatcher [dispatch.c:1240]: ds_get_index(): destination set
> [50] not found
> ERROR: dispatcher [dispatch.c:1618]: ds_select_dst(): destination set
> [50] not found
> WARNING: <script>: Failed to load dispatcher entries for lb using did
> '50', use first lb found in network.yml -
> R=sip:316<SNIP-DESTNR>@<SNIP-PEERIP>:5060;transport=udp
> ID=1540068188-268_b2b-1
> NOTICE: <script>: Setting caller_cli_userprov/caller_domain_userprov
> '317<SNIP-SOURCENR>@<SNIP-SIPDOMAIN>' for upn -
> R=sip:316<SNIP-DESTNR>@<SNIP-PEERIP>:5060;transport=udp
> ID=1540068188-268_b2b-1
> 
> 
> I can't tell what I'm doing wrong or how to troubleshout any further..
> Normaly, I would check the lcr_rule tables, but these are empty. I don't
> know how lcr works with the sipwise patches on Kamailio.
> 
> Kind regards,
> 
> Mark van Herpen
> 
> 
> 
> 
> 
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> https://lists.sipwise.com/listinfo/spce-user
> 




More information about the Spce-user mailing list