diff options
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1c8abd1e1..9cfa64f64 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -30193,9 +30193,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 (asprintf(®_string, "%s?%s:%s@%s/%s", peer->name, peer->username, !ast_strlen_zero(peer->remotesecret) ? peer->remotesecret : peer->secret, peer->tohost, peer->callback) < 0) { - ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); - } else if (reg_string) { + if (ast_asprintf(®_string, "%s?%s:%s@%s/%s", peer->name, peer->username, !ast_strlen_zero(peer->remotesecret) ? peer->remotesecret : peer->secret, peer->tohost, peer->callback) >= 0) { sip_register(reg_string, 0); /* XXX TODO: count in registry_count */ ast_free(reg_string); } |