<spanre>Hi Bogdan<br />I tried to follow your directions, but the problem persists.<br /><br />This is what I did:<br /><br />In the route where the function do_routing is called I inserted:<br /><br />########################################################################<br /># Request route 'invite-to-external'<br />########################################################################<br />route[6] {<br /> if(isflagset(20)) {<br /> xlog("L_INFO", "Call to foreign domain - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /> route(2);<br /> exit;<br /> }<br /> if(!isflagset(23)) {<br /> # don't allow calls relaying from PSTN to PSTN, if not explicitely forwarded<br /> if(uri=~ "^sip:[0-9]+@") {<br /> xlog("L_INFO", "Call to PSTN\n");<br /> do_routing();<br /> xlog("L_INFO", "first attempt is $ru, attributes are $avp(s:drattrs)\n");<br /> if(!goes_to_gw()) {<br /> xlog("L_ERR", "No PSTN gateways available - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /> sl_send_reply("503", "PSTN Termination Currently Unavailable");<br /> exit;<br /> }<br /> setflag(21);<br /><br /> t_on_branch("1");<br /> t_on_failure("2");<br /> route(2);<br /> exit;<br /> }<br /> }<br /><br /> xlog("L_INFO", "Call to unknown user - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /> sl_send_reply("404", "User Not Found");<br /> exit;<br />}<br /><br />In the branch_route:<br /><br />branch_route[1] {<br /> if(is_present_hf("P-Asserted-Identity")) {<br /> xlog("L_INFO", "Removing P-Asserted-Identity in branches\n");<br /> remove_hf("P-Asserted-Identity");<br /> }<br /> if(is_present_hf("Remote-Party-ID")) {<br /> remove_hf("Remote-Party-ID");<br /> }<br /> if(is_avp_set("$avp(s:caller_cli)/s")) {<br /> xlog("L_INFO", "Set caller CLI '$avp(s:caller_cli)' - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /> append_hf("P-Asserted-Identity: <$avp(s:caller_cli)>\r\n");<br /> }<br /> route(14);<br />}<br /><br />########################################################################<br /># Request route 'clir'<br />########################################################################<br />route[14] {<br /> if(isflagset(28) && !isflagset(27)) {<br /> setflag(27);<br /><br /> xlog("L_INFO", "Anonymize caller - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /> uac_replace_from("Anonymous","sip:anonymous@anonymous.invalid");<br /> if(is_present_hf("Privacy")) {<br /> remove_hf("Privacy");<br /> }<br /> append_hf("Privacy: id\r\n");<br /> }<br />}<br /><br />########################################################################<br /># Request route 'base-outbound'<br />########################################################################<br />route[2] {<br /> xlog("L_INFO","ARRIVATO NELLA ROUTE 2\n");<br /> t_on_reply("1");<br /><br /> if(!isflagset(21)) {<br /> t_on_failure("1");<br /> }<br /> if(is_present_hf("Proxy-Authorization")) {<br /> consume_credentials();<br /> }<br /><br /> xlog("L_INFO", "Request leaving server, D-URI='$du' - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /><br /> if(!t_relay()) {<br /> sl_reply_error();<br /> }<br /> exit;<br />}<br /><br />In the failure_route;<br /><br />########################################################################<br /># Failure route 'pstn-failover'<br />########################################################################<br />failure_route[2] {<br /> xlog("L_INFO", "Failure route for PSTN entered - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /> route(9);<br /><br /> if(!use_next_gw()) {<br /> xlog("L_ERR", "Failed to select next PSTN gateway - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /> exit;<br /> }<br /> xlog("L_INFO", "selected next gateway $ru, attributes are $avp(s:drattrs)\n");<br /><br /> if(is_present_hf("P-Asserted-Identity")) {<br /> xlog("L_INFO", "Removing P-Asserted-Identity in failure route\n");<br /> remove_hf("P-Asserted-Identity");<br /> }<br /> if(is_present_hf("Remote-Party-ID")) {<br /> remove_hf("Remote-Party-ID");<br /> }<br /> if(is_avp_set("$avp(s:caller_cli)/s")) {<br /> xlog("L_INFO", "Set caller CLI '$avp(s:caller_cli)' - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br /> append_hf("P-Asserted-Identity: <$avp(s:caller_cli)>\r\n");<br /> #append_hf("Remote-Party-ID: <$avp(s:caller_cli)>;party=caller;privacy=none;screen=yes\r\n");<br /> }<br /> route(14);<br /><br /> t_on_failure("2");<br /> route(2);<br />}<br /><br />In the INVITE sent from proxy to the second gateway are still two P-Asserted Idntity fields.<br /></pre><div id="result_box" style="text-align: left;" dir="ltr"> Where am I wrong?</div><spanre>Thanks in advance.<br /><br />Matteo Marzuola<br /><br /><br /><br /><br />>Hi Matteo,<br /><br />>Whatever change you in request_route will propagate in all branches - <br />>this is your problem - when you set the PAI for the first destination, <br />>in request_route, the PAI will be present in all future branches.<br /><br />>To avoid this situation, avoid adding "per-branch" info from <br />>request_branch - do it from branch_route; branch_route and failure_route <br />>allows changes per branch (and not global ones).<br /><br />>Do something like:<br /><br />>request_route -> do_routing + arm branch_route<br />>branch_route -> set PAI for the first branch<br />>failure_route -> set PAI for the next branch<br /><br />>Regards,<br />>Bogdan<br /></pre><span> </span><br /><span>>Hi all. In my scenario I try to use dynamic routing and I have a problem with the P-Asserted Identity field. When >the proxy tries to send the INVITE to the first gateway selected from DRouting module by the function</span><br /><span>>do_routing, there is only one PAI field, but if that gateway is down, at the second attempt to next gateway, the >INVITE contains two PAI fields identicals.</span><br /><span> </span><br /><span>>Thanks in advance.</span><br /><span> </span><br /><span>>Matteo Marzuola</span><br />
<br>----------------------------------------------------------------------------<br>Vuoi essere presente online? <br>Vuoi dare voce alla tua attivita`? <br>Acquista un dominio su domini.interfree.it.<br>A partire da 18,59 euro<br>----------------------------------------------------------------------------<br>