I used the "SIP Proxy/Registrar with Offnet-Termination and
Accounting" configuration from the Sipwise Wizard.  Rather than
gumming up the list with what it spits out there, here is the relevant
bits when issuing a call to one of my gateways:

########################################################################
# Request route 'invite-to-external'
########################################################################
route[6]
{
        if(isflagset(20))
        {
                
                xlog("L_INFO", "Call to foreign domain - M=$rm RURI=$ru F=$fu 
T=$tu
IP=$si ID=$ci\n");
                route(2);
                exit;
        }
        if(!isflagset(23))
        {
                # don't allow calls relaying from PSTN to PSTN, if not 
explicitely forwarded
                if(uri =~ "^sip:[0-9]+@")
                {
                        # only route numeric users to PSTN
                        if(!load_gws())
                        {
                                
                                xlog("L_ERR", "Error loading PSTN gateways - 
M=$rm RURI=$ru F=$fu
T=$tu IP=$si ID=$ci\n");
                                sl_send_reply("503", "PSTN Termination 
Currently Unavailable");
                                exit;
                        }
                        if(!next_gw())
                        {
                                
                                xlog("L_ERR", "No PSTN gateways available - 
M=$rm RURI=$ru F=$fu
T=$tu IP=$si ID=$ci\n");
                                sl_send_reply("503", "PSTN Termination 
Currently Unavailable");
                                exit;
                        }
                        setflag(21);
                        
                        t_on_failure("1");
                        route(2);
                }
        }
        
        xlog("L_INFO", "Call to unknown user - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
        sl_send_reply("404", "User Not Found");
        exit;
        
}

########################################################################
# Request route 'base-outbound'
########################################################################
route[2]
{
        t_on_reply("1");
        if(!isflagset(21))
        {

                t_on_failure("2");
        }
        if(is_present_hf("Proxy-Authorization"))
        {
                xlog("L_INFO", "Attempting to consume
credentials.\n$hdr(Proxy-Authorization)\n)");
                remove_hf("Proxy-Authorization");
        }

        xlog("L_INFO", "Request leaving server, D-URI='$du' - M=$rm
RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
        # no 100 (we already sent it) and no DNS blacklisting
        if(!t_relay("0x05"))
        {
                sl_reply_error();
        }
        exit;

}

########################################################################

For the life of me, I can't find much of a definition of D-URI in
Google.  Even the OpenSER book I have does not even touch on it other
than saying $du = Destination URI.

Thanks.

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

Reply via email to