[Freeswitch-users] Matching context based on sip_req_host

Peter Olsson peter at olssononline.se
Wed Aug 21 16:25:44 MSD 2013


That should probably be:  <condition field="${sip_req_host}"
expression="^62\.180\.237\.73$">

/Peter


2013/8/21 Grant Bagdasarian <GB at cm.nl>

> The following line: <condition field="sip_req_host"
> expression="^10\.0\.0\.1$">****
>
> Should be  <condition field="sip_req_host" expression="^62\.180\.237\.73$">
> ****
>
> ** **
>
> Wrong sample.****
>
> ** **
>
> *From:* Grant Bagdasarian
> *Sent:* Wednesday, August 21, 2013 1:50 PM
> *To:* FreeSWITCH Users Help (freeswitch-users at lists.freeswitch.org)
> *Subject:* Matching context based on sip_req_host****
>
> ** **
>
> Hello,****
>
> ** **
>
> I want to match a context based on the value of sip_req_host, but the
> context isn’t matched.****
>
> ** **
>
>     <extension name="internal_to_external">****
>
>       <condition field="sip_req_host" expression="^10\.0\.0\.1$">****
>
>         <action application="set" data="hangup_after_bridge=false"/>****
>
>         <action application="set" data="continue_on_fail=true"/>****
>
>         <action application="bridge" data="sofia/external/${sip_req_uri}"/>
> ****
>
>       </condition>****
>
>     </extension>****
>
> ** **
>
> Debug output:****
>
> Dialplan: sofia/internal/31765727000 at 192.168.18.6 Regex (FAIL)
> [internal_to_external] sip_req_host() =~ /^62\.180\.237\.73$/ break=on-false
> ****
>
> ** **
>
> I checked with an online regex validator and it seems that the first and
> last ‘/’ character is causing it to not match. I’m not a regex expert, so I
> would appreciate it if someone could help me out with this.****
>
> ** **
>
> Thanks!****
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130821/c7cfc975/attachment.html 


Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list