aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk/ASTERISK-20527.patch
blob: e2095bed41be066ce40e5ab1eba7073233c2834d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 538c6415c6d255876a808d69acd9f5ebd603b286 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Fri, 3 Jun 2016 09:33:08 +0300
Subject: [PATCH 1/1] chan_sip: Support auth username for callbackextension
 feature

ASTERISK-20527 #close

Change-Id: I659cf7f00836a09d09d146ad226a40477d731239
---
 channels/chan_sip.c             | 2 +-
 configs/samples/sip.conf.sample | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 19f8aa3..03cba92 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -31811,7 +31811,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
 	olddirectmediaacl = ast_free_acl_list(olddirectmediaacl);
 	if (!ast_strlen_zero(peer->callback)) { /* build string from peer info */
 		char *reg_string;
-		if (ast_asprintf(&reg_string, "%s?%s:%s@%s/%s", peer->name, peer->username, !ast_strlen_zero(peer->remotesecret) ? peer->remotesecret : peer->secret, peer->tohost, peer->callback) >= 0) {
+		if (ast_asprintf(&reg_string, "%s?%s:%s:%s@%s/%s", peer->name, S_OR(peer->fromuser, peer->username), S_OR(peer->remotesecret, peer->secret), peer->username, peer->tohost, peer->callback) >= 0) {
 			sip_register(reg_string, 0); /* XXX TODO: count in registry_count */
 			ast_free(reg_string);
 		}
diff --git a/configs/samples/sip.conf.sample b/configs/samples/sip.conf.sample
index 8f28e26..a7b74df 100644
--- a/configs/samples/sip.conf.sample
+++ b/configs/samples/sip.conf.sample
@@ -786,7 +786,7 @@ srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
 ; A similar effect can be achieved by adding a "callbackextension" option in a peer section.
 ; this is equivalent to having the following line in the general section:
 ;
-;        register => username:secret@host/callbackextension
+;        register => fromuser:secret:username@host/callbackextension
 ;
 ; and more readable because you don't have to write the parameters in two places
 ; (note that the "port" is ignored - this is a bug that should be fixed).
-- 
2.10.0