<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p><br>
</p>
<p>Dear SIPusers,</p>
<p><br>
</p>
<p>In my project I use to keep a valuable information in table location. This is about the state of a subscriber's localization.</p>
<p>I have to read such information for the callees, every time a new branch is created and every time a INVITE is answered with SIP OK.</p>
<p>So, my OpenSIPS configuration has something similar to the following code:</p>
<p><br>
</p>
<p><span>1 route{</span></p>
<p>2 ... // hidden code for simplification.<br>
</p>
<p>3 <span>lookup("location","m")</span></p>
<p>4 ...<br>
</p>
<p>5 <span> route(relay);</span><br>
</p>
<p>6 }</p>
<p><br>
</p>
<p><span>7 route[relay]</span>{</p>
<p></p>
<div>8 if (is_method("INVITE")) { <br>
9 ...<br>
10 t_on_branch("per_branch_ops"); <br>
11 t_on_reply("handle_nat"); <br>
12 t_on_failure("missed_call"); <br>
13 } </div>
<p></p>
14 ...
<p>15 }</p>
<p><br>
</p>
<p><span>16 branch_route[per_branch_ops] { <br>
17 ....</span></p>
<p><span><span>18 $(avp(attr)[$T_branch_idx])</span><br>
</span></p>
<p><span>19 ...<br>
</span></p>
<p><span>20 }</span></p>
<p><span><br>
</span></p>
<p><span><span>21 onreply_route[handle_nat] {</span><br>
</span></p>
<p><span>22 ...</span></p>
<p><span>23 <span>$(avp(attr)[$T_branch_idx])</span><br>
</span></p>
<p><span>24 ...<br>
</span></p>
<p><span>25 }</span></p>
<p>26 ...<br>
</p>
<p><br>
</p>
<p>In a determined call, when the OpenSIPS receives the INVITE and then a SIP OK (200), the code gets right value in lines 18 and 23.</p>
<p>In such call, the SIP OK (from callee) offers a kind of video that the caller can't support. In this case the caller sends another SIP INVITE with inactive video (SDP).</p>
<p>In this moment, OpenSIPS gets this second INVITE and create a new branch.</p>
<p>However, for this new branch, lines 18 and 23 give me NULL for <span><span>$(avp(attr)[$T_branch_idx])</span></span>.</p>
<p><br>
</p>
<p>How to solve this issue?</p>
<p><br>
</p>
<p>Any hint will be very helpful!!</p>
<p><br>
</p>
<p>Best regards!</p>
<p><br>
</p>
<p>P.S.: I'm not expert in SIP.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: +55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
</div>
</body>
</html>