Hi, I want my FS to entertain only those calls which are coming from a specific IP address . For this, I have defined a profile in vars.xml as <X-PRE-PROCESS cmd="set" data="profile_00=192.168.4.10"/>. & another line in public.xml as <extension name="transfer_to_context_01"> <condition field="${sip_from_host}" expression="$${profile_00}"> <action application="transfer" data="${destination_number} XML sharad"/> </condition> </extension> As per my understanding, if call is coming from 192.168.4.10, that call should be processed as per the context `sharad'.....correct ? Yes, it works like this. Upto here all is ok. But if the call is coming from 192.168.100 - 192.168.4.109, these calls also are processed as per context `sharad'. Means entire IP is not matched by condition field. Is there any solution for this. Requesting all of you to help me in this regard. Regards Sharad
You need to escape the dots, ie 192\.168\.4\.10. That should make things work as expected. /Peter Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För sharad Skickat: den 29 juni 2011 09:47 Till: freeswitch-users@lists.freeswitch.org Ämne: [Freeswitch-users] SIP Profile Hi, I want my FS to entertain only those calls which are coming from a specific IP address . For this, I have defined a profile in vars.xml as <X-PRE-PROCESS cmd="set" data="profile_00=192.168.4.10"/>. & another line in public.xml as <extension name="transfer_to_context_01"> <condition field="${sip_from_host}" expression="$${profile_00}"> <action application="transfer" data="${destination_number} XML sharad"/> </condition> </extension> As per my understanding, if call is coming from 192.168.4.10, that call should be processed as per the context `sharad'.....correct ? Yes, it works like this. Upto here all is ok. But if the call is coming from 192.168.100 - 192.168.4.109, these calls also are processed as per context `sharad'. Means entire IP is not matched by condition field. Is there any solution for this. Requesting all of you to help me in this regard. Regards Sharad !DSPAM:4e0ada5632766217057301!
Yes, if you take this route, do what Peter said.. but mostly the issue is: <X-PRE-PROCESS cmd="set" data="profile_00=192.168.4.10"/>. <condition field="${sip_from_host}" expression="$${profile_00}"> So the match is: "it must CONTAIN the variable" - what you want is "it must BE the variable" To do it properly would be: <condition field="${sip_from_host}" expression="^$${profile_00}$"> Anyway, Steven's solution is much better. -Avi Marcus On Wed, Jun 29, 2011 at 11:03 AM, Peter Olsson <peter.olsson@visionutveckling.se> wrote:
You need to escape the dots, ie 192\.168\.4\.10. That should make things work as expected.
/Peter
Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För sharad Skickat: den 29 juni 2011 09:47 Till: freeswitch-users@lists.freeswitch.org Ämne: [Freeswitch-users] SIP Profile
Hi,
I want my FS to entertain only those calls which are coming from a specific IP address .
For this, I have defined a profile in vars.xml as
<X-PRE-PROCESS cmd="set" data="profile_00=192.168.4.10"/>.
& another line in public.xml as
<extension name="transfer_to_context_01">
<condition field="${sip_from_host}" expression="$${profile_00}">
<action application="transfer" data="${destination_number} XML sharad"/>
</condition>
</extension>
As per my understanding, if call is coming from 192.168.4.10, that call should be processed as per the context `sharad'.....correct ?
Yes, it works like this. Upto here all is ok.
But if the call is coming from 192.168.100 - 192.168.4.109, these calls also are processed as per context `sharad'.
Means entire IP is not matched by condition field.
Is there any solution for this.
Requesting all of you to help me in this regard.
Regards
Sharad
!DSPAM:4e0ada5632766217057301!
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thanks to all of you you provided the solution. I think the below solution suits my requirement & it works exactly as my requirement is. Thanks Marcus... Best Regards Sharad ----- Original Message ----- From: "Avi Marcus" <avi@avimarcus.net> To: "FreeSWITCH Users Help" <freeswitch-users@lists.freeswitch.org> Sent: Wednesday, June 29, 2011 6:11 PM Subject: Re: [Freeswitch-users] SIP Profile Yes, if you take this route, do what Peter said.. but mostly the issue is: <X-PRE-PROCESS cmd="set" data="profile_00=192.168.4.10"/>. <condition field="${sip_from_host}" expression="$${profile_00}"> So the match is: "it must CONTAIN the variable" - what you want is "it must BE the variable" To do it properly would be: <condition field="${sip_from_host}" expression="^$${profile_00}$"> Anyway, Steven's solution is much better. -Avi Marcus On Wed, Jun 29, 2011 at 11:03 AM, Peter Olsson <peter.olsson@visionutveckling.se> wrote:
You need to escape the dots, ie 192\.168\.4\.10. That should make things work as expected.
/Peter
Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För sharad Skickat: den 29 juni 2011 09:47 Till: freeswitch-users@lists.freeswitch.org Ämne: [Freeswitch-users] SIP Profile
Hi,
I want my FS to entertain only those calls which are coming from a specific IP address .
For this, I have defined a profile in vars.xml as
<X-PRE-PROCESS cmd="set" data="profile_00=192.168.4.10"/>.
& another line in public.xml as
<extension name="transfer_to_context_01">
<condition field="${sip_from_host}" expression="$${profile_00}">
<action application="transfer" data="${destination_number} XML sharad"/>
</condition>
</extension>
As per my understanding, if call is coming from 192.168.4.10, that call should be processed as per the context `sharad'.....correct ?
Yes, it works like this. Upto here all is ok.
But if the call is coming from 192.168.100 - 192.168.4.109, these calls also are processed as per context `sharad'.
Means entire IP is not matched by condition field.
Is there any solution for this.
Requesting all of you to help me in this regard.
Regards
Sharad
!DSPAM:4e0ada5632766217057301!
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
There are also a few other ways to handle this before the dialplan: 1) ACL on the profile that restricts dialing in to 192.168.4.10 2) User account with cidr="192.168.4.10" and <variable name="user_context" value="sharad"/> First would prevent anyone calling in except from your IP. Second would automatically authenticate anything from that IP as your user and handle it in the shared context, anyone else would be calling in unauthenticated into the default context. -Steve On 29 June 2011 08:47, sharad <sharad@coraltele.com> wrote:
**
Hi,
I want my FS to entertain only those calls which are coming from a specific IP address .
For this, I have defined a profile in vars.xml as
<X-PRE-PROCESS cmd="set" data="profile_00=192.168.4.10"/>.
& another line in public.xml as
<extension name="transfer_to_context_01">
<condition field="${sip_from_host}" expression="$${profile_00}">
<action application="transfer" data="${destination_number} XML sharad"/>
</condition>
</extension>
As per my understanding, if call is coming from 192.168.4.10, that call should be processed as per the context `sharad'.....correct ?
Yes, it works like this. Upto here all is ok.
But if the call is coming from 192.168.100 - 192.168.4.109, these calls also are processed as per context `sharad'.
Means entire IP is not matched by condition field.
Is there any solution for this.
Requesting all of you to help me in this regard.
Regards
Sharad
_______________________________________________ Join us at ClueCon 2011, Aug 9-11, Chicago http://www.cluecon.com 877-7-4ACLUE
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (4)
-
Avi Marcus
-
Peter Olsson
-
sharad
-
Steven Ayre