<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<font face="monospace">Hi,<br>
<br>
With that approach you still have to do the actual lookup(),
something that Guillaume wants to avoid, AFAIU. I mean if you do
end up doing lookup(), you can check the $socket_out directly :)<br>
<br>
If you want to fetch the socket info WITHOUT doing lookup() (and
affecting the current SIP message), you can do this via the MI
`ul_show_contct` [1] directly via script using the mi_script
module [2]<br>
<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="https://opensips.org/html/docs/modules/3.4.x/usrloc.html#mi_ul_show_contact">https://opensips.org/html/docs/modules/3.4.x/usrloc.html#mi_ul_show_contact</a><br>
[2]
<a class="moz-txt-link-freetext" href="https://opensips.org/html/docs/modules/3.4.x/mi_script.html#func_mi">https://opensips.org/html/docs/modules/3.4.x/mi_script.html#func_mi</a><br>
<br>
Regards,<br>
</font>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
<a class="moz-txt-link-freetext" href="https://www.siphub.com">https://www.siphub.com</a></pre>
<div class="moz-cite-prefix">On 29.03.2024 16:01, Vlad Paiu wrote:<br>
</div>
<blockquote type="cite"
cite="mid:0ce77a75-bd01-4b73-85fc-614bf7ce4e3c@opensips.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>Hello,</p>
<p>You can use
<a class="moz-txt-link-freetext"
href="https://opensips.org/html/docs/modules/3.3.x/registrar.html#param_attr_avp"
moz-do-not-send="true">https://opensips.org/html/docs/modules/3.3.x/registrar.html#param_attr_avp</a>
in order to populate any custom info at save() time and the info
will automatically be populated for you at lookup() time.</p>
<p><br>
</p>
Regards,<br>
Vlad<br>
<p><br>
</p>
<div class="moz-cite-prefix">On 29.03.2024 15:08, <a
class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:guillaume.desgeorge@orange.com"
moz-do-not-send="true">guillaume.desgeorge@orange.com</a>
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:PAVPR02MB9207FBAC5310A1EF8FD4C3A1833A2@PAVPR02MB9207.eurprd02.prod.outlook.com">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<div class="WordSection1">
<p class="MsoNormal"><span>Hi Bogdan,</span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you for your
answer.</span></p>
<p class="MsoNormal"><span lang="EN-US">And is it possible to
use that </span><span lang="EN-US">lookup("location")
function to </span><span lang="EN-US">put the “registered
socket” field in a variable in order to use it for my
script ?</span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> Guillaume</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<div>
<div>
<p class="MsoNormal"><b><span>De :</span></b><span>
Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E"
href="mailto:bogdan@opensips.org"
moz-do-not-send="true"><bogdan@opensips.org></a>
<br>
<b>Envoyé :</b> jeudi 28 mars 2024 11:15<br>
<b>À :</b> OpenSIPS users mailling list <a
class="moz-txt-link-rfc2396E"
href="mailto:users@lists.opensips.org"
moz-do-not-send="true"><users@lists.opensips.org></a>;
DESGEORGE Guillaume INNOV/IT-S <a
class="moz-txt-link-rfc2396E"
href="mailto:guillaume.desgeorge@orange.com"
moz-do-not-send="true"><guillaume.desgeorge@orange.com></a><br>
<b>Objet :</b> Re: [OpenSIPS-Users] How to access to a
column of a location database</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<table class="MsoNormalTable">
<tbody>
<tr>
<td>
<p class="MsoNormal"><strong><span>CAUTION</span></strong><span>
: This email originated outside the company. Do
not click on any links or open attachments
unless you are expecting them from the sender. </span><span></span></p>
</td>
</tr>
<tr>
<td>
<p class="MsoNormal"><strong><span>ATTENTION</span></strong><span>
: Cet e-mail provient de l'extérieur de
l'entreprise. Ne cliquez pas sur les liens ou
n'ouvrez pas les pièces jointes à moins de
connaitre l'expéditeur.</span><span></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><br>
<br>
<span>Hi Guillaume,<br>
<br>
The registered contact (and the additional info) is
fetched via the lookup("location") function. It also sets
the registered socket for the routing the current request.<br>
<br>
Regards,<br>
<br>
</span></p>
<pre>Bogdan-Andrei Iancu</pre>
<pre> </pre>
<pre>OpenSIPS Founder and Developer</pre>
<pre> <a href="https://www.opensips-solutions.com/"
moz-do-not-send="true" class="moz-txt-link-freetext">https://www.opensips-solutions.com</a></pre>
<pre> <a href="https://www.siphub.com/"
moz-do-not-send="true" class="moz-txt-link-freetext">https://www.siphub.com</a></pre>
<div>
<p class="MsoNormal">On 22.03.2024 10:57, <a
href="mailto:guillaume.desgeorge@orange.com"
moz-do-not-send="true" class="moz-txt-link-freetext">
guillaume.desgeorge@orange.com</a> wrote:</p>
</div>
<blockquote>
<p class="MsoNormal"><span>Hi everybody,</span></p>
<p class="MsoNormal"><span lang="EN-US">In my routing logic
of my “opensips.cfg” file, I’m trying to access the
“socket” field of the location table of registered
contacts.</span></p>
<p class="MsoNormal"><span lang="EN-US">I have the
registering informations correctly written in MySQL
location table but can’t find a function to access it.</span></p>
<p class="MsoNormal"><span lang="EN-US">I’d like to have a
function which I give the registered username and can
give me back the associated socket.</span></p>
<p class="MsoNormal"><span lang="EN-US">Is the lookup ()
function the good one ? I didn’t understand how to use
it that way.</span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks for your
help,</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> Guillaume</span></p>
<div>
<p class="MsoNormal"><span>Orange Restricted</span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span> </span></p>
<p><span>Orange Restricted</span></p>
<pre>____________________________________________________________________________________________________________</pre>
<pre>Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc</pre>
<pre>pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler</pre>
<pre>a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,</pre>
<pre>Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.</pre>
<pre> </pre>
<pre>This message and its attachments may contain confidential or privileged information that may be protected by law;</pre>
<pre>they should not be distributed, used or copied without authorisation.</pre>
<pre>If you have received this email in error, please notify the sender and delete this message and its attachments.</pre>
<pre>As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.</pre>
<pre>Thank you.</pre>
<p class="MsoNormal"><span><br>
<br>
</span></p>
<pre>_______________________________________________</pre>
<pre>Users mailing list</pre>
<pre><a href="mailto:Users@lists.opensips.org"
moz-do-not-send="true" class="moz-txt-link-freetext">Users@lists.opensips.org</a></pre>
<pre><a
href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
moz-do-not-send="true" class="moz-txt-link-freetext">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></pre>
</blockquote>
<p class="MsoNormal"><span> </span></p>
</div>
<pre>_________________<wbr>______________________________<wbr>______________________________<wbr>______________________________<wbr>_
Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.
This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.</pre>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:Users@lists.opensips.org" moz-do-not-send="true">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext"
href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
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>
</body>
</html>