[asterisk-commits] dvossel: branch 1.6.2 r223089 - in /branches/1.6.2: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 9 10:53:56 CDT 2009


Author: dvossel
Date: Fri Oct  9 10:53:51 2009
New Revision: 223089

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

........
  r223088 | dvossel | 2009-10-09 10:49:30 -0500 (Fri, 09 Oct 2009) | 14 lines
  
  p->peerauth is always empty in transmit_register()
  
  When using callbackextension or specifing the peer name
  in a registration string, the peer's specific auth settings
  set by the "auth=" strings within the peer definition are not
  used by the registration.  Thanks to ebroad for reporting the
  issue and providing the patch.
  
  (closes issue #15955)
  Reported by: ebroad
  Patches:
        regauthfix.patch uploaded by ebroad (license 878)
........

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=223089&r1=223088&r2=223089
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Fri Oct  9 10:53:51 2009
@@ -11165,7 +11165,7 @@
 	char tmp[80];
 	char addr[80];
 	struct sip_pvt *p;
-	struct sip_peer *peer;
+	struct sip_peer *peer = NULL;
 	int res;
 	char *fromdomain;
 
@@ -11183,7 +11183,7 @@
 		snprintf(transport, sizeof(transport), "_sip._%s", get_transport(r->transport)); /* have to use static get_transport function */
 		ast_dnsmgr_lookup(peer ? peer->tohost : r->hostname, &r->us, &r->dnsmgr, sip_cfg.srvlookup ? transport : NULL);
 		if (peer) {
-			unref_peer(peer, "removing peer ref for dnsmgr_lookup");
+			peer = unref_peer(peer, "removing peer ref for dnsmgr_lookup");
 		}
 	}
 
@@ -11198,8 +11198,6 @@
 		}
 	} else {
 		/* Build callid for registration if we haven't registered before */
-		struct sip_peer *peer = NULL;
-
 		if (!r->callid_valid) {
 			build_callid_registry(r, internip.sin_addr, default_fromdomain);
 			r->callid_valid = TRUE;
@@ -11216,6 +11214,8 @@
 		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() */




More information about the asterisk-commits mailing list