summaryrefslogtreecommitdiff
path: root/res/res_pjsip
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-03-10 12:53:00 +0000
committerJoshua Colp <jcolp@digium.com>2014-03-10 12:53:00 +0000
commitaa57dcf6341a9a6e91e93cda14258ea3ba48af60 (patch)
treece0553a2af36267d2cf3bf96ac8b6bf2e8111ba5 /res/res_pjsip
parent3ff60b75b144d70034a768fc7d7da4537bf7cd7a (diff)
AST-2014-003: res_pjsip: When handling 401/407 responses don't assume a request will have an endpoint.
This change removes the assumption that an outgoing request will always have an endpoint and makes the authenticate_qualify option work once again. (closes issue ASTERISK-23210) Reported by: Joshua Colp ........ Merged revisions 410306 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip')
-rw-r--r--res/res_pjsip/pjsip_options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 2fe104aa8..c72e58972 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -226,7 +226,7 @@ static int qualify_contact(struct ast_sip_endpoint *endpoint, struct ast_sip_con
RAII_VAR(struct ast_sip_endpoint *, endpoint_local, ao2_bump(endpoint), ao2_cleanup);
- if (!endpoint_local) {
+ if (!endpoint_local && contact->authenticate_qualify) {
struct ao2_iterator *endpoint_iterator = find_endpoints(contact);
/* try to find endpoints that are associated with the contact */
@@ -256,7 +256,7 @@ static int qualify_contact(struct ast_sip_endpoint *endpoint, struct ast_sip_con
init_start_time(contact);
ao2_ref(contact, +1);
- if (ast_sip_send_request(tdata, NULL, endpoint_local, contact,
+ if (ast_sip_send_request(tdata, NULL, contact->authenticate_qualify ? endpoint_local : NULL, contact,
qualify_contact_cb) != PJ_SUCCESS) {
/* The callback will be called so we don't need to drop the contact ref*/
ast_log(LOG_ERROR, "Unable to send request to qualify contact %s\n",