[Freeswitch-users] Regex

T Fred Farmington tfred31 at yahoo.com
Mon Mar 9 16:23:01 MSK 2015


First, I use the following site (there are many others as well) to test any RegEx expressions that I intend to use
    https://www.regex101.com/
On that site I select the "Unit Tests", enter a number of test strings into the Add Test, and then click on the right arrow above the test strings to execute the test

But looking at the RegEx that you have written, it would REQUIRE: that the string begin with both 9 & 0 and then be followed by 10 digits.
The 'captured' value would be that within the parenthesis  ( 0nnnnnnnnnn )   which would be used by subsequent code (extensions, outside numbers, passed to 'wph-office', etc.)

Within your freeswitch.log file you should be able to see if that particular 'extension' is executed.
Do a search for    wph_out_work    and see if it is listed.   If so, they you should be able to see   PASS  or  FAIL  on the RegEx  that it received.
If it is not found by the Search, then something else might be 'intercepting' the number before it ever gets to that 'extension'

If all that looks good, then I'd look into whether or not you should be using  'bridge'  instead of  'transfer' 

Good Luck






--------------------------------------------
On Sat, 3/7/15, Richard Mace <richard.mace at gmail.com> wrote:

 Subject: [Freeswitch-users] Regex
 To: "FreeSWITCH Users Help" <freeswitch-users at lists.freeswitch.org>
 Date: Saturday, March 7, 2015, 2:42 AM
 
 Hi,Can I just confirm that the
 following:
     <extension
 name="wph_out_work">      <condition
 field="destination_number"
 expression="^9(0\d{10})$">        <action
 application="bridge"
 data="sofia/gateway/wph-office/$1"/>     
 </condition>   
 </extension>
 
 Would route all calls that were 90 and then
 another 10 digits, to the gateway wph-office by just passing
 the number beginning with the 0
 Thanks
 Richard
 -----Inline Attachment Follows-----
 
 _________________________________________________________________________
 Professional FreeSWITCH Consulting Services: 
 consulting at freeswitch.org
 http://www.freeswitchsolutions.com
 
 Official FreeSWITCH Sites
 http://www.freeswitch.org
 http://confluence.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



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