[Serusers] Forward to PSTN gateway question

Alejandro G ag2005 at fibertel.com.ar
Wed Oct 12 06:25:32 CEST 2005



Hi,

I have the following configuration:


                               192.168.0.101    192.168.0.1
    Public IP <---> Asterisk <------------------------------>  SER <--->
Public IP  <-----> SIP Phone
                   as PSTN GW

I use mediaproxy for dealing with NAT, everything works fine. We have 2
internet connections: one over Asterisk with low bandwith, and the other
over SER with more bandwidth. The SIP phone is Sipura 2100.

The routing block I use in INVITE is something liske this:

route[1] {

   # -----------------------------------------------------------------
   # Default Message Handler
   # -----------------------------------------------------------------
   t_on_reply("1");
   if (!t_relay()) {

      if (method=="INVITE" || method=="ACK") {
         end_media_session();
      };

      sl_reply_error();
   };
}

route[4] {

   # -----------------------------------------------------------------
   # PSTN Handler
   # -----------------------------------------------------------------
   rewritehost("192.168.0.1"); # GATEWAY IP ADDRESS
   avp_write("i:45", "inv_timeout");
   append_hf("P-hint: GATEWAY\r\n");

   # -----------------------------------------------------------------
   # RTP Proxy Enabler
   # -----------------------------------------------------------------
   if (isflagset(6) || isflagset(7)) {	# flags set by client_nat_test()
      use_media_proxy();
   };

   route(1);
}


When the user with the SIP phone terminates in PSTN via Asterisk, SER
forwards to Asterisk but Asterisk then * contacts rtp streams directly to
SIP phone bypassing SER and using the low bandwidth connection.

My knowledge is poor about SER and SIP issues but I believe that * tries to
contact to the UA specified in the Contact header. Is this correct?

Is anyway SIP phone could terminate in PSTN connecting using SER and private
LAN to connect to asterisk instead of using asterisk's public IP?

Sorry, I'm not sure that my questions is clear enough. Thanks.


Alejandro Ghergherian




More information about the sr-users mailing list