[OpenSIPS-Users] Aliases to multiple users
Кузьмицкий Александр
brat002 at gmail.com
Tue Feb 16 17:47:18 CET 2010
I`m trying next routing logic:
for alias 1009 i have two subscribers 1000 and 1001
When I try dialing from 1002 to 1009 ring only one phone(first element from
table dbalias).
Config blocks:
..............
modparam("alias_db", "append_branches", 1)
..............
alias_db_lookup("dbaliases");
...............
if($avp(s:dest)=="usrloc"){
route(3);
}
...........
route[1] {
# for INVITEs enable some additional helper routes
if (subst_uri('/(sip:.*);nat=yes/\1/')){
setbflag(6);
};
if(isflagset(5)||isbflagset(6)){
route(6);
};
if(isflagset(5)){
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
};
if (is_method("INVITE")) {
t_on_branch("2");
t_on_failure("4");
t_on_reply("2");
t_on_failure("1");
}
if (!t_relay()) {
sl_reply_error();
};
exit;
}
failure_route[4]{
serialize_branches(1);
if(next_branches()){
#lookup("location", "m");
t_on_reply("2");
t_on_failure("1");
xlog("DIALING!");
t_relay();
}
}
route[3]{
if($(rU{s.len}) == 3)
{
# Group is searched on database, by using
# From username.
xlog("!!!!!!!!!!!!!");
cd_lookup("closeddial", "GroupA");
};
xlog("BRANCH=$branch");
if(!lookup("location", "m")){
switch($retcode){
case -1:
case -3:
t_newtran();
t_reply("404", "Contact Not Found");
exit;
case -2:
sl_send_reply("405", "Method Not Allowed");
exit;
}
}
setflag(2);
xlog("!!!!!!!!!!!!!!!!ROUTE 3 LOGIC!!!!!!!!!!!!");
route(1);
xlog("AFTER ROUTE 3 LOGIC");
}
route[4]{
rewritehostport("89.107.120.237");
route(1);
}
branch_route[2] {
xlog("new branch at $ru\n");
}
onreply_route[2] {
xlog("incoming reply\n");
if ((isflagset(5) || isbflagset(6)) &&
status=~"(183)|(2[0-9][0-9])"){
force_rtp_proxy();
append_hf("P-hint: onreply_route|force_rtp_proxy \r\n");
}
if(isbflagset(6)){
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
append_hf("P-hint: Onreply-route - fixcontact \r\n");
fix_nated_contact();
}
exit;
}
I can`t find errors. Please, help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100216/fa9619a8/attachment.htm
More information about the Users
mailing list