Ok,

Here the code.

#############################################################
#                                                           #
#Authentication and Authorization against a radius server.  #
#                                                           #
#############################################################
route[1]{
        sl_send_reply("100","Trying");

         if (!radius_www_authorize("")){
             www_challenge("", "0");
             sl_send_reply("401","Unauthorized");
             exit;
          };
#############################################################
#                                                           #
# Check if register request was originated  behind a NAT    #
#     and saved his IInformation to the location table      #
#      the setbflag with value 6 is identified the client   #
#                   behind a NAT                            #
#                                                           #
#############################################################

        if(!search("^Contact:[ ]*\*") && nat_uac_test("19"))
        {
                fix_nated_register();
                setbflag(6);
       
        }

        if(!save("location"))
        {
                sl_reply_error();
                exit;
        }

       
        exit;
}

############################################################
#                                                          #
#               INVITE MESSAGE HANDLER                     #
#                                                          #
############################################################
route[2]{
         if(nat_uac_test("19"))
           {
            setbflag(6);
            force_rport();
            fix_nated_contact();
           };

        if(!lookup("location")){
        
           ............................................ #SEND TO VOICE MAIL
AND OUTGOING CALLS
         }
          else
         {
                route(13); #CHECK THE PREFERENCE OF ONLINE USERS
         } 


}

##################################################################
#                                                                #
#                       Call Forward                #
#                                                                #
##################################################################
route[11]
{
avp_pushto("$ru", "$avp(s:callForward)");
route(12);
exit;

}

route[12]{


        t_on_reply("1");
        if (!t_relay()) {       
          sl_reply_error();
        };
        exit;
}

###################################################################
#                                                                 #
#                       ONLINE USER PREFERENCE LOGIC              #
#                                                                 #
###################################################################
route[13]
{

                 avp_db_load("$ru/username","*");


                 if(is_avp_set("$avp(s:callForward)"))
                   {
                        route(11);
                        exit;
                   }
                  ........
                        #OTHER USER STATUS HANDLED HERE.
exit;
}

Iñaki Baz Castillo wrote:
> 
> El Jueves, 22 de Enero de 2009, pjgonzalez escribió:
>> I do ti but right now the call only ring on the Softphone, User B.
> 
> Sorry, but things are not so simple. You should provide a more detailed 
> description of the desired behaviour, current behaviour and code.
> 
> -- 
> Iñaki Baz Castillo
> 
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/inbounts-calls-problems-tp2197805p2199510.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to