VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
ex.vitorino at gmail.com Guest
|
Posted: Thu Mar 13, 2008 5:58 am Post subject: [asterisk-users] How to find out the IP of the calling party |
|
|
On Thu, Mar 13, 2008 at 3:47 AM, Gonzalo Servat <gservat at gmail.com> wrote:
Quote: |
I can't find any channel variable that gives me this info.
|
Gonzalo,
With SIP callers you can get the address from the SIPURI channel variable.
IAX does not seem to have an equivalent var... The best I could find is the
output of "iax2 show channels" on the CLI wich seems to include the peer IP
for running channels.
Good luck,
--
exvito |
|
Back to top |
|
|
ex.vitorino at gmail.com Guest
|
Posted: Thu Mar 13, 2008 6:05 am Post subject: [asterisk-users] How to find out the IP of the calling party |
|
|
Improvement: also check the funcions SIPCHANINFO and IAXPEER... With
this and the SIPURI channel variable you should be able to have all the info.
Cheers,
--
exvito |
|
Back to top |
|
|
rizwanhasham at gmail.com Guest
|
Posted: Fri Mar 14, 2008 6:01 am Post subject: [asterisk-users] How to find out the IP of the calling party |
|
|
I dont know about IAX, but for SIP users you can use the function
SIP_HEADER(headername) to get the information u need from the sip packets.
for example you can use SIP_HEADER(From) which will give you the From header
containing the IP address of the caller. You will have to apply regex on it
to extract the ip.
On Thu, Mar 13, 2008 at 8:47 AM, Gonzalo Servat <gservat at gmail.com> wrote:
Quote: | Hi All,
I'm trying to achieve the following:
- If <sip/iax user> logs in from home, they can dial internal extensions
only (this is to avoid employees going wild on local/mobile calls from home)
- If <sip/iax user> logs in from the office, they can call anyone they
want.
Since I have my users defined in an LDAP tree, I'd like to stick to
one-account-per-user (each account is setup for both - IAX and SIP logins -
to allow the employee to use IAX from home and SIP at work, or whatever
combination they prefer).
So, I thought I would simply look at the IP address of the originating
call. If the SIP/IAX user has an IP address outside the local subnet ->
allow calls to extensions only. Else -> allow all. I thought the best way of
doing this would be using AGI with a Perl script. The only problem I'm
having is determining the IP address of the originating call. I can't find
any channel variable that gives me this info.
The reason why I mentioned that I'd like to stick to one-account-per-user
is that I know I could fix this simply by having 2 accounts per user (one
that allows connections from the local subnet, and the other to login from
outside and use different contexts for each), but it'd be much nicer to
avoid having 2 accounts per user.
If anyone has any suggestions on how to achieve the above, I'd love to
read them!
Thanks in advance.
Gonzalo
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
|
--
Best Regards
Rizwan Hisham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080314/ee772dde/attachment.htm |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|