mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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/trunk@220718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -24641,7 +24641,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 */
|
||||
|
Reference in New Issue
Block a user