[svn-commits] mmichelson: branch 1.6.2 r265699 - in /branches/1.6.2: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 25 16:05:56 CDT 2010


Author: mmichelson
Date: Tue May 25 16:05:54 2010
New Revision: 265699

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=265699
Log:
Merged revisions 265698 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r265698 | mmichelson | 2010-05-25 15:59:04 -0500 (Tue, 25 May 2010) | 12 lines
  
  Properly use peer's outboundproxy for outbound REGISTERs.
  
  The logic used in transmit_register to get the outboundproxy for a peer
  was flawed since this value would be overridden shortly afterwards when
  create_addr was called.
  
  In addition, this also fixes some logic used when parsing users.conf so
  that the peer name is placed in the internally-generated register string
  so that an outboundproxy set in the Asterisk GUI will be used for outbound
  REGISTERs.
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_sip.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=265699&r1=265698&r2=265699
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Tue May 25 16:05:54 2010
@@ -11653,23 +11653,12 @@
 		if (p->do_history)
 			append_history(p, "RegistryInit", "Account: %s@%s", r->username, r->hostname);
 
-		if (!ast_strlen_zero(r->peername)) {
-			if (!(peer = find_peer(r->peername, NULL, 1, FINDPEERS, FALSE, 0))) {
-				ast_log(LOG_WARNING, "Could not find peer %s in transmit_register\n", r->peername);
-			} else {
-				p->peerauth = peer->auth;
-			}
-		}
-		ref_proxy(p, obproxy_get(p, peer)); /* it is ok to pass a NULL peer into obproxy_get() */
-		if (peer) {
-			unref_peer(peer, "transmit_registration: from find_peer operation");
-		}
 		/* Use port number specified if no SRV record was found */
 		if (!r->us.sin_port && r->portno)
 			r->us.sin_port = htons(r->portno);
 
 		/* Find address to hostname */
-		if (create_addr(p, r->hostname, &r->us, 0)) {
+		if (create_addr(p, S_OR(r->peername, r->hostname), &r->us, 0)) {
 			/* we have what we hope is a temporary network error,
 			 * probably DNS.  We need to reschedule a registration try */
 			dialog_unlink_all(p, TRUE, TRUE);
@@ -25107,14 +25096,14 @@
 					if (!ast_strlen_zero(username) && !ast_strlen_zero(host)) {
 						if (!ast_strlen_zero(secret)) {
 							if (!ast_strlen_zero(authuser)) {
-								snprintf(tmp, sizeof(tmp), "%s:%s:%s@%s/%s", username, secret, authuser, host, contact);
+								snprintf(tmp, sizeof(tmp), "%s?%s:%s:%s@%s/%s", cat, username, secret, authuser, host, contact);
 							} else {
-								snprintf(tmp, sizeof(tmp), "%s:%s@%s/%s", username, secret, host, contact);
+								snprintf(tmp, sizeof(tmp), "%s?%s:%s@%s/%s", cat, username, secret, host, contact);
 							}
 						} else if (!ast_strlen_zero(authuser)) {
-							snprintf(tmp, sizeof(tmp), "%s::%s@%s/%s", username, authuser, host, contact);
+							snprintf(tmp, sizeof(tmp), "%s?%s::%s@%s/%s", cat, username, authuser, host, contact);
 						} else {
-							snprintf(tmp, sizeof(tmp), "%s@%s/%s", username, host, contact);
+							snprintf(tmp, sizeof(tmp), "%s?%s@%s/%s", cat, username, host, contact);
 						}
 						if (sip_register(tmp, 0) == 0)
 							registry_count++;




More information about the svn-commits mailing list