Make variables work in manager originate again
authorJames Golovich <james@gnuinter.net>
Mon, 17 May 2004 21:10:26 +0000 (21:10 +0000)
committerJames Golovich <james@gnuinter.net>
Mon, 17 May 2004 21:10:26 +0000 (21:10 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2993 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index b97264d..1f77bb3 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -3963,6 +3963,11 @@ int ast_pbx_outgoing_exten(char *type, int format, void *data, int timeout, char
                strncpy(as->exten,  exten, sizeof(as->exten) - 1);
                as->priority = priority;
                as->timeout = timeout;
                strncpy(as->exten,  exten, sizeof(as->exten) - 1);
                as->priority = priority;
                as->timeout = timeout;
+               if (variable) {
+                       tmp = ast_strdupa(variable);
+                               for (var = strtok_r(tmp, "|", &tmp); var; var = strtok_r(NULL, "|", &tmp))
+                                       pbx_builtin_setvar( chan, var );
+               }
                pthread_attr_init(&attr);
                pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
                if (pthread_create(&as->p, &attr, async_wait, as)) {
                pthread_attr_init(&attr);
                pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
                if (pthread_create(&as->p, &attr, async_wait, as)) {
@@ -4068,6 +4073,11 @@ int ast_pbx_outgoing_app(char *type, int format, void *data, int timeout, char *
                if (appdata)
                        strncpy(as->appdata,  appdata, sizeof(as->appdata) - 1);
                as->timeout = timeout;
                if (appdata)
                        strncpy(as->appdata,  appdata, sizeof(as->appdata) - 1);
                as->timeout = timeout;
+               if (variable) {
+                       tmp = ast_strdupa(variable);
+                               for (var = strtok_r(tmp, "|", &tmp); var; var = strtok_r(NULL, "|", &tmp))
+                                       pbx_builtin_setvar( chan, var );
+               }
                /* Start a new thread, and get something handling this channel. */
                pthread_attr_init(&attr);
                pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
                /* Start a new thread, and get something handling this channel. */
                pthread_attr_init(&attr);
                pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);