[asterisk-commits] rizzo: branch rizzo/astobj2 r77651 - /team/rizzo/astobj2/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 28 18:09:54 CDT 2007


Author: rizzo
Date: Sat Jul 28 18:09:53 2007
New Revision: 77651

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77651
Log:
document auto_congest and fix refcount handling

Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=77651&r1=77650&r2=77651
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Sat Jul 28 18:09:53 2007
@@ -1529,7 +1529,7 @@
 static void __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod);
 static void __sip_pretend_ack(struct sip_pvt *p);
 static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod);
-static int auto_congest(void *nothing);
+static int auto_congest(void *arg);
 static int update_call_counter(struct sip_pvt *fup, int event);
 static int hangup_sip2cause(int cause);
 static const char *hangup_cause2sip(int cause);
@@ -3398,13 +3398,15 @@
 	return 0;
 }
 
-/*! \brief Scheduled congestion on a call */
-static int auto_congest(void *nothing)
-{
-	struct sip_pvt *p = nothing;
+/*! \brief Scheduled congestion on a call.
+ * Only called by the scheduler, must return the reference when done.
+ */
+static int auto_congest(void *arg)
+{
+	struct sip_pvt *p = arg;
 
 	sip_pvt_lock(p);
-	p->initid = -1;
+	p->initid = -1;	/* event gone, will not be rescheduled */
 	if (p->owner) {
 		/* XXX fails on possible deadlock */
 		if (!ast_channel_trylock(p->owner)) {
@@ -3415,6 +3417,7 @@
 		}
 	}
 	sip_pvt_unlock(p);
+	dialog_unref(p);
 	return 0;
 }
 




More information about the asterisk-commits mailing list