automerge commit

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

@ -3440,7 +3440,7 @@ enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_cha
}
for (/* ever */;;) {
struct timeval now;
struct timeval now = { 0, };
int to;
to = -1;

@ -770,15 +770,15 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
ch->amaflags = pvt->amaflags;
}
/*
* 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->cid_num)) {
ch->cid.cid_num = strdup(pvt->cid_num);
ch->cid.cid_ani = strdup(pvt->cid_num);
} else if (!ast_strlen_zero(pvt->cd.call_source_e164)) {
ch->cid.cid_num = strdup(pvt->cd.call_source_e164);
ch->cid.cid_ani = strdup(pvt->cd.call_source_e164);
}
if (!ast_strlen_zero(pvt->cid_name))
ch->cid.cid_name = strdup(pvt->cid_name);
if (!ast_strlen_zero(pvt->rdnis)) {
ch->cid.cid_rdnis = strdup(pvt->rdnis);

@ -3442,15 +3442,22 @@ 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);
ast_set_callerid(tmp, i->cid_num, i->cid_name,
i->ani ? i->ani : i->cid_num);
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);
else if (!ast_strlen_zero(i->cid_num))
tmp->cid.cid_ani = strdup(i->cid_num);
tmp->cid.cid_pres = i->calling_pres;
tmp->cid.cid_ton = i->calling_ton;
tmp->cid.cid_tns = i->calling_tns;
if (!ast_strlen_zero(i->language))
ast_copy_string(tmp->language, i->language, sizeof(tmp->language));
if (!ast_strlen_zero(i->dnid))
tmp->cid.cid_dnid = strdup(i->dnid);
tmp->cid.cid_pres = i->calling_pres;
tmp->cid.cid_ton = i->calling_ton;
tmp->cid.cid_tns = i->calling_tns;
if (!ast_strlen_zero(i->accountcode))
ast_copy_string(tmp->accountcode, i->accountcode, sizeof(tmp->accountcode));
if (i->amaflags)
@ -3461,10 +3468,6 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
i->owner = tmp;
i->capability = capability;
ast_setstate(tmp, state);
ast_mutex_lock(&usecnt_lock);
usecnt++;
ast_mutex_unlock(&usecnt_lock);
ast_update_use_count();
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@ -3475,6 +3478,10 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
for (v = i->vars ; v ; v = v->next)
pbx_builtin_setvar_helper(tmp,v->name,v->value);
ast_mutex_lock(&usecnt_lock);
usecnt++;
ast_mutex_unlock(&usecnt_lock);
ast_update_use_count();
}
return tmp;
}

@ -1428,7 +1428,14 @@ 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);
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!ast_strlen_zero(i->cid_num)) {
tmp->cid.cid_num = strdup(i->cid_num);
tmp->cid.cid_ani = strdup(i->cid_num);
}
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
if (!i->adsi)
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
tmp->priority = 1;

@ -2164,7 +2164,12 @@ 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);
ast_set_callerid(tmp, cid_num, cid_name, cid_num);
if (!ast_strlen_zero(cid_num)) {
tmp->cid.cid_num = strdup(cid_num);
tmp->cid.cid_ani = strdup(cid_num);
}
if (!ast_strlen_zero(cid_name))
tmp->cid.cid_name = strdup(cid_name);
}
{

@ -573,7 +573,12 @@ 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);
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!ast_strlen_zero(i->cid_num)) {
tmp->cid.cid_num = strdup(i->cid_num);
tmp->cid.cid_ani = strdup(i->cid_num);
}
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
if (!ast_strlen_zero(i->language))
strncpy(tmp->language,i->language, sizeof(tmp->language)-1);

@ -825,7 +825,14 @@ 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);
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!ast_strlen_zero(i->cid_num)) {
tmp->cid.cid_num = strdup(i->cid_num);
tmp->cid.cid_ani = strdup(i->cid_num);
}
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
i->owner = tmp;
ast_mutex_lock(&usecnt_lock);
usecnt++;

@ -2859,16 +2859,20 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
if (!ast_strlen_zero(i->musicclass))
ast_copy_string(tmp->musicclass, i->musicclass, sizeof(tmp->musicclass));
i->owner = tmp;
ast_mutex_lock(&usecnt_lock);
usecnt++;
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));
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!ast_strlen_zero(i->cid_num)) {
tmp->cid.cid_num = strdup(i->cid_num);
tmp->cid.cid_ani = strdup(i->cid_num);
}
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
if (!ast_strlen_zero(i->rdnis))
tmp->cid.cid_rdnis = strdup(i->rdnis);
if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
tmp->cid.cid_dnid = strdup(i->exten);
tmp->priority = 1;
if (!ast_strlen_zero(i->uri)) {
pbx_builtin_setvar_helper(tmp, "SIPURI", i->uri);
@ -2898,6 +2902,11 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title)
for (v = i->chanvars ; v ; v = v->next)
pbx_builtin_setvar_helper(tmp,v->name,v->value);
ast_mutex_lock(&usecnt_lock);
usecnt++;
ast_mutex_unlock(&usecnt_lock);
ast_update_use_count();
return tmp;
}

@ -2279,7 +2279,14 @@ 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);
ast_set_callerid(tmp, l->cid_num, l->cid_name, l->cid_num);
if (!ast_strlen_zero(l->cid_num)) {
tmp->cid.cid_num = strdup(l->cid_num);
tmp->cid.cid_ani = strdup(l->cid_num);
}
if (!ast_strlen_zero(l->cid_name))
tmp->cid.cid_name = strdup(l->cid_name);
tmp->priority = 1;
tmp->adsicpe = AST_ADSI_UNAVAILABLE;

@ -2647,7 +2647,12 @@ static struct ast_channel *vpb_new(struct vpb_pvt *me, int state, char *context)
cid_name[0] = '\0';
cid_num[0] = '\0';
ast_callerid_split(me->callerid, cid_name, sizeof(cid_name), cid_num, sizeof(cid_num));
ast_set_callerid(tmp, cid_num, cid_name, cid_num);
if (!ast_strlen_zero(cid_num)) {
tmp->cid.cid_num = strdup(cid_num);
tmp->cid.cid_ani = strdup(cid_num);
}
if (!ast_strlen_zero(cid_name))
tmp->cid.cid_name = strdup(cid_name);
}
tmp->tech_pvt = me;

@ -5118,9 +5118,21 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
tmp->cid.cid_dnid = strdup(i->dnid);
#ifdef PRI_ANI
ast_set_callerid(tmp, i->cid_num, i->cid_name, ast_strlen_zero(i->cid_ani) ? i->cid_num : i->cid_ani);
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->cid_ani))
tmp->cid.cid_ani = strdup(i->cid_num);
else if (!ast_strlen_zero(i->cid_num))
tmp->cid.cid_ani = strdup(i->cid_num);
#else
ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
if (!ast_strlen_zero(i->cid_num)) {
tmp->cid.cid_num = strdup(i->cid_num);
tmp->cid.cid_ani = strdup(i->cid_num);
}
if (!ast_strlen_zero(i->cid_name))
tmp->cid.cid_name = strdup(i->cid_name);
#endif
tmp->cid.cid_pres = i->callingpres;
tmp->cid.cid_ton = i->cid_ton;

Loading…
Cancel
Save