Hi,

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 :)

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]


[1] https://opensips.org/html/docs/modules/3.4.x/usrloc.html#mi_ul_show_contact
[2] https://opensips.org/html/docs/modules/3.4.x/mi_script.html#func_mi

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 29.03.2024 16:01, Vlad Paiu wrote:

Hello,

You can use https://opensips.org/html/docs/modules/3.3.x/registrar.html#param_attr_avp in order to populate any custom info at save() time and the info will automatically be populated for you at lookup() time.


Regards,
Vlad


On 29.03.2024 15:08, [email protected] wrote:

Hi Bogdan,

Thank you for your answer.

And is it possible to use that lookup("location") function to put the “registered socket” field in a variable in order to use it for my script ?

Regards,

  Guillaume

*De :*Bogdan-Andrei Iancu <[email protected]>
*Envoyé :* jeudi 28 mars 2024 11:15
*À :* OpenSIPS users mailling list <[email protected]>; DESGEORGE Guillaume INNOV/IT-S <[email protected]> *Objet :* Re: [OpenSIPS-Users] How to access to a column of a location database

*CAUTION*: This email originated outside the company. Do not click on any links or open attachments unless you are expecting them from the sender.

*ATTENTION*: 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.



Hi Guillaume,

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.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 22.03.2024 10:57, [email protected] wrote:

    Hi everybody,

    In my routing logic of my “opensips.cfg” file, I’m trying to
    access the “socket” field of the location table of registered
    contacts.

    I have the registering informations correctly written in MySQL
    location table but can’t find a function to access it.

    I’d like to have a function which I give the registered username
    and can give me back the associated socket.

    Is the lookup () function the good one ? I didn’t understand how
    to use it that way.

    Thanks for your help,

       Guillaume

    Orange Restricted

    Orange Restricted

    
____________________________________________________________________________________________________________

    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.



    _______________________________________________

    Users mailing list

    [email protected]

    http://lists.opensips.org/cgi-bin/mailman/listinfo/users

____________________________________________________________________________________________________________
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.

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to