[Home]

Summary:ASTERISK-09736: Asterisk does not parse n extensions correctly
Reporter:mitcheloc (mitcheloc)Labels:
Date Opened:2007-06-22 19:24:15Date Closed:2007-07-06 19:18:18
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:The following works:
    [macro-snap-catch]
         exten => s,1,GotoIf($["${CALLERID(num)}"=""]?returntoivr);
         exten => s,n,GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardLimit)})}=1]?cleanup);
         exten => s,n,GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardUntil)})}=1]?cleanupuntil);
         exten => s,n,GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardTo)})}=1]?cleanupto);
         exten => s,n,GotoIf($[${ISNULL(${DB(${DB(${CALLERID(num)}/ForwardTo)}/Extension)})}=1]?cleanupto);
         exten => s,n,GotoIf($[${DB(${CALLERID(num)}/ForwardLimit)}=0]?returntoivr);
         exten => s,n,GotoIf($[${DB(${CALLERID(num)}/ForwardUntil)}>${EPOCH}]?returntoivr);
         exten => s,n,NoOp(Call caught);          
         exten => s,n,GotoIf($[${DB(${CALLERID(num)}/ForwardLimit)}=-1]?calluser);
         exten => s,n,Set(newlimit=$[${DB(${CALLERID(num)}/ForwardLimit)} - 1]);
         exten => s,n,Set(DB(${CALLERID(num)}/ForwardLimit)=${newlimit});
         exten => s,n,Set(extension=${DB(${DB(${CALLERID(num)}/ForwardTo)}/Extension)});
         exten => s,n(calluser),Goto(${extension});
         exten => s,n(cleanup),DBdel(${CALLERID(num)}/ForwardLimit)});
         exten => s,n(cleanupuntil),DBdel(${CALLERID(num)}/ForwardUntil)});
         exten => s,n(cleanupto),DBdel(${CALLERID(num)}/ForwardTo)});
         exten => s,n(returntoivr),NoOp(Caller not found in database, continuing dialplan);

While the following does not:
    [macro-snap-catch]
         exten => s, 1, GotoIf($["${CALLERID(num)}"=""]?returntoivr);
         exten => s, n, GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardLimit)})}=1]?cleanup);
         exten => s, n, GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardUntil)})}=1]?cleanupuntil);
         exten => s, n, GotoIf($[${ISNULL(${DB(${CALLERID(num)}/ForwardTo)})}=1]?cleanupto);
         exten => s, n, GotoIf($[${ISNULL(${DB(${DB(${CALLERID(num)}/ForwardTo)}/Extension)})}=1]?cleanupto);
         exten => s, n, GotoIf($[${DB(${CALLERID(num)}/ForwardLimit)}=0]?returntoivr);
         exten => s, n, GotoIf($[${DB(${CALLERID(num)}/ForwardUntil)}>${EPOCH}]?returntoivr);
         exten => s, n, NoOp(Call caught);          
         exten => s, n, GotoIf($[${DB(${CALLERID(num)}/ForwardLimit)}=-1]?calluser);
         exten => s, n, Set(newlimit=$[${DB(${CALLERID(num)}/ForwardLimit)} - 1]);
         exten => s, n, Set(DB(${CALLERID(num)}/ForwardLimit)=${newlimit})
         exten => s, n, Set(extension=${DB(${DB(${CALLERID(num)}/ForwardTo)}/Extension)})
         exten => s, n(calluser), Goto(${extension});
         exten => s, n(cleanup), DBdel(${CALLERID(num)}/ForwardLimit)})
         exten => s, n(cleanupuntil), DBdel(${CALLERID(num)}/ForwardUntil)})
         exten => s, n(cleanupto), DBdel(${CALLERID(num)}/ForwardTo)})
         exten => s, n(returntoivr), NoOp(Caller not found in database, continuing dialplan)
         

****** ADDITIONAL INFORMATION ******

This is the CLI output when attemping to use the Macro with spaces in it:

   -- Executing [000@mitchel-trusted:1] NoOp("SIP/mconstantin-082efed0", "614") in new stack
   -- Executing [000@mitchel-trusted:2] Answer("SIP/mconstantin-082efed0", "") in new stack
   -- Executing [000@mitchel-trusted:3] Macro("SIP/mconstantin-082efed0", "snap-catch") in new stack
   -- Executing [s@macro-snap-catch:1] GotoIf("SIP/mconstantin-082efed0", "0?returntoivr") in new stack
   -- Executing [000@mitchel-trusted:4] Hangup("SIP/mconstantin-082efed0", "") in new stack


and here is the CLI output from the one without spaces:

   -- Executing [000@mitchel-trusted:1] Answer("SIP/mconstantin-b63d5360", "") in new stack
   -- Executing [000@mitchel-trusted:2] NoOp("SIP/mconstantin-b63d5360", "614") in new stack
   -- Executing [000@mitchel-trusted:3] Macro("SIP/mconstantin-b63d5360", "snap-catch") in new stack
   -- Executing [s@macro-snap-catch:1] GotoIf("SIP/mconstantin-b63d5360", "0?returntoivr") in new stack
   -- Executing [s@macro-snap-catch:2] GotoIf("SIP/mconstantin-b63d5360", "0?cleanup") in new stack
   -- Executing [s@macro-snap-catch:3] GotoIf("SIP/mconstantin-b63d5360", "0?cleanupuntil") in new stack
   -- Executing [s@macro-snap-catch:4] GotoIf("SIP/mconstantin-b63d5360", "0?cleanupto") in new stack
   -- Executing [s@macro-snap-catch:5] GotoIf("SIP/mconstantin-b63d5360", "0?cleanupto") in new stack
   -- Executing [s@macro-snap-catch:6] GotoIf("SIP/mconstantin-b63d5360", "0?returntoivr") in new stack
   -- Executing [s@macro-snap-catch:7] GotoIf("SIP/mconstantin-b63d5360", "1?returntoivr") in new stack
   -- Goto (macro-snap-catch,s,17)
   -- Executing [s@macro-snap-catch:17] NoOp("SIP/mconstantin-b63d5360", "Caller not found in database| continuing dialplan") in new stack
   -- Executing [000@mitchel-trusted:4] Hangup("SIP/mconstantin-b63d5360", "") in new stack
Comments:By: Russell Bryant (russell) 2007-06-23 23:49:33

Do spaces work otherwise when using explicit priority numbers, and not "n" ?

By: Tilghman Lesher (tilghman) 2007-06-24 20:44:50

They do, but we've always told people not to use spaces after commas when specifying extension,priority,application.  At worst, this is a feature request.

By: Russell Bryant (russell) 2007-06-27 16:08:46

Fixed in 1.2, 1.4, and trunk in revisions 72267, 72272, and 72274.  Thanks

By: Digium Subversion (svnbot) 2007-07-04 18:38:36

Repository: asterisk
Revision: 73297

------------------------------------------------------------------------
r73297 | file | 2007-07-04 18:38:34 -0500 (Wed, 04 Jul 2007) | 817 lines

Merged revisions 72207,72232-72233,72241,72258,72261,72274,72304,72325-72326,72329-72330,72332,72337,72354,72358,72382,72384,72437,72452,72454-72457,72466,72490-72492,72494,72524,72539,72555,72557,72598,72600,72666,72670,72700-72701,72706,72727,72738,72741,72767,72807,72867-72869,72889,72920-72923,72927-72932,72935-72940,72982,72986-72987,73003,73006,73054,73127,73144,73174-73175,73191,73209,73254 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r72207 | kpfleming | 2007-06-27 16:13:54 -0300 (Wed, 27 Jun 2007) | 10 lines

Merged revisions 72205 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r72205 | kpfleming | 2007-06-27 14:13:21 -0500 (Wed, 27 Jun 2007) | 2 lines

use the proper type for storing group number bits so that if someone specifies 'group=42' it will actually work instead of being silently ignored

........

................
r72232 | mmichelson | 2007-06-27 16:50:21 -0300 (Wed, 27 Jun 2007) | 10 lines

Adding feature to support the storage and retrieval of voicemail greetings using IMAP storage.
This feature may be turned on by adding imapgreetings=yes to the general section of voicemail.conf
voicemail.conf.sample has details on the options added.

As a result, IMAP storage now has RETRIEVE and DISPOSE macros defined.

In addition to the IMAP greeting changes, I also have added an enum for the voicemail folders
and so now the code should be easier to understand and maintain when it comes to this area.


................
r72233 | file | 2007-06-27 16:57:36 -0300 (Wed, 27 Jun 2007) | 2 lines

Fix -T option. (issue ASTERISK-9767 reported by xylome)

................
r72241 | file | 2007-06-27 17:07:46 -0300 (Wed, 27 Jun 2007) | 2 lines

Fix up properties.

................
r72258 | file | 2007-06-27 17:26:53 -0300 (Wed, 27 Jun 2007) | 18 lines

Merged revisions 72257 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r72257 | file | 2007-06-27 16:25:24 -0400 (Wed, 27 Jun 2007) | 10 lines

Merged revisions 72256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72256 | file | 2007-06-27 16:23:24 -0400 (Wed, 27 Jun 2007) | 2 lines

I may possibly get shot for doing this... but... defer CDR processing until after the channel has been dealt with. This should eliminate all of the issues with channels going funky (SIP/PRI) when you are posting CDRs to a database that is either slow or unavailable and do not want to enable batching.

........

................

................
r72261 | bbryant | 2007-06-27 17:47:45 -0300 (Wed, 27 Jun 2007) | 20 lines

Merged revisions 72260 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r72260 | bbryant | 2007-06-27 15:46:12 -0500 (Wed, 27 Jun 2007) | 12 lines

Merged revisions 72259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72259 | bbryant | 2007-06-27 15:43:53 -0500 (Wed, 27 Jun 2007) | 4 lines

Fixes 1000ad when controlling terminal disappears.

Issue ASTERISK-9371, ASTERISK-9710

........

................

................
r72274 | russell | 2007-06-27 18:09:24 -0300 (Wed, 27 Jun 2007) | 21 lines

Merged revisions 72272 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r72272 | russell | 2007-06-27 16:08:34 -0500 (Wed, 27 Jun 2007) | 13 lines

Merged revisions 72267 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72267 | russell | 2007-06-27 16:06:45 -0500 (Wed, 27 Jun 2007) | 5 lines

Fix a minor issue with parsing the priority number.  You could have as much
whitespace as you want around a numeric priority, but you couldn't have any
whitespace around a special priority like "n" or "hint".
(issue ASTERISK-9736, reported by mitheloc, fixed by me)

........

................

................
r72304 | mattf | 2007-06-27 18:44:13 -0300 (Wed, 27 Jun 2007) | 1 line

Let's NOT create a deadlock scenario here
................
r72325 | qwell | 2007-06-27 19:17:59 -0300 (Wed, 27 Jun 2007) | 4 lines

Add support for Thai language in say.c

Issue 9417, patch by dome, with some cleanup done by me.

................
r72326 | qwell | 2007-06-27 19:27:09 -0300 (Wed, 27 Jun 2007) | 4 lines

Fix a segfault when trying to tab complete the "core show uptime" command.

Reported in #asterisk-dev on IRC by jcmoore, fixed by me.

................
r72329 | mmichelson | 2007-06-27 19:47:08 -0300 (Wed, 27 Jun 2007) | 4 lines

Added ability to customize which buttons control forward, reverse, pause, and stop during message playback.
(closes issue 9474, reported and patched by jaroth with modifications by me)


................
r72330 | file | 2007-06-27 19:48:15 -0300 (Wed, 27 Jun 2007) | 18 lines

Merged revisions 72328 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r72328 | file | 2007-06-27 18:45:49 -0400 (Wed, 27 Jun 2007) | 10 lines

Merged revisions 72327 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72327 | file | 2007-06-27 18:43:11 -0400 (Wed, 27 Jun 2007) | 2 lines

Fix issue where queue log events might be missing. (issue ASTERISK-7561 reported by mtryfoss)

........

................

................
r72332 | file | 2007-06-27 19:58:53 -0300 (Wed, 27 Jun 2007) | 10 lines

Merged revisions 72331 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r72331 | file | 2007-06-27 18:58:02 -0400 (Wed, 27 Jun 2007) | 2 lines

Make payload IDs for iLBC/Speex match to our list. Since these are dynamic payloads the other side shouldn't care. (issue ASTERISK-9150 reported by irroot)

........

................
r72337 | bbryant | 2007-06-27 20:04:06 -0300 (Wed, 27 Jun 2007) | 18 lines

Merged revisions 72335 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r72335 | bbryant | 2007-06-27 18:03:01 -0500 (Wed, 27 Jun 2007) | 10 lines

Merged revisions 72333 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72333 | bbryant | 2007-06-27 17:58:53 -0500 (Wed, 27 Jun 2007) | 2 lines

Reverted changes for earlier revisions 72259 to 72261. Issue ASTERISK-9371, ASTERISK-9710

........

................

................
r72354 | file | 2007-06-27 20:13:09 -0300 (Wed, 27 Jun 2007) | 2 lines

Add SIPREFERRINGCONTEXT and SIPREFERREDBYHDR variables when a transfer takes place. (issue ASTERISK-8148 reported by jcovert)

................
r72358 | file | 2007-06-27 20:14:39 -0300 (Wed, 27 Jun 2007) | 2 lines

Silly jingle...

................
r72382 | file | 2007-06-27 20:26:46 -0300 (Wed, 27 Jun 2007) | 18 lines

Merged revisions 72381 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r72381 | file | 2007-06-27 19:25:12 -0400 (Wed, 27 Jun 2007) | 10 lines

Merged revisions 72378 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72378 | file | 2007-06-27 19:24:01 -0400 (Wed, 27 Jun 2007) | 2 lines

Update documentation to clarify variable usage with MixMonitor. (issue ASTERISK-9218 reported by netoguy)

........

................

................
r72384 | bbryant | 2007-06-27 20:30:31 -0300 (Wed, 27 Jun 2007) | 19 lines

Merged revisions 72383 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r72383 | bbryant | 2007-06-27 18:29:14 -0500 (Wed, 27 Jun 2007) | 11 lines

Merged revisions 72373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72373 | bbryant | 2007-06-27 18:22:13 -0500 (Wed, 27 Jun 2007) | 3 lines

Reinstating patch. This actually fixes the problem, however I was running a development branch without it and mistakenly thought it wasn't fixed.
Fixes issue ASTERISK-9710, and ASTERISK-9371: 100