<div dir="ltr">That should probably be: <span style="font-family:arial,sans-serif;font-size:13px"> <condition field="${sip_req_host}" expression="^62\.180\.237\.73$</span><span style="font-family:arial,sans-serif;font-size:13px">"></span><div>
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">/Peter</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/8/21 Grant Bagdasarian <span dir="ltr"><<a href="mailto:GB@cm.nl" target="_blank">GB@cm.nl</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple">
<div><p class="MsoNormal">The following line: <condition field="sip_req_host" expression="^10\.0\.0\.1$"><u></u><u></u></p><p class="MsoNormal">Should be <condition field="sip_req_host" expression="^62\.180\.237\.73$"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Wrong sample.<u></u><u></u></p><p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Grant Bagdasarian <br>
<b>Sent:</b> Wednesday, August 21, 2013 1:50 PM<br><b>To:</b> FreeSWITCH Users Help (<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>)<br><b>Subject:</b> Matching context based on sip_req_host<u></u><u></u></span></p>
</div></div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Hello,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I want to match a context based on the value of sip_req_host, but the context isn’t matched.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> <extension name="internal_to_external"><u></u><u></u></p><p class="MsoNormal"> <condition field="sip_req_host" expression="^10\.0\.0\.1$"><u></u><u></u></p>
<p class="MsoNormal"> <action application="set" data="hangup_after_bridge=false"/><u></u><u></u></p><p class="MsoNormal"> <action application="set" data="continue_on_fail=true"/><u></u><u></u></p>
<p class="MsoNormal"> <action application="bridge" data="sofia/external/${sip_req_uri}"/><u></u><u></u></p><p class="MsoNormal"> </condition><u></u><u></u></p><p class="MsoNormal">
</extension><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Debug output:<u></u><u></u></p><p class="MsoNormal">Dialplan: <a href="mailto:sofia/internal/31765727000@192.168.18.6" target="_blank">sofia/internal/31765727000@192.168.18.6</a> Regex (FAIL) [internal_to_external] sip_req_host() =~ /^62\.180\.237\.73$/ break=on-false<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks!<u></u><u></u></p></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>