[Serusers] SER-0.9.1 + MediaProxy + Cisco3600

smy at addm.com smy at addm.com
Tue May 3 09:37:59 CEST 2005



Hi all,

I'm a newbie and I've been searching through the entire mailing (including
www.onsip.org) for a solution regarding landing of calls to a Cisco 3600 GW.

I've configured my SER based on the "Getting Started for mediaproxy" document
found on www.onsip.org, and it worked great between UAs.  Based on all the info
I've found on this list + suggestions from others, I came up with the following
config file.  I've managed to have the UAs to dial out via the cisco, yet once
the PSTN side picks up, no sound could be heard (both ways).  I know the Cisco
is working for sure, since my friend is using AUVTECH SIP Server and is landing
calls properly via the same gateway.


I'm greatful for any help on this issue!!

==================================================================

route {
        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483", "Too Many Hops");
                break;
        };

        if (msg:len > max_len) {
                sl_send_reply("513", "Message Overflow");
                break;
        };

         if (method=="INVITE" && client_nat_test("1")) {
                record_route_preset("202.67.215.28:5080;nat=yes"); # insert IP
address
        } else if (method!="REGISTER") {
                record_route();
        };

                      end_media_session();
        };

       if (loose_route()) {

                if (has_totag() && method=="INVITE") {

                        if (client_nat_test("1") || search("^Route:.*;nat=yes"))
{
                                setflag(6);
                                use_media_proxy();
                        };

};

                route(1);
                break;
        };
        # labeled all transaction for accounting
        setflag(1);
        setflag(2);
# -----------------------------------------------------------------
        # Call Type Processing Section
        # -----------------------------------------------------------------
        if (uri==myself) {
                if (method=="INVITE") {
                        route(3);
                        break;
                } else  if (method=="REGISTER") {
                        route(2);
                        break;
                };

                if (!lookup("location")) {
                        sl_send_reply("404", "User Not Found");
                        break;
                };

                route(1);
        };
}

route[1] {

        # -----------------------------------------------------------------
        # Default Message Handler
        # -----------------------------------------------------------------

        t_on_reply("1");

        if (!t_relay()) {

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

                sl_reply_error();
        };
}
route[2] {

        # -----------------------------------------------------------------
        # REGISTER Message Handler
        # ----------------------------------------------------------------

        sl_send_reply("100", "Trying");

        # -----------------------------------------------------------------
        # Testing script for unconditional registration of PSTN gateway
        # -----------------------------------------------------------------
        #if (src_ip==61.234.124.150){
        #  save("location_cscisco3600");
        #};
        # -----------------------------------------------------------------
        if (!search("^Contact: \*") && client_nat_test("1")) {
                setflag(6);
                fix_nated_register();
                force_rport();
        };

        if (!www_authorize("","subscriber")) {
                www_challenge("","0");
                break;
        };

        if (!check_to()) {
                sl_send_reply("401", "Unauthorized");
                break;
        };

        consume_credentials();

        if (!save("location")) {
                sl_reply_error(route[3] {

        # -----------------------------------------------------------------
        # INVITE Message Handler
        # -----------------------------------------------------------------

        if (client_nat_test("1")) {
                setflag(7);
                force_rport();
                fix_nated_contact();
        };
        # -----------------------------------------------------------------
        # INVITE Message Handler
        # -----------------------------------------------------------------
        #if (lookup("location_cscisco3600"){
#               t_relay_to_udp("61.234.124.150");
#       }
        # -----------------------------------------------------------------

        lookup("aliases");
        if (uri!=myself) {
                route(1);
                break;
        };

        # --------------------------------------------------------
        # PSTN Gateway config for Call Landing
        # --------------------------------------------------------

        if (uri=~"^sip:8676[0-9]*@.*") {
                #rewritehostport("211.147.240.67:5060");
                #rewritehostport("210.21.105.91:5060");
                setflag(1);
                rewritehostport("61.234.124.150:5060");
                force_rport();
                #fix_nated_contact();
                #force_rtp_proxy();
                #t_relay();
                #use_media_proxy();
        #        forward(uri:host, uri:port);
                if (!t_relay()) {
                        sl_reply_error();
                };
);
break;
        }
        # ---------------------------------------------------------

        if (!lookup("location")) {
                sl_send_reply("404", "User Not Found");
                break;
        };

        if (!proxy_authorize("","subscriber")) {
                proxy_challenge("","0");
                break;
        } else if (!check_from()) {
                sl_send_reply("403", "Use From=ID");
                break;
        };

        consume_credentials();

        if (isflagset(6) || isflagset(7)) {
                use_media_proxy();
        };

        route(1);
}

onreply_route[1] {

        if ((isflagset(6) || isflagset(7)) &&
(status=~"(180)|(183)|2[0-9][0-9]")) {

                if (!search("^Content-Length:\ 0")) {
                        use_media_proxy();
                };
        };

        if (client_nat_test("1")) {
                fix_nated_contact();
        };
}

        };
}


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the sr-users mailing list