Can anyone help out to make a default config to allow a static ip to use an openser that would just push the calls to another openser ?

 

 

What I have tried yet is non working…

 

 

201.1.2.3 is one of our term boxes.

1.2.3.4 is the static ip to allow (eg clients asterisk)

5.6.7.8 is ser termination

 

 

Each time I place a call from 1.2.3..4 to this box  5.5.5.5 and relay to 5.6.7.8  the (5.6.7.8) replies with No Direct Communications, Please

From        if(uri == myself) {

 

 

 

route[0] {

 

 

        if(msg:len > max_len)   {

 

                xlog("L_INFO", "Message too big - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");

                sl_send_reply("513", "Message Too Big");

                exit;

        }

        if (!mf_process_maxfwd_header("10"))    {

 

                xlog("L_INFO", "Too many hops - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");

                sl_send_reply("483", "Too Many Hops");

                exit;

        }

 

        if(method == "INVITE") {

                record_route();

 

 

        }

        if(allow_trusted() && loose_route()) {

                if(!t_relay()) {

                        sl_send_reply("503", "Service Failure to Relay");

                }

                exit;

        } else if( $si=="1.2.3.4" && loose_route()) {

 

                if(!t_relay()) {

                        sl_send_reply("503", "Service Failure to Relay");

                }

                exit;

 

        }

 

        if($si == "1.2.3.4") {

                # Do your gateway selection and t_on_failure() here

                rewritehost("5.6.7.8");

        }

        if(uri == myself) {

                sl_send_reply("403", "No Direct Communications, Please");

                exit;

        }

        if($si=="1.2.3.4" && (uri =~ "@201\.1\.2\.3")) {

                if(!t_relay()) {

                        sl_send_reply("503", "Service Unavailable");

                }

        } else {

                sl_send_reply("403", "Forbidden");

        }

}