[asterisk-commits] rmudgett: trunk r291114 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 11 13:58:53 CDT 2010


Author: rmudgett
Date: Mon Oct 11 13:58:50 2010
New Revision: 291114

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=291114
Log:
Merged revisions 291112-291113 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r291112 | rmudgett | 2010-10-11 13:48:15 -0500 (Mon, 11 Oct 2010) | 20 lines
  
  Merged revisions 291110-291111 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r291110 | rmudgett | 2010-10-11 13:34:22 -0500 (Mon, 11 Oct 2010) | 9 lines
    
    Merged revisions 291109 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r291109 | rmudgett | 2010-10-11 13:29:43 -0500 (Mon, 11 Oct 2010) | 1 line
      
      Add missing unlock to an exception condition in reload_config().
    ........
  ................
    r291111 | rmudgett | 2010-10-11 13:39:06 -0500 (Mon, 11 Oct 2010) | 1 line
    
    Make exit from handle_request_do() consistent.
  ................
................
  r291113 | rmudgett | 2010-10-11 13:51:13 -0500 (Mon, 11 Oct 2010) | 1 line
  
  Move declaration closer to where now used.
................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=291114&r1=291113&r2=291114
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Oct 11 13:58:50 2010
@@ -7400,7 +7400,6 @@
  */
 static struct sip_pvt *find_call(struct sip_request *req, struct ast_sockaddr *addr, const int intended_method)
 {
-	struct sip_pvt *p = NULL;
 	char totag[128];
 	char fromtag[128];
 	const char *callid = get_header(req, "Call-ID");
@@ -7517,6 +7516,8 @@
 
 	/* See if the method is capable of creating a dialog */
 	if (sip_methods[intended_method].can_create == CAN_CREATE_DIALOG) {
+		struct sip_pvt *p = NULL;
+
 		if (intended_method == SIP_REFER) {
 			/* We do support REFER, but not outside of a dialog yet */
 			transmit_response_using_temp(callid, addr, 1, intended_method, req, "603 Declined (no dialog)");
@@ -23529,9 +23530,13 @@
 	return res;
 }
 
-/*! \brief Handle incoming SIP requests (methods)
-\note	This is where all incoming requests go first   */
-/* called with p and p->owner locked */
+/*!
+ * \brief Handle incoming SIP requests (methods)
+ * \note
+ * This is where all incoming requests go first.
+ * \note
+ * called with p and p->owner locked
+ */
 static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct ast_sockaddr *addr, int *recount, int *nounlock)
 {
 	/* Called with p->lock held, as well as p->owner->lock if appropriate, keeping things
@@ -24030,8 +24035,8 @@
 	if (p->owner && !nounlock)
 		ast_channel_unlock(p->owner);
 	sip_pvt_unlock(p);
+	ao2_t_ref(p, -1, "throw away dialog ptr from find_call at end of routine"); /* p is gone after the return */
 	ast_mutex_unlock(&netlock);
-	ao2_t_ref(p, -1, "throw away dialog ptr from find_call at end of routine"); /* p is gone after the return */
 	return 1;
 }
 
@@ -27210,6 +27215,7 @@
 		if (sipsock < 0) {
 			ast_log(LOG_WARNING, "Unable to create SIP socket: %s\n", strerror(errno));
 			ast_config_destroy(cfg);
+			ast_mutex_unlock(&netlock);
 			return -1;
 		} else {
 			/* Allow SIP clients on the same host to access us: */




More information about the asterisk-commits mailing list