diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-10-08 10:27:41 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-10-08 10:28:35 +0300 |
commit | 088b4cbc7dbb9248ad6662d7cba95c1e96526e7a (patch) | |
tree | 577614c61a83961a49c7c2514cd70ef89ed310cd /main/asterisk/ASTERISK-20527.patch | |
parent | 623b0e3b0de0a9ed4e27609159c8ae646abb1f6c (diff) | |
download | aports-088b4cbc7dbb9248ad6662d7cba95c1e96526e7a.tar.bz2 aports-088b4cbc7dbb9248ad6662d7cba95c1e96526e7a.tar.xz |
main/asterisk: cherry pick sip registration fix from bug tracker
Diffstat (limited to 'main/asterisk/ASTERISK-20527.patch')
-rw-r--r-- | main/asterisk/ASTERISK-20527.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/main/asterisk/ASTERISK-20527.patch b/main/asterisk/ASTERISK-20527.patch new file mode 100644 index 0000000000..eba41d72ce --- /dev/null +++ b/main/asterisk/ASTERISK-20527.patch @@ -0,0 +1,26 @@ +diff --git a/channels/chan_sip.c b/channels/chan_sip.c +index 7569bba..24a8cec 100644 +--- a/channels/chan_sip.c ++++ b/channels/chan_sip.c +@@ -30189,7 +30189,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) { ++ if (asprintf(®_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) { + 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 */ +diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample +index 81ca998..812be7b 100644 +--- a/configs/sip.conf.sample ++++ b/configs/sip.conf.sample +@@ -711,7 +711,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). |