[Freeswitch-users] bind_digits_action regexp

Andrew Newlands anewlands at btlnet.co.uk
Tue Jul 12 19:13:11 MSD 2016

Hi, Luis

Looking  the FS source code, it will return an “ungreedy” match if you are using a regex and it is your and only bind_digit_action.  If this matches your scenario, try adding a 2nd  bind_digit_action - it doesn’t matter what it is and it doesn’t need to be a regex (it just needs to be something which won’t interfere with anything else).

So, for example, you could try this:

bind_digit_action(my_domain,'~^\*(\d+)$',exec:execute_extension,MY_EXTENSION XML my_context,both,self)
bind_digit_action(my_domain,'##',exec:execute_extension,MY_DO_NOTHING_EXTENSION XML my_context,both,self)

I’ve spent quite some time looking at that part of the FS code, so I hope this is helpful.

From: Luis Azedo [mailto:luis.azedo at factorlusitano.com]
Sent: 05 July 2016 12:52
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] bind_digits_action regexp

Hi David,

i'm not trying to capture to any variable, i'm using last_matching_digits variable in MY_EXTENSION handling. This works if i add '#' to the end of the regexp. i am trying to get the same result without the need for '#' at the end.

---------- Forwarded message ----------
From: David Ponzone <david.ponzone at gmail.com<mailto:david.ponzone at gmail.com>>
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org<mailto:freeswitch-users at lists.freeswitch.org>>
Date: Tue, 28 Jun 2016 23:09:19 +0200
Subject: Re: [Freeswitch-users] bind_digits_action regexp
According the wiki page, it cannot be used for capture.

David Ponzone

> Le 28 juin 2016 à 20:06, Luis Azedo <luis.azedo at factorlusitano.com<mailto:luis.azedo at factorlusitano.com>> a écrit :
> Hi,
> i'm trying to collect as many digits as possible but only getting the first.
> bind_digit_action(my_domain,'~^\*(\d+)$',exec:execute_extension,MY_EXTENSION XML my_context,both,self)
> if i press *8754, MY_EXTENSION is executed as soon as i type the 8. i guess the regexp is true, but shouldn't it try to capture the rest of the digits ?
> also tried
> [Freeswitch-users] bind_digits_action regexp
> when i press *123456789, MY_EXTENSION is executed as soon as i type the 5
> also used 'set(bind_digit_input_timeout=15000)' with no luck
> is there a way to capture until bind_digit_input_timeout ?
> Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160712/c0545320/attachment.html 

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