if ( loose_route()) { if (( method=="INVITE" || method=="REFER") && !has_totag()) { sl_send_reply("403", "Forbidden"); return; }; if ( method == "INVITE" ) { if (nat_uac_test("19")) { setflag(6); force_rport(); #adds the rport we have received the packet from to be added to the first via-header fix_nated_contact(); #Rewrites Contact HF to contain request's source address:port if ( ! search( "^Content-Length:\ 0" ) ) { fix_nated_sdp( "1" ); }; }; if ( ! proxy_authorize( "proxy.mydomain.org", "subscriber" ) ) { proxy_challenge( "proxy.mydomain.org", "0" ); return; } else if ( ! check_from() ) { #check_from checks the username against the db sl_send_reply( "403", "Username must be same as login name" ); return; }; consume_credentials(); force_rtp_proxy("l"); #Rewrites SDP body to ensure that media is passed through an RTP proxy. #(l-flag means lookup mode, only use this if a corresponding #session already exists in the rtpproxy } xlog("L_ERR", "XXXXXXXXXXXXXLOG1 route1 time [$Tf] method <$rm> r-uri <$ru> 2nd via <$hdr(via[1])>\n"); route(1); return; };