[OpenSIPS-Users] Aliases to multiple users

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Feb 17 09:47:56 CET 2010


Hi,

After doing alias lookup, print all current RURI and branches:
xlog(" --- RURI=$ru, branches=$(branch(uri)[*]) \n ");

Just to see if both subscribers were returned.

Anyhow the problem in your case is that the lookup(location) - function 
for setting the registration address - does the job only for RURI and 
not for the additional branches.
In other words, only 1000 will be translate to the phone address while 
1001 not.

But first check if both subscribers were loaded.

Regards,
Bogdan

Кузьмицкий Александр wrote:
> 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.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list