[Serusers] Problem with forwarding to a PSTN-Gateway :-(

Greger V. Teigre greger at teigre.com
Sun Apr 3 11:09:18 CEST 2005


I haven't seen an answer to this post...

First of all, your rtp proxying will not work. Ex. you have no failure_route 
to handle the OKs.  Please see the Getting Started document at 
http://onsip.org/ for an example config and explanations.

Secondly, if you think in straight lines, your GW getting requests from the 
client and not SER, means that the client sends the SIP message directly to 
the GW. So, are you really sure that the INVITE goes through your SER? 
Check with tcpdump or ngrep.
    If your domain has a DNS sip entry pointing to the GW, the client will 
find the GW itself and bypass SER unless you put SER as the client's 
outbound proxy.

Finally, I'm not sure what the append_branches is for. A forwarding to a GW 
can simply be done with a rewritehostport("ip:port") and then call 
t_relay().
g-)

Dirk Willbrandt wrote:
> Hi all...
>
> now i have the following scenario:
>
> I want to forward calls with an 8 as prefix to a PSTN Gateway but
> when i place a call to i.e. 8004912345678  i get a busy-tone on my
> VoIP Phone and the call gets canceled.
>
> My ser.cfg is configured out, so that i can say "theoretly it have to
> do" :-)
>
> I've installed a RTPProxy too. I've took the rtpproxy from ser-cvs.
>
> The connection between ser and rtp is ethablished when i start the
> ser.
> On the PSTN-Gateway i can see, when i place a call, that a request
> comes to the Gateway but it isn't the IP-Address of my ser but the
> IP-Address of my VoIP Phone
> and this IP-Address isn't allowed to connect to the PSTN-Gateway.
>
> Also, when i reconfigure the PSTN-Gateway so that the Phone-IP-Address
> is allowed to connect
> then i get a busy-tone on my phone, but the PSTN Phone rings. When i
> took the PSTN-Phone i hear
> nothing and my VoIP-Phone doesn't ring again.
>
> Can anyone help me ? :-(
> I become crazy with it - i work now 2 weeks on this Problem :-(
>
> Here is my ser.cfg for reference:
>
> ---
>
> #
> # $Id: ser.cfg,v 1.21.2.1 2003/07/30 16:46:18 andrei Exp $
> #
> # simple quick-start config script
> #
>
>
> # ----------- global configuration parameters ------------------------
>
>
> #debug=3         # debug level (cmd line: -dddddddddd)
> #fork=yes
> #log_stderror=no        # (cmd line: -E)
>
>
> # Uncomment these lines to enter debugging mode
> debug=7
> fork=no
> log_stderror=yes
> #
>
>
> check_via=no    # (cmd. line: -v)
> dns=no           # (cmd. line: -r)
> rev_dns=no      # (cmd. line: -R)
> port=5060
> #children=4
> #fifo="/tmp/ser_fifo"
>
>
> alias="terralink.de" # myself=terralink.de
> alias="siiip.terralink.de" # myself=siiip.terralink.de
> alias="217.9.16.13" # myself
>
>
> # ------------------ module loading ----------------------------------
>
>
> # Uncomment this if you want to use SQL database
> loadmodule "/usr/local/lib/ser/modules/mysql.so"
>
>
> loadmodule "/usr/local/lib/ser/modules/sl.so"
> loadmodule "/usr/local/lib/ser/modules/tm.so"
> loadmodule "/usr/local/lib/ser/modules/rr.so"
> loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
> loadmodule "/usr/local/lib/ser/modules/usrloc.so"
> loadmodule "/usr/local/lib/ser/modules/registrar.so"
>
>
> # Uncomment this if you want digest authentication
> # mysql.so must be loaded !
> loadmodule "/usr/local/lib/ser/modules/auth.so"
> loadmodule "/usr/local/lib/ser/modules/auth_radius.so"
>
>
> #loadmodule "/usr/local/lib/ser/modules/acc.so"
>
>
> loadmodule "/usr/local/lib/ser/modules/nathelper.so"
>
>
> loadmodule "/usr/local/lib/ser/modules/xlog.so"
>
> # ----------------- setting module-specific parameters ---------------
>
> # -- usrloc params --
> modparam("usrloc", "db_url", "mysql://ser:ser@localhost/ser")
> #modparam("usrloc", "db_mode",   0)
> modparam("usrloc", "db_mode",   2)
>
>
> # -- auth params --
> #modparam("auth_db", "db_url", "sql://ser:ser@localhost/ser")
> #modparam("auth_db", "calculate_ha1", yes)
> #modparam("auth_db", "password_column", "password")
> modparam("auth_radius", "radius_config",
> "/usr/local/etc/radiusclient/radiusclient.conf")
>
> # -- rr params --
> modparam("rr", "enable_full_lr", 1)
>
> # -- acc params --
> #modparam("acc", "log_level", 1)
> #modparam("acc", "log_flag", 1 )
> #modparam("acc", "log_missed_flag", 3)
> #modparam("acc", "radius_config",
> "/usr/local/etc/radiusclient/radiusclient.conf")
> #modparam("acc", "radius_flag", 1)
> #modparam("acc", "radius_missed_flag", 3)
>
> # -- nat params --
> modparam("nathelper", "natping_interval", 10)
> modparam("nathelper","rtpproxy_sock", "/var/run/rtpproxy.sock")
>
> # -------------------------  request routing logic -------------------
>
> # main routing logic
>
> route{
>        # zu viele Hops ?
>        if (!mf_process_maxfwd_header("10")) {
>                sl_send_reply("483","Too Many Hops");
>                break;
>        };
>        # nachricht zu lang ?
>        if ( msg:len > max_len ) {
>                sl_send_reply("513", "Message too big");
>                break;
>        };
>
>        # we record-route all messages -- to make sure that
>        # subsequent messages will go through our proxy; that's
>        # particularly good if upstream and downstream entities
>        # use different transport protocol
>        record_route();
>
>        # loose-route processing
>        if (loose_route()) { t_relay(); break; };
>
>        # labeled all transaction for accounting
>        setflag(1);
>
>        #if (!lookup("location")) {
>        #        # call invitations to off-line users are reported
>        using the #        # acc_request action; to avoid duplicate
>        reports on request #        # retransmissions, request is
> processed statefuly (t_newtran,
>        #        # t_reply)
>        #        if ((method=="INVITE" || method=="ACK") &&
>        t_newtran() ) { #                t_reply("404", "Not Found");
>        #                #acc_request("404 Not Found");
>        #                break;
>        #        };
>        #        # all other requests to off-line users are simply
>        replied #        # statelessly and no reports are issued
>        #        #sl_send_reply("404", "Not Found");
>        #        #break;
>        #} else {
>        #        # user on-line; report on failed transactions; mark
>        the #        # transaction for reporting using the same number
>        as #        # configured above; if the call is really missed,
>        a report #        # will be issued
>        #        setflag(3);
>        #        # forward to user's current destination
>        #        t_relay();
>        #        break;
>        #};
>
>        # if the request is for other domain use UsrLoc
>        # (in case, it does not work, use the following command
>        # with proper names and addresses in it)
>        if (uri==myself) {
>                rewritehost("siiip.terralink.de");
>                #xlog("L_DBG", "time [%Tf] method <%rm> r-uri <%ru>
> from <%fu> contact <%ct>\n");
>                if (method=="REGISTER") { route(1); break; };
>                if (method=="INVITE") {
>                        fix_nated_contact();
>                        record_route();
>                        force_rtp_proxy();
>                        if (uri=~"^sip:(.+)?@(.+)?") { route(3);
>                        break; } #else { break; };
>                }
>
>                lookup("aliases");
>
>                # native SIP destinations are handled using our USRLOC
>                DB if (!lookup("location")) {
>                #if (!lookup("location") || !lookup("aliases")) {
>                        sl_send_reply("404", "Not Found");
>                        break;
>                };
>        };
>        # forward to current uri now; use stateful forwarding; that
>        # works reliably even if we forward from TCP to UDP
>        if (!t_relay()) {
>                sl_reply_error();
>        };
> }
>
> route[1] {
>        #xlog("L_DBG", "Hier registriert sich jemand !\n");
>        if (!radius_www_authorize("")) {
>                www_challenge("", "0");
>                break;
>        };
>        save("location");
>        break;
> }
>
> #route[2] {
>        #xlog("L_DBG", "Hier will jemand intern telefonieren !\n");
> #}
>
> route[3] {
>        #xlog("L_DBG", "Hier will jemand extern telefonieren !\n");
>        #strip(1);
>        #rewritehostport("217.9.16.13:5060");
>        rewritehostport("217.9.21.6:5060");
>        #forward( 217.9.16.11, 5060 );
>        append_branch("sip:sip at 217.9.16.13");
>        #t_relay_to_udp("217.9.21.6", "5060");
>        if (!t_relay_to_udp("217.9.21.6", "5060")) {
>                sl_reply_error();
>                break;
>        };
> }
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers 




More information about the sr-users mailing list