[SR-Users] Finding advertised address of socket

Daniel-Constantin Mierla miconda at gmail.com
Fri Jun 24 14:40:37 CEST 2022


$fsn gives the socket name, probably $fsa can be added (as shortcut) for
getting the advertised address. Otherwise, if you use 5.6.x, see the
$lsock(...) variable, it should offer what you need.



On 24.06.22 10:53, Tor Petterson wrote:
> $fs gives me the address of the socket. Is there a way to find the
> advertised address?
> ------------------------------------------------------------------------
> *From:* sr-users <sr-users-bounces at lists.kamailio.org> on behalf of
> Daniel-Constantin Mierla <miconda at gmail.com>
> *Sent:* Tuesday, June 21, 2022 13:18
> *To:* Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
> *Subject:* Re: [SR-Users] Finding advertised address of socket
>  
>
> 	
> You don't often get email from miconda at gmail.com. Learn why this is
> important <https://aka.ms/LearnAboutSenderIdentification>
> 	
>

It is indeed important not to get often emails from me, that means
Kamailio just works :-) !


Cheers,
Daniel


> If dispatcher sets a socket for sending out, you can get its address
> with $fs.
>
>
> Also, there is a mode parameter for dispatcher that allows you to
> specify you want the socket value from attributes to be set as string
> in a field of an xavp -- right now I have now quick option to check it
> myself and point to it, just look at the dispatcher readme.
>
>
> Cheers,
> Daniel
>
>
> On 21.06.22 12:14, Tor Petterson wrote:
>> I guess I didn't explain myself well enough.
>> I would like to find the socket address programatically from the
>> kamailio.cfg script.
>> so after I do this:
>>         if (ds_select_domain($var(dispgroup), "4")) {
>>                 xavp_params_explode($xavp(dsdst=>attrs), "dstattr");
>>
>> is there a way to get the IP address of the selected socket?
>> ------------------------------------------------------------------------
>> *From:* sr-users <sr-users-bounces at lists.kamailio.org>
>> <mailto:sr-users-bounces at lists.kamailio.org> on behalf of Mathias
>> WOLFF <mathias at celea.org> <mailto:mathias at celea.org>
>> *Sent:* Tuesday, June 21, 2022 11:58
>> *To:* Kamailio \(SER\) - Users Mailing List
>> <sr-users at lists.kamailio.org> <mailto:sr-users at lists.kamailio.org>
>> *Subject:* Re: [SR-Users] Finding advertised address of socket
>>  
>> Hello,
>> Yes, you can add it in the configuration file, it is the 'socket' ->
>> used to set the sending socket for the gateway. It is used for
>> sending the SIP traffic as well as OPTIONS keepalives.
>>
>> Regards
>>
>> .....................................................................
>> Mathias WOLFF
>> Tel : +33 9.72.13.22.62
>> Gsm : +33 6.79.59.43.32
>> .....................................................................
>> *CONFIDENTIALITE.*
>> Cet email (y compris les éventuelles pièces jointes) peut contenir
>> des informations confidentielles. Il ne peut être utilisé que pour la
>> finalité pour laquelle il a été envoyé. Au cas où il ne vous serait
>> pas destiné, merci de le supprimer et d'en avertir l'expéditeur.
>> *CONFIDENTIALITY.*
>> This email (including any attachments) may contain confidential
>> information. It may not be used other than for the purpose for which
>> it has been sent. If you are not the intendedrecipient, please delete
>> it and notify the sender.
>>
>>
>> Envoyé avec la messagerie sécurisée Proton Mail
>> <https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fproton.me%2F&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=subNKhnEcjgOtD5bA%2F1uUJMiwazLI4xBFWMFOlp5rmk%3D&reserved=0>.
>>
>>
>> ------- Original Message -------
>> Le mardi 21 juin 2022 à 11:53, Tor Petterson
>> <tor.petterson at enreach.com> <mailto:tor.petterson at enreach.com> a écrit :
>>
>>> Hi
>>>
>>> I have a setup where Kamailio is connected to several telephony
>>> providers using different IP addresses to communicate with them.
>>> So I have a socket per provider.
>>> I am using the dispatcher module to route calls to the different
>>> providers.
>>> My question is if there is a way to get the advertised address of
>>> the socket chosen by dispatcher?
>>> I have a socket pointer in the XAVP, but I can't figure out if it is
>>> possible to get the advertised address from it somehow.
>>>
>>> Thanks in advance.
>>> Tor
>>
>>
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>   * sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>> Important: keep the mailing list in the recipients, do not reply only to the sender!
>> Edit mailing list options or unsubscribe:
>>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=PQd%2BUQysjsANnTAJOA0zJaqx62pGlIUYo7ghQe4mYdc%3D&reserved=0>
> -- 
> Daniel-Constantin Mierla -- www.asipto.com <https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.asipto.com%2F&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Js5VGv01flw12CJCfVrjDH046B7xOnSqAc8ZC6uC8vA%3D&reserved=0>
> www.twitter.com/miconda <https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.twitter.com%2Fmiconda&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=sxW4nuTePoV%2F0IoKTw8sSrHAVIRUlAkzthXR9FBDtA4%3D&reserved=0> -- www.linkedin.com/in/miconda <https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.linkedin.com%2Fin%2Fmiconda&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=HKYJndO%2FV0YyneNfoVj%2BnMBFLLvzWyzRVG5PlmHBioc%3D&reserved=0>
> Kamailio Advanced Training - Online: June 20-23, 2022
>   * https://www.asipto.com/sw/kamailio-advanced-training-online/ <https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.asipto.com%2Fsw%2Fkamailio-advanced-training-online%2F&data=05%7C01%7Ctor.petterson%40enreach.com%7Ca9bdf0aa7c914a1bb36008da5377f22e%7C33733f45cfce4d1e9d174adfad5af331%7C0%7C0%7C637914072320647703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=m2ic%2BcPwxnObl8sYckw%2Bd5f%2BNjmqTDLMP2DS4t5jhZA%3D&reserved=0>

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online: June 20-23, 2022
  * https://www.asipto.com/sw/kamailio-advanced-training-online/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220624/532f501c/attachment.htm>


More information about the sr-users mailing list