I'm using the LCR module to send traffic based on just the prefix of the number at the moment.
I have two gateway groups, one with a local provider to connect locally, one with a larger one to do international calls (they can also connect locally but with a higher price)..
When I call next_gw() will LCR use all possible gateway groups, or just the gateway(s) in the first matching group?
The second question is tangential to the first, if it does send the traffic to other gateway group after failing through the first, does it regenerate the RURI, because the local provider wants a numerical prefix on the calls I send, and the other one no (basically do I need to account for this in my config?)
Nick Warr writes:
When I call next_gw() will LCR use all possible gateway groups, or just the gateway(s) in the first matching group?
that depends on your lcr entries. if called number matches to all entries, then all of their gateway groups will be selected.
The second question is tangential to the first, if it does send the traffic to other gateway group after failing through the first, does it regenerate the RURI, because the local provider wants a numerical prefix on the calls I send, and the other one no (basically do I need to account for this in my config?)
yes, if you set priority correctly and tags properly.
-- juha
2009/4/27 Nick Warr nick@mobilia.it:
When I call next_gw() will LCR use all possible gateway groups, or just the gateway(s) in the first matching group?
Just the gateway(s) in the first matching group. If not, it doesn't make sense.
The second question is tangential to the first, if it does send the traffic to other gateway group after failing through the first, does it regenerate the RURI, because the local provider wants a numerical prefix on the calls I send, and the other one no (basically do I need to account for this in my config?)
No, LCR will not add a prefix, you must do it. When ou cal "load_gw(ARG)", just the gateway goups matching the *current* RURI prefix and the PV used as ARG will be selected. Later, if the first result fails, "next_gw()" will take out the second result.
Iñaki Baz Castillo ha scritto:
2009/4/27 Nick Warr nick@mobilia.it:
When I call next_gw() will LCR use all possible gateway groups, or just the gateway(s) in the first matching group?
Just the gateway(s) in the first matching group. If not, it doesn't make sense.
So, to send it to the second group, I'd need to actually have a matching entry pointing to it with a lower priority, correct?
The second question is tangential to the first, if it does send the traffic to other gateway group after failing through the first, does it regenerate the RURI, because the local provider wants a numerical prefix on the calls I send, and the other one no (basically do I need to account for this in my config?)
No, LCR will not add a prefix, you must do it.
What's the prefix in the gateway table there for then?
When ou cal "load_gw(ARG)", just the gateway goups matching the *current* RURI prefix and the PV used as ARG will be selected. Later, if the first result fails, "next_gw()" will take out the second result.
Sorry if I wasn't clear, the prefix in the LCR module is for _matching_ the prefix of a RURI, correct? The prefix in the gw Table should be added to the beginning of the RURI before it is forwarded to the GW, but as you said, the added prefix is discarded every time, then re added depending on the selected gateway from the gw table, I if understand...
2009/4/27 Nick Warr nick@mobilia.it:
No, LCR will not add a prefix, you must do it.
What's the prefix in the gateway table there for then?
For matching the RURI.
When ou cal "load_gw(ARG)", just the gateway goups matching the *current* RURI prefix and the PV used as ARG will be selected. Later, if the first result fails, "next_gw()" will take out the second result.
Sorry if I wasn't clear, the prefix in the LCR module is for _matching_ the prefix of a RURI, correct?
Yes:
http://kamailio.org/docs/modules/1.5.x/lcr.html ---------- For the purpose of facilitating least cost routing of requests, each gateway belongs to a gateway group and each gateway group is associated with one or more <prefix, from pattern, priority> tuples. A gateway matches a request if user part of Request URI matches a prefix and caller's URI matches a from pattern in a tuple that belongs to the group of the gateway. ----------
The prefix in the gw Table should be added to the beginning of the RURI before it is forwarded to the GW, but as you said, the added prefix is discarded every time,
What you mean with "the added prefix"? who adds that prefix?
The prefix in the gw Table should be added to the beginning of the RURI before it is forwarded to the GW, but as you said, the added prefix is discarded every time,
What you mean with "the added prefix"? who adds that prefix?
The prefix works ok.
From the doc:
"Function next_gw() can then be used to select one gateway at a time for forwarding. Upon each call, user part of original Request URI is first stripped by the number of characters as specified by the gateway's strip count and then prefixed by gateway's tag."
The GW's tag is the prefix.
Regards, Ovidiu Sas
2009/4/27 Ovidiu Sas osas@voipembedded.com:
The prefix in the gw Table should be added to the beginning of the RURI before it is forwarded to the GW, but as you said, the added prefix is discarded every time,
What you mean with "the added prefix"? who adds that prefix?
The prefix works ok. From the doc: "Function next_gw() can then be used to select one gateway at a time for forwarding. Upon each call, user part of original Request URI is first stripped by the number of characters as specified by the gateway's strip count and then prefixed by gateway's tag."
The GW's tag is the prefix.
ahh, ok, you mean the "tag". This is added to the RURI *after* mathing the prefix against the original RURI.