[Serusers] number translation

Raymond Chen rchen at cityabove.net
Mon Jan 17 19:31:16 CET 2005


Dear all,

 

I have number translation as below to manipulate the dialing pattern,  it's
works fine for it's purpose.  One problem is all on net calls can connect
but no voice.  Any idea?

 

route{

        if (!mf_process_maxfwd_header("10")) {

                if (method!="ACK") {

                        sl_send_reply("483", "Too many hops");

                };

                break;

        };

 

        if (msg:len >= max_len) {

                if (method!="ACK") {

                        sl_send_reply("513", "Message too big");

                };

                break;

        };

 

        if (search("^From: sip:sipsak@") && (method=="OPTIONS") &&
(!uri=~"sip:.*[@]+.*")) {

                options_reply();

                break;

        };

 

        # !! Nathelper

        if (nat_uac_test("19")) {

 

                if (method == "REGISTER" || !search("^Record-Route:")) {

 

                    fix_nated_contact(); # Rewrite contact with source IP of
signalling

                    if (method == "INVITE") {

                        fix_nated_sdp("1"); # Add direction=active to SDP

                    };

                    force_rport(); # Add rport parameter to topmost Via

                    append_hf("P-hint: Proxied\r\n");

                    setflag(5);    # Mark as NATed

                };

        };

 

 

        if (!method=="REGISTER") record_route();

 

 

        if (loose_route()) {

                # mark routing logic in request

                append_hf("P-hint: rr-enforced\r\n");

                route(1);

                break;

        };

 

 

        if (!uri=~"^sip:1[0-9]+ at .*" && !uri=~"^sip:81[0-9]+ at .*") {

 

                        if (uri=~"sip:[1-9][0-9]+ at .*") {

                                 prefix("81");

                        } else if (uri=~"sip:0[1-9][0-9]+ at .*") {

                                strip(1);

                                prefix("81");

                        } else if (uri=~"sip:00[1-9][0-9]+ at .*") {

                                strip(2);

                        };

        };

 

        if (!uri==myself) {

                # mark routing logic in request

                append_hf("P-hint: outbound\r\n");

                route(1);

                break;

        };

 

        if (uri==myself) {

 

                if (method=="REGISTER") {

 

                        if (!www_authorize("", "subscriber")) {

                                www_challenge("", "1");

                                break;

                        };

 

                        save("location");

                        break;

                };

 

                setflag(1);

 

                lookup("aliases");

 

                if (lookup("location")) {

                        append_hf("P-hint: usrloc applied\r\n");

                        route(1);

                        break;

                };

 

            .......

 

 

Raymond

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20050118/3a2200ab/attachment.htm>


More information about the sr-users mailing list