summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/ael/pval.c4
-rw-r--r--res/parking/parking_bridge_features.c2
-rw-r--r--res/res_parking.c2
-rw-r--r--res/res_pjsip_config_wizard.c2
-rw-r--r--res/res_pjsip_refer.c3
-rw-r--r--res/res_pjsip_session.c6
-rw-r--r--res/res_rtp_asterisk.c28
7 files changed, 27 insertions, 20 deletions
diff --git a/res/ael/pval.c b/res/ael/pval.c
index 6803ab634..b0a04fe2f 100644
--- a/res/ael/pval.c
+++ b/res/ael/pval.c
@@ -4234,7 +4234,7 @@ void add_extensions(struct ael_extension *exten)
pbx_substitute_variables_helper(NULL, exten->name, realext, sizeof(realext) - 1);
if (exten->hints) {
if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, PRIORITY_HINT, NULL, exten->cidmatch,
- exten->hints, NULL, ast_free_ptr, registrar)) {
+ exten->hints, NULL, ast_free_ptr, registrar, NULL, 0)) {
ast_log(LOG_WARNING, "Unable to add step at priority 'hint' of extension '%s'\n",
exten->name);
}
@@ -4314,7 +4314,7 @@ void add_extensions(struct ael_extension *exten)
label = 0;
if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, pr->priority_num, (label?label:NULL), exten->cidmatch,
- app, strdup(appargs), ast_free_ptr, registrar)) {
+ app, strdup(appargs), ast_free_ptr, registrar, NULL, 0)) {
ast_log(LOG_WARNING, "Unable to add step at priority '%d' of extension '%s'\n", pr->priority_num,
exten->name);
}
diff --git a/res/parking/parking_bridge_features.c b/res/parking/parking_bridge_features.c
index 3fa7e42b3..277023333 100644
--- a/res/parking/parking_bridge_features.c
+++ b/res/parking/parking_bridge_features.c
@@ -633,7 +633,7 @@ static int parking_duration_callback(struct ast_bridge_channel *bridge_channel,
ast_debug(3, "An extension for '%s@%s' was already registered by another registrar '%s'\n",
dial_string_flat, PARK_DIAL_CONTEXT, ast_get_extension_registrar(existing_exten));
} else if (ast_add_extension2_nolock(park_dial_context, 1, dial_string_flat, 1, NULL, NULL,
- "Dial", duplicate_returnexten, ast_free_ptr, BASE_REGISTRAR)) {
+ "Dial", duplicate_returnexten, ast_free_ptr, BASE_REGISTRAR, NULL, 0)) {
ast_free(duplicate_returnexten);
ast_log(LOG_ERROR, "Failed to create parking redial parker extension %s@%s - Dial(%s)\n",
dial_string_flat, PARK_DIAL_CONTEXT, returnexten);
diff --git a/res/res_parking.c b/res/res_parking.c
index 171fdce61..94cdb0e6d 100644
--- a/res/res_parking.c
+++ b/res/res_parking.c
@@ -721,7 +721,7 @@ static int parking_add_extension(struct ast_context *context, int replace, const
}
if (ast_add_extension2_nolock(context, replace, extension, priority, NULL, NULL,
- application, data_duplicate, ast_free_ptr, registrar)) {
+ application, data_duplicate, ast_free_ptr, registrar, NULL, 0)) {
ast_free(data_duplicate);
return -1;
}
diff --git a/res/res_pjsip_config_wizard.c b/res/res_pjsip_config_wizard.c
index 2441184a2..83e282821 100644
--- a/res/res_pjsip_config_wizard.c
+++ b/res/res_pjsip_config_wizard.c
@@ -461,7 +461,7 @@ static int add_extension(struct ast_context *context, const char *exten,
}
if (ast_add_extension2_nolock(context, 0, exten, priority, NULL, NULL,
- app, data, free_ptr, BASE_REGISTRAR)) {
+ app, data, free_ptr, BASE_REGISTRAR, NULL, 0)) {
ast_free(data);
return -1;
}
diff --git a/res/res_pjsip_refer.c b/res/res_pjsip_refer.c
index 107a3e7c3..aa2af0933 100644
--- a/res/res_pjsip_refer.c
+++ b/res/res_pjsip_refer.c
@@ -1007,6 +1007,7 @@ static int refer_incoming_refer_request(struct ast_sip_session *session, struct
int response;
static const pj_str_t str_refer_to = { "Refer-To", 8 };
+ static const pj_str_t str_refer_to_s = { "r", 1 };
static const pj_str_t str_replaces = { "Replaces", 8 };
if (!session->channel) {
@@ -1025,7 +1026,7 @@ static int refer_incoming_refer_request(struct ast_sip_session *session, struct
}
/* A Refer-To header is required */
- refer_to = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_refer_to, NULL);
+ refer_to = pjsip_msg_find_hdr_by_names(rdata->msg_info.msg, &str_refer_to, &str_refer_to_s, NULL);
if (!refer_to) {
pjsip_dlg_respond(session->inv_session->dlg, rdata, 400, NULL, NULL, NULL);
ast_debug(3, "Received a REFER without Refer-To on channel '%s' from endpoint '%s'\n",
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index be07e94ab..ad9670cd1 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -2000,6 +2000,12 @@ static enum sip_get_destination_result get_destination(struct ast_sip_session *s
if (!strcmp(session->exten, pickupexten) ||
ast_exists_extension(NULL, session->endpoint->context, session->exten, 1, NULL)) {
+ size_t size = pj_strlen(&sip_ruri->host) + 1;
+ char *domain = ast_alloca(size);
+
+ ast_copy_pj_str(domain, &sip_ruri->host, size);
+ pbx_builtin_setvar_helper(session->channel, "SIPDOMAIN", domain);
+
return SIP_GET_DEST_EXTEN_FOUND;
}
/* XXX In reality, we'll likely have further options so that partial matches
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index b78fc30bd..4c79f8f5b 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -4912,9 +4912,11 @@ static void ast_rtp_prop_set(struct ast_rtp_instance *instance, enum ast_rtp_pro
ast_sockaddr_set_port(&rtp->rtcp->us,
ast_sockaddr_port(&rtp->rtcp->us) + 1);
+ ast_sockaddr_copy(&local_addr, &rtp->rtcp->us);
if (!ast_find_ourip(&local_addr, &rtp->rtcp->us, 0)) {
ast_sockaddr_set_port(&local_addr, ast_sockaddr_port(&rtp->rtcp->us));
} else {
+ /* Failed to get local address reset to use default. */
ast_sockaddr_copy(&local_addr, &rtp->rtcp->us);
}
@@ -5003,31 +5005,31 @@ static int ast_rtp_fd(struct ast_rtp_instance *instance, int rtcp)
static void ast_rtp_remote_address_set(struct ast_rtp_instance *instance, struct ast_sockaddr *addr)
{
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
- struct ast_sockaddr local, us;
+ struct ast_sockaddr local;
+ ast_rtp_instance_get_local_address(instance, &local);
if (!ast_sockaddr_isnull(addr)) {
/* Update the local RTP address with what is being used */
- ast_ouraddrfor(addr, &us);
- ast_rtp_instance_get_local_address(instance, &local);
- ast_sockaddr_set_port(&us, ast_sockaddr_port(&local));
- ast_rtp_instance_set_local_address(instance, &us);
+ if (ast_ouraddrfor(addr, &local)) {
+ /* Failed to update our address so reuse old local address */
+ ast_rtp_instance_get_local_address(instance, &local);
+ } else {
+ ast_rtp_instance_set_local_address(instance, &local);
+ }
}
if (rtp->rtcp) {
ast_debug(1, "Setting RTCP address on RTP instance '%p'\n", instance);
ast_sockaddr_copy(&rtp->rtcp->them, addr);
if (!ast_sockaddr_isnull(addr)) {
- ast_sockaddr_set_port(&rtp->rtcp->them,
- ast_sockaddr_port(addr) + 1);
- }
+ ast_sockaddr_set_port(&rtp->rtcp->them, ast_sockaddr_port(addr) + 1);
- if (!ast_sockaddr_isnull(addr)) {
/* Update the local RTCP address with what is being used */
- ast_sockaddr_set_port(&us, ast_sockaddr_port(&local) + 1);
- ast_sockaddr_copy(&rtp->rtcp->us, &us);
+ ast_sockaddr_set_port(&local, ast_sockaddr_port(&local) + 1);
+ ast_sockaddr_copy(&rtp->rtcp->us, &local);
ast_free(rtp->rtcp->local_addr_str);
- rtp->rtcp->local_addr_str = ast_strdup(ast_sockaddr_stringify(&us));
+ rtp->rtcp->local_addr_str = ast_strdup(ast_sockaddr_stringify(&local));
}
}
@@ -5037,8 +5039,6 @@ static void ast_rtp_remote_address_set(struct ast_rtp_instance *instance, struct
rtp->strict_rtp_state = STRICT_RTP_LEARN;
rtp_learning_seq_init(&rtp->rtp_source_learn, rtp->seqno);
}
-
- return;
}
/*! \brief Write t140 redundacy frame