summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bridges/bridge_native_rtp.c5
-rw-r--r--channels/chan_sip.c4
-rw-r--r--funcs/func_channel.c7
-rw-r--r--main/cdr.c36
-rw-r--r--main/loader.c2
-rw-r--r--main/manager.c20
-rw-r--r--menuselect/Makefile5
-rw-r--r--menuselect/configure.ac4
-rw-r--r--res/res_pjsip_sdp_rtp.c4
9 files changed, 53 insertions, 34 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/channels/chan_sip.c b/channels/chan_sip.c
index 3ff84153d..ee2eee009 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11288,7 +11288,7 @@ static int process_sdp_a_ice(const char *a, struct sip_pvt *p, struct ast_rtp_in
{
struct ast_rtp_engine_ice *ice;
int found = FALSE;
- char ufrag[256], pwd[256], foundation[32], transport[4], address[46], cand_type[6], relay_address[46] = "";
+ char ufrag[256], pwd[256], foundation[33], transport[4], address[46], cand_type[6], relay_address[46] = "";
struct ast_rtp_engine_ice_candidate candidate = { 0, };
unsigned int port, relay_port = 0;
@@ -11302,7 +11302,7 @@ static int process_sdp_a_ice(const char *a, struct sip_pvt *p, struct ast_rtp_in
} else if (sscanf(a, "ice-pwd: %255s", pwd) == 1) {
ice->set_authentication(instance, NULL, pwd);
found = TRUE;
- } else if (sscanf(a, "candidate: %31s %30u %3s %30u %23s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport, (unsigned *)&candidate.priority,
+ } else if (sscanf(a, "candidate: %32s %30u %3s %30u %23s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport, (unsigned *)&candidate.priority,
address, &port, cand_type, relay_address, &relay_port) >= 7) {
if (rtcp_mux_offered && ast_test_flag(&p->flags[2], SIP_PAGE3_RTCP_MUX) && candidate.id > 1) {
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 3005d31b1..793ea3f89 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -69,8 +69,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
Gets or sets variables on the master channel
</synopsis>
<description>
- <para>Allows access to the channel which created the current channel, if any. If the channel is already
- a master channel, then accesses local channel variables.</para>
+ <para>Allows access to the oldest channel associated with the current
+ channel if it still exists. If the channel is the master channel or
+ the master channel no longer exists then access local channel variables
+ instead. In other words, the master channel is the channel identified by
+ the channel's linkedid.</para>
</description>
</function>
<function name="CHANNEL" language="en_US">
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/loader.c b/main/loader.c
index c18fb379f..b9baf3e93 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -202,7 +202,7 @@ static AST_DLLIST_HEAD_STATIC(reload_queue, reload_queue_item);
*
* This is protected by the module_list lock.
*/
-static struct ast_module *resource_being_loaded;
+static struct ast_module * volatile resource_being_loaded;
/*!
* \internal
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
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 0fcd509fb..585202787 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -618,7 +618,7 @@ static void process_ice_attributes(struct ast_sip_session *session, struct ast_s
/* Find all of the candidates */
for (attr_i = 0; attr_i < remote_stream->attr_count; ++attr_i) {
- char foundation[32], transport[32], address[PJ_INET6_ADDRSTRLEN + 1], cand_type[6], relay_address[PJ_INET6_ADDRSTRLEN + 1] = "";
+ char foundation[33], transport[32], address[PJ_INET6_ADDRSTRLEN + 1], cand_type[6], relay_address[PJ_INET6_ADDRSTRLEN + 1] = "";
unsigned int port, relay_port = 0;
struct ast_rtp_engine_ice_candidate candidate = { 0, };
@@ -631,7 +631,7 @@ static void process_ice_attributes(struct ast_sip_session *session, struct ast_s
ast_copy_pj_str(attr_value, (pj_str_t*)&attr->value, sizeof(attr_value));
- if (sscanf(attr_value, "%31s %30u %31s %30u %46s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport,
+ if (sscanf(attr_value, "%32s %30u %31s %30u %46s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport,
(unsigned *)&candidate.priority, address, &port, cand_type, relay_address, &relay_port) < 7) {
/* Candidate did not parse properly */
continue;