diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-02 01:01:11 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-02 01:01:11 +0000 |
commit | 907b53f827a5202f4f0928ef98bedc6ff5958936 (patch) | |
tree | 975b2dabe30d1a8c86307711c15c13d63c258135 /apps/app_page.c | |
parent | 73f1a2863ebe21859bd73208fdd3ac3e4f124729 (diff) |
Merged revisions 7265-7266,7268-7275 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines
Changing bug report address to the Asterisk issue tracker
........
r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines
Makefile 'update' target now supports updating from Subversion repositories (issue #5875)
remove support for 'patches' subdirectory, it's no longer useful
........
r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines
ensure channel's scheduling context is freed (issue #5788)
........
r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines
don't block waiting for the Festival server forever when it goes away (issue #5882)
........
r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines
allow variables to exist on both 'halves' of the Local channel (issue #5810)
........
r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines
protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue #5879)
........
r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines
properly handle password changes when mailbox is last line of config file and not followed by a newline (issue #5870)
reformat password changing code to conform to coding guidelines (issue #5870)
........
r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines
allow previous context-searching behavior to be used if desired (issue #5899)
........
r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines
inherit channel variables into channels created by Page() application (issue #5888)
........
r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines
Bug #5907. Improve SIP INFO DTMF debugging output. (1.2 & Trunk)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7276 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_page.c')
-rw-r--r-- | apps/app_page.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/apps/app_page.c b/apps/app_page.c index 441208fd9..39a0eb4bc 100644 --- a/apps/app_page.c +++ b/apps/app_page.c @@ -40,6 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/file.h" #include "asterisk/app.h" +#include "asterisk/chanvars.h" static const char *tdesc = "Page Multiple Phones"; @@ -77,13 +78,14 @@ struct calloutdata { char tech[64]; char resource[256]; char meetmeopts[64]; + struct ast_variable *variables; }; static void *page_thread(void *data) { struct calloutdata *cd = data; ast_pbx_outgoing_app(cd->tech, AST_FORMAT_SLINEAR, cd->resource, 30000, - "MeetMe", cd->meetmeopts, NULL, 0, cd->cidnum, cd->cidname, NULL, NULL); + "MeetMe", cd->meetmeopts, NULL, 0, cd->cidnum, cd->cidname, cd->variables, NULL); free(cd); return NULL; } @@ -91,6 +93,9 @@ static void *page_thread(void *data) static void launch_page(struct ast_channel *chan, const char *meetmeopts, const char *tech, const char *resource) { struct calloutdata *cd; + const char *varname; + struct ast_variable *lastvar = NULL; + struct ast_var_t *varptr; pthread_t t; pthread_attr_t attr; cd = malloc(sizeof(struct calloutdata)); @@ -101,6 +106,29 @@ static void launch_page(struct ast_channel *chan, const char *meetmeopts, const ast_copy_string(cd->tech, tech, sizeof(cd->tech)); ast_copy_string(cd->resource, resource, sizeof(cd->resource)); ast_copy_string(cd->meetmeopts, meetmeopts, sizeof(cd->meetmeopts)); + + AST_LIST_TRAVERSE(&chan->varshead, varptr, entries) { + if (!(varname = ast_var_full_name(varptr))) + continue; + if (varname[0] == '_') { + struct ast_variable *newvar = NULL; + + if (varname[1] == '_') { + newvar = ast_variable_new(varname, ast_var_value(varptr)); + } else { + newvar = ast_variable_new(&varname[1], ast_var_value(varptr)); + } + + if (newvar) { + if (lastvar) + lastvar->next = newvar; + else + cd->variables = newvar; + lastvar = newvar; + } + } + } + pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if (ast_pthread_create(&t, &attr, page_thread, cd)) { |