Changeset 2973

Removed the old "executing in new stack" stuff. This does nothing. I think it must be left over from a pre-threaded core

Committed by:  mjagdis
Date:  Jun 12 2007 * 00:05 (about 1 year ago)

Affected files:

callweaver/trunk/apps/app_proc.c (unified diff)

r2956r2973
210210 while(opbx_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
211211 /* Reset the proc depth, if it was changed in the last iteration */
212212 pbx_builtin_setvar_helper(chan, "PROC_DEPTH", depthc);
213 if ((res = opbx_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num))) {
213 if ((res = opbx_exec_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num))) {
214214 /* Something bad happened, or a hangup has been requested. */
215215 if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F')) ||
216216 (res == '*') || (res == '#')) {

callweaver/trunk/corelib/pbx.c (unified diff)

r2972r2973
657657 #define OPBX_PBX_MAX_STACK 128
658658
659659 #define HELPER_EXISTS 0
660 #define HELPER_SPAWN 1
661 #define HELPER_EXEC 2
662 #define HELPER_CANMATCH 3
663 #define HELPER_MATCHMORE 4
664 #define HELPER_FINDLABEL 5
660 #define HELPER_EXEC 1
661 #define HELPER_CANMATCH 2
662 #define HELPER_MATCHMORE 3
663 #define HELPER_FINDLABEL 4
665664
666665 struct opbx_app *pbx_findapp(const char *app)
667666 {
------
975974 switch (action)
976975 {
977976 case HELPER_EXISTS:
978 case HELPER_SPAWN:
979977 case HELPER_EXEC:
980978 case HELPER_FINDLABEL:
981979 /* We are only interested in exact matches */
------
20062004 struct opbx_switch *sw;
20072005 char *data;
20082006 const char *foundcontext=NULL;
2009 int newstack = 0;
20102007 int res;
20112008 int status = 0;
20122009 char *incstack[OPBX_PBX_MAX_STACK];
------
20422039 case HELPER_MATCHMORE:
20432040 opbx_mutex_unlock(&conlock);
20442041 return -1;
2045 case HELPER_SPAWN:
2046 newstack++;
2047 /* Fall through */
20482042 case HELPER_EXEC:
20492043 app = pbx_findapp(e->app);
20502044 opbx_mutex_unlock(&conlock);
------
20572051 c->priority = priority;
20582052 pbx_substitute_variables(passdata, sizeof(passdata), c, e);
20592053 if (option_verbose > 2)
2060 opbx_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\") %s\n",
2054 opbx_verbose( VERBOSE_PREFIX_3 "Executing %s(\"%s\", \"%s\")\n",
20612055 opbx_term_color(tmp, app->name, COLOR_BRCYAN, 0, sizeof(tmp)),
20622056 opbx_term_color(tmp2, c->name, COLOR_BRMAGENTA, 0, sizeof(tmp2)),
2063 opbx_term_color(tmp3, (!opbx_strlen_zero(passdata) ? (char *)passdata : ""), COLOR_BRMAGENTA, 0, sizeof(tmp3)),
2064 (newstack ? "in new stack" : "in same stack"));
2057 opbx_term_color(tmp3, (!opbx_strlen_zero(passdata) ? (char *)passdata : ""), COLOR_BRMAGENTA, 0, sizeof(tmp3)));
20652058 manager_event(EVENT_FLAG_CALL, "Newexten",
20662059 "Channel: %s\r\n"
20672060 "Context: %s\r\n"
------
20972090 case HELPER_FINDLABEL:
20982091 opbx_mutex_unlock(&conlock);
20992092 return -1;
2100 case HELPER_SPAWN:
2101 newstack++;
2102 /* Fall through */
21032093 case HELPER_EXEC:
21042094 opbx_mutex_unlock(&conlock);
21052095 if (sw->exec)
21062096 {
2107 res = sw->exec(c, foundcontext ? foundcontext : context, exten, priority, callerid, newstack, data);
2097 res = sw->exec(c, foundcontext ? foundcontext : context, exten, priority, callerid, data);
21082098 }
21092099 else
21102100 {
------
26352625 return pbx_extension_helper(c, NULL, context, exten, priority, NULL, callerid, HELPER_MATCHMORE);
26362626 }
26372627
2638 int opbx_spawn_extension(struct opbx_channel *c, const char *context, const char *exten, int priority, const char *callerid)
2639 {
2640 return pbx_extension_helper(c, NULL, context, exten, priority, NULL, callerid, HELPER_SPAWN);
2641 }
2642
26432628 int opbx_exec_extension(struct opbx_channel *c, const char *context, const char *exten, int priority, const char *callerid)
26442629 {
26452630 return pbx_extension_helper(c, NULL, context, exten, priority, NULL, callerid, HELPER_EXEC);
------
27112696 while (opbx_exists_extension(c, c->context, c->exten, c->priority, c->cid.cid_num))
27122697 {
27132698 memset(exten, 0, sizeof(exten));
2714 if ((res = opbx_spawn_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)))
2699 if ((res = opbx_exec_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)))
27152700 {
27162701 /* Something bad happened, or a hangup has been requested. */
27172702 if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F')) ||
------
29152900 c->priority = 1;
29162901 while (opbx_exists_extension(c, c->context, c->exten, c->priority, c->cid.cid_num))
29172902 {
2918 if ((res = opbx_spawn_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)))
2903 if ((res = opbx_exec_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)))
29192904 {
29202905 /* Something bad happened, or a hangup has been requested. */
29212906 if (option_debug)

callweaver/trunk/include/callweaver/ast.h (unified diff)

r2961r2973
601601 #define ast_socket opbx_socket
602602 #define ast_softhangup_nolock opbx_softhangup_nolock
603603 #define ast_softhangup opbx_softhangup
604 #define ast_spawn_extension opbx_spawn_extension
604 #define ast_spawn_extension opbx_spawn_extension_incompatible_api
605605 #define ast_startuptime opbx_startuptime
606606 #define ast_state2str opbx_state2str
607607 #define ast_stopstream opbx_stopstream

callweaver/trunk/include/callweaver/pbx.h (unified diff)

r2956r2973
125125
126126 int (*canmatch)(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data);
127127
128 int (*exec)(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, int newstack, const char *data);
128 int (*exec)(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data);
129129
130130 int (*matchmore)(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data);
131131 };
------
428428 */
429429 int opbx_extension_pattern_match(const char *destination, const char *pattern);
430430
431 /*! Launch a new extension (i.e. new stack) */
432 /*!
433 * \param c not important
434 * \param context which context to generate the extension within
435 * \param exten new extension to add
436 * \param priority priority of new extension
437 * \param callerid callerid of extension
438 * This adds a new extension to the callweaver extension list.
439 * It returns 0 on success, -1 on failure.
440 */
441 int opbx_spawn_extension(struct opbx_channel *c, const char *context, const char *exten, int priority, const char *callerid);
442
443431 /*! Execute an extension. */
444432 /*!
445433 \param c channel to execute upon

callweaver/trunk/pbx/pbx_dundi.c (unified diff)

r2956r2973
44524452 return dundi_helper(chan, context, exten, priority, data, DUNDI_FLAG_CANMATCH);
44534453 }
44544454
4455 static int dundi_exec(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, int newstack, const char *data)
4455 static int dundi_exec(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
44564456 {
44574457 struct dundi_result results[MAX_RESULTS];
44584458 int res;

callweaver/trunk/pbx/pbx_loopback.c (unified diff)

r2956r2973
172172 return res;
173173 }
174174
175 static int loopback_exec(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, int newstack, const char *data)
175 static int loopback_exec(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
176176 {
177177 LOOPBACK_COMMON;
178178
179 if (newstack)
180 res = opbx_spawn_extension(chan, newcontext, newexten, newpriority, callerid);
181 else
182 res = opbx_exec_extension(chan, newcontext, newexten, newpriority, callerid);
179 res = opbx_exec_extension(chan, newcontext, newexten, newpriority, callerid);
183180 if (newpattern)
184181 {
185182 switch (opbx_extension_pattern_match(exten, newpattern))

callweaver/trunk/pbx/pbx_realtime.c (unified diff)

r2956r2973
185185 return res > 0 ? res : 0;
186186 }
187187
188 static int realtime_exec(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, int newstack, const char *data)
188 static int realtime_exec(struct opbx_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
189189 {
190190 char app[256];
191191 char appdata[512]="";