<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div> Need a little help with get_redirects(), using openser 1.2. I am using the following in failure_route to capture contacts from a "multiple choices" reply from cisco media gateway. </div><div><br></div><div><div>Following code sets the ruri to the last contact, however, the $ds show more information about other contacts. Is there a way to reset this so that only ruri information is used? Cisco response and xlog information is also given below. </div><div><br></div><div><div>if(!get_redirects("*:*"))</div><div> {</div><div> xlog("L_ERROR", "Failed to fetch contact '$ct' from 301/302 - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");</div><div> acc_db_request("480", "acc");</div><div> t_reply("480", "Temporarily Unavailable");</div><div> exit;</div><div> }</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span># get last URI from destination-set and set it as R-URI</div><div> xlog("L_INFO", "Redirect from UAC intercepted 1 - M=$rm RURI=$ru D=$ds B=$bR \nF=$fu T=$tu IP=$si ID=$ci\n");</div><div> avp_delete("$avp(s:tmp)/g");</div><div> $avp(s:tmp) = $ds;</div><div> avp_subst("$avp(s:tmp)", "/.*(<a href="sip:.+@">sip:.+@</a>[^:;>]+).*$/\1/");</div><div> avp_pushto("$ru", "$avp(s:tmp)");</div><div> setflag(29);</div><div> xlog("L_INFO", "Redirect from UAC intercepted 2 - M=$rm RURI=$ru D=$ds B=$bR \ntmp=$avp(s:tmp) \nF=$fu T=$tu IP=$si ID=$ci\n");</div><div> append_branch();</div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>route(17); # process <br></div><div><span class="Apple-tab-span" style="white-space: pre; ">                </span>exit;<br></div><div>}</div><div><br></div></div><div><br></div><div>Thanks in advance for your advice. </div><div><br></div><div>-- </div><div>Zahid</div><div> </div><div><br></div></div><div><div><br></div><div>The response from gateway:</div><div><br></div></div><div><div>U 2008/08/26 08:19:04.440411 10.10.0.32:5060 -> 10.10.0.98:5060</div><div>SIP/2.0 300 Multiple Choices.</div><div>Via: SIP/2.0/UDP 10.10.0.98;branch=z9hG4bK901b.335cb695.0,SIP/2.0/UDP 10.10.12.140;branch=z9hG4bK612a4f20B9293665.</div><div>From: "10521" <<a href="sip:10521@">sip:10521@</a>devproxy.myip.org>;tag=B395F9F2-4618AC3F.</div><div>To: <<a href="sip:40001@">sip:40001@</a>devproxy.myip.org;user=phone>;tag=195535C4-11AC.</div><div>Date: Tue, 26 Aug 2008 12:19:04 GMT.</div><div>Call-ID: f7932e23-d89cd014-e3ea20a9@10.10.12.140.</div><div>Server: Cisco-SIPGateway/IOS-12.x.</div><div>CSeq: 2 INVITE.</div><div>Allow-Events: telephone-event.</div><div>Diversion: <<a href="sip:40001@">sip:40001@</a>10.10.0.32>;reason=unconditional;counter=1.</div><div>Contact: <<a href="sip:10512@">sip:10512@</a>10.10.0.98>,<<a href="sip:10512@">sip:10512@</a>10.10.0.32>.</div><div>Content-Length: 0.</div><div><br></div><div><br></div><div>xlog entries:</div><div><br></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">Aug 26 08:19:04 mousse openser[15353]: Redirect from UAC intercepted 1 - </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">M=INVITE RURI=<a href="sip:40001@">sip:40001@</a>10.10.0.32:5060;transport=udp </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>D=Contact: <a href="sip:40001@">sip:40001@</a>10.10.0.32:5060;transport=udp, <<a href="sip:10512@">sip:10512@</a>10.10.0.32>;q=0.01, <<a href="sip:10512@">sip:10512@</a>10.10.0.98>;q=0.01 </b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>B=<<a href="sip:10512@">sip:10512@</a>10.10.0.32>;q=0.01, <<a href="sip:10512@">sip:10512@</a>10.10.0.98>;q=0.01 </b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">F=<a href="sip:10521@">sip:10521@</a>devproxy.myip.org T=<a href="sip:40001@">sip:40001@</a>devproxy.myip.org;user=phone IP=10.10.12.140 ID=f7932e23-d89cd014-e3ea20a9@10.10.12.140 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">Aug 26 08:19:04 mousse openser[15353]: Redirect from UAC intercepted 2 - </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">M=INVITE RURI=<a href="sip:10512@">sip:10512@</a>10.10.0.98 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>D=Contact: <a href="sip:10512@">sip:10512@</a>10.10.0.98, <<a href="sip:10512@">sip:10512@</a>10.10.0.32>;q=0.01, <<a href="sip:10512@">sip:10512@</a>10.10.0.98>;q=0.01 </b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>B=<<a href="sip:10512@">sip:10512@</a>10.10.0.32>;q=0.01, <<a href="sip:10512@">sip:10512@</a>10.10.0.98>;q=0.01 </b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">tmp=<a href="sip:10512@">sip:10512@</a>10.10.0.98 F=<a href="sip:10521@">sip:10521@</a>devproxy.myip.org T=<a href="sip:40001@">sip:40001@</a>devproxy.myip.org;user=phone IP=10.10.12.140 ID=f7932e23-d89cd014-e3ea20a9@10.10.12.140 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">Aug 26 08:19:04 mousse openser[15353]: Redirect from UAC intercepted - </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">M=INVITE RURI=<a href="sip:10512@">sip:10512@</a>10.10.0.98 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>D=Contact: <a href="sip:10512@">sip:10512@</a>10.10.0.98, <<a href="sip:10512@">sip:10512@</a>10.10.0.32>;q=0.01, <<a href="sip:10512@">sip:10512@</a>10.10.0.98>;q=0.01, <a href="sip:10512@">sip:10512@</a>10.10.0.98 </b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><b>B=<<a href="sip:10512@">sip:10512@</a>10.10.0.32>;q=0.01, <<a href="sip:10512@">sip:10512@</a>10.10.0.98>;q=0.01, <a href="sip:10512@">sip:10512@</a>10.10.0.98 </b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">F=<a href="sip:10521@">sip:10521@</a>devproxy.myip.org T=<a href="sip:40001@">sip:40001@</a>devproxy.myip.org;user=phone IP=10.10.12.140 ID=f7932e23-d89cd014-e3ea20a9@10.10.12.140 </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div></div></div><div><div><br></div></div></body></html>