route { force_rport(); ...Irrelevant part... t_check_trans(); if (loose_route()) { xlog("L_ERR", "Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]"); if (!is_method("ACK")) sl_send_reply("403","Preload Route denied"); exit; } ...Irrelevant part... if ($rU==NULL) { sl_send_reply("484","Address Incomplete"); exit; } #FreeSWITCH route(freeswitch); #Outbound route(outbound); if (!lookup("location", "m")) { t_newtran(); t_reply("404", "Not Found"); exit; } setflag(ACC_MISSED); xlog("Reaching lowest Call Relay.\n"); route(relay); } route[outbound] { xlog("Jumped to Outbound.\n"); if(!is_method("INVITE")){ return; } if ($rU=~"^[1-9][0-9]+$") { xlog("FS tries to call PBX! $rU@$rd:$rp via $si"); $rd="192.168.1.30"; $rp="5060"; force_send_socket(udp:192.168.1.150:5060); route(relay); exit; } } route[freeswitch] { if(!is_method("INVITE")){ return; } if ( ($rU=~"^[5]$" || $rU=~"^[7]$") && src_ip==192.168.1.30 && src_port==5060) { xlog("PBX tries to call FS! $rU@$rd:$rp via $si"); $rd="10.250.5.50"; $rp="5090"; force_send_socket(udp:10.250.5.3:5080); route(relay); exit; } } route[relay] { if (is_method("INVITE")) { if (has_body("application/sdp") && $si=="192.168.1.30") { xlog("Offer rtpp Inbound.\n"); rtpproxy_offer("rei"); }else{ xlog("Offer rtpp Outbound.\n"); rtpproxy_offer("rie"); } t_on_branch("per_branch_ops"); t_on_reply("handle_nat"); t_on_failure("missed_call"); } if (is_method("CANCEL|BYE")) { rtpproxy_unforce(); } if (!t_relay()) { send_reply("500","Internal Error"); }; exit; } branch_route[per_branch_ops] { xlog("new branch at $ru\n"); } onreply_route[handle_nat] { if( is_method("ACK") && has_body("application/sdp")){ xlog("Answer rtpp reply\n"); rtpproxy_answer("rie"); } else if(has_body("application/sdp")) { xlog("Offer rtpp reply\n"); rtpproxy_offer("rei"); } xlog("incoming reply\n"); } ...Irrelevant part...