These mods are to solve the problem in bug 7506. It's a lot of rework to solve a fairly small problem... such is life.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47303 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Steve Murphy
2006-11-07 23:46:41 +00:00
parent b3bf131dd8
commit 517978fd5f
23 changed files with 254 additions and 165 deletions

View File

@@ -1427,7 +1427,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
struct mgcp_endpoint *i = sub->parent;
int fmt;
tmp = ast_channel_alloc(1);
tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, "MGCP/%s@%s-%d", i->name, i->parent->name, sub->id);
if (tmp) {
tmp->tech = &mgcp_tech;
tmp->nativeformats = i->capability;
@@ -1445,7 +1445,6 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
} else {
i->dsp = NULL;
}
ast_setstate(tmp, state);
if (state == AST_STATE_RING)
tmp->rings = 1;
tmp->writeformat = fmt;
@@ -1468,7 +1467,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
/* Don't use ast_set_callerid() here because it will
* generate a NewCallerID event before the NewChannel event */
* generate a needless NewCallerID event */
tmp->cid.cid_num = ast_strdup(i->cid_num);
tmp->cid.cid_ani = ast_strdup(i->cid_num);
tmp->cid.cid_name = ast_strdup(i->cid_name);