diff options
-rw-r--r-- | bridges/bridge_native_rtp.c | 5 | ||||
-rw-r--r-- | main/cdr.c | 36 | ||||
-rw-r--r-- | main/manager.c | 20 | ||||
-rw-r--r-- | menuselect/Makefile | 5 | ||||
-rw-r--r-- | menuselect/configure.ac | 4 |
5 files changed, 43 insertions, 27 deletions
diff --git a/bridges/bridge_native_rtp.c b/bridges/bridge_native_rtp.c index 122c132d6..d490183ff 100644 --- a/bridges/bridge_native_rtp.c +++ b/bridges/bridge_native_rtp.c @@ -755,7 +755,7 @@ static int native_rtp_bridge_compatible(struct ast_bridge *bridge) static int native_rtp_bridge_framehook_attach(struct ast_bridge_channel *bridge_channel) { struct native_rtp_bridge_channel_data *data = bridge_channel->tech_pvt; - static struct ast_framehook_interface hook = { + struct ast_framehook_interface hook = { .version = AST_FRAMEHOOK_INTERFACE_VERSION, .event_cb = native_rtp_framehook, .destroy_cb = __ao2_cleanup, @@ -773,9 +773,10 @@ static int native_rtp_bridge_framehook_attach(struct ast_bridge_channel *bridge_ ast_debug(2, "Bridge '%s'. Attaching hook data %p to '%s'\n", bridge_channel->bridge->uniqueid, data, ast_channel_name(bridge_channel->chan)); - ast_channel_lock(bridge_channel->chan); /* We're giving 1 ref to the framehook and keeping the one from the alloc for ourselves */ hook.data = ao2_bump(data->hook_data); + + ast_channel_lock(bridge_channel->chan); data->hook_data->id = ast_framehook_attach(bridge_channel->chan, &hook); ast_channel_unlock(bridge_channel->chan); if (data->hook_data->id < 0) { diff --git a/main/cdr.c b/main/cdr.c index 0b571fe0e..df5ce5497 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -2094,7 +2094,12 @@ static void handle_dial_message(void *data, struct stasis_subscription *sub, str if (!peer && !caller) { return; } - if (filter_channel_snapshot(peer) || (caller && filter_channel_snapshot(caller))) { + + if (peer && filter_channel_snapshot(peer)) { + return; + } + + if (caller && filter_channel_snapshot(caller)) { return; } @@ -2868,32 +2873,39 @@ int ast_cdr_backend_unsuspend(const char *name) int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be) { - struct cdr_beitem *i = NULL; + struct cdr_beitem *i; + struct cdr_beitem *cur; - if (!name) + if (!name) { return -1; + } if (!be) { ast_log(LOG_WARNING, "CDR engine '%s' lacks backend\n", name); + + return -1; + } + + i = ast_calloc(1, sizeof(*i)); + if (!i) { return -1; } + i->be = be; + ast_copy_string(i->name, name, sizeof(i->name)); + ast_copy_string(i->desc, desc, sizeof(i->desc)); + AST_RWLIST_WRLOCK(&be_list); - AST_RWLIST_TRAVERSE(&be_list, i, list) { - if (!strcasecmp(name, i->name)) { + AST_RWLIST_TRAVERSE(&be_list, cur, list) { + if (!strcasecmp(name, cur->name)) { ast_log(LOG_WARNING, "Already have a CDR backend called '%s'\n", name); AST_RWLIST_UNLOCK(&be_list); + ast_free(i); + return -1; } } - if (!(i = ast_calloc(1, sizeof(*i)))) - return -1; - - i->be = be; - ast_copy_string(i->name, name, sizeof(i->name)); - ast_copy_string(i->desc, desc, sizeof(i->desc)); - AST_RWLIST_INSERT_HEAD(&be_list, i, list); AST_RWLIST_UNLOCK(&be_list); diff --git a/main/manager.c b/main/manager.c index 890a97548..4e611a085 100644 --- a/main/manager.c +++ b/main/manager.c @@ -247,14 +247,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") <parameter name="DNID"> <para>Dialed number identifier</para> </parameter> + <parameter name="EffectiveConnectedLineNum"> + </parameter> + <parameter name="EffectiveConnectedLineName"> + </parameter> <parameter name="TimeToHangup"> <para>Absolute lifetime of the channel</para> </parameter> <parameter name="BridgeID"> <para>Identifier of the bridge the channel is in, may be empty if not in one</para> </parameter> - <parameter name="Linkedid"> - </parameter> <parameter name="Application"> <para>Application currently executing on the channel</para> </parameter> @@ -4583,6 +4585,7 @@ static int action_status(struct mansession *s, const struct message *m) struct timeval now; long elapsed_seconds; struct ast_bridge *bridge; + struct ast_party_id effective_id; ast_channel_lock(chan); @@ -4611,10 +4614,12 @@ static int action_status(struct mansession *s, const struct message *m) channels++; bridge = ast_channel_get_bridge(chan); + effective_id = ast_channel_connected_effective_id(chan); astman_append(s, "Event: Status\r\n" "Privilege: Call\r\n" + /* v-- Start channel snapshot headers */ "Channel: %s\r\n" "ChannelState: %u\r\n" "ChannelStateDesc: %s\r\n" @@ -4627,13 +4632,14 @@ static int action_status(struct mansession *s, const struct message *m) "Exten: %s\r\n" "Priority: %d\r\n" "Uniqueid: %s\r\n" + "Linkedid: %s\r\n" + /* ^-- End channel snapshot headers */ "Type: %s\r\n" "DNID: %s\r\n" "EffectiveConnectedLineNum: %s\r\n" "EffectiveConnectedLineName: %s\r\n" "TimeToHangup: %ld\r\n" "BridgeID: %s\r\n" - "Linkedid: %s\r\n" "Application: %s\r\n" "Data: %s\r\n" "Nativeformats: %s\r\n" @@ -4647,6 +4653,7 @@ static int action_status(struct mansession *s, const struct message *m) "%s" "%s" "\r\n", + /* v-- Start channel snapshot headers */ ast_channel_name(chan), ast_channel_state(chan), ast_state2str(ast_channel_state(chan)), @@ -4659,13 +4666,14 @@ static int action_status(struct mansession *s, const struct message *m) ast_channel_exten(chan), ast_channel_priority(chan), ast_channel_uniqueid(chan), + ast_channel_linkedid(chan), + /* ^-- End channel snapshot headers */ ast_channel_tech(chan)->type, S_OR(ast_channel_dialed(chan)->number.str, ""), - S_COR(ast_channel_connected_effective_id(chan).number.valid, ast_channel_connected_effective_id(chan).number.str, "<unknown>"), - S_COR(ast_channel_connected_effective_id(chan).name.valid, ast_channel_connected_effective_id(chan).name.str, "<unknown>"), + S_COR(effective_id.number.valid, effective_id.number.str, "<unknown>"), + S_COR(effective_id.name.valid, effective_id.name.str, "<unknown>"), (long)ast_channel_whentohangup(chan)->tv_sec, bridge ? bridge->uniqueid : "", - ast_channel_linkedid(chan), ast_channel_appl(chan), ast_channel_data(chan), ast_format_cap_get_names(ast_channel_nativeformats(chan), &codec_buf), diff --git a/menuselect/Makefile b/menuselect/Makefile index cdd7ebedb..c2c9373f4 100644 --- a/menuselect/Makefile +++ b/menuselect/Makefile @@ -64,10 +64,7 @@ all: $(ALL_TGTS) $(OBJS) $(C_OBJS) $(N_OBJS) $(G_OBJS) $(M_OBJS): autoconfig.h menuselect.h -makeopts: makeopts.in -autoconfig.h: autoconfig.h.in - -makeopts autoconfig.h: +makeopts: configure @./configure $(CONFIGURE_SILENT) @echo "****" @echo "**** The configure script was just executed, so 'make' needs to be" diff --git a/menuselect/configure.ac b/menuselect/configure.ac index 5945f5c9f..2dd4ed652 100644 --- a/menuselect/configure.ac +++ b/menuselect/configure.ac @@ -61,9 +61,7 @@ AH_TOP( #endif ) -AH_BOTTOM( -#endif -) +AH_BOTTOM([#endif]) # Checks for programs. AC_PROG_CC |