automerge commit

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@36750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Automerge script 19 years ago
parent ec42b4f2b1
commit fd757fcf51

@ -661,18 +661,8 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
/* Call on this agent */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "outgoing agentcall, to agent '%s', on '%s'\n", p->agent, p->chan->name);
if (p->chan->cid.cid_num)
free(p->chan->cid.cid_num);
if (ast->cid.cid_num)
p->chan->cid.cid_num = strdup(ast->cid.cid_num);
else
p->chan->cid.cid_num = NULL;
if (p->chan->cid.cid_name)
free(p->chan->cid.cid_name);
if (ast->cid.cid_name)
p->chan->cid.cid_name = strdup(ast->cid.cid_name);
else
p->chan->cid.cid_name = NULL;
ast_set_callerid(p->chan,
ast->cid.cid_num, ast->cid.cid_name, NULL);
ast_channel_inherit_variables(ast, p->chan);
res = ast_call(p->chan, p->loginchan, 0);
CLEANUP(ast,p);

@ -328,26 +328,15 @@ static int features_call(struct ast_channel *ast, char *dest, int timeout)
ast_mutex_lock(&p->lock);
x = indexof(p, ast, 0);
if (!x && p->subchan) {
if (p->owner->cid.cid_num)
p->subchan->cid.cid_num = strdup(p->owner->cid.cid_num);
else
p->subchan->cid.cid_num = NULL;
if (p->owner->cid.cid_name)
p->subchan->cid.cid_name = strdup(p->owner->cid.cid_name);
else
p->subchan->cid.cid_name = NULL;
ast_set_callerid(p->subchan,
p->owner->cid.cid_num, p->owner->cid.cid_name,
p->owner->cid.cid_ani ? p->owner->cid.cid_ani : p->owner->cid.cid_num);
if (p->owner->cid.cid_rdnis)
p->subchan->cid.cid_rdnis = strdup(p->owner->cid.cid_rdnis);
else
p->subchan->cid.cid_rdnis = NULL;
if (p->owner->cid.cid_ani)
p->subchan->cid.cid_ani = strdup(p->owner->cid.cid_ani);
else
p->subchan->cid.cid_ani = NULL;
p->subchan->cid.cid_pres = p->owner->cid.cid_pres;
strncpy(p->subchan->language, p->owner->language, sizeof(p->subchan->language) - 1);
strncpy(p->subchan->accountcode, p->owner->accountcode, sizeof(p->subchan->accountcode) - 1);

@ -769,16 +769,17 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
if (pvt->amaflags) {
ch->amaflags = pvt->amaflags;
}
if (!ast_strlen_zero(pvt->cid_num)) {
ch->cid.cid_num = strdup(pvt->cid_num);
} else if (!ast_strlen_zero(pvt->cd.call_source_e164)) {
ch->cid.cid_num = strdup(pvt->cd.call_source_e164);
}
if (!ast_strlen_zero(pvt->cid_name)) {
ch->cid.cid_name = strdup(pvt->cid_name);
} else if (!ast_strlen_zero(pvt->cd.call_source_name)) {
ch->cid.cid_name = strdup(pvt->cd.call_source_name);
}
/*
* If cid_num and cdi.call_source_e164 are both null, then
* ast_set_callerid will do the right thing and leave the
* cid_num and cid_ani for the channel alone.
*/
ast_set_callerid(ch,
!ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164,
pvt->cid_name,
!ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164);
if (!ast_strlen_zero(pvt->rdnis)) {
ch->cid.cid_rdnis = strdup(pvt->rdnis);
}

@ -3412,12 +3412,8 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
tmp->writeformat = ast_best_codec(capability);
tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
if (!ast_strlen_zero(i->cid_num))
tmp->cid.cid_num = strdup(i->cid_num);
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
if (!ast_strlen_zero(i->ani))
tmp->cid.cid_ani = strdup(i->ani);
ast_set_callerid(tmp, i->cid_num, i->cid_name,
i->ani ? i->ani : i->cid_num);
if (!ast_strlen_zero(i->language))
ast_copy_string(tmp->language, i->language, sizeof(tmp->language));
if (!ast_strlen_zero(i->dnid))

@ -336,26 +336,16 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout)
size_t len, namelen;
ast_mutex_lock(&p->lock);
if (p->owner->cid.cid_num)
p->chan->cid.cid_num = strdup(p->owner->cid.cid_num);
else
p->chan->cid.cid_num = NULL;
if (p->owner->cid.cid_name)
p->chan->cid.cid_name = strdup(p->owner->cid.cid_name);
else
p->chan->cid.cid_name = NULL;
ast_set_callerid(p->chan,
p->owner->cid.cid_num, p->owner->cid.cid_name,
p->owner->cid.cid_ani ? p->chan->cid.cid_ani : p->owner->cid.cid_num);
if (p->owner->cid.cid_rdnis)
p->chan->cid.cid_rdnis = strdup(p->owner->cid.cid_rdnis);
else
p->chan->cid.cid_rdnis = NULL;
if (p->owner->cid.cid_ani)
p->chan->cid.cid_ani = strdup(p->owner->cid.cid_ani);
else
p->chan->cid.cid_ani = NULL;
p->chan->cid.cid_pres = p->owner->cid.cid_pres;
strncpy(p->chan->language, p->owner->language, sizeof(p->chan->language) - 1);

@ -1428,10 +1428,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
strncpy(tmp->call_forward, i->call_forward, sizeof(tmp->call_forward) - 1);
strncpy(tmp->context, i->context, sizeof(tmp->context)-1);
strncpy(tmp->exten, i->exten, sizeof(tmp->exten)-1);
if (!ast_strlen_zero(i->cid_num))
tmp->cid.cid_num = strdup(i->cid_num);
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!i->adsi)
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
tmp->priority = 1;
@ -2621,21 +2618,10 @@ static void *mgcp_ss(void *data)
/*res = tone_zone_play_tone(p->subs[index].zfd, -1);*/
ast_indicate(chan, -1);
strncpy(chan->exten, exten, sizeof(chan->exten)-1);
if (!ast_strlen_zero(p->cid_num)) {
if (!p->hidecallerid) {
/* SC: free existing chan->callerid */
if (chan->cid.cid_num)
free(chan->cid.cid_num);
chan->cid.cid_num = strdup(p->cid_num);
/* SC: free existing chan->callerid */
if (chan->cid.cid_name)
free(chan->cid.cid_name);
chan->cid.cid_name = strdup(p->cid_name);
}
if (chan->cid.cid_ani)
free(chan->cid.cid_ani);
chan->cid.cid_ani = strdup(p->cid_num);
}
ast_set_callerid(chan,
p->hidecallerid ? "" : p->cid_num,
p->hidecallerid ? "" : p->cid_name,
chan->cid.cid_ani ? NULL : p->cid_num);
ast_setstate(chan, AST_STATE_RING);
/*zt_enable_ec(p);*/
if (p->dtmfmode & MGCP_DTMF_HYBRID) {
@ -2692,12 +2678,7 @@ static void *mgcp_ss(void *data)
}
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
if (chan->cid.cid_num)
free(chan->cid.cid_num);
chan->cid.cid_num = NULL;
if (chan->cid.cid_name)
free(chan->cid.cid_name);
chan->cid.cid_name = NULL;
ast_set_callerid(chan, "", "", NULL);
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
len = 0;
@ -2776,14 +2757,7 @@ static void *mgcp_ss(void *data)
}
/* Enable Caller*ID if enabled */
p->hidecallerid = 0;
if (chan->cid.cid_num)
free(chan->cid.cid_num);
if (!ast_strlen_zero(p->cid_num))
chan->cid.cid_num = strdup(p->cid_num);
if (chan->cid.cid_name)
free(chan->cid.cid_name);
if (!ast_strlen_zero(p->cid_name))
chan->cid.cid_name = strdup(p->cid_name);
ast_set_callerid(chan, p->cid_num, p->cid_name, NULL);
/*res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_DIALRECALL);*/
transmit_notify_request(sub, "L/sl");
len = 0;

@ -2164,10 +2164,7 @@ struct ast_channel *misdn_new(struct chan_list *chlist, int state, char * name,
char *cid_name, *cid_num;
ast_callerid_parse(callerid, &cid_name, &cid_num);
if (cid_name)
tmp->cid.cid_name=strdup(cid_name);
if (cid_num)
tmp->cid.cid_num=strdup(cid_num);
ast_set_callerid(tmp, cid_num, cid_name, cid_num);
}
{

@ -576,10 +576,7 @@ struct ast_channel *ast_modem_new(struct ast_modem_pvt *i, int state)
tmp->tech_pvt = i;
strncpy(tmp->context, i->context, sizeof(tmp->context)-1);
if (!ast_strlen_zero(i->cid_num))
tmp->cid.cid_num = strdup(i->cid_num);
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!ast_strlen_zero(i->language))
strncpy(tmp->language,i->language, sizeof(tmp->language)-1);

@ -825,10 +825,7 @@ static struct ast_channel *phone_new(struct phone_pvt *i, int state, char *conte
strncpy(tmp->exten, "s", sizeof(tmp->exten) - 1);
if (!ast_strlen_zero(i->language))
strncpy(tmp->language, i->language, sizeof(tmp->language)-1);
if (!ast_strlen_zero(i->cid_num))
tmp->cid.cid_num = strdup(i->cid_num);
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
i->owner = tmp;
ast_mutex_lock(&usecnt_lock);
usecnt++;

@ -2855,10 +2855,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
ast_mutex_unlock(&usecnt_lock);
ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
if (!ast_strlen_zero(i->cid_num))
tmp->cid.cid_num = strdup(i->cid_num);
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!ast_strlen_zero(i->rdnis))
tmp->cid.cid_rdnis = strdup(i->rdnis);
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))

@ -1741,11 +1741,12 @@ static void *skinny_ss(void *data)
getforward = 0;
} else {
strncpy(chan->exten, exten, sizeof(chan->exten)-1);
if (!ast_strlen_zero(l->cid_num)) {
if (!l->hidecallerid) {
chan->cid.cid_num = strdup(l->cid_num);
chan->cid.cid_ani = strdup(l->cid_num);
}
ast_set_callerid(chan,
l->hidecallerid ? "" : l->cid_num,
l->hidecallerid ? "" : l->cid_name,
chan->cid.cid_ani ? NULL : l->cid_num);
ast_setstate(chan, AST_STATE_RING);
res = ast_pbx_run(chan);
if (res) {
@ -1792,14 +1793,7 @@ static void *skinny_ss(void *data)
}
/* Disable Caller*ID if enabled */
l->hidecallerid = 1;
if (chan->cid.cid_num) {
free(chan->cid.cid_num);
}
chan->cid.cid_num = NULL;
if (chan->cid.cid_name) {
free(chan->cid.cid_name);
}
chan->cid.cid_name = NULL;
ast_set_callerid(chan, "", "", NULL);
transmit_tone(s, SKINNY_DIALTONE);
len = 0;
memset(exten, 0, sizeof(exten));
@ -1873,18 +1867,7 @@ static void *skinny_ss(void *data)
}
/* Enable Caller*ID if enabled */
l->hidecallerid = 0;
if (chan->cid.cid_num) {
free(chan->cid.cid_num);
}
if (!ast_strlen_zero(l->cid_num)) {
chan->cid.cid_num = strdup(l->cid_num);
}
if (chan->cid.cid_name) {
free(chan->cid.cid_name);
}
if (!ast_strlen_zero(l->cid_name)) {
chan->cid.cid_name = strdup(l->cid_name);
}
ast_set_callerid(chan, l->cid_num, l->cid_name, NULL);
transmit_tone(s, SKINNY_DIALTONE);
len = 0;
memset(exten, 0, sizeof(exten));
@ -2296,12 +2279,7 @@ static struct ast_channel *skinny_new(struct skinny_subchannel *sub, int state)
strncpy(tmp->call_forward, l->call_forward, sizeof(tmp->call_forward) - 1);
strncpy(tmp->context, l->context, sizeof(tmp->context)-1);
strncpy(tmp->exten,l->exten, sizeof(tmp->exten)-1);
if (!ast_strlen_zero(l->cid_num)) {
tmp->cid.cid_num = strdup(l->cid_num);
}
if (!ast_strlen_zero(l->cid_name)) {
tmp->cid.cid_name = strdup(l->cid_name);
}
ast_set_callerid(tmp, l->cid_num, l->cid_name, l->cid_num);
tmp->priority = 1;
tmp->adsicpe = AST_ADSI_UNAVAILABLE;

Loading…
Cancel
Save