[asterisk-commits] russell: branch russell/issue_8637 r51261 - in /team/russell/issue_8637: ./ a...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jan 18 14:45:47 MST 2007


Author: russell
Date: Thu Jan 18 15:45:46 2007
New Revision: 51261

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51261
Log:
Merged revisions 51241,51243,51245,51251,51256 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r51241 | qwell | 2007-01-18 12:28:29 -0600 (Thu, 18 Jan 2007) | 2 lines

Fix an issue with deprecated commands

................
r51243 | file | 2007-01-18 12:36:35 -0600 (Thu, 18 Jan 2007) | 2 lines

Copy MOH settings when calling a peer so that if they put someone on hold or get put on hold themselves they get the right music class. (issue #8840 reported by mdu113)

................
r51245 | qwell | 2007-01-18 12:42:00 -0600 (Thu, 18 Jan 2007) | 4 lines

Fix an issue with file name completion in "module load" and "load".

Issue 8846

................
r51251 | file | 2007-01-18 13:17:34 -0600 (Thu, 18 Jan 2007) | 2 lines

Only start timeout once we reach the end of the files to play back.

................
r51256 | tilghman | 2007-01-18 15:14:24 -0600 (Thu, 18 Jan 2007) | 10 lines

Merged revisions 51255 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51255 | tilghman | 2007-01-18 15:11:34 -0600 (Thu, 18 Jan 2007) | 2 lines

If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748)

........

................

Modified:
    team/russell/issue_8637/   (props changed)
    team/russell/issue_8637/apps/app_speech_utils.c
    team/russell/issue_8637/channels/chan_sip.c
    team/russell/issue_8637/main/channel.c
    team/russell/issue_8637/main/cli.c
    team/russell/issue_8637/main/stdtime/localtime.c

Propchange: team/russell/issue_8637/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/russell/issue_8637/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jan 18 15:45:46 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-51238
+/branches/1.4:1-51260

Modified: team/russell/issue_8637/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/russell/issue_8637/apps/app_speech_utils.c?view=diff&rev=51261&r1=51260&r2=51261
==============================================================================
--- team/russell/issue_8637/apps/app_speech_utils.c (original)
+++ team/russell/issue_8637/apps/app_speech_utils.c Thu Jan 18 15:45:46 2007
@@ -609,7 +609,7 @@
                         /* If audio playback has stopped do a check for timeout purposes */
                         if (chan->streamid == -1 && chan->timingfunc == NULL)
                                 ast_stopstream(chan);
-                        if (chan->stream == NULL && timeout > 0 && started == 0) {
+                        if (chan->stream == NULL && timeout > 0 && started == 0 && !filename_tmp) {
 				time(&start);
 				started = 1;
                         }

Modified: team/russell/issue_8637/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/issue_8637/channels/chan_sip.c?view=diff&rev=51261&r1=51260&r2=51261
==============================================================================
--- team/russell/issue_8637/channels/chan_sip.c (original)
+++ team/russell/issue_8637/channels/chan_sip.c Thu Jan 18 15:45:46 2007
@@ -2626,6 +2626,8 @@
 	ast_string_field_set(dialog, username, peer->username);
 	ast_string_field_set(dialog, peersecret, peer->secret);
 	ast_string_field_set(dialog, peermd5secret, peer->md5secret);
+	ast_string_field_set(dialog, mohsuggest, peer->mohsuggest);
+	ast_string_field_set(dialog, mohinterpret, peer->mohinterpret);
 	ast_string_field_set(dialog, tohost, peer->tohost);
 	ast_string_field_set(dialog, fullcontact, peer->fullcontact);
 	if (!dialog->initreq.headers && !ast_strlen_zero(peer->fromdomain)) {

Modified: team/russell/issue_8637/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/issue_8637/main/channel.c?view=diff&rev=51261&r1=51260&r2=51261
==============================================================================
--- team/russell/issue_8637/main/channel.c (original)
+++ team/russell/issue_8637/main/channel.c Thu Jan 18 15:45:46 2007
@@ -214,7 +214,7 @@
 
 }
 
-static int show_channeltype(int fd, int argc, char *argv[])
+static int show_channeltype_deprecated(int fd, int argc, char *argv[])
 {
 	struct chanlist *cl = NULL;
 
@@ -267,7 +267,60 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_channeltypes(const char *line, const char *word, int pos, int state)
+static int show_channeltype(int fd, int argc, char *argv[])
+{
+	struct chanlist *cl = NULL;
+
+	if (argc != 4)
+		return RESULT_SHOWUSAGE;
+	
+	if (AST_LIST_LOCK(&channels)) {
+		ast_log(LOG_WARNING, "Unable to lock channel list\n");
+		return RESULT_FAILURE;
+	}
+
+	AST_LIST_TRAVERSE(&backends, cl, list) {
+		if (!strncasecmp(cl->tech->type, argv[3], strlen(cl->tech->type))) {
+			break;
+		}
+	}
+
+
+	if (!cl) {
+		ast_cli(fd, "\n%s is not a registered channel driver.\n", argv[3]);
+		AST_LIST_UNLOCK(&channels);
+		return RESULT_FAILURE;
+	}
+
+	ast_cli(fd,
+		"-- Info about channel driver: %s --\n"
+		"  Device State: %s\n"
+		"    Indication: %s\n"
+		"     Transfer : %s\n"
+		"  Capabilities: %d\n"
+		"   Digit Begin: %s\n"
+		"     Digit End: %s\n"
+		"    Send HTML : %s\n"
+		" Image Support: %s\n"
+		"  Text Support: %s\n",
+		cl->tech->type,
+		(cl->tech->devicestate) ? "yes" : "no",
+		(cl->tech->indicate) ? "yes" : "no",
+		(cl->tech->transfer) ? "yes" : "no",
+		(cl->tech->capabilities) ? cl->tech->capabilities : -1,
+		(cl->tech->send_digit_begin) ? "yes" : "no",
+		(cl->tech->send_digit_end) ? "yes" : "no",
+		(cl->tech->send_html) ? "yes" : "no",
+		(cl->tech->send_image) ? "yes" : "no",
+		(cl->tech->send_text) ? "yes" : "no"
+		
+	);
+
+	AST_LIST_UNLOCK(&channels);
+	return RESULT_SUCCESS;
+}
+
+static char *complete_channeltypes_deprecated(const char *line, const char *word, int pos, int state)
 {
 	struct chanlist *cl;
 	int which = 0;
@@ -289,6 +342,28 @@
 	return ret;
 }
 
+static char *complete_channeltypes(const char *line, const char *word, int pos, int state)
+{
+	struct chanlist *cl;
+	int which = 0;
+	int wordlen;
+	char *ret = NULL;
+
+	if (pos != 3)
+		return NULL;
+
+	wordlen = strlen(word);
+
+	AST_LIST_TRAVERSE(&backends, cl, list) {
+		if (!strncasecmp(word, cl->tech->type, wordlen) && ++which > state) {
+			ret = strdup(cl->tech->type);
+			break;
+		}
+	}
+	
+	return ret;
+}
+
 static char show_channeltypes_usage[] =
 "Usage: core show channeltypes\n"
 "       Lists available channel types registered in your Asterisk server.\n";
@@ -304,8 +379,8 @@
 
 static struct ast_cli_entry cli_show_channeltype_deprecated = {
 	{ "show", "channeltype", NULL },
-	show_channeltype, NULL,
-	NULL, complete_channeltypes };
+	show_channeltype_deprecated, NULL,
+	NULL, complete_channeltypes_deprecated };
 
 static struct ast_cli_entry cli_channel[] = {
 	{ { "core", "show", "channeltypes", NULL },

Modified: team/russell/issue_8637/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/russell/issue_8637/main/cli.c?view=diff&rev=51261&r1=51260&r2=51261
==============================================================================
--- team/russell/issue_8637/main/cli.c (original)
+++ team/russell/issue_8637/main/cli.c Thu Jan 18 15:45:46 2007
@@ -1243,12 +1243,33 @@
 	return ast_module_helper(line, word, pos, state, 3, 0);
 }
 
-static char *complete_fn(const char *line, const char *word, int pos, int state)
+static char *complete_fn_2(const char *line, const char *word, int pos, int state)
 {
 	char *c;
 	char filename[256];
 
 	if (pos != 1)
+		return NULL;
+	
+	if (word[0] == '/')
+		ast_copy_string(filename, word, sizeof(filename));
+	else
+		snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_MODULE_DIR, word);
+	
+	c = filename_completion_function(filename, state);
+	
+	if (c && word[0] != '/')
+		c += (strlen(ast_config_AST_MODULE_DIR) + 1);
+	
+	return c ? strdup(c) : c;
+}
+
+static char *complete_fn_3(const char *line, const char *word, int pos, int state)
+{
+	char *c;
+	char filename[256];
+
+	if (pos != 2)
 		return NULL;
 	
 	if (word[0] == '/')
@@ -1391,7 +1412,7 @@
 static struct ast_cli_entry cli_module_load_deprecated = {
 	{ "load", NULL },
 	handle_load_deprecated, NULL,
-	NULL, complete_fn };
+	NULL, complete_fn_2 };
 
 static struct ast_cli_entry cli_module_reload_deprecated = {
 	{ "reload", NULL },
@@ -1460,7 +1481,7 @@
 
 	{ { "module", "load", NULL },
 	handle_load, "Load a module by name",
-	load_help, complete_fn, &cli_module_load_deprecated },
+	load_help, complete_fn_3, &cli_module_load_deprecated },
 
 	{ { "module", "reload", NULL },
 	handle_reload, "Reload configuration",

Modified: team/russell/issue_8637/main/stdtime/localtime.c
URL: http://svn.digium.com/view/asterisk/team/russell/issue_8637/main/stdtime/localtime.c?view=diff&rev=51261&r1=51260&r2=51261
==============================================================================
--- team/russell/issue_8637/main/stdtime/localtime.c (original)
+++ team/russell/issue_8637/main/stdtime/localtime.c Thu Jan 18 15:45:46 2007
@@ -61,6 +61,7 @@
 
 #include "asterisk/lock.h"
 #include "asterisk/localtime.h"
+#include "asterisk/strings.h"
 
 #ifndef lint
 #ifndef NOID
@@ -1055,7 +1056,7 @@
 #ifdef _THREAD_SAFE
 	ast_mutex_lock(&lcl_mutex);
 #endif
-	ast_tzset(zone);
+	ast_tzset(ast_strlen_zero(zone) ? "/etc/localtime" : zone);
 	localsub(timep, 0L, p_tm, zone);
 #ifdef _THREAD_SAFE
 	ast_mutex_unlock(&lcl_mutex);
@@ -1495,8 +1496,8 @@
 #ifdef	_THREAD_SAFE
 	ast_mutex_lock(&lcl_mutex);
 #endif
-	ast_tzset(zone);
-	mktime_return_value = time1(tmp, localsub, 0L, zone);
+	ast_tzset(!ast_strlen_zero(zone) ? zone : "/etc/localtime");
+	mktime_return_value = time1(tmp, localsub, 0L, !ast_strlen_zero(zone) ? zone : "/etc/localtime");
 #ifdef	_THREAD_SAFE
 	ast_mutex_unlock(&lcl_mutex);
 #endif



More information about the asterisk-commits mailing list