<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<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;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi <font style="font-size:11pt" face="Calibri, sans-serif" color="#000000">Răzvan</font>.</p>
<p><br>
</p>
<p>I have tried that idea. But that didn't work. The SIP INVITE message is being changed by the OpenSIPS in a wrong way, in my point of view.</p>
<p>Do you know some way to save the entire SIP INVITE message before calling lookup() and then make the saved message take place after the lookup() execution?</p>
<p><br>
</p>
<p>My original message is:</p>
<p><br>
</p>
<p></p>
<div><span style="color: rgb(0, 111, 201);">INVITE sip:6001@myDomain.com.br SIP/2.0</span><br>
<span style="color: rgb(0, 111, 201);">Via: SIP/2.0/TCP 192.168.21.40:5090;rport;branch=z9hG4bK876727215</span><br>
<span style="color: rgb(0, 111, 201);">From: <sip:crdphmacl_SPnuV5xqtnSX@<span style="color: rgb(0, 111, 201);">myDomain</span>.com.br>;tag=179920819</span><br>
<span style="color: rgb(0, 111, 201);">To: <sip:6001@<span style="color: rgb(0, 111, 201);">myDomain</span>.com.br></span><br>
<span style="color: rgb(0, 111, 201);">Call-ID: 1410250893</span><br>
<span style="color: rgb(0, 111, 201);">CSeq: 21 INVITE</span><br>
<span style="color: rgb(0, 111, 201);">Contact: <sip:crdphmacl_SPnuV5xqtnSX@xxx.yyy.240.204:60033;transport=tcp></span><br>
<span style="color: rgb(0, 111, 201);">Proxy-Authorization: Digest username="crdphmacl_SPnuV5xqtnSX", realm="localhost", nonce="5769458c000001cc263a7c0d6995dc48d42288ec6f8e4048", uri="sip:6001@<span style="color: rgb(0, 111, 201);">myDomain</span>.com.br",
response="0f4c122d2a0a28dea6194c235cd77430", algorithm=MD5</span><br>
<span style="color: rgb(0, 111, 201);">Content-Type: application/sdp</span><br>
<span style="color: rgb(0, 111, 201);">Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO</span><br>
<span style="color: rgb(0, 111, 201);">Max-Forwards: 70</span><br>
<span style="color: rgb(0, 111, 201);">User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)</span><br>
<span style="color: rgb(0, 111, 201);">Subject: Phone call</span><br>
<span style="color: rgb(0, 111, 201);">Content-Length: 227</span></div>
<br>
<p></p>
<p>This is being changed to:</p>
<p><br>
</p>
<p></p>
<div><span style="color: rgb(0, 111, 201);">INVITE <span style="color: rgb(255, 0, 0);">
sip:crdphmacl_SPnuV5xqtnSX@131.221.240.204:60672;transport=tcp;line=c6356a7d87d6f81 SIP/2.0</span></span><br>
<span style="color: rgb(0, 111, 201);">Record-Route: <sip:<span style="color: rgb(0, 111, 201);">myDomain</span>.com.br;transport=tcp;lr;nat=yes;did=0b.b9e0cfe5></span><br>
<span style="color: rgb(0, 111, 201);">Via: SIP/2.0/TCP <span style="color: rgb(0, 111, 201);">
myDomain</span>.com.br:5060;branch=z9hG4bKe2db.49d54587.0;i=1</span><br>
<span style="color: rgb(0, 111, 201);">Via: SIP/2.0/TCP 192.168.21.40:5090;received=<span style="color: rgb(0, 111, 201);">xxx.yyy</span>.240.204;rport=60672;branch=z9hG4bK716249970</span><br>
<span style="color: rgb(0, 111, 201);">From: <sip:crdphmacl_SPnuV5xqtnSX@<span style="color: rgb(0, 111, 201);">myDomain</span>.com.br>;tag=12586028</span><br>
<span style="color: rgb(0, 111, 201);">To: <sip:6001@<span style="color: rgb(0, 111, 201);">myDomain</span>.com.br></span><br>
<span style="color: rgb(0, 111, 201);">Call-ID: 1106771604</span><br>
<span style="color: rgb(0, 111, 201);">CSeq: 21 INVITE</span><br>
<span style="color: rgb(0, 111, 201);">Contact: <sip:crdphmacl_SPnuV5xqtnSX@<span style="color: rgb(0, 111, 201);">xxx.yyy</span>.240.204:60672;transport=tcp></span><br>
<span style="color: rgb(0, 111, 201);">Content-Type: application/sdp</span><br>
<span style="color: rgb(0, 111, 201);">Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO</span><br>
<span style="color: rgb(0, 111, 201);">Max-Forwards: 70</span><br>
<span style="color: rgb(0, 111, 201);">User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)</span><br>
<span style="color: rgb(0, 111, 201);">Subject: Phone call</span><br>
<span style="color: rgb(0, 111, 201);">Content-Length: 224</span></div>
<p></p>
<p><br>
</p>
<p>So, the caller is receiving its own SIP INVITE.<br>
</p>
<p>That is why when A calls B, is A that rings, not B.</p>
<p><br>
</p>
<p>It is becoming a bit complicated. So, I suspect I'm going to the incorrect direction....
<br>
</p>
<p><br>
</p>
<p>Best regards.</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>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> users-bounces@lists.opensips.org <users-bounces@lists.opensips.org> em nome de Răzvan Crainea <razvan@opensips.org><br>
<b>Enviado:</b> terça-feira, 21 de junho de 2016 04:24<br>
<b>Para:</b> users@lists.opensips.org<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?</font>
<div> </div>
</div>
<div>
<p><tt>Hi, Rodrigo!</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Have you tried restoring the R-URI after the caller lookup? Something like:</tt></p>
<p><tt><br>
</tt></p>
<p><tt>$var(ru) = $ru;</tt></p>
<p><tt>lookup("location", "", "$fu"); # this takes the caller from FROM uri, which I think is more suitable than from contact uri</tt></p>
<p><tt>$ru = $var(ru);</tt></p>
<p><tt># continue your processing here<br>
</tt></p>
<p><tt>....</tt></p>
<p><tt># now do the real lookup for the callee</tt></p>
<p><tt>lookup("location");</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Don't do the lookups in the reversed way, because you might loose some contacts.</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Best regards,</tt></p>
<pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a id="LPlnk925360" class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
<div style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;" id="LPBorder_GT_14665081476460.4076791762148423">
<table style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" id="LPContainer_14665081476430.3959761845830473" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" id="TextCell_14665081476440.11327963056423607">
<div id="LPRemovePreviewContainer_14665081476440.715657754829526"></div>
<div style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light","Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; line-height: 21px;" id="LPTitle_14665081476440.178337023690203">
<a target="_blank" href="http://www.opensips-solutions.com/" style="text-decoration: none;" id="LPUrlAnchor_14665081476450.8245898287686168">Home — OpenSIPS Solutions</a></div>
<div style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size: 14px; line-height: 14px;" id="LPMetadata_14665081476450.7986499792204279">
www.opensips-solutions.com</div>
<div style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;" id="LPDescription_14665081476460.5765572521696759">
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is more than a SIP proxy/router as it includes application-level functionalities.</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="moz-cite-prefix">On 06/20/2016 09:02 PM, Rodrigo Pimenta Carvalho wrote:<br>
</div>
<blockquote type="cite">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear OpenSIPS-users,</p>
<p><br>
</p>
<p>The table location has the column attr where I use to <span>store specific additional information for each registration</span>.</p>
<p>Whenever A calls B, I have to read this specific information from the A record and from the B record. That is, I need to get and handle specific information about the caller and callee.</p>
<p><br>
</p>
<p>For the callee, I use to invoke the lookup("location") function that put the needed information in the attr_avp. That is good and works very well. Then, I just have to read the attr_avp to get such specific information.</p>
<p><br>
</p>
<p>For the caller, I use to invoke:</p>
<p><br>
</p>
<p><span style="color:rgb(0,111,201)">$var(aorChamador) = $(ct.fields(uri));</span></p>
<p><span><span style="color:rgb(0,111,201)">lookup("location","","$var(aorChamador)");</span><br>
</span></p>
<p><br>
</p>
<p>However it causes amazing side effect in the SIP signaling. Ex: When A calls B, B stays quiet and A rings. So A can answer A. Crazy!</p>
<p>According to the documentation, lookup will <span><span>overwritten</span></span> the
<span>Request-URI. <span>I guess that is why the SIP signaling become incoherent.</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>How could I get the caller attr specific information without side effects?</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>Any hint will be very helpful!!</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>Best regards.</span></span><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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
</div>
</div>
</body>
</html>