[OpenSIPS-Users] Is there some way to set Alias at execution time (dinamically) - Everything is ok now!

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Jan 22 10:26:58 CET 2016


I'm glad you managed to solve the problem.

Regards,

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

On 21.01.2016 18:50, Rodrigo Pimenta Carvalho wrote:
>
> Hi Bogdan-Andrei.
>
>
> Now everything is Ok! I have followed your instructions and I got my 
> system working very well.
>
> The configuration I'm using now is:
>
>
> a) no Alias in cfg file
>
> b) executed command: opensipsctl domain add <mydomain>
>
> c) in cfg file, for route, I put:
>
>
>              avp_db_query("select domain from domain", 
> "$avp(DOMAIN)");        #table domain will never has more than 1 domain.
>              set_advertised_address("$avp(DOMAIN)");
>
>
> If you see any problem in my idea, comment, please.
>
> Thank you very much for help me!
>
> Best regards.
>
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center - BRAZIL
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> ------------------------------------------------------------------------
> *De:* Bogdan-Andrei Iancu <bogdan at opensips.org>
> *Enviado:* quinta-feira, 21 de janeiro de 2016 08:54
> *Para:* Rodrigo Pimenta Carvalho; users at lists.opensips.org
> *Assunto:* Re: [OpenSIPS-Users] Is there some way to set Alias at 
> execution time (dinamically)?
> Hi Rodrigo,
>
> To make things simpler to explain : when you use advertised_address, 
> basically you add a new SIP domain to your server (the external IP you 
> are advertising). In a static setup, you can do the trick by using the 
> alias global param (to add a new SIP domain to be handled by 
> OpenSIPS). If you want to handle SIP domains in a dynamic way, use the 
> domain module.
> So, even from users perspective you have a single SIP domain, because 
> of the advertise you actually do create a new SIP domain you need to 
> handle (recognize) in script.
>
> Regards,
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
> <http://www.opensips-solutions.com/>
> 	
> Home — OpenSIPS Solutions <http://www.opensips-solutions.com/>
> www.opensips-solutions.com
> 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.
>
> On 20.01.2016 19:31, Rodrigo Pimenta Carvalho wrote:
>>
>> Hi Bogdan-Andrei.
>>
>>
>> I have just studied the Domain Module. But I still wasn't able to 
>> visualize how it can help me.
>>
>> According to the documentation: "Domain module implements checks that 
>> based on domain table determine if a host part of an URI is “local” 
>> or not. A “local” domain is one that the proxy is responsible for. "
>>
>> However, in my project there will be always only one proxy and only 
>> one domain. Every sip client will be part of the same unique domain 
>> and the unique proxy must be responsible for every message it 
>> receives. So, the proxy doesn't have to check if a host part of an 
>> URI is “local” or not.  For my project, it must be always considered 
>> as local. In this case, my proxy have to handle every message as 
>> responsible for it.
>>
>>
>> So, I have the following doubts:
>>
>> 1 - If I use Domain module and just put that unique domain in the 
>> domain table, will it be enough to make OpenSIPS handle every message 
>> as being responsible for it? That is, will OpenSIPS automatically 
>> become responsible for messages with host part of an URI equals to 
>> domain in database?
>>
>>
>> 2 - If the answer for (1) is no (and I guess so), is there a way to 
>> force OpenSIPS handle ACK messages as being responsible for it? ( I 
>> have cases when RR header field has the proxy's domain, which 
>> translate to a public IP and it makes the OpenSIPS consider itself 
>> not responsible for the ACK messages. Just when RR has a local IP the 
>> OpenSIPS considers itself as responsible.).
>>
>>
>> 3 - If the answer for (2) is no, should I change the Route header 
>> fields of ACK messages (maybe removing that one with public address), 
>> to force OpenSIPS be responsible for the messages?
>>
>>
>> 4 - If the answer for (3) is no, should the client invert the order 
>> of RR header fields, so that the proxy will consider first the one 
>> with local address and then will become responsible for it? (I have 
>> cases when RR has 2 addresses, one local and one public)
>>
>>
>> Until now, the workaround was the use of Alias, as you tell me to do. 
>> But, as long as I can't continue using a static Alias, I have to 
>> abandon this.
>>
>>
>> Sorry the big message.
>>
>> Any hint will be very helpful!
>>
>>
>> Best regards.
>>
>>
>>
>>
>>
>> RODRIGO PIMENTA CARVALHO
>> Inatel Competence Center
>> Software
>> Ph: +55 35 3471 9200 RAMAL 979
>>
>>
>> ------------------------------------------------------------------------
>> *De:* Bogdan-Andrei Iancu <bogdan at opensips.org>
>> *Enviado:* quarta-feira, 20 de janeiro de 2016 10:31
>> *Para:* OpenSIPS users mailling list; Rodrigo Pimenta Carvalho
>> *Assunto:* Re: [OpenSIPS-Users] Is there some way to set Alias at 
>> execution time (dinamically)?
>> Hi Rodrigo,
>>
>> Use the domain module to list aliases via DB ; and in your script, 
>> where you have the "myself" checks use one of the functions from 
>> domain module:
>>     is_from_local() or is uri_host_local()
>> See:
>> http://www.opensips.org/html/docs/modules/2.1.x/domain.html
>> Domain Module - OpenSIPS 
>> <http://www.opensips.org/html/docs/modules/2.1.x/domain.html>
>> www.opensips.org
>> Domain module implements checks that based on domain table determine 
>> if a host part of an URI is “ local ” or not. A “ local ” domain is 
>> one that the proxy is ...
>>
>>
>>
>> Regards,
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developer
>> http://www.opensips-solutions.com
>> On 19.01.2016 20:00, Rodrigo Pimenta Carvalho wrote:
>>>
>>> Dear OpenSIPS-users,
>>>
>>>
>>> I have used the global parameter Alias successful. The same for 
>>> advertised_address.
>>>
>>>
>>> Now, I have to configure these values at execution time. Such values 
>>> will be determined just after starting my system. So, I need a way 
>>> to configure these values in a dynamic way.
>>>
>>>
>>> Then, I will use the core function set_advertised_address.
>>>
>>> But, I did not find a core function to set the Alias at execution time?
>>>
>>>
>>> Is there a way to set Alias at execution time? Is there a function 
>>> for that or can I set Alias with a database query. Ex: Alias = 
>>> select from....
>>>
>>>
>>> Any hint will be very helpful!
>>>
>>>
>>> Best regards.
>>>
>>>
>>> RODRIGO PIMENTA CARVALHO
>>> Inatel Competence Center
>>> Software
>>> Ph: +55 35 3471 9200 RAMAL 979
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160122/6cb7683d/attachment-0001.htm>


More information about the Users mailing list