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]+@.*" && !uri=~”^sip:81[0-9]+@.*”) {

 

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

                                 prefix(“81”);

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

                                strip(1);

                                prefix("81");

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

                                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