Merged revisions 79174 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r79174 | file | 2007-08-13 11:18:04 -0300 (Mon, 13 Aug 2007) | 4 lines (closes issue #10437) Reported by: haklin Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79175 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
7ff3213f00
commit
2ca342ce99
|
@ -979,9 +979,7 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i,
|
||||||
cid = data;
|
cid = data;
|
||||||
}
|
}
|
||||||
cid = strsep(&cid, "@");
|
cid = strsep(&cid, "@");
|
||||||
tmp->cid.cid_num = ast_strdup(cid);
|
|
||||||
tmp->cid.cid_ani = ast_strdup(cid);
|
tmp->cid.cid_ani = ast_strdup(cid);
|
||||||
tmp->cid.cid_name = ast_strdup(i->them);
|
|
||||||
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
|
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
|
||||||
tmp->cid.cid_dnid = ast_strdup(i->exten);
|
tmp->cid.cid_dnid = ast_strdup(i->exten);
|
||||||
tmp->priority = 1;
|
tmp->priority = 1;
|
||||||
|
|
|
@ -1079,9 +1079,7 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
|
||||||
|
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate a needless NewCallerID event */
|
* generate a needless NewCallerID event */
|
||||||
ch->cid.cid_num = ast_strdup(cid_num);
|
|
||||||
ch->cid.cid_ani = ast_strdup(cid_num);
|
ch->cid.cid_ani = ast_strdup(cid_num);
|
||||||
ch->cid.cid_name = ast_strdup(cid_name);
|
|
||||||
|
|
||||||
if (pvt->cd.redirect_reason >= 0) {
|
if (pvt->cd.redirect_reason >= 0) {
|
||||||
ch->cid.cid_rdnis = ast_strdup(pvt->cd.redirect_number);
|
ch->cid.cid_rdnis = ast_strdup(pvt->cd.redirect_number);
|
||||||
|
|
|
@ -3569,8 +3569,6 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
|
||||||
|
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate a NewCallerID event before the NewChannel event */
|
* generate a NewCallerID event before the NewChannel event */
|
||||||
tmp->cid.cid_num = ast_strdup(i->cid_num);
|
|
||||||
tmp->cid.cid_name = ast_strdup(i->cid_name);
|
|
||||||
if (!ast_strlen_zero(i->ani))
|
if (!ast_strlen_zero(i->ani))
|
||||||
tmp->cid.cid_ani = ast_strdup(i->ani);
|
tmp->cid.cid_ani = ast_strdup(i->ani);
|
||||||
else
|
else
|
||||||
|
|
|
@ -827,9 +827,7 @@ static struct ast_channel *jingle_new(struct jingle *client, struct jingle_pvt *
|
||||||
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
|
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate an unnecessary NewCallerID event */
|
* generate an unnecessary NewCallerID event */
|
||||||
tmp->cid.cid_num = ast_strdup(i->cid_num);
|
|
||||||
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
||||||
tmp->cid.cid_name = ast_strdup(i->cid_name);
|
|
||||||
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
|
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
|
||||||
tmp->cid.cid_dnid = ast_strdup(i->exten);
|
tmp->cid.cid_dnid = ast_strdup(i->exten);
|
||||||
tmp->priority = 1;
|
tmp->priority = 1;
|
||||||
|
|
|
@ -453,8 +453,6 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
|
||||||
|
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
|
|
||||||
p->chan->cid.cid_num = ast_strdup(p->owner->cid.cid_num);
|
|
||||||
p->chan->cid.cid_name = ast_strdup(p->owner->cid.cid_name);
|
|
||||||
p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis);
|
p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis);
|
||||||
p->chan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani);
|
p->chan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani);
|
||||||
p->chan->cid.cid_pres = p->owner->cid.cid_pres;
|
p->chan->cid.cid_pres = p->owner->cid.cid_pres;
|
||||||
|
|
|
@ -1495,9 +1495,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
|
||||||
|
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate a needless NewCallerID 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_ani = ast_strdup(i->cid_num);
|
||||||
tmp->cid.cid_name = ast_strdup(i->cid_name);
|
|
||||||
|
|
||||||
if (!i->adsi)
|
if (!i->adsi)
|
||||||
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
|
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
|
||||||
|
|
|
@ -3206,16 +3206,10 @@ static struct ast_channel *misdn_new(struct chan_list *chlist, int state, char
|
||||||
else
|
else
|
||||||
chan_misdn_log(1, 0, "misdn_new: no exten given.\n");
|
chan_misdn_log(1, 0, "misdn_new: no exten given.\n");
|
||||||
|
|
||||||
if (callerid) {
|
if (callerid)
|
||||||
char *cid_name, *cid_num;
|
|
||||||
|
|
||||||
ast_callerid_parse(callerid, &cid_name, &cid_num);
|
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate a needless NewCallerID event */
|
* generate a needless NewCallerID event */
|
||||||
tmp->cid.cid_num = ast_strdup(cid_num);
|
|
||||||
tmp->cid.cid_ani = ast_strdup(cid_num);
|
tmp->cid.cid_ani = ast_strdup(cid_num);
|
||||||
tmp->cid.cid_name = ast_strdup(cid_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pipe(chlist->pipe) < 0)
|
if (pipe(chlist->pipe) < 0)
|
||||||
ast_log(LOG_ERROR, "Pipe failed\n");
|
ast_log(LOG_ERROR, "Pipe failed\n");
|
||||||
|
|
|
@ -1036,9 +1036,7 @@ static struct ast_channel *oss_new(struct chan_oss_pvt *o, char *ext, char *ctx,
|
||||||
ast_string_field_set(c, language, o->language);
|
ast_string_field_set(c, language, o->language);
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate a needless NewCallerID event */
|
* generate a needless NewCallerID event */
|
||||||
c->cid.cid_num = ast_strdup(o->cid_num);
|
|
||||||
c->cid.cid_ani = ast_strdup(o->cid_num);
|
c->cid.cid_ani = ast_strdup(o->cid_num);
|
||||||
c->cid.cid_name = ast_strdup(o->cid_name);
|
|
||||||
if (!ast_strlen_zero(ext))
|
if (!ast_strlen_zero(ext))
|
||||||
c->cid.cid_dnid = ast_strdup(ext);
|
c->cid.cid_dnid = ast_strdup(ext);
|
||||||
|
|
||||||
|
|
|
@ -890,9 +890,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *conte
|
||||||
|
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate a NewCallerID event before the NewChannel event */
|
* generate a NewCallerID event before the NewChannel event */
|
||||||
tmp->cid.cid_num = ast_strdup(i->cid_num);
|
|
||||||
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
||||||
tmp->cid.cid_name = ast_strdup(i->cid_name);
|
|
||||||
|
|
||||||
i->owner = tmp;
|
i->owner = tmp;
|
||||||
ast_module_ref(ast_module_info->self);
|
ast_module_ref(ast_module_info->self);
|
||||||
|
|
|
@ -4622,9 +4622,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
|
||||||
|
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate an unnecessary NewCallerID event */
|
* generate an unnecessary NewCallerID event */
|
||||||
tmp->cid.cid_num = ast_strdup(i->cid_num);
|
|
||||||
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
||||||
tmp->cid.cid_name = ast_strdup(i->cid_name);
|
|
||||||
if (!ast_strlen_zero(i->rdnis))
|
if (!ast_strlen_zero(i->rdnis))
|
||||||
tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
|
tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
|
||||||
|
|
||||||
|
|
|
@ -3229,9 +3229,7 @@ static struct ast_channel *skinny_new(struct skinny_line *l, int state)
|
||||||
|
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate a needless NewCallerID event */
|
* generate a needless NewCallerID event */
|
||||||
tmp->cid.cid_num = ast_strdup(l->cid_num);
|
|
||||||
tmp->cid.cid_ani = ast_strdup(l->cid_num);
|
tmp->cid.cid_ani = ast_strdup(l->cid_num);
|
||||||
tmp->cid.cid_name = ast_strdup(l->cid_name);
|
|
||||||
|
|
||||||
tmp->priority = 1;
|
tmp->priority = 1;
|
||||||
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
|
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
|
||||||
|
|
|
@ -5616,16 +5616,12 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
|
||||||
/* Don't use ast_set_callerid() here because it will
|
/* Don't use ast_set_callerid() here because it will
|
||||||
* generate a needless NewCallerID event */
|
* generate a needless NewCallerID event */
|
||||||
#ifdef PRI_ANI
|
#ifdef PRI_ANI
|
||||||
tmp->cid.cid_num = ast_strdup(i->cid_num);
|
|
||||||
tmp->cid.cid_name = ast_strdup(i->cid_name);
|
|
||||||
if (!ast_strlen_zero(i->cid_ani))
|
if (!ast_strlen_zero(i->cid_ani))
|
||||||
tmp->cid.cid_ani = ast_strdup(i->cid_ani);
|
tmp->cid.cid_ani = ast_strdup(i->cid_ani);
|
||||||
else
|
else
|
||||||
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
||||||
#else
|
#else
|
||||||
tmp->cid.cid_num = ast_strdup(i->cid_num);
|
|
||||||
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
tmp->cid.cid_ani = ast_strdup(i->cid_num);
|
||||||
tmp->cid.cid_name = ast_strdup(i->cid_name);
|
|
||||||
#endif
|
#endif
|
||||||
tmp->cid.cid_pres = i->callingpres;
|
tmp->cid.cid_pres = i->callingpres;
|
||||||
tmp->cid.cid_ton = i->cid_ton;
|
tmp->cid.cid_ton = i->cid_ton;
|
||||||
|
|
Reference in New Issue