[asterisk-commits] chan sip: Support auth username for callbackextension feature (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 9 21:35:43 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: chan_sip: Support auth username for callbackextension feature
......................................................................


chan_sip: Support auth username for callbackextension feature

ASTERISK-20527 #close

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

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



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 @@
 	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 @@
 ; 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 at host/callbackextension
+;        register => fromuser:secret:username at 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).

-- 
To view, visit https://gerrit.asterisk.org/2940
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I659cf7f00836a09d09d146ad226a40477d731239
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Timo Teräs <timo.teras at iki.fi>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list