diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-12-02 01:01:11 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-12-02 01:01:11 +0000 |
commit | 0242a69b3f6f7bc9fa884d51f89988e3e3ef550d (patch) | |
tree | 975b2dabe30d1a8c86307711c15c13d63c258135 /channels | |
parent | 6b8a8926abfb2c08e61c90e6366806843efb020e (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: https://origsvn.digium.com/svn/asterisk/trunk@7276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_agent.c | 15 | ||||
-rw-r--r-- | channels/chan_local.c | 21 | ||||
-rw-r--r-- | channels/chan_sip.c | 6 |
3 files changed, 30 insertions, 12 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c index e2ef0f203..a754f8a8f 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -910,15 +910,16 @@ static int agent_ack_sleep( void *data ) static struct ast_channel *agent_bridgedchannel(struct ast_channel *chan, struct ast_channel *bridge) { - struct agent_pvt *p; + struct agent_pvt *p = bridge->tech_pvt; struct ast_channel *ret=NULL; - - p = bridge->tech_pvt; - if (chan == p->chan) - ret = bridge->_bridge; - else if (chan == bridge->_bridge) - ret = p->chan; + if (p) { + if (chan == p->chan) + ret = bridge->_bridge; + else if (chan == bridge->_bridge) + ret = p->chan; + } + if (option_debug) ast_log(LOG_DEBUG, "Asked for bridged channel on '%s'/'%s', returning '%s'\n", chan->name, bridge->name, ret ? ret->name : "<none>"); return ret; diff --git a/channels/chan_local.c b/channels/chan_local.c index 6dec650ab..f843fd95d 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -320,6 +320,8 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout) { struct local_pvt *p = ast->tech_pvt; int res; + struct ast_var_t *varptr = NULL, *new; + size_t len, namelen; ast_mutex_lock(&p->lock); if (p->owner->cid.cid_num) @@ -345,9 +347,22 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout) strncpy(p->chan->language, p->owner->language, sizeof(p->chan->language) - 1); strncpy(p->chan->accountcode, p->owner->accountcode, sizeof(p->chan->accountcode) - 1); p->chan->cdrflags = p->owner->cdrflags; - /* move the channel variables from the incoming channel to the outgoing channel */ - AST_LIST_HEAD_SET_NOLOCK(&p->chan->varshead, AST_LIST_FIRST(&p->owner->varshead)); - AST_LIST_HEAD_INIT_NOLOCK(&p->owner->varshead); + + /* copy the channel variables from the incoming channel to the outgoing channel */ + /* Note that due to certain assumptions, they MUST be in the same order */ + AST_LIST_TRAVERSE(&p->owner->varshead, varptr, entries) { + namelen = strlen(varptr->name); + len = sizeof(struct ast_var_t) + namelen + strlen(varptr->value) + 2; + new = malloc(len); + if (new) { + memcpy(new, varptr, len); + new->value = &(new->name[0]) + namelen + 1; + AST_LIST_INSERT_TAIL(&p->chan->varshead, new, entries); + } else { + ast_log(LOG_ERROR, "Out of memory!\n"); + } + } + p->launchedpbx = 1; /* Start switch on sub channel */ diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 0daf12f89..c93f21fa3 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -8604,8 +8604,6 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req) return; } - if (sipdebug) - ast_verbose("* DTMF-relay event received: '%c'\n", buf[0]); if (buf[0] == '*') event = 10; else if (buf[0] == '#') @@ -8618,6 +8616,8 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req) /* send a FLASH event */ struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH, }; ast_queue_frame(p->owner, &f); + if (sipdebug) + ast_verbose("* DTMF-relay event received: FLASH\n"); } else { /* send a DTMF event */ struct ast_frame f = { AST_FRAME_DTMF, }; @@ -8631,6 +8631,8 @@ static void handle_request_info(struct sip_pvt *p, struct sip_request *req) f.subclass = 'A' + (event - 12); } ast_queue_frame(p->owner, &f); + if (sipdebug) + ast_verbose("* DTMF-relay event received: %c\n", f.subclass); } transmit_response(p, "200 OK", req); return; |