I'm getting this error: 2013-03-21 09:52:46.921136 [ERR] switch_regex.c:101 COMPILE ERROR: 1 [nothing to repeat][^+12243336164$] It comes from this condition: <condition field="caller_id_number" expression="^\+?(12243336164|12025551212)$"> (The corresponding action routes the call directly to my extension, but that's not important.) The reason I have "\+?" is I didn't know if the plus sign was included in the caller-ID. I have since learned that it is, so I can remove the "?", but I still want to know what I did wrong. -- Steve
This regex looks perfectly fine to me. Also, it works fine in fs_cli: freeswitch@default> regex 123|^\+?(12243336164\|12025551212)$ false freeswitch@default> regex 12243336164|^\+?(12243336164\|12025551212)$ true freeswitch@default> regex +12243336164|^\+?(12243336164\|12025551212)$ true Note that when you must escape the | character in your patterns when you use the regex command because regex uses | as a delimiter. Try those commands in your fs_cli and see what happens. -MC On Thu, Mar 21, 2013 at 3:19 PM, Steven Schoch < schoch+freeswitch.org@xwin32.com> wrote:
I'm getting this error: 2013-03-21 09:52:46.921136 [ERR] switch_regex.c:101 COMPILE ERROR: 1 [nothing to repeat][^+12243336164$]
It comes from this condition: <condition field="caller_id_number" expression="^\+?(12243336164| 12025551212)$">
(The corresponding action routes the call directly to my extension, but that's not important.)
The reason I have "\+?" is I didn't know if the plus sign was included in the caller-ID. I have since learned that it is, so I can remove the "?", but I still want to know what I did wrong.
-- Steve
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
On Thu, Mar 21, 2013 at 8:25 PM, Michael Collins <msc@freeswitch.org> wrote:
This regex looks perfectly fine to me. Also, it works fine in fs_cli: freeswitch@default> regex 123|^\+?(12243336164\|12025551212)$
My bad. It turns out I had the error pattern in a different file, which had this incorrect line: <condition field="caller_id_number" expression="^+12243336164$"> In that case, the + was not escaped, so it tried to repeat the start, which it can't. Condition deleted, problem solved. Sorry to trouble you. On Thu, Mar 21, 2013 at 9:38 PM, SS <8f27e956@gmail.com> wrote:
Is the problem not that you wrote, field="caller_id_number"
and shouldn't it be, field="${caller_id_number}"
It probably would work either way. I just looked at the source, in mod_dialplan_xml.c, line 354, and found that if the field contains a dollar sign, then it is expanded and that is used to match the expression. However, if it does not contain a dollar sign, then it fetches the data from a variable of that name. That means that you can't put the name of a field in a channel variable and use that in the field parameter as a way of doing double-indirection (which would be a bad idea anyway). -- Steve
Is the problem not that you wrote, field="caller_id_number" and shouldn't it be, field="${caller_id_number}" /S On 2013-03-21 18:19, Steven Schoch wrote:
I'm getting this error: 2013-03-21 09:52:46.921136 [ERR] switch_regex.c:101 COMPILE ERROR: 1 [nothing to repeat][^+12243336164$]
It comes from this condition: <condition field="caller_id_number" expression="^\+?(12243336164|12025551212)$">
(The corresponding action routes the call directly to my extension, but that's not important.)
The reason I have "\+?" is I didn't know if the plus sign was included in the caller-ID. I have since learned that it is, so I can remove the "?", but I still want to know what I did wrong.
-- Steve
participants (3)
-
Michael Collins
-
SS
-
Steven Schoch