[Asterisk-Dev] Modules doesn't free from asterisk

Miroslaw KLABA totoro at ovh.net
Wed Apr 23 13:17:12 MST 2003


Hello, 

Here is a patch for H.323 channel.
This patch discrements the usecnt variable when the channel is hanged up.
This patch is to use against the CVS version.

Thanks
Miro



On Thu, Apr 17, 2003 at 01:28:10PM +0200, Miroslaw KLABA wrote:
> Hello,
> 
> Many thanks for this very good tool, which works really well.
> I've got just one problem.
> The modules that stoped working doesn't releases from asterisk:
> I've got around 7 iax peers on a hotline and the peers connect
> and disconnect around 2-3 times a day. And after 2 weeks I had
> someting like this:
> pabx*CLI> show modules
> [...]
> app_dial.so          Dialing Application                      1         
> pbx_wilcalu.so       Wil Cal U (Auto Dialer)                  0         
> pbx_config.so        Text Extension Configuration             0         
> chan_iax.so          Inter Asterisk eXchange                  1050
> res_monitor.so       Call Monitoring Resource                 1         
> res_indications.so   Indications Configuration                0         
> res_crypto.so        Cryptographic Digital Signatures         1         
> res_parking.so       Call Parking Resource                    1         
> res_adsi.so          Call Parking Resource                    1         
> [...]
> 
> asterisk began to hang and we bagan to have low sound quality. More
> over asterisk used lots of cpu, while in a normal way it doesn't go
> above 30%.
> 
> I used Asterisk version CVS-09/09/02-05:12:13 but the problem is the same
> when I used the version CVS-04/14/03-13:24:06 with h.323 modules.
> 
> The only way I found to avoid this problem was to do
> "asterisk -vr 'restart gracefully'" everyday to do it.
> 
> I'd like to know if it's a known problem in Asterisk or if it's a
> configuration problem.
> 
> Thanks
> Miro
> Ovh
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
-------------- next part --------------
--- channels/h323/chan_h323.c	Wed Apr 23 22:00:45 2003
+++ channels/h323/chan_h323.c.new	Wed Apr 23 22:04:41 2003
@@ -463,6 +463,15 @@
 			ast_log(LOG_DEBUG, "ClearCall failed.\n");
 		p->needdestroy = 1;
 	}
+	
+	/* Update usage counter */
+	ast_pthread_mutex_lock(&usecnt_lock);
+	usecnt--;
+	if (usecnt < 0)
+		ast_log(LOG_WARNING, "Usecnt < 0???\n");
+	ast_pthread_mutex_unlock(&usecnt_lock);
+	ast_update_use_count();
+
 
 	
 	ast_pthread_mutex_unlock(&p->lock);


More information about the asterisk-dev mailing list