[asterisk-dev] mmichelson: trunk r185704 - in /trunk: CHANGES main/manager.c

Russell Bryant russell at digium.com
Tue Mar 31 20:55:27 CDT 2009


On Mar 31, 2009, at 7:39 PM, SVN commits to the Digium repositories  
wrote:
> 	c = ast_get_channel_by_name_locked(name);
> 	if (!c) {
> 		astman_send_error(s, m, "No such channel");
> 		return 0;
> +	}
> +	if (causecode > 0) {
> +		if (option_debug >= 1) {
> +			ast_log(LOG_DEBUG, "Setting hangupcause of channel %s to %d (is  
> %d now)\n",
> +				c->name, causecode, c->hangupcause);
> +		}
> +		c->hangupcause = causecode;
> 	}

Please use ast_debug() here.

> 	ast_softhangup(c, AST_SOFTHANGUP_EXPLICIT);
> 	ast_channel_unlock(c);


Also, you can use ast_softhangup_nolock() instead of ast_softhangup()  
since the channel is already locked here.  (I know this didn't get  
changed, but I happened to notice it while reading the diff.)

--
Russell Bryant
Digium, Inc. | Senior Software Engineer, Open Source Team Lead
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org







More information about the asterisk-dev mailing list