From 024ee4a43e737a4dc5eca68621dd71b65d386e75 Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Mon, 28 Sep 2009 19:11:53 +0000 Subject: [PATCH] Merged revisions 220718 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r220718 | jpeeler | 2009-09-28 14:10:10 -0500 (Mon, 28 Sep 2009) | 10 lines Fix building of registration entry in build_peer when using callbackextension Check for remotesecret option was unintentionally always true, which therefore caused the secret option to never be used. Thanks to dvossel for pointing out the exact fix. (closes issue #15943) Reported by: tpsast ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@220722 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ade8c64dc0..791dd8be89 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -23539,7 +23539,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str ast_free_ha(oldha); if (!ast_strlen_zero(callback)) { /* build string from peer info */ char *reg_string; - if (asprintf(®_string, "%s?%s:%s@%s/%s", peer->name, peer->username, peer->remotesecret ? peer->remotesecret : peer->secret, peer->tohost, callback) < 0) { + if (asprintf(®_string, "%s?%s:%s@%s/%s", peer->name, peer->username, !ast_strlen_zero(peer->remotesecret) ? peer->remotesecret : peer->secret, peer->tohost, callback) < 0) { ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); } else if (reg_string) { sip_register(reg_string, 0); /* XXX TODO: count in registry_count */