[OpenSIPS-Users] check_address() causes crash

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Oct 19 20:00:47 CEST 2009


Hi Jeff,


Jeff Pyle wrote:
> Irina,
>
> In this case $rd was an IP address, freshly loaded from a
> lookup("location"). 
well, there is no guarantee that after the lookup() you will have an IP 
in the domain part - it is up to the client what contact it uploaded 
(and you accepted :P )
>  But, going forward, you're right, this isn't a great
> way to do it.  Any suggestions on how to get the IP of the where the message
> will go if it were to hit a t_relay(), for example?
>   
you cannot know it prior to t_relay() - IP the RURI is an IP, then is 
fine, but if the RURI is a domain, the translation from domain to IP 
(via DNS) is done internally by t_relay(), so you do not have access to it.


not sure what you try to do, but maybe you should consider the blacklist 
capability of opensips:
       http://www.opensips.org/Resources/DocsCoreFcn16#toc45

Regards,
Bogdan
> I'll update and see if it still crashes.
>
>
> Thanks,
> Jeff
>
>
>
> On 10/15/09 9:21 AM, "Irina Stanescu" <ironmissy at gmail.com> wrote:
>
>   
>> Hello Jeff,
>>
>> I managed to get a core dump only when the second parameter of the
>> check_address is empty. 
>> I added a check for that (rev. 6272), so it shouldn't crash anymore.
>>
>> Also, you can use "$rd" as the second parameter only if the domain name is an
>> ip address, otherwise it won't work.
>>
>> Thanks!
>>
>> Irina Stanescu
>>
>> On Wed, Oct 14, 2009 at 10:43 PM, Jeff Pyle <jpyle at fidelityvoice.com> wrote:
>>     
>>> Hello,
>>>
>>> I have the following:
>>>
>>>         if (check_address("10", "$rd", "0", "$proto")) {
>>>                setflag(7);
>>>         }
>>>
>>> In many cases, and I can't seem to determine what those cases are, this
>>> causes the system to run very slowly for about 30 seconds, and then Opensips
>>> exits.
>>>
>>> I need to know if the source or destination IP addresses fall into one of
>>> the blocks included in group 10 of the address table.
>>> check_source_address() works great with Irina's fix; this is the destination
>>> half.  It tanks the system.
>>>
>>> On the doc page it says:
>>>   Transport protocol is either "ANY" or any valid transport protocol value:
>>> "UDP, "TCP", "TLS", and "SCTP".
>>>
>>> Is case relevant?  Is lowercase just as valid as the uppercase examples?
>>>
>>>
>>>
>>> - Jeff
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>       
>>     
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   




More information about the Users mailing list