# rename the variable 'tmp' in zt_new() to 'ast_chan'. # This patch should have no functional effect. Index: trunk/channels/chan_zap.c =================================================================== --- trunk.orig/channels/chan_zap.c 2008-02-27 02:18:04.929859618 +0200 +++ trunk/channels/chan_zap.c 2008-02-27 02:19:34.934988550 +0200 @@ -5825,7 +5825,7 @@ static int zt_indicate(struct ast_channe static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int index, int law, int transfercapability) { - struct ast_channel *tmp; + struct ast_channel *ast_chan; int deflaw; int res; int x,y; @@ -5855,10 +5855,10 @@ static struct ast_channel *zt_new(struct } y++; } while (x < 3); - tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "Zap/%s", chan_name->str); - if (!tmp) + ast_chan = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, "Zap/%s", chan_name->str); + if (!ast_chan) return NULL; - tmp->tech = &zap_tech; + ast_chan->tech = &zap_tech; ps.channo = i->channel; res = ioctl(i->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps); if (res) { @@ -5875,13 +5875,13 @@ static struct ast_channel *zt_new(struct else deflaw = AST_FORMAT_ULAW; } - ast_channel_set_fd(tmp, 0, i->subs[index].zfd); - tmp->nativeformats = AST_FORMAT_SLINEAR | deflaw; + ast_channel_set_fd(ast_chan, 0, i->subs[index].zfd); + ast_chan->nativeformats = AST_FORMAT_SLINEAR | deflaw; /* Start out assuming ulaw since it's smaller :) */ - tmp->rawreadformat = deflaw; - tmp->readformat = deflaw; - tmp->rawwriteformat = deflaw; - tmp->writeformat = deflaw; + ast_chan->rawreadformat = deflaw; + ast_chan->readformat = deflaw; + ast_chan->rawwriteformat = deflaw; + ast_chan->writeformat = deflaw; i->subs[index].linear = 0; zt_setlinear(i->subs[index].zfd, i->subs[index].linear); features = 0; @@ -5909,7 +5909,7 @@ static struct ast_channel *zt_new(struct } if (features) { if (i->dsp) { - ast_debug(1, "Already have a dsp on %s?\n", tmp->name); + ast_debug(1, "Already have a dsp on %s?\n", ast_chan->name); } else { if (i->channel != CHAN_PSEUDO) i->dsp = ast_dsp_new(); @@ -5938,50 +5938,50 @@ static struct ast_channel *zt_new(struct } if (state == AST_STATE_RING) - tmp->rings = 1; - tmp->tech_pvt = i; + ast_chan->rings = 1; + ast_chan->tech_pvt = i; if ((i->sig == SIG_FXOKS) || (i->sig == SIG_FXOGS) || (i->sig == SIG_FXOLS)) { /* Only FXO signalled stuff can be picked up */ - tmp->callgroup = i->callgroup; - tmp->pickupgroup = i->pickupgroup; + ast_chan->callgroup = i->callgroup; + ast_chan->pickupgroup = i->pickupgroup; } if (!ast_strlen_zero(i->language)) - ast_string_field_set(tmp, language, i->language); + ast_string_field_set(ast_chan, language, i->language); if (!i->owner) - i->owner = tmp; + i->owner = ast_chan; if (!ast_strlen_zero(i->accountcode)) - ast_string_field_set(tmp, accountcode, i->accountcode); + ast_string_field_set(ast_chan, accountcode, i->accountcode); if (i->amaflags) - tmp->amaflags = i->amaflags; - i->subs[index].owner = tmp; - ast_copy_string(tmp->context, i->context, sizeof(tmp->context)); - ast_string_field_set(tmp, call_forward, i->call_forward); + ast_chan->amaflags = i->amaflags; + i->subs[index].owner = ast_chan; + ast_copy_string(ast_chan->context, i->context, sizeof(ast_chan->context)); + ast_string_field_set(ast_chan, call_forward, i->call_forward); /* If we've been told "no ADSI" then enforce it */ if (!i->adsi) - tmp->adsicpe = AST_ADSI_UNAVAILABLE; + ast_chan->adsicpe = AST_ADSI_UNAVAILABLE; if (!ast_strlen_zero(i->exten)) - ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten)); + ast_copy_string(ast_chan->exten, i->exten, sizeof(ast_chan->exten)); if (!ast_strlen_zero(i->rdnis)) - tmp->cid.cid_rdnis = ast_strdup(i->rdnis); + ast_chan->cid.cid_rdnis = ast_strdup(i->rdnis); if (!ast_strlen_zero(i->dnid)) - tmp->cid.cid_dnid = ast_strdup(i->dnid); + ast_chan->cid.cid_dnid = ast_strdup(i->dnid); /* Don't use ast_set_callerid() here because it will * generate a needless NewCallerID event */ #ifdef PRI_ANI if (!ast_strlen_zero(i->cid_ani)) - tmp->cid.cid_ani = ast_strdup(i->cid_ani); + ast_chan->cid.cid_ani = ast_strdup(i->cid_ani); else - tmp->cid.cid_ani = ast_strdup(i->cid_num); + ast_chan->cid.cid_ani = ast_strdup(i->cid_num); #else - tmp->cid.cid_ani = ast_strdup(i->cid_num); + ast_chan->cid.cid_ani = ast_strdup(i->cid_num); #endif - tmp->cid.cid_pres = i->callingpres; - tmp->cid.cid_ton = i->cid_ton; - tmp->cid.cid_ani2 = i->cid_ani2; + ast_chan->cid.cid_pres = i->callingpres; + ast_chan->cid.cid_ton = i->cid_ton; + ast_chan->cid.cid_ani2 = i->cid_ani2; #if defined(HAVE_PRI) || defined(HAVE_SS7) - tmp->transfercapability = transfercapability; - pbx_builtin_setvar_helper(tmp, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability)); + ast_chan->transfercapability = transfercapability; + pbx_builtin_setvar_helper(ast_chan, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability)); if (transfercapability & AST_TRANS_CAP_DIGITAL) i->digital = 1; /* Assume calls are not idle calls unless we're told differently */ @@ -5993,24 +5993,24 @@ static struct ast_channel *zt_new(struct /* Assure there is no confmute on this channel */ zt_confmute(i, 0); /* Configure the new channel jb */ - ast_jb_configure(tmp, &global_jbconf); + ast_jb_configure(ast_chan, &global_jbconf); - ast_device_state_changed_literal(tmp->name); + ast_device_state_changed_literal(ast_chan->name); for (v = i->vars ; v ; v = v->next) - pbx_builtin_setvar_helper(tmp, v->name, v->value); + pbx_builtin_setvar_helper(ast_chan, v->name, v->value); if (startpbx) { - if (ast_pbx_start(tmp)) { - ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name); - ast_hangup(tmp); + if (ast_pbx_start(ast_chan)) { + ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ast_chan->name); + ast_hangup(ast_chan); i->owner = NULL; return NULL; } } ast_module_ref(ast_module_info->self); - return tmp; + return ast_chan; }