[asterisk-users] Conditional IF based on IP address?

Rushowr rushowr at phreaker.net
Wed Sep 6 12:45:23 MST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rushowr wrote:
> Steve Hsieh wrote:
>> Greetings,
> 
>> Is it possible to create a conditional IF inside extensions.conf based
>> on the source IP address of a SIP phone (as opposed to extension)?  What
>> I would like to do is the following:
> 
> 
>> 1. If SIP phone IP belongs to 192.168.0.0/24 <http://192.168.0.0/24>
>> subnet, set CALLERID=xxxx
>> 2. Else, set CALLERID=yyyy
> 
>> Thanks in advance for any examples or help.
> 
>> Steve
> 
> 
>> ------------------------------------------------------------------------
> 
>> _______________________________________________
>> --Bandwidth and Colocation provided by Easynews.com --
> 
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-users
> Steve, yes you can do it.
> 
> You'll need to use the SIPPEER function (available in trunk only I
> believe) to get ${SIPPEER(ipaddr)}. You can then use Set and If() to do
> what you want.
> 
> SKM

I'm sorry, you need ${SIPPEER(${EXTEN}|ipaddr)} to retrieve the data you
want
_______________________________________________
- --Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: ENCRYPTED WITH GPG

iD8DBQFE/yVTlfQsv7FBhp8RAo2WAJ4kloejXzy1mocv39VgXvoh02BQRACeIxWK
PCOoyQSzurXvUvxaRhD5zn0=
=YU5E
-----END PGP SIGNATURE-----



More information about the asterisk-users mailing list