<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#0070C0;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US">Hi, Luis<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US">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 2<sup>nd</sup> 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).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US">So, for example, you could try this:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US">bind_digit_action(my_domain,'~^\*(\d+)$',exec:execute_extension,MY_EXTENSION XML my_context,both,self)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US">bind_digit_action(my_domain,'##',exec:execute_extension,MY_DO_NOTHING_EXTENSION XML my_context,both,self)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US">I’ve spent quite some time looking at that part of the FS code, so I hope this is helpful.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#0070C0;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Luis Azedo [mailto:luis.azedo@factorlusitano.com]
<br>
<b>Sent:</b> 05 July 2016 12:52<br>
<b>To:</b> freeswitch-users@lists.freeswitch.org<br>
<b>Subject:</b> Re: [Freeswitch-users] bind_digits_action regexp<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hi David,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt">---------- Forwarded message ----------<br>
From: David Ponzone <<a href="mailto:david.ponzone@gmail.com">david.ponzone@gmail.com</a>><br>
To: FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>><br>
Cc: <br>
Date: Tue, 28 Jun 2016 23:09:19 +0200<br>
Subject: Re: [Freeswitch-users] bind_digits_action regexp<br>
According the wiki page, it cannot be used for capture.<br>
<br>
David Ponzone<br>
<br>
<br>
<br>
> Le 28 juin 2016 à 20:06, Luis Azedo <<a href="mailto:luis.azedo@factorlusitano.com">luis.azedo@factorlusitano.com</a>> a écrit :<br>
><br>
> Hi,<br>
><br>
> i'm trying to collect as many digits as possible but only getting the first.<br>
><br>
> bind_digit_action(my_domain,'~^\*(\d+)$',exec:execute_extension,MY_EXTENSION XML my_context,both,self)<br>
> 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 ?<br>
><br>
> also tried<br>
> <span style="color:#0070C0">[Freeswitch-users] bind_digits_action regexp</span><br>
> when i press *123456789, MY_EXTENSION is executed as soon as i type the 5<br>
><br>
> also used 'set(bind_digit_input_timeout=15000)' with no luck<br>
> is there a way to capture until bind_digit_input_timeout ?<br>
><br>
> Thanks<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>