aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-10-22 15:31:47 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-10-22 15:31:47 +0000
commit8e69d5d172a93ecd4051e6ca504cea0a7fe1cab3 (patch)
tree5c88a6fcedc2c50be79e22d06ee1fc5d61b607f0
parentf84fd20f0f307b388a22ec7be9f054224745b548 (diff)
Version 0.3.0 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@539 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchanvars.c88
-rwxr-xr-xconfigs/modem.conf.sample23
-rwxr-xr-xcontrib/init.d/rc.redhat.asterisk8
-rwxr-xr-xinclude/asterisk/chanvars.h13
-rwxr-xr-xinit.asterisk8
5 files changed, 107 insertions, 33 deletions
diff --git a/chanvars.c b/chanvars.c
index 70324b161..6f8e8475e 100755
--- a/chanvars.c
+++ b/chanvars.c
@@ -1,39 +1,81 @@
-#include <asterisk/chanvars.h>
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * Channel Variables
+ *
+ * Copyright (C) 2002, Mark Spencer
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+
#include <malloc.h>
#include <string.h>
-struct ast_var_t *ast_var_assign(char *name,char *value) {
+#include <asterisk/chanvars.h>
+#include <asterisk/logger.h>
+
+struct ast_var_t *ast_var_assign(char *name, char *value)
+{
int i;
struct ast_var_t *var;
- var=malloc(sizeof(struct ast_var_t));
-
- i=strlen(value);
- var->value=malloc(i+1);
- strncpy(var->value,value,i);
- var->value[i]='\0';
+ var = malloc(sizeof(struct ast_var_t));
+
+ if (var == NULL)
+ {
+ ast_log(LOG_WARNING, "Out of memory\n");
+ return NULL;
+ }
- i=strlen(name);
- var->name=malloc(i+1);
- strncpy(var->name,name,i);
- var->name[i]='\0';
- return(var);
-}
+ i = strlen(value);
+ var->value = malloc(i + 1);
+ if (var->value == NULL)
+ {
+ ast_log(LOG_WARNING, "Out of memory\n");
+ free(var);
+ return NULL;
+ }
+
+ strncpy(var->value, value, i);
+ var->value[i] = '\0';
-void ast_var_delete(struct ast_var_t *var) {
- if (var!=NULL) {
- if (var->name!=NULL) free(var->name);
- if (var->value!=NULL) free(var->value);
+ i = strlen(name);
+ var->name = malloc(i + 1);
+ if (var->name == NULL)
+ {
+ ast_log(LOG_WARNING, "Out of memory\n");
+ free(var->value);
free(var);
+ return NULL;
}
+
+ strncpy(var->name, name, i);
+ var->name[i] = '\0';
+
+ return var;
+}
+
+void ast_var_delete(struct ast_var_t *var)
+{
+ if (var == NULL) return;
+
+ if (var->name != NULL) free(var->name);
+ if (var->value != NULL) free(var->value);
+
+ free(var);
}
-char *ast_var_name(struct ast_var_t *var) {
- return(var->name);
+char *ast_var_name(struct ast_var_t *var)
+{
+ return (var != NULL ? var->name : NULL);
}
-char *ast_var_value(struct ast_var_t *var) {
- return(var->value);
+char *ast_var_value(struct ast_var_t *var)
+{
+ return (var != NULL ? var->value : NULL);
}
- \ No newline at end of file
+
diff --git a/configs/modem.conf.sample b/configs/modem.conf.sample
index 1a75b7fbb..d177502df 100755
--- a/configs/modem.conf.sample
+++ b/configs/modem.conf.sample
@@ -49,3 +49,26 @@ mode=immediate
;
;msn=39907835
;device => /dev/ttyI0
+
+;===============
+; More complex ISDN example
+;
+; A single device which listens to 3 MSNs
+; the wildcard '*' can be used when all MSN's should be accepted.
+; (The incoming number can be used to go directly into the extension
+; with the matching number. I.e. if MSN 33 is called, (context,33)
+; will tried first, than (context,s) and finally (default,s).
+;
+;msn=50780020
+;incomingmsn=50780020,50780021,50780022
+;device => /dev/ttyI2
+;
+; two other devices, which are in group '1' and are used when an
+; outgoing dial used: exten => s,1,Dial,Modem/g1:1234|60|r
+; (we do not need more outgoing devices, since ISDN2 has only 2 channels.)
+; Lines can be in more than one group (1-31); comma seperated list.
+;
+group=1 ; group=1,2,3,9-12
+;msn=50780023
+;device => /dev/ttyI3
+;device => /dev/ttyI4
diff --git a/contrib/init.d/rc.redhat.asterisk b/contrib/init.d/rc.redhat.asterisk
index 09d5e269a..bc421beb3 100755
--- a/contrib/init.d/rc.redhat.asterisk
+++ b/contrib/init.d/rc.redhat.asterisk
@@ -1,13 +1,11 @@
#!/bin/sh
#
-# asterisk This shell script takes care of starting and stopping
-# asterisk (printer daemon).
+# asterisk This shell script takes care of starting and stopping Asterisk.
+#
#
# chkconfig: 2345 60 60
-# description: asterisk is the print daemon required for lpr to work properly. \
-# It is basically a server that arbitrates print jobs to printer(s).
+# description: Asterisk is the Linux based PBX
# processname: asterisk
-# config: /etc/printcap
# Source function library.
. /etc/rc.d/init.d/functions
diff --git a/include/asterisk/chanvars.h b/include/asterisk/chanvars.h
index 0e20c536e..d37c159ee 100755
--- a/include/asterisk/chanvars.h
+++ b/include/asterisk/chanvars.h
@@ -1,3 +1,16 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
+ * Channel Variables
+ *
+ * Copyright (C) 2002, Mark Spencer
+ *
+ * Mark Spencer <markster@linux-support.net>
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License
+ */
+
#ifndef _ASTERISK_CHANVARS_INCLUDE
#define _ASTERISK_CHANVARS_INCLUDE
diff --git a/init.asterisk b/init.asterisk
index 09d5e269a..bc421beb3 100755
--- a/init.asterisk
+++ b/init.asterisk
@@ -1,13 +1,11 @@
#!/bin/sh
#
-# asterisk This shell script takes care of starting and stopping
-# asterisk (printer daemon).
+# asterisk This shell script takes care of starting and stopping Asterisk.
+#
#
# chkconfig: 2345 60 60
-# description: asterisk is the print daemon required for lpr to work properly. \
-# It is basically a server that arbitrates print jobs to printer(s).
+# description: Asterisk is the Linux based PBX
# processname: asterisk
-# config: /etc/printcap
# Source function library.
. /etc/rc.d/init.d/functions