[asterisk-commits] jpeeler: branch jpeeler/chan_dahdi14 r119418 - in /team/jpeeler/chan_dahdi14:...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri May 30 16:21:00 CDT 2008
Author: jpeeler
Date: Fri May 30 16:21:00 2008
New Revision: 119418
URL: http://svn.digium.com/view/asterisk?view=rev&rev=119418
Log:
add configuration option to control channel name
Modified:
team/jpeeler/chan_dahdi14/apps/app_chanspy.c
team/jpeeler/chan_dahdi14/apps/app_zapscan.c
team/jpeeler/chan_dahdi14/include/asterisk/options.h
team/jpeeler/chan_dahdi14/main/asterisk.c
Modified: team/jpeeler/chan_dahdi14/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/apps/app_chanspy.c?view=diff&rev=119418&r1=119417&r2=119418
==============================================================================
--- team/jpeeler/chan_dahdi14/apps/app_chanspy.c (original)
+++ team/jpeeler/chan_dahdi14/apps/app_chanspy.c Fri May 30 16:21:00 2008
@@ -461,6 +461,7 @@
const char *exten, const char *context, struct chanspy_ds *chanspy_ds)
{
struct ast_channel *this;
+ char channel_name[AST_CHANNEL_NAME];
redo:
if (spec)
@@ -473,7 +474,8 @@
if (!this)
return NULL;
- if (!strncmp(this->name, "Zap/pseudo", 10)) {
+ snprintf(channel_name, AST_CHANNEL_NAME, "%s/pseudo", dahdi_chan_name);
+ if (!strncmp(this->name, channel_name, 10)) {
ast_channel_unlock(this);
goto redo;
} else if (this == chan) {
Modified: team/jpeeler/chan_dahdi14/apps/app_zapscan.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/apps/app_zapscan.c?view=diff&rev=119418&r1=119417&r2=119418
==============================================================================
--- team/jpeeler/chan_dahdi14/apps/app_zapscan.c (original)
+++ team/jpeeler/chan_dahdi14/apps/app_zapscan.c Fri May 30 16:21:00 2008
@@ -74,7 +74,7 @@
static struct ast_channel *get_zap_channel_locked(int num) {
char name[80];
- snprintf(name,sizeof(name),"Zap/%d-1",num);
+ snprintf(name,sizeof(name),"%s/%d-1", dahdi_chan_name, num);
return ast_get_channel_by_name_locked(name);
}
Modified: team/jpeeler/chan_dahdi14/include/asterisk/options.h
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/include/asterisk/options.h?view=diff&rev=119418&r1=119417&r2=119418
==============================================================================
--- team/jpeeler/chan_dahdi14/include/asterisk/options.h (original)
+++ team/jpeeler/chan_dahdi14/include/asterisk/options.h Fri May 30 16:21:00 2008
@@ -29,6 +29,7 @@
#define AST_CACHE_DIR_LEN 512
#define AST_FILENAME_MAX 80
+#define AST_CHANNEL_NAME 80
/*! \ingroup main_options */
enum ast_option_flags {
@@ -121,6 +122,7 @@
extern char record_cache_dir[AST_CACHE_DIR_LEN];
extern char debug_filename[AST_FILENAME_MAX];
+extern char dahdi_chan_name[AST_CHANNEL_NAME];
extern int ast_language_is_prefix;
Modified: team/jpeeler/chan_dahdi14/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/chan_dahdi14/main/asterisk.c?view=diff&rev=119418&r1=119417&r2=119418
==============================================================================
--- team/jpeeler/chan_dahdi14/main/asterisk.c (original)
+++ team/jpeeler/chan_dahdi14/main/asterisk.c Fri May 30 16:21:00 2008
@@ -172,6 +172,7 @@
char record_cache_dir[AST_CACHE_DIR_LEN] = AST_TMP_DIR;
char debug_filename[AST_FILENAME_MAX] = "";
+char dahdi_chan_name[AST_CHANNEL_NAME] = "ZAP";
static int ast_socket = -1; /*!< UNIX Socket for allowing remote control */
static int ast_consock = -1; /*!< UNIX Socket for controlling another asterisk */
@@ -2578,6 +2579,10 @@
ast_copy_string(ast_config_AST_SYSTEM_NAME, v->value, sizeof(ast_config_AST_SYSTEM_NAME));
} else if (!strcasecmp(v->name, "languageprefix")) {
ast_language_is_prefix = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "dahdichanname")) {
+ if (!strcasecmp(v->value, "yes")) {
+ ast_copy_string(dahdi_chan_name, "DAHDI", sizeof(dahdi_chan_name));
+ }
}
}
ast_config_destroy(cfg);
More information about the asterisk-commits
mailing list