[Users] determining originating address

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu Nov 2 15:10:04 CET 2006


Hi,

the most trivial way is:

if (src_ip==111.222.111.222) {
}

regards,
bogdan

Norman Brandinger wrote:

> Perhaps the Source IP address pseudo variable is what you are looking 
> for.
>
> Reference to it can be found at: 
> http://openser.org/docs/pseudo-variables-1.1.x.htm
> Section: 3.45. IP source address
>
> With $si on one side of the equation, you need something on the other 
> side.
> This can be perhaps a hardcoded IP address or perhaps an $avp() variable.
> Pretty much any business logic can be used to pull an IP out of a 
> database table and put it into an avp variable.
>
> With $si on one side of the equation and an $avp() on the other, you 
> can then perform various comparisons.
>
> Another approach might be to use the permissions module and the 
> "trusted" table.
> Using this method, a simple "allow_trusted()" call can be made to 
> determine is an address is "trusted".
>
> Hope this helps.
>
> Regards,
> Norm
>
>
>
>
>
>
> Mark Price wrote:
>
>> What is the best way to detect whether an INVITE message came from a 
>> certain
>> IP address?
>> I.e. if a call comes from a certain asterisk box?
>>
>> I have thought of using the textops search(), but this seems a little
>> clumsy.
>> Perhaps there is a way to get directly at the via headers?
>> Or is there a keyword of corresponding functionality to the uri keyword?
>>
>>
>> Thanks,
>> Mark Price
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/users
>>   
>
>
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>





More information about the Users mailing list