El Viernes, 16 de Noviembre de 2007, Daniel escribió:
Hi all,
I have this problem.
I have 2 contacts for one user subscriber, so in LOCATION tables, after
REGISTER session I have:
ID user contact q
12 A A@IP_X 1
13 A A@IP_Y 1
14 B B@IP_Z 1
so, B calls A and A has an incoming CPL script.
In this script I'd like to call the 2 A's contacts in sequential order:
The script is after looup("location"), so the R-URI is just A@IP_X (because
it has lowest ID)
SRIPT user A:
<cpl>
<incoming>
<location url="sip:A@IP_Y" priority="0.3">
<proxy timeout="10" ordering="sequential" />
</location>
</incoming>
</cpl>
Whit this script I hoped to add A@IP_Y to location set (that already
included A@IP_X) with priority 0.3, and then call A@IP_X as first (it has
priority=q=1) and then, if I no aswer after 10sec, call A@IP_Y (that it
has lowest priority).
CPL don't add A@IP_Y to the location set, but it rewrites the location (it
removes the old R-URI, A@IP_X) with A@IP_Y and it call only this contact.
Is there a sense in what I've write?
if yes, where is the problem?
I'm learning now about CPL, but I think you shouldn't do
a "lookup('location')" before the CPL script.
Instead use:
<incoming>
<lookup source="registration">
<success>
<proxy />
</success>
...
So if you set:
modparam("cpl-c","lookup_append_branches",1)
(
http://www.openser.org/docs/modules/devel/cpl-c.html#AEN210)
the both contacts (A@IP_X and A@IP_Y) will be called in parallel.
Unfortunatelly I think there is no way to use the qvalue inside CPL, so what I
say is not valid for you at all XD
I have working serial forwarding based on qvalue with LCR module, it works
very well, but now I'm just trying to integrate it with CPL. I've got it
(thanks Jesus for the inspiration) with this:
- You need LCR working for serial forwarding based on qvalue (if you have not
there are some examples in the web and I add mine at the end of this mail).
- Your A@domain CPL XML like this:
<cpl>
<incoming>
...
<location url="sip:ibc@sip.aliax.net;cpl=no">
<proxy />
</location>
...
</incoming>
</cpl>
Note the "cpl=no" in the URL.
And note that,instead of using:
lookup source="registration" (that perfoms a location by itself)
I do:
location url="sip:ibc@sip.aliax.net;cpl=no"
so the INVITE does a loop and comes again to proxy.
- In the script, **before** a lookup(location) (this lookup will not be place
in fact if there is CPL script for called user):
if ! uri_param("cpl","no") {
cpl_run_script("incoming","force_stateful");
}
So CPL will no be called again when the INVITE comes again because the loop.
PD: The LCR module for serial forwarding based on qvalue:
# -- tm --
modparam("tm", "fr_timer", 10)
modparam("tm", "fr_inv_timer", 80)
modparam("tm", "noisy_ctimer", 1)
# -- lcr --
modparam("lcr|tm", "fr_inv_timer_avp", "$avp(i:701)")
modparam("lcr", "contact_avp", "$avp(i:702)")
modparam("lcr","fr_inv_timer_next",20)
modparam("lcr","fr_inv_timer",60)
modparam("lcr", "gw_uri_avp", "$avp(i:703)")
modparam("lcr", "ruri_user_avp", "$avp(i:704)")
modparam("lcr", "rpid_avp", "$avp(i:705)")
modparam("lcr", "dm_flag", 25)
route {
...
lookup("location");
load_contacts();
next_contacts();
route(1);
exit;
...
}
route[1] {
t_on_branch("1");
t_on_reply("1");
t_on_failure("1");
t_relay();
}
branch_route[1] {
#aply RtpProxy to this branch if needed and so...
}
failure_route[1] {
if (next_contacts()) {
route(1);
exit;
}
}
Hope it can help you. Regards.
--
Iñaki Baz Castillo