diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c index 5f6014ad96..99968ed31d 100644 --- a/cdr/cdr_radius.c +++ b/cdr/cdr_radius.c @@ -239,6 +239,7 @@ static int unload_module(void) static int load_module(void) { struct ast_config *cfg; + int res; const char *tmp; if ((cfg = ast_config_load(cdr_config))) { @@ -257,16 +258,17 @@ static int load_module(void) /* read radiusclient-ng config file */ if (!(rh = rc_read_config(radiuscfg))) { ast_log(LOG_NOTICE, "Cannot load radiusclient-ng configuration file %s.\n", radiuscfg); - return -1; + return AST_MODULE_LOAD_DECLINE; } /* read radiusclient-ng dictionaries */ if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary"))) { ast_log(LOG_NOTICE, "Cannot load radiusclient-ng dictionary file.\n"); - return -1; + return AST_MODULE_LOAD_DECLINE; } - return ast_cdr_register(name, desc, radius_log); + res = ast_cdr_register(name, desc, radius_log); + return AST_MODULE_LOAD_SUCCESS; } AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "RADIUS CDR Backend"); diff --git a/channels/chan_zap.c b/channels/chan_zap.c index a614194354..78e30bccf4 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -5548,7 +5548,7 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int } y++; } while (x < 3); - tmp = ast_channel_alloc(0, state, 0, 0, i->accountcode, i->exten, i->context, i->amaflags, b2); + tmp = ast_channel_alloc(0, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, i->amaflags, b2); if (b2) /*!> b2 can be freed now, it's been copied into the channel structure */ free(b2); if (!tmp) diff --git a/main/channel.c b/main/channel.c index c518e4143b..c93d6ade9e 100644 --- a/main/channel.c +++ b/main/channel.c @@ -710,6 +710,9 @@ struct ast_channel *ast_channel_alloc(int needqueue, int state, const char *cid_ (long) time(NULL), ast_atomic_fetchadd_int(&uniqueint, 1)); } + tmp->cid.cid_name = ast_strdup(cid_name); + tmp->cid.cid_num = ast_strdup(cid_num); + if (!ast_strlen_zero(name_fmt)) { /* Almost every channel is calling this function, and setting the name via the ast_string_field_build() call. * And they all use slightly different formats for their name string. diff --git a/main/pbx.c b/main/pbx.c index 5f3f77b168..edb3d1ba7a 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -515,7 +515,7 @@ int pbx_exec(struct ast_channel *c, /*!< Channel */ const char *saved_c_appl; const char *saved_c_data; - if (c->cdr) + if (c->cdr && !(c->exten[0] == 'h' && c->exten[1] == 0) ) ast_cdr_setapp(c->cdr, app->name, data); /* save channel values */