[asterisk-commits] junky: branch junky/cli-tls r208547 - in /team/junky/cli-tls: channels/ inclu...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 24 09:53:05 CDT 2009


Author: junky
Date: Fri Jul 24 09:53:01 2009
New Revision: 208547

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=208547
Log:
functions:
is_string_match_cli_filters
tls_remove_channel
tls_add_channel

must be prefixed with ast_ to be able to used in different modules, tested with chan_oss.c

Also, added the va_start to get my_printf() to works properly, with flag.



Modified:
    team/junky/cli-tls/channels/chan_oss.c
    team/junky/cli-tls/include/asterisk/logger.h
    team/junky/cli-tls/main/logger.c
    team/junky/cli-tls/main/pbx.c

Modified: team/junky/cli-tls/channels/chan_oss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/channels/chan_oss.c?view=diff&rev=208547&r1=208546&r2=208547
==============================================================================
--- team/junky/cli-tls/channels/chan_oss.c (original)
+++ team/junky/cli-tls/channels/chan_oss.c Fri Jul 24 09:53:01 2009
@@ -798,8 +798,8 @@
 	if (c == NULL)
 		return NULL;
 	/* TODO add that newly created channel to the TLS container
-	tls_add_channel(c);
 	*/
+	ast_tls_add_channel(c);
 	c->tech = &oss_tech;
 	if (o->sounddev < 0)
 		setformat(o, O_RDWR);

Modified: team/junky/cli-tls/include/asterisk/logger.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/include/asterisk/logger.h?view=diff&rev=208547&r1=208546&r2=208547
==============================================================================
--- team/junky/cli-tls/include/asterisk/logger.h (original)
+++ team/junky/cli-tls/include/asterisk/logger.h Fri Jul 24 09:53:01 2009
@@ -213,11 +213,11 @@
 void ast_logger_unregister_level(const char *name);
 
 /* To add a channel to a TLS object */
-int tls_add_channel(struct ast_channel *chan);
-
-int tls_remove_channel(struct ast_channel *chan);
-
-int is_string_match_cli_filters(void);
+int ast_tls_add_channel(struct ast_channel *chan);
+
+int ast_tls_remove_channel(struct ast_channel *chan);
+
+int ast_is_string_match_cli_filters(void);
 struct ast_cli_filter *ast_filter_get_by_name(const char *name);
 
 

Modified: team/junky/cli-tls/main/logger.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/main/logger.c?view=diff&rev=208547&r1=208546&r2=208547
==============================================================================
--- team/junky/cli-tls/main/logger.c (original)
+++ team/junky/cli-tls/main/logger.c Fri Jul 24 09:53:01 2009
@@ -1208,7 +1208,7 @@
 	   ignore if the string doesnt match these filters
 	*/
 
-	if (is_string_match_cli_filters() <= 0) {
+	if (ast_is_string_match_cli_filters() <= 0) {
 		junky_printf("No skip!\n");
 	} else {
 		junky_printf("skip!\n");
@@ -1370,7 +1370,7 @@
 	/* Set type */
 	logmsg->type = LOGMSG_VERBOSE;
 
-        if (is_string_match_cli_filters()<= 0) {
+        if (ast_is_string_match_cli_filters()<= 0) {
                 junky_printf("No skip!\n");
         } else {
 		junky_printf("skip!\n");
@@ -1544,7 +1544,7 @@
 
 //http://pastebin.ca/1474652
 /* Function used to add a specific channel to the TLS container */
-int tls_add_channel(struct ast_channel *chan){
+int ast_tls_add_channel(struct ast_channel *chan){
         struct logger_filter_list_item *filter;
         int res = 0;
 
@@ -1568,7 +1568,7 @@
 /* Function used to remove a specific channel from the TLS container 
 Will be used for different channel driver monitor threads
 */
-int tls_remove_channel(struct ast_channel *chan){
+int ast_tls_remove_channel(struct ast_channel *chan){
 	struct logger_filter_list_item *filter;
 	int res = 0;
 
@@ -1615,7 +1615,7 @@
 	*/
 }
 
-int is_string_match_cli_filters(void) {
+int ast_is_string_match_cli_filters(void) {
 	int res = -1;
 	struct logger_filter_list_item *filter;
 	struct ast_cli_filter *c;
@@ -1671,14 +1671,15 @@
 	va_list ap;
 	char *buf;	
 
+	va_start(ap, fmt);
         if (ast_vasprintf(&buf, fmt, ap) < 0) {
                 va_end(ap);
                 return;
         }
         va_end(ap);
 
-	//printf("buffer is:%s", buf);
-	//ast_free(buf);
+	printf("buffer is:%s", buf);
+	ast_free(buf);
 #endif
 }
 

Modified: team/junky/cli-tls/main/pbx.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/junky/cli-tls/main/pbx.c?view=diff&rev=208547&r1=208546&r2=208547
==============================================================================
--- team/junky/cli-tls/main/pbx.c (original)
+++ team/junky/cli-tls/main/pbx.c Fri Jul 24 09:53:01 2009
@@ -4936,7 +4936,7 @@
 	 */
 	struct ast_channel *c = data;
 
-	tls_add_channel(c);
+	ast_tls_add_channel(c);
 
 	__ast_pbx_run(c, NULL);
 	decrease_call_count();




More information about the asterisk-commits mailing list