[OpenSIPS-Users] topology_hiding

Kirill Galinurov k.galinurov at gmail.com
Tue Nov 14 10:49:45 EST 2017


Hi. All we try topology hiding module.
We have opensips 2.3/2 like sbc with to interfaces.
And ip addresses are X.X.X.X and y.y.y.y.
We have to softswitch with ip addreses z.z.z.1 and z.z.z.2
Also we loadbalancing calls between softswitch .
My config
if(is_method("INVITE"))  {
           create_dialog();
           topology_hiding();
           if (check_address("1","$si","$sp","any","$avp(ctx)")){
               force_send_socket(udp:10.240.250.121:5126);
               setflag(CALL_SW);
               do_accounting("log", "cdr|failed");
               $dlg_val(callee) = $rU;
               $dlg_val(calling) =$fU;
               $dlg_val(callcount) = $var(size);
               xlog("L_INFO","+++++Incoming call from $fU $sp $proto \n");
               $acc_extra(src_ip) = $si;
               $acc_leg(caller) = $fU;
               $acc_leg(callee) = $rU;
               if(!lb_start_or_next("1","st","s")){
                   switch($rc){
                       case -1:
                           xlog("L_INFO","error  500 General dispatch
error\n");
                           send_reply("503", "No resource avaiable");
                           acc_log_request("503 General dispatch error");
                           break;

                       case -2:
                           xlog("L_INFO", "503 No free resources on
nodes\n");
                           send_reply("503", "No resource avaible");
                           acc_log_request("503 No free resource on
nodes");
                           break;
                       case -3:
                           xlog("L_INFO","606 No nodes avaible\n");
                           send_reply("503", "No resource avaible");
                           acc_log_request("606 No nodes avaible");
                           break;
                   }
                 } else {
                       xlog("L_INFO","Dispatch request to softswitch
$du\n");
                       $avp(node) = $du;
                       $acc_extra(dst_node) = $du;
                       t_on_failure("fail_softswitch");
                       route(relay);
               }
           }
       else
           if (check_address("2","$Ri","$Rp","any","$avp(ctx)")){
               setflag(CALL_FROM_SW);
               do_accounting("log", "cdr|failed");
               $dlg_val(callee) = $rU;
               $dlg_val(calling) = $fU;
               $dlg_val(callcount) = $var(size);
               xlog("L_INFO","+++++Outgouing call from $fU $sp $proto \n");
               $acc_extra(src_ip) = $si;
               $acc_leg(caller) = $fU;
               $acc_leg(callee) = $rU;
               if(!lb_start_or_next("$avp(ctx)","st","s")){
                   switch($rc){
                       case -1:
                           xlog("L_INFO","error  500 General dispatch
error\n");
                           send_reply("503", "No resource avaiable");
                           acc_log_request("503 General dispatch error");
                           break;

                       case -2:
                           xlog("L_INFO", "503 No free resources on
operator\n");
                           send_reply("503", "No resource avaible");
                           acc_log_request("503 No free resource on
operator");
                           break;
                       case -3:
                           xlog("L_INFO","606 No resources avaible\n");
                           send_reply("503", "No resource avaible");
                           acc_log_request("606 No nodes avaible");
                           break;
                   }
                 } else {
                       xlog("L_INFO","Dispatch request to operator sbc
$du\n");
                       $avp(node) = $du;
                       $acc_extra(dst_node) = $du;
                       t_on_failure("fail_operator");
                       route(relay);
               }
           }
       else
            sl_send_reply("403", "Forbidden posible wrong port");

       }
}
In invite on softswitch i see
NVITE sip:12345 at XX.XX.XX.XX:5126 SIP/2.0
Via: SIP/2.0/UDP YY.YY.YY.YY:5126;branch=z9hG4bKe4d9.14b51d57.0
Max-Forwards: 69
From: "Anonymous" <sip:12345 at CC.CC.CC.CC>;tag=as59cc9e35
To: <sip:12345 at xx.xx.xx.xx:5126>
Contact: <sip:10.240.250.121:5126;did=e7e.87a97756>
Call-ID: 0068dba856ae05e8406504ab71fc9900 at CC.CC.CC.CC.CC
CSeq: 102 INVITE

Where CC is client ip. I thithk it must be opensips ip adress
10.240.250.121:5126
What is wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20171114/1eebc6b3/attachment-0001.html>


More information about the Users mailing list