[asterisk-commits] murf: branch 1.4 r45103 - in /branches/1.4/pbx:
./ ael/ael-test/ ael/ael-test...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Fri Oct 13 13:52:18 MST 2006
Author: murf
Date: Fri Oct 13 15:52:17 2006
New Revision: 45103
URL: http://svn.digium.com/view/asterisk?rev=45103&view=rev
Log:
Bug 8128 fixed in this release via these changes
Added:
branches/1.4/pbx/ael/ael-test/ael-vtest17/
branches/1.4/pbx/ael/ael-test/ael-vtest17/extensions.ael (with props)
branches/1.4/pbx/ael/ael-test/ref.ael-vtest17 (with props)
Modified:
branches/1.4/pbx/ael/ael-test/ref.ael-test3
branches/1.4/pbx/pbx_ael.c
Added: branches/1.4/pbx/ael/ael-test/ael-vtest17/extensions.ael
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/ael/ael-test/ael-vtest17/extensions.ael?rev=45103&view=auto
==============================================================================
--- branches/1.4/pbx/ael/ael-test/ael-vtest17/extensions.ael (added)
+++ branches/1.4/pbx/ael/ael-test/ael-vtest17/extensions.ael Fri Oct 13 15:52:17 2006
@@ -1,0 +1,116 @@
+context dialextens
+{
+ /*
+ 101 thru 123, 149 thru 152
+ */
+ _10X => Dial(Zap/${EXTEN:2},30,tw);
+ _1ZX => Dial(Zap/${EXTEN:1},30,tw);
+}
+/*
+ Due to extenal wiring:
+
+ dialing 125 will ring 101
+ dialing 126 will ring 102
+ and so on until
+ dialing 147 will ring 123
+
+We can dial out on zap 69 thru 72; and 25-47
+
+*/
+
+context dialthrus
+{
+ /* 369-372; 325-347 */
+ _3XX => Dial(Zap/${EXTEN:1},30,tw);
+}
+
+context t1incoming
+{
+ includes
+ {
+ dialextens;
+ parkedcalls;
+ }
+ s => {
+ Answer();
+ Background(welcome-to-test-machine);
+ }
+
+}
+
+context t1extension
+{
+ includes
+ {
+ dialextens;
+ dialthrus;
+ }
+
+}
+
+context incoming
+{
+ includes
+ {
+ dialextens;
+ parkedcalls;
+ }
+ s => {
+ Answer();
+ Background(welcome-to-test-machine);
+ }
+}
+
+context extension
+{
+ includes
+ {
+ dialextens;
+ dialthrus;
+ }
+ 5 => {
+ Record(recording:gsm);
+ Background(recording);
+ }
+
+ 81 => {
+ iterations=1000000;
+ Set(time1=${EPOCH});
+ for(i=1; ${i}<${iterations}; i=${i}+1)
+ {
+ NoOp(Hello);
+ }
+ Set(time2=${EPOCH});
+ Verbose(The time diff is $[${time2} - ${time1} ] seconds);
+ Verbose(Which means that the priorities/sec = $[4* ${iterations} / (${time2} - ${time1}) ]);
+ SayNumber($[4 * ${iterations} / (${time2} - ${time1}) ]);
+ }
+ 82 => {
+ &ndeep(100000);
+ Verbose(Finished 100000 levels deep call!);
+ }
+ 83 => {
+ switch (${EXTEN})
+ {
+ pattern 8X:
+ Verbose(do something to prepare it);
+ pattern 9X:
+ Verbose(handle both 8x and 9x calls);
+ pattern [4-7]X:
+ Verbose(and this too!);
+
+ }
+
+ }
+}
+
+macro ndeep(level)
+{
+ if( ${level} == 0)
+ {
+ Verbose(2|Got to Level 0);
+ return;
+ }
+ &ndeep($[${level}-1]);
+ return;
+}
Propchange: branches/1.4/pbx/ael/ael-test/ael-vtest17/extensions.ael
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: branches/1.4/pbx/ael/ael-test/ael-vtest17/extensions.ael
------------------------------------------------------------------------------
svn:keywords = Author Id Date Revision
Propchange: branches/1.4/pbx/ael/ael-test/ael-vtest17/extensions.ael
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: branches/1.4/pbx/ael/ael-test/ref.ael-test3
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/ael/ael-test/ref.ael-test3?rev=45103&r1=45102&r2=45103&view=diff
==============================================================================
--- branches/1.4/pbx/ael/ael-test/ref.ael-test3 (original)
+++ branches/1.4/pbx/ael/ael-test/ref.ael-test3 Fri Oct 13 15:52:17 2006
@@ -2,17 +2,20 @@
(If you find progress and other non-error messages irritating, you can use -q to suppress them)
(You can use the -w option to dump extensions.conf format to extensions.conf.aeldump)
-LOG: lev:2 file:pbx_ael.c line:3803 func: pbx_load_module Starting AEL load process.
-LOG: lev:2 file:pbx_ael.c line:3810 func: pbx_load_module AEL load process: calculated config file name './extensions.ael'.
+LOG: lev:2 file:pbx_ael.c line:3856 func: pbx_load_module Starting AEL load process.
+LOG: lev:2 file:pbx_ael.c line:3863 func: pbx_load_module AEL load process: calculated config file name './extensions.ael'.
LOG: lev:2 file:ael.flex line:429 func: ael_yylex --Read in included file ./include1.ael2, 78 chars
LOG: lev:2 file:ael.flex line:429 func: ael_yylex --Read in included file ./include2.ael2, 98 chars
LOG: lev:2 file:ael.flex line:429 func: ael_yylex --Read in included file ./include3.ael2, 57 chars
LOG: lev:2 file:ael.flex line:429 func: ael_yylex --Read in included file ./include5.ael2, 56 chars
LOG: lev:2 file:ael.flex line:429 func: ael_yylex --Read in included file ./include4.ael2, 87 chars
LOG: lev:2 file:ael.flex line:429 func: ael_yylex --Read in included file ./telemarket_torture.ael2, 28036 chars
-LOG: lev:2 file:pbx_ael.c line:3818 func: pbx_load_module AEL load process: parsed config file name './extensions.ael'.
-LOG: lev:2 file:pbx_ael.c line:3821 func: pbx_load_module AEL load process: checked config file name './extensions.ael'.
-LOG: lev:2 file:pbx_ael.c line:3823 func: pbx_load_module AEL load process: compiled config file name './extensions.ael'.
-LOG: lev:2 file:pbx_ael.c line:3826 func: pbx_load_module AEL load process: merged config file name './extensions.ael'.
-LOG: lev:2 file:pbx_ael.c line:3829 func: pbx_load_module AEL load process: verified config file name './extensions.ael'.
+LOG: lev:2 file:pbx_ael.c line:3871 func: pbx_load_module AEL load process: parsed config file name './extensions.ael'.
+LOG: lev:3 file:pbx_ael.c line:816 func: check_includes Warning: file ./extensions.ael, line 2747-2751: The included context 'parkedcalls' cannot be found.
+LOG: lev:3 file:pbx_ael.c line:816 func: check_includes Warning: file ./extensions.ael, line 2954-2957: The included context 'parkedcalls' cannot be found.
+LOG: lev:3 file:pbx_ael.c line:816 func: check_includes Warning: file ./extensions.ael, line 3005-3012: The included context 'parkedcalls' cannot be found.
+LOG: lev:2 file:pbx_ael.c line:3874 func: pbx_load_module AEL load process: checked config file name './extensions.ael'.
+LOG: lev:2 file:pbx_ael.c line:3876 func: pbx_load_module AEL load process: compiled config file name './extensions.ael'.
+LOG: lev:2 file:pbx_ael.c line:3879 func: pbx_load_module AEL load process: merged config file name './extensions.ael'.
+LOG: lev:2 file:pbx_ael.c line:3882 func: pbx_load_module AEL load process: verified config file name './extensions.ael'.
LOG: lev:4 file:ael2_parse line:479 func: main 172 contexts, 858 extensions, 2326 priorities
Added: branches/1.4/pbx/ael/ael-test/ref.ael-vtest17
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/ael/ael-test/ref.ael-vtest17?rev=45103&view=auto
==============================================================================
--- branches/1.4/pbx/ael/ael-test/ref.ael-vtest17 (added)
+++ branches/1.4/pbx/ael/ael-test/ref.ael-vtest17 Fri Oct 13 15:52:17 2006
@@ -1,0 +1,68 @@
+
+
+[dialextens]
+exten => _10X,1,Dial(Zap/${EXTEN:2}|30|tw)
+exten => _1ZX,1,Dial(Zap/${EXTEN:1}|30|tw)
+
+
+[dialthrus]
+exten => _3XX,1,Dial(Zap/${EXTEN:1}|30|tw)
+
+
+[t1incoming]
+include => dialextens
+include => parkedcalls
+exten => s,1,Answer()
+exten => s,2,Background(welcome-to-test-machine)
+
+
+[incoming]
+include => dialextens
+include => parkedcalls
+exten => s,1,Answer()
+exten => s,2,Background(welcome-to-test-machine)
+
+
+[extension]
+include => dialextens
+include => dialthrus
+exten => 5,1,Record(recording:gsm)
+exten => 5,2,Background(recording)
+exten => 81,1,Set(iterations=$[1000000])
+exten => 81,2,Set(time1=${EPOCH})
+exten => 81,3,Set(i=$[1])
+exten => 81,4,GotoIf($[${i}<${iterations}]?5:8)
+exten => 81,5,NoOp(Hello)
+exten => 81,6,Set(i=$[${i}+1])
+exten => 81,7,Goto(4)
+exten => 81,8,NoOp(Finish for-extension-1)
+exten => 81,9,Set(time2=${EPOCH})
+exten => 81,10,Verbose(The time diff is $[${time2} - ${time1} ] seconds)
+exten => 81,11,Verbose(Which means that the priorities/sec = $[4* ${iterations} / (${time2} - ${time1}) ])
+exten => 81,12,SayNumber($[4 * ${iterations} / (${time2} - ${time1}) ])
+exten => 82,1,Macro(ndeep|100000)
+exten => 82,2,Verbose(Finished 100000 levels deep call!)
+exten => 83,1,Goto(sw-2-${EXTEN}|1)
+exten => 83,2,NoOp(Finish switch-extension-2)
+exten => _sw-2-[4-7]X,1,Verbose(and this too!)
+exten => _sw-2-[4-7]X,2,Goto(83|2)
+exten => _sw-2-9X,1,Verbose(handle both 8x and 9x calls)
+exten => _sw-2-9X,2,Goto(sw-2-49|1)
+exten => _sw-2-8X,1,Verbose(do something to prepare it)
+exten => _sw-2-8X,2,Goto(sw-2-99|1)
+
+
+[macro-ndeep]
+exten => s,1,Set(level=${ARG1})
+exten => s,2,GotoIf($[${level} == 0]?3:5)
+exten => s,3,Verbose(2|Got to Level 0)
+exten => s,4,Goto(8)
+exten => s,5,NoOp(Finish if-ndeep-3)
+exten => s,6,Macro(ndeep|$[${level}-1])
+exten => s,7,Goto(8)
+exten => s,8,NoOp(End of Macro ndeep-s)
+
+
+[t1extension]
+include => dialextens
+include => dialthrus
Propchange: branches/1.4/pbx/ael/ael-test/ref.ael-vtest17
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: branches/1.4/pbx/ael/ael-test/ref.ael-vtest17
------------------------------------------------------------------------------
svn:keywords = Author Id Date Revision
Propchange: branches/1.4/pbx/ael/ael-test/ref.ael-vtest17
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: branches/1.4/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/pbx_ael.c?rev=45103&r1=45102&r2=45103&view=diff
==============================================================================
--- branches/1.4/pbx/pbx_ael.c (original)
+++ branches/1.4/pbx/pbx_ael.c Fri Oct 13 15:52:17 2006
@@ -2785,6 +2785,29 @@
}
}
+static void gen_match_to_pattern(char *pattern, char *result)
+{
+ /* the result will be a string that will be matched by pattern */
+ char *p=pattern, *t=result;
+ while (*p) {
+ if (*p == 'x' || *p == 'n' || *p == 'z' || *p == 'X' || *p == 'N' || *p == 'Z')
+ *t++ = '9';
+ else if (*p == '[') {
+ char *z = p+1;
+ while (*z != ']')
+ z++;
+ if (*(z+1)== ']')
+ z++;
+ *t++=*(p+1); /* use the first char in the set */
+ p = z;
+ } else {
+ *t++ = *p;
+ }
+ p++;
+ }
+ *t++ = 0; /* cap it off */
+}
+
static void gen_prios(struct ael_extension *exten, char *label, pval *statement, struct ael_extension *mother_exten, struct ast_context *this_context )
{
pval *p,*p2,*p3;
@@ -3031,14 +3054,15 @@
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"_sw-%d-%s|1",local_control_statement_count, p2->next->u1.str);
+ gen_match_to_pattern(p2->next->u1.str, buf2);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|1", local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"_sw-%d-.|1",local_control_statement_count);
+ snprintf(buf1,sizeof(buf1),"sw-%d-.|1",local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (!p2->next) {
@@ -3092,14 +3116,15 @@
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"_sw-%d-%s|1",local_control_statement_count, p2->next->u1.str);
+ gen_match_to_pattern(p2->next->u1.str, buf2);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|1",local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"_sw-%d-.|1",local_control_statement_count);
+ snprintf(buf1,sizeof(buf1),"sw-%d-.|1",local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (!p2->next) {
@@ -3155,14 +3180,15 @@
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"_sw-%d-%s|1",local_control_statement_count, p2->next->u1.str);
+ gen_match_to_pattern(p2->next->u1.str, buf2);
+ snprintf(buf1,sizeof(buf1),"sw-%d-%s|1",local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"_sw-%d-.|1",local_control_statement_count);
+ snprintf(buf1,sizeof(buf1),"sw-%d-.|1",local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru);
} else if (!p2->next) {
More information about the asterisk-commits
mailing list