| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2005-09-14 20:46:50 +00:00
										 |  |  |  * Asterisk -- An open source telephony toolkit. | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  |  * Copyright (C) 2004 - 2006, Andy Powell  | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Updated by Mark Spencer <markster@digium.com> | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-14 20:46:50 +00:00
										 |  |  |  * See http://www.asterisk.org for more information about
 | 
					
						
							|  |  |  |  * the Asterisk project. Please do not directly contact | 
					
						
							|  |  |  |  * any of the maintainers of this project for assistance; | 
					
						
							|  |  |  |  * the project provides a web site, mailing lists and IRC | 
					
						
							|  |  |  |  * channels for your use. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software, distributed under the terms of | 
					
						
							|  |  |  |  * the GNU General Public License Version 2. See the LICENSE file | 
					
						
							|  |  |  |  * at the top of the source tree. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-24 20:12:06 +00:00
										 |  |  | /*! \file
 | 
					
						
							| 
									
										
										
										
											2005-09-14 20:46:50 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  |  * \brief Math related dialplan function | 
					
						
							| 
									
										
										
										
											2005-12-30 21:18:06 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * \author Andy Powell | 
					
						
							|  |  |  |  * \author Mark Spencer <markster@digium.com> | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <stdlib.h>
 | 
					
						
							| 
									
										
										
										
											2005-11-08 04:48:00 +00:00
										 |  |  | #include <stdio.h>
 | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | #include <string.h>
 | 
					
						
							|  |  |  | #include <sys/types.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "asterisk.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-11 03:14:05 +00:00
										 |  |  | ASTERISK_FILE_VERSION(__FILE__, "$Revision$") | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-11 03:14:05 +00:00
										 |  |  | #include "asterisk/module.h"
 | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | #include "asterisk/channel.h"
 | 
					
						
							|  |  |  | #include "asterisk/pbx.h"
 | 
					
						
							|  |  |  | #include "asterisk/logger.h"
 | 
					
						
							|  |  |  | #include "asterisk/utils.h"
 | 
					
						
							|  |  |  | #include "asterisk/app.h"
 | 
					
						
							|  |  |  | #include "asterisk/config.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | enum TypeOfFunctions { | 
					
						
							|  |  |  | 	ADDFUNCTION, | 
					
						
							|  |  |  | 	DIVIDEFUNCTION, | 
					
						
							|  |  |  | 	MULTIPLYFUNCTION, | 
					
						
							|  |  |  | 	SUBTRACTFUNCTION, | 
					
						
							|  |  |  | 	MODULUSFUNCTION, | 
					
						
							|  |  |  | 	GTFUNCTION, | 
					
						
							|  |  |  | 	LTFUNCTION, | 
					
						
							|  |  |  | 	GTEFUNCTION, | 
					
						
							|  |  |  | 	LTEFUNCTION, | 
					
						
							|  |  |  | 	EQFUNCTION | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | enum TypeOfResult { | 
					
						
							|  |  |  | 	FLOAT_RESULT, | 
					
						
							|  |  |  | 	INT_RESULT, | 
					
						
							|  |  |  | 	HEX_RESULT, | 
					
						
							|  |  |  | 	CHAR_RESULT | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | static int math(struct ast_channel *chan, char *cmd, char *parse, | 
					
						
							|  |  |  | 		char *buf, size_t len) | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | { | 
					
						
							|  |  |  | 	float fnum1; | 
					
						
							|  |  |  | 	float fnum2; | 
					
						
							|  |  |  | 	float ftmp = 0; | 
					
						
							|  |  |  | 	char *op; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	int iaction = -1; | 
					
						
							|  |  |  | 	int type_of_result = FLOAT_RESULT; | 
					
						
							|  |  |  | 	char *mvalue1, *mvalue2 = NULL, *mtype_of_result; | 
					
						
							| 
									
										
										
										
											2006-01-10 16:08:28 +00:00
										 |  |  | 	AST_DECLARE_APP_ARGS(args, | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 			     AST_APP_ARG(argv0); | 
					
						
							|  |  |  | 			     AST_APP_ARG(argv1); | 
					
						
							| 
									
										
										
										
											2006-01-10 16:08:28 +00:00
										 |  |  | 	); | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	if (ast_strlen_zero(parse)) { | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		ast_log(LOG_WARNING, "Syntax: Math(<number1><op><number 2>[,<type_of_result>]) - missing argument!\n"); | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		return -1; | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-01-10 16:08:28 +00:00
										 |  |  | 	AST_STANDARD_APP_ARGS(args, parse); | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-01-10 16:08:28 +00:00
										 |  |  | 	if (args.argc < 1) { | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		ast_log(LOG_WARNING, "Syntax: Math(<number1><op><number 2>[,<type_of_result>]) - missing argument!\n"); | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		return -1; | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-01-10 16:08:28 +00:00
										 |  |  | 	mvalue1 = args.argv0; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	if ((op = strchr(mvalue1, '+'))) { | 
					
						
							|  |  |  | 		iaction = ADDFUNCTION; | 
					
						
							|  |  |  | 		*op = '\0'; | 
					
						
							|  |  |  | 	} else if ((op = strchr(mvalue1, '-'))) { | 
					
						
							|  |  |  | 		iaction = SUBTRACTFUNCTION; | 
					
						
							|  |  |  | 		*op = '\0'; | 
					
						
							|  |  |  | 	} else if ((op = strchr(mvalue1, '*'))) { | 
					
						
							|  |  |  | 		iaction = MULTIPLYFUNCTION; | 
					
						
							|  |  |  | 		*op = '\0'; | 
					
						
							|  |  |  | 	} else if ((op = strchr(mvalue1, '/'))) { | 
					
						
							|  |  |  | 		iaction = DIVIDEFUNCTION; | 
					
						
							|  |  |  | 		*op = '\0'; | 
					
						
							|  |  |  | 	} else if ((op = strchr(mvalue1, '%'))) { | 
					
						
							|  |  |  | 		iaction = MODULUSFUNCTION; | 
					
						
							|  |  |  | 		*op = '\0'; | 
					
						
							|  |  |  | 	} else if ((op = strchr(mvalue1, '>'))) { | 
					
						
							|  |  |  | 		iaction = GTFUNCTION; | 
					
						
							|  |  |  | 		*op = '\0'; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		if (*(op + 1) == '=') { | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 			*++op = '\0'; | 
					
						
							|  |  |  | 			iaction = GTEFUNCTION; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} else if ((op = strchr(mvalue1, '<'))) { | 
					
						
							|  |  |  | 		iaction = LTFUNCTION; | 
					
						
							|  |  |  | 		*op = '\0'; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		if (*(op + 1) == '=') { | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 			*++op = '\0'; | 
					
						
							|  |  |  | 			iaction = LTEFUNCTION; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} else if ((op = strchr(mvalue1, '='))) { | 
					
						
							|  |  |  | 		iaction = GTFUNCTION; | 
					
						
							|  |  |  | 		*op = '\0'; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		if (*(op + 1) == '=') { | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 			*++op = '\0'; | 
					
						
							|  |  |  | 			iaction = EQFUNCTION; | 
					
						
							|  |  |  | 		} else | 
					
						
							|  |  |  | 			op = NULL; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (op) | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		mvalue2 = op + 1; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* detect wanted type of result */ | 
					
						
							| 
									
										
										
										
											2006-01-10 16:08:28 +00:00
										 |  |  | 	mtype_of_result = args.argv1; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	if (mtype_of_result) { | 
					
						
							|  |  |  | 		if (!strcasecmp(mtype_of_result, "float") | 
					
						
							|  |  |  | 		    || !strcasecmp(mtype_of_result, "f")) | 
					
						
							|  |  |  | 			type_of_result = FLOAT_RESULT; | 
					
						
							|  |  |  | 		else if (!strcasecmp(mtype_of_result, "int") | 
					
						
							|  |  |  | 			 || !strcasecmp(mtype_of_result, "i")) | 
					
						
							|  |  |  | 			type_of_result = INT_RESULT; | 
					
						
							|  |  |  | 		else if (!strcasecmp(mtype_of_result, "hex") | 
					
						
							|  |  |  | 			 || !strcasecmp(mtype_of_result, "h")) | 
					
						
							|  |  |  | 			type_of_result = HEX_RESULT; | 
					
						
							|  |  |  | 		else if (!strcasecmp(mtype_of_result, "char") | 
					
						
							|  |  |  | 			 || !strcasecmp(mtype_of_result, "c")) | 
					
						
							|  |  |  | 			type_of_result = CHAR_RESULT; | 
					
						
							|  |  |  | 		else { | 
					
						
							|  |  |  | 			ast_log(LOG_WARNING, "Unknown type of result requested '%s'.\n", | 
					
						
							|  |  |  | 					mtype_of_result); | 
					
						
							|  |  |  | 			return -1; | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	if (!mvalue1 || !mvalue2) { | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		ast_log(LOG_WARNING, | 
					
						
							|  |  |  | 				"Supply all the parameters - just this once, please\n"); | 
					
						
							|  |  |  | 		return -1; | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (sscanf(mvalue1, "%f", &fnum1) != 1) { | 
					
						
							|  |  |  | 		ast_log(LOG_WARNING, "'%s' is not a valid number\n", mvalue1); | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		return -1; | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (sscanf(mvalue2, "%f", &fnum2) != 1) { | 
					
						
							|  |  |  | 		ast_log(LOG_WARNING, "'%s' is not a valid number\n", mvalue2); | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		return -1; | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	switch (iaction) { | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case ADDFUNCTION: | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		ftmp = fnum1 + fnum2; | 
					
						
							|  |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case DIVIDEFUNCTION: | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		if (fnum2 <= 0) | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 			ftmp = 0;			/* can't do a divide by 0 */ | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		else | 
					
						
							|  |  |  | 			ftmp = (fnum1 / fnum2); | 
					
						
							|  |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case MULTIPLYFUNCTION: | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		ftmp = (fnum1 * fnum2); | 
					
						
							|  |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case SUBTRACTFUNCTION: | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		ftmp = (fnum1 - fnum2); | 
					
						
							|  |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case MODULUSFUNCTION: | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			int inum1 = fnum1; | 
					
						
							|  |  |  | 			int inum2 = fnum2; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			ftmp = (inum1 % inum2); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	case GTFUNCTION: | 
					
						
							|  |  |  | 		ast_copy_string(buf, (fnum1 > fnum2) ? "TRUE" : "FALSE", len); | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case LTFUNCTION: | 
					
						
							|  |  |  | 		ast_copy_string(buf, (fnum1 < fnum2) ? "TRUE" : "FALSE", len); | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case GTEFUNCTION: | 
					
						
							|  |  |  | 		ast_copy_string(buf, (fnum1 >= fnum2) ? "TRUE" : "FALSE", len); | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case LTEFUNCTION: | 
					
						
							|  |  |  | 		ast_copy_string(buf, (fnum1 <= fnum2) ? "TRUE" : "FALSE", len); | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	case EQFUNCTION: | 
					
						
							|  |  |  | 		ast_copy_string(buf, (fnum1 == fnum2) ? "TRUE" : "FALSE", len); | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		break; | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	default: | 
					
						
							|  |  |  | 		ast_log(LOG_WARNING, | 
					
						
							|  |  |  | 				"Something happened that neither of us should be proud of %d\n", | 
					
						
							|  |  |  | 				iaction); | 
					
						
							|  |  |  | 		return -1; | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (iaction < GTFUNCTION || iaction > EQFUNCTION) { | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		if (type_of_result == FLOAT_RESULT) | 
					
						
							|  |  |  | 			snprintf(buf, len, "%f", ftmp); | 
					
						
							|  |  |  | 		else if (type_of_result == INT_RESULT) | 
					
						
							|  |  |  | 			snprintf(buf, len, "%i", (int) ftmp); | 
					
						
							|  |  |  | 		else if (type_of_result == HEX_RESULT) | 
					
						
							|  |  |  | 			snprintf(buf, len, "%x", (unsigned int) ftmp); | 
					
						
							|  |  |  | 		else if (type_of_result == CHAR_RESULT) | 
					
						
							|  |  |  | 			snprintf(buf, len, "%c", (unsigned char) ftmp); | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	return 0; | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-02-11 03:14:05 +00:00
										 |  |  | static struct ast_custom_function math_function = { | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 	.name = "MATH", | 
					
						
							|  |  |  | 	.synopsis = "Performs Mathematical Functions", | 
					
						
							|  |  |  | 	.syntax = "MATH(<number1><op><number 2>[,<type_of_result>])", | 
					
						
							|  |  |  | 	.desc = "Perform calculation on number 1 to number 2. Valid ops are: \n" | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 		"    +,-,/,*,%,<,>,>=,<=,==\n" | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | 		"and behave as their C equivalents.\n" | 
					
						
							|  |  |  | 		"<type_of_result> - wanted type of result:\n" | 
					
						
							|  |  |  | 		"	f, float - float(default)\n" | 
					
						
							|  |  |  | 		"	i, int - integer,\n" | 
					
						
							|  |  |  | 		"	h, hex - hex,\n" | 
					
						
							|  |  |  | 		"	c, char - char\n" | 
					
						
							|  |  |  | 		"Example: Set(i=${MATH(123%16,int)}) - sets var i=11", | 
					
						
							| 
									
										
										
										
											2006-02-11 03:14:05 +00:00
										 |  |  | 	.read = math | 
					
						
							| 
									
										
										
										
											2005-06-09 22:59:08 +00:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2006-02-11 03:14:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | static char *tdesc = "Mathematical dialplan function"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int unload_module(void) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	return ast_custom_function_unregister(&math_function); | 
					
						
							| 
									
										
										
										
											2006-02-11 03:14:05 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int load_module(void) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2006-02-12 04:28:58 +00:00
										 |  |  | 	return ast_custom_function_register(&math_function); | 
					
						
							| 
									
										
										
										
											2006-02-11 03:14:05 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | char *description(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return tdesc; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int usecount(void) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | char *key() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return ASTERISK_GPL_KEY; | 
					
						
							|  |  |  | } |