Import new package spec for introduction into repository.

Mon, 27 Apr 2009 12:19:05 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 27 Apr 2009 12:19:05 +0200
changeset 202
f29abea29121
parent 201
3be96a4c8c18
child 203
d6cbdf7bfcd7

Import new package spec for introduction into repository.

asterisk/amd.conf file | annotate | diff | comparison | revisions
asterisk/asterisk.conf file | annotate | diff | comparison | revisions
asterisk/asterisk.patch file | annotate | diff | comparison | revisions
asterisk/asterisk.patch.parseavp file | annotate | diff | comparison | revisions
asterisk/asterisk.patch.proxymwi file | annotate | diff | comparison | revisions
asterisk/asterisk.patch.xfersips file | annotate | diff | comparison | revisions
asterisk/asterisk.spec file | annotate | diff | comparison | revisions
asterisk/capi.conf file | annotate | diff | comparison | revisions
asterisk/cdr.conf file | annotate | diff | comparison | revisions
asterisk/cdr_custom.conf file | annotate | diff | comparison | revisions
asterisk/codecs.conf file | annotate | diff | comparison | revisions
asterisk/dundi.conf file | annotate | diff | comparison | revisions
asterisk/enum.conf file | annotate | diff | comparison | revisions
asterisk/extensions.conf file | annotate | diff | comparison | revisions
asterisk/features.conf file | annotate | diff | comparison | revisions
asterisk/festival.conf file | annotate | diff | comparison | revisions
asterisk/followme.conf file | annotate | diff | comparison | revisions
asterisk/indications.conf file | annotate | diff | comparison | revisions
asterisk/logger.conf file | annotate | diff | comparison | revisions
asterisk/manager.conf file | annotate | diff | comparison | revisions
asterisk/meetme.conf file | annotate | diff | comparison | revisions
asterisk/misdn.conf file | annotate | diff | comparison | revisions
asterisk/modules.conf file | annotate | diff | comparison | revisions
asterisk/musiconhold.conf file | annotate | diff | comparison | revisions
asterisk/privacy.conf file | annotate | diff | comparison | revisions
asterisk/rc.asterisk file | annotate | diff | comparison | revisions
asterisk/rpt.conf file | annotate | diff | comparison | revisions
asterisk/rtp.conf file | annotate | diff | comparison | revisions
asterisk/say.conf file | annotate | diff | comparison | revisions
asterisk/sip.conf file | annotate | diff | comparison | revisions
asterisk/sip_notify.conf file | annotate | diff | comparison | revisions
asterisk/sla.conf file | annotate | diff | comparison | revisions
asterisk/voicemail.conf file | annotate | diff | comparison | revisions
asterisk/wakeup.agi file | annotate | diff | comparison | revisions
asterisk/zapata.conf file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/asterisk/amd.conf	Mon Apr 27 12:19:05 2009 +0200
     1.3 @@ -0,0 +1,18 @@
     1.4 +;
     1.5 +; Answering Machine Detection Configuration
     1.6 +;
     1.7 +
     1.8 +;[general]
     1.9 +;initial_silence = 2500		; Maximum silence duration before the greeting.
    1.10 +				; If exceeded then MACHINE.
    1.11 +;greeting = 1500			; Maximum length of a greeting. If exceeded then MACHINE.
    1.12 +;after_greeting_silence = 800	; Silence after detecting a greeting.
    1.13 +				; If exceeded then HUMAN
    1.14 +;total_analysis_time = 5000	; Maximum time allowed for the algorithm to decide
    1.15 +				; on a HUMAN or MACHINE
    1.16 +;min_word_length = 100		; Minimum duration of Voice to considered as a word
    1.17 +;between_words_silence = 50	; Minimum duration of silence after a word to consider
    1.18 +				; the audio what follows as a new word
    1.19 +;maximum_number_of_words = 3	; Maximum number of words in the greeting.
    1.20 +				; If exceeded then MACHINE
    1.21 +;silence_threshold = 256
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/asterisk/asterisk.conf	Mon Apr 27 12:19:05 2009 +0200
     2.3 @@ -0,0 +1,78 @@
     2.4 +;;
     2.5 +;;  asterisk.conf -- Asterisk main configuration file
     2.6 +;;
     2.7 +
     2.8 +;[directories]
     2.9 +; Make sure these directories have the right permissions if not
    2.10 +; running Asterisk as root 
    2.11 +
    2.12 +; Where the configuration files (except for this one) are located
    2.13 +;astetcdir => /etc/asterisk
    2.14 +
    2.15 +; Where the Asterisk loadable modules are located
    2.16 +;astmoddir => /usr/lib/asterisk/modules
    2.17 +
    2.18 +; Where additional 'library' elements (scripts, etc.) are located
    2.19 +;astvarlibdir => /var/lib/asterisk
    2.20 +
    2.21 +; Where AGI scripts/programs are located
    2.22 +;astagidir => /var/lib/asterisk/agi-bin
    2.23 +
    2.24 +; Where spool directories are located
    2.25 +; Voicemail, monitor, dictation and other apps will create files here
    2.26 +; and outgoing call files (used with pbx_spool) must be placed here
    2.27 +;astspooldir => /var/spool/asterisk
    2.28 +
    2.29 +; Where the Asterisk process ID (pid) file should be created
    2.30 +;astrundir => /var/run/asterisk
    2.31 +
    2.32 +; Where the Asterisk log files should be created
    2.33 +;astlogdir => /var/log/asterisk
    2.34 +
    2.35 +
    2.36 +;[options]
    2.37 +;Under "options" you can enter configuration options
    2.38 +;that you also can set with command line options
    2.39 +
    2.40 +;verbose = 0					; Verbosity level for logging (-v)
    2.41 +;debug = 3					; Debug: "No" or value (1-4)
    2.42 +;nofork=yes | no					; Background execution disabled (-f)
    2.43 +;alwaysfork=yes | no				; Always background, even with -v or -d (-F)
    2.44 +;console= yes | no				; Console mode (-c)
    2.45 +;highpriority = yes | no				; Execute with high priority (-p)
    2.46 +;initcrypto = yes | no				; Initialize crypto at startup (-i)
    2.47 +;nocolor = yes | no				; Disable ANSI colors (-n)
    2.48 +;dumpcore = yes | no				; Dump core on failure (-g)
    2.49 +;quiet = yes | no				; Run quietly (-q)
    2.50 +;timestamp = yes | no				; Force timestamping in CLI verbose output (-T)
    2.51 +;runuser = asterisk				; User to run asterisk as (-U) NOTE: will require changes to
    2.52 +						; directory and device permissions
    2.53 +;rungroup = asterisk				; Group to run asterisk as (-G)
    2.54 +;internal_timing = yes | no			; Enable internal timing support (-I)
    2.55 +
    2.56 +;These options have no command line equivalent
    2.57 +;cache_record_files = yes | no			; Cache record() files in another directory until completion
    2.58 +;record_cache_dir = <dir>
    2.59 +;transcode_via_sln = yes | no 			; Build transcode paths via SLINEAR
    2.60 +;transmit_silence_during_record = yes | no	; send SLINEAR silence while channel is being recorded
    2.61 +;maxload = 1.0					; The maximum load average we accept calls for
    2.62 +;maxcalls = 255					; The maximum number of concurrent calls you want to allow 
    2.63 +;execincludes = yes | no 			; Allow #exec entries in configuration files
    2.64 +;dontwarn = yes | no				; Don't over-inform the Asterisk sysadm, he's a guru
    2.65 +;systemname = <a_string>				; System name. Used to prefix CDR uniqueid and to fill ${SYSTEMNAME}
    2.66 +;languageprefix = yes | no			; Should language code be last component of sound file name or first?
    2.67 +	       	       				; when off, sound files are searched as <path>/<lang>/<file>
    2.68 +						; when on, sound files are search as <lang>/<path>/<file>
    2.69 +						; (only affects relative paths for sound files)
    2.70 +
    2.71 +;[files]
    2.72 +; Changing the following lines may compromise your security
    2.73 +; Asterisk.ctl is the pipe that is used to connect the remote CLI
    2.74 +; (asterisk -r) to Asterisk. Changing these settings change the
    2.75 +; permissions and ownership of this file. 
    2.76 +; The file is created when Asterisk starts, in the "astrundir" above.
    2.77 +
    2.78 +;astctlpermissions = 0660
    2.79 +;astctlowner = root
    2.80 +;astctlgroup = asterisk
    2.81 +;astctl = asterisk.ctl
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/asterisk/asterisk.patch	Mon Apr 27 12:19:05 2009 +0200
     3.3 @@ -0,0 +1,2265 @@
     3.4 +Index: cdr/cdr_sqlite.c
     3.5 +diff -Nau cdr/cdr_sqlite.c.orig cdr/cdr_sqlite.c
     3.6 +--- cdr/cdr_sqlite.c.orig	2007-06-14 23:50:40.000000000 +0200
     3.7 ++++ cdr/cdr_sqlite.c	2009-04-24 00:30:33.000000000 +0200
     3.8 +@@ -58,7 +58,7 @@
     3.9 + #define DATE_FORMAT "%Y-%m-%d %T"
    3.10 + 
    3.11 + static char *name = "sqlite";
    3.12 +-static sqlite* db = NULL;
    3.13 ++static sqlite3 *db = NULL;
    3.14 + 
    3.15 + AST_MUTEX_DEFINE_STATIC(sqlite_lock);
    3.16 + 
    3.17 +@@ -92,10 +92,10 @@
    3.18 + static int sqlite_log(struct ast_cdr *cdr)
    3.19 + {
    3.20 + 	int res = 0;
    3.21 +-	char *zErr = 0;
    3.22 + 	struct tm tm;
    3.23 + 	time_t t;
    3.24 + 	char startstr[80], answerstr[80], endstr[80];
    3.25 ++    char *cdrsql = 0;
    3.26 + 	int count;
    3.27 + 
    3.28 + 	ast_mutex_lock(&sqlite_lock);
    3.29 +@@ -113,7 +113,7 @@
    3.30 + 	strftime(endstr, sizeof(endstr), DATE_FORMAT, &tm);
    3.31 + 
    3.32 + 	for(count=0; count<5; count++) {
    3.33 +-		res = sqlite_exec_printf(db,
    3.34 ++		cdrsql = sqlite3_mprintf(
    3.35 + 			"INSERT INTO cdr ("
    3.36 + 				"clid,src,dst,dcontext,"
    3.37 + 				"channel,dstchannel,lastapp,lastdata, "
    3.38 +@@ -138,8 +138,7 @@
    3.39 + #				if LOG_USERFIELD
    3.40 + 				",'%q'"
    3.41 + #				endif
    3.42 +-			")", NULL, NULL, &zErr,
    3.43 +-				cdr->clid, cdr->src, cdr->dst, cdr->dcontext,
    3.44 ++			")", cdr->clid, cdr->src, cdr->dst, cdr->dcontext,
    3.45 + 				cdr->channel, cdr->dstchannel, cdr->lastapp, cdr->lastdata,
    3.46 + 				startstr, answerstr, endstr,
    3.47 + 				cdr->duration, cdr->billsec, cdr->disposition, cdr->amaflags,
    3.48 +@@ -151,16 +150,13 @@
    3.49 + 				,cdr->userfield
    3.50 + #				endif
    3.51 + 			);
    3.52 ++			res = sqlite3_exec(db, cdrsql, 0, 0, 0);
    3.53 ++			sqlite3_free(cdrsql);
    3.54 + 		if (res != SQLITE_BUSY && res != SQLITE_LOCKED)
    3.55 + 			break;
    3.56 + 		usleep(200);
    3.57 + 	}
    3.58 + 	
    3.59 +-	if (zErr) {
    3.60 +-		ast_log(LOG_ERROR, "cdr_sqlite: %s\n", zErr);
    3.61 +-		free(zErr);
    3.62 +-	}
    3.63 +-
    3.64 + 	ast_mutex_unlock(&sqlite_lock);
    3.65 + 	return res;
    3.66 + }
    3.67 +@@ -168,7 +164,7 @@
    3.68 + static int unload_module(void)
    3.69 + {
    3.70 + 	if (db)
    3.71 +-		sqlite_close(db);
    3.72 ++		sqlite3_close(db);
    3.73 + 	ast_cdr_unregister(name);
    3.74 + 	return 0;
    3.75 + }
    3.76 +@@ -181,17 +177,16 @@
    3.77 + 
    3.78 + 	/* is the database there? */
    3.79 + 	snprintf(fn, sizeof(fn), "%s/cdr.db", ast_config_AST_LOG_DIR);
    3.80 +-	db = sqlite_open(fn, 0660, &zErr);
    3.81 ++	sqlite3_open(fn, &db);
    3.82 + 	if (!db) {
    3.83 +-		ast_log(LOG_ERROR, "cdr_sqlite: %s\n", zErr);
    3.84 +-		free(zErr);
    3.85 ++		ast_log(LOG_ERROR, "cdr_sqlite: %s\n", sqlite3_errmsg(db));
    3.86 + 		return -1;
    3.87 + 	}
    3.88 + 
    3.89 + 	/* is the table there? */
    3.90 +-	res = sqlite_exec(db, "SELECT COUNT(AcctId) FROM cdr;", NULL, NULL, NULL);
    3.91 ++	res = sqlite3_exec(db, "SELECT COUNT(AcctId) FROM cdr;", NULL, NULL, NULL);
    3.92 + 	if (res) {
    3.93 +-		res = sqlite_exec(db, sql_create_table, NULL, NULL, &zErr);
    3.94 ++		res = sqlite3_exec(db, sql_create_table, NULL, NULL, &zErr);
    3.95 + 		if (res) {
    3.96 + 			ast_log(LOG_ERROR, "cdr_sqlite: Unable to create table 'cdr': %s\n", zErr);
    3.97 + 			free(zErr);
    3.98 +@@ -210,7 +205,7 @@
    3.99 + 
   3.100 + err:
   3.101 + 	if (db)
   3.102 +-		sqlite_close(db);
   3.103 ++		sqlite3_close(db);
   3.104 + 	return -1;
   3.105 + }
   3.106 + 
   3.107 +Index: channels/chan_sip.c
   3.108 +diff -Nau channels/chan_sip.c.orig channels/chan_sip.c
   3.109 +--- channels/chan_sip.c.orig	2009-04-02 19:20:22.000000000 +0200
   3.110 ++++ channels/chan_sip.c	2009-04-24 00:30:33.000000000 +0200
   3.111 +@@ -7469,7 +7469,7 @@
   3.112 + 
   3.113 + 	ast_copy_string(from, get_header(&p->initreq, "From"), sizeof(from));
   3.114 + 	c = get_in_brackets(from);
   3.115 +-	if (strncasecmp(c, "sip:", 4)) {
   3.116 ++	if (strncasecmp(c, "sip:", 4) && strncasecmp(c, "sips:", 5)) {
   3.117 + 		ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", c);
   3.118 + 		return -1;
   3.119 + 	}
   3.120 +@@ -7477,7 +7477,7 @@
   3.121 + 
   3.122 + 	ast_copy_string(to, get_header(&p->initreq, "To"), sizeof(to));
   3.123 + 	c = get_in_brackets(to);
   3.124 +-	if (strncasecmp(c, "sip:", 4)) {
   3.125 ++	if (strncasecmp(c, "sip:", 4) && strncasecmp(c, "sips:", 5)) {
   3.126 + 		ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", c);
   3.127 + 		return -1;
   3.128 + 	}
   3.129 +@@ -8004,7 +8004,10 @@
   3.130 + 	of = get_in_brackets(from);
   3.131 + 	ast_string_field_set(p, from, of);
   3.132 + 	if (strncasecmp(of, "sip:", 4))
   3.133 +-		ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n");
   3.134 ++		if (strncasecmp(of, "sips:", 5))
   3.135 ++			ast_log(LOG_NOTICE, "From address missing 'sip:' or 'sips:', using it anyway\n");
   3.136 ++		else
   3.137 ++			of += 5;
   3.138 + 	else
   3.139 + 		of += 4;
   3.140 + 	/* Get just the username part */
   3.141 +@@ -8280,7 +8283,10 @@
   3.142 + 
   3.143 + 	/* Make sure it's a SIP URL */
   3.144 + 	if (strncasecmp(contact, "sip:", 4)) {
   3.145 +-		ast_log(LOG_NOTICE, "'%s' is not a valid SIP contact (missing sip:) trying to use anyway\n", contact);
   3.146 ++		if (strncasecmp(contact, "sips:", 5))
   3.147 ++			ast_log(LOG_NOTICE, "'%s' is not a valid SIP contact (missing sip: or sips:) trying to use anyway\n", contact);
   3.148 ++		else
   3.149 ++			contact += 5;
   3.150 + 	} else
   3.151 + 		contact += 4;
   3.152 + 
   3.153 +@@ -8409,7 +8415,10 @@
   3.154 + 
   3.155 + 	/* Make sure it's a SIP URL */
   3.156 + 	if (strncasecmp(curi, "sip:", 4)) {
   3.157 +-		ast_log(LOG_NOTICE, "'%s' is not a valid SIP contact (missing sip:) trying to use anyway\n", curi);
   3.158 ++		if (strncasecmp(curi, "sips:", 5))
   3.159 ++			ast_log(LOG_NOTICE, "'%s' is not a valid SIP contact (missing sip: or sips:) trying to use anyway\n", curi);
   3.160 ++		else
   3.161 ++			curi += 5;
   3.162 + 	} else
   3.163 + 		curi += 4;
   3.164 + 	/* Ditch q */
   3.165 +@@ -9000,9 +9009,12 @@
   3.166 + 
   3.167 + 	if (!strncasecmp(c, "sip:", 4)) {
   3.168 + 		name = c + 4;
   3.169 ++	}
   3.170 ++	else if (!strncasecmp(c, "sips:", 5)) {
   3.171 ++		name = c + 5;
   3.172 + 	} else {
   3.173 + 		name = c;
   3.174 +-		ast_log(LOG_NOTICE, "Invalid to address: '%s' from %s (missing sip:) trying to use anyway...\n", c, ast_inet_ntoa(sin->sin_addr));
   3.175 ++		ast_log(LOG_NOTICE, "Invalid to address: '%s' from %s (missing sip: or sips:) trying to use anyway...\n", c, ast_inet_ntoa(sin->sin_addr));
   3.176 + 	}
   3.177 + 
   3.178 + 	/* Strip off the domain name */
   3.179 +@@ -9162,10 +9174,15 @@
   3.180 + 		return 0;
   3.181 + 	c = get_in_brackets(tmp);
   3.182 + 	if (strncasecmp(c, "sip:", 4)) {
   3.183 +-		ast_log(LOG_WARNING, "Huh?  Not an RDNIS SIP header (%s)?\n", c);
   3.184 +-		return -1;
   3.185 ++		if (strncasecmp(c, "sips:", 5)) {
   3.186 ++			ast_log(LOG_WARNING, "Huh?  Not an RDNIS SIP header (%s)?\n", c);
   3.187 ++			return -1;
   3.188 ++		}
   3.189 ++		else
   3.190 ++			c += 5;
   3.191 + 	}
   3.192 +-	c += 4;
   3.193 ++	else
   3.194 ++		c += 4;
   3.195 + 	a = c;
   3.196 + 	strsep(&a, "@;");	/* trim anything after @ or ; */
   3.197 + 	if (sip_debug_test_pvt(p))
   3.198 +@@ -9200,10 +9217,15 @@
   3.199 + 	uri = get_in_brackets(tmp);
   3.200 + 
   3.201 + 	if (strncasecmp(uri, "sip:", 4)) {
   3.202 +-		ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", uri);
   3.203 +-		return -1;
   3.204 ++		if (strncasecmp(uri, "sips:", 5)) {
   3.205 ++			ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", uri);
   3.206 ++			return -1;
   3.207 ++		}
   3.208 ++		else
   3.209 ++			uri += 5;
   3.210 + 	}
   3.211 +-	uri += 4;
   3.212 ++	else
   3.213 ++		uri += 4;
   3.214 + 
   3.215 + 	/* Now find the From: caller ID and name */
   3.216 + 	ast_copy_string(tmpf, get_header(req, "From"), sizeof(tmpf));
   3.217 +@@ -9217,10 +9239,15 @@
   3.218 + 	
   3.219 + 	if (!ast_strlen_zero(from)) {
   3.220 + 		if (strncasecmp(from, "sip:", 4)) {
   3.221 +-			ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", from);
   3.222 +-			return -1;
   3.223 ++			if (strncasecmp(from, "sips:", 5)) {
   3.224 ++				ast_log(LOG_WARNING, "Huh?  Not a SIP header (%s)?\n", from);
   3.225 ++				return -1;
   3.226 ++			}
   3.227 ++			else
   3.228 ++				from += 5;
   3.229 + 		}
   3.230 +-		from += 4;
   3.231 ++		else
   3.232 ++			from += 4;
   3.233 + 		if ((a = strchr(from, '@')))
   3.234 + 			*a++ = '\0';
   3.235 + 		else
   3.236 +@@ -9397,10 +9424,15 @@
   3.237 + 		ast_uri_decode(refer_to);
   3.238 + 
   3.239 + 	if (strncasecmp(refer_to, "sip:", 4)) {
   3.240 +-		ast_log(LOG_WARNING, "Can't transfer to non-sip: URI.  (Refer-to: %s)?\n", refer_to);
   3.241 +-		return -3;
   3.242 ++		if (strncasecmp(refer_to, "sips:", 5)) {
   3.243 ++			ast_log(LOG_WARNING, "Can't transfer to non-sip: URI.  (Refer-to: %s)?\n", refer_to);
   3.244 ++			return -3;
   3.245 ++		}
   3.246 ++		else
   3.247 ++			refer_to += 5;			/* Skip sips: */
   3.248 + 	}
   3.249 +-	refer_to += 4;			/* Skip sip: */
   3.250 ++	else
   3.251 ++		refer_to += 4;			/* Skip sip: */
   3.252 + 
   3.253 + 	/* Get referred by header if it exists */
   3.254 + 	p_referred_by = get_header(req, "Referred-By");
   3.255 +@@ -9417,9 +9449,13 @@
   3.256 + 		}
   3.257 + 
   3.258 + 		referred_by_uri = get_in_brackets(h_referred_by);
   3.259 +-		if(strncasecmp(referred_by_uri, "sip:", 4)) {
   3.260 +-			ast_log(LOG_WARNING, "Huh?  Not a sip: header (Referred-by: %s). Skipping.\n", referred_by_uri);
   3.261 +-			referred_by_uri = (char *) NULL;
   3.262 ++		if (strncasecmp(referred_by_uri, "sip:", 4)) {
   3.263 ++			if (strncasecmp(referred_by_uri, "sips:", 5)) {
   3.264 ++				ast_log(LOG_WARNING, "Huh?  Not a sip: header (Referred-by: %s). Skipping.\n", referred_by_uri);
   3.265 ++				referred_by_uri = (char *) NULL;
   3.266 ++			}
   3.267 ++			else
   3.268 ++				referred_by_uri += 5;		/* Skip sips: */
   3.269 + 		} else {
   3.270 + 			referred_by_uri += 4;		/* Skip sip: */
   3.271 + 		}
   3.272 +@@ -9547,10 +9583,15 @@
   3.273 + 		ast_uri_decode(c);
   3.274 + 	
   3.275 + 	if (strncasecmp(c, "sip:", 4)) {
   3.276 +-		ast_log(LOG_WARNING, "Huh?  Not a SIP header in Also: transfer (%s)?\n", c);
   3.277 +-		return -1;
   3.278 ++		if (strncasecmp(c, "sips:", 5)) {
   3.279 ++			ast_log(LOG_WARNING, "Huh?  Not a SIP header in Also: transfer (%s)?\n", c);
   3.280 ++			return -1;
   3.281 ++		}
   3.282 ++		else
   3.283 ++			c += 5;
   3.284 + 	}
   3.285 +-	c += 4;
   3.286 ++	else
   3.287 ++		c += 4;
   3.288 + 	if ((a = strchr(c, ';'))) 	/* Remove arguments */
   3.289 + 		*a = '\0';
   3.290 + 	
   3.291 +@@ -9761,6 +9802,8 @@
   3.292 + 		t = uri2;
   3.293 + 		if (!strncasecmp(t, "sip:", 4))
   3.294 + 			t+= 4;
   3.295 ++		else if (!strncasecmp(t, "sips:", 5))
   3.296 ++			t+= 5;
   3.297 + 		ast_string_field_set(p, exten, t);
   3.298 + 		t = strchr(p->exten, '@');
   3.299 + 		if (t)
   3.300 +@@ -9771,7 +9814,10 @@
   3.301 + 	/* save the URI part of the From header */
   3.302 + 	ast_string_field_set(p, from, of);
   3.303 + 	if (strncasecmp(of, "sip:", 4)) {
   3.304 +-		ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n");
   3.305 ++		if (strncasecmp(of, "sips:", 5))
   3.306 ++			ast_log(LOG_NOTICE, "From address missing 'sip:' or 'sips:', using it anyway\n");
   3.307 ++		else
   3.308 ++			of += 5;
   3.309 + 	} else
   3.310 + 		of += 4;
   3.311 + 	/* Get just the username part */
   3.312 +@@ -12379,6 +12425,8 @@
   3.313 + 	if (ast_test_flag(&p->flags[0], SIP_PROMISCREDIR)) {
   3.314 + 		if (!strncasecmp(s, "sip:", 4))
   3.315 + 			s += 4;
   3.316 ++		else if (!strncasecmp(s, "sips:", 5))
   3.317 ++			s += 5;
   3.318 + 		e = strchr(s, ';');
   3.319 + 		if (e)
   3.320 + 			*e = '\0';
   3.321 +@@ -12404,6 +12452,8 @@
   3.322 + 	
   3.323 + 		if (!strncasecmp(s, "sip:", 4))
   3.324 + 			s += 4;
   3.325 ++		else if (!strncasecmp(s, "sips:", 5))
   3.326 ++			s += 5;
   3.327 + 		if (option_debug > 1)
   3.328 + 			ast_log(LOG_DEBUG, "Received 302 Redirect to extension '%s' (domain %s)\n", s, domain);
   3.329 + 		if (p->owner) {
   3.330 +Index: codecs/codec_g722.c
   3.331 +diff -Nau codecs/codec_g722.c.orig codecs/codec_g722.c
   3.332 +--- codecs/codec_g722.c.orig	1970-01-01 01:00:00.000000000 +0100
   3.333 ++++ codecs/codec_g722.c	2009-04-24 00:30:33.000000000 +0200
   3.334 +@@ -0,0 +1,306 @@
   3.335 ++/*
   3.336 ++ * Asterisk -- An open source telephony toolkit.
   3.337 ++ *
   3.338 ++ * Copyright (C) 1999 - 2008, Digium, Inc.
   3.339 ++ *
   3.340 ++ * Matthew Fredrickson <creslin@digium.com>
   3.341 ++ * Russell Bryant <russell@digium.com>
   3.342 ++ *
   3.343 ++ * Special thanks to Steve Underwood for the implementation
   3.344 ++ * and for doing the 8khz<->g.722 direct translation code.
   3.345 ++ *
   3.346 ++ * See http://www.asterisk.org for more information about
   3.347 ++ * the Asterisk project. Please do not directly contact
   3.348 ++ * any of the maintainers of this project for assistance;
   3.349 ++ * the project provides a web site, mailing lists and IRC
   3.350 ++ * channels for your use.
   3.351 ++ *
   3.352 ++ * This program is free software, distributed under the terms of
   3.353 ++ * the GNU General Public License Version 2. See the LICENSE file
   3.354 ++ * at the top of the source tree.
   3.355 ++ */
   3.356 ++
   3.357 ++/*! \file
   3.358 ++ *
   3.359 ++ * \brief codec_g722.c - translate between signed linear and ITU G.722-64kbps
   3.360 ++ *
   3.361 ++ * \author Matthew Fredrickson <creslin@digium.com>
   3.362 ++ * \author Russell Bryant <russell@digium.com>
   3.363 ++ *
   3.364 ++ * \arg http://soft-switch.org/downloads/non-gpl-bits.tgz
   3.365 ++ * \arg http://lists.digium.com/pipermail/asterisk-dev/2006-September/022866.html
   3.366 ++ *
   3.367 ++ * \ingroup codecs
   3.368 ++ */
   3.369 ++
   3.370 ++#include "asterisk.h"
   3.371 ++
   3.372 ++ASTERISK_FILE_VERSION(__FILE__, "$Revision: 106501 $")
   3.373 ++
   3.374 ++#include "asterisk/linkedlists.h"
   3.375 ++#include "asterisk/module.h"
   3.376 ++#include "asterisk/config.h"
   3.377 ++#include "asterisk/options.h"
   3.378 ++#include "asterisk/translate.h"
   3.379 ++#include "asterisk/utils.h"
   3.380 ++
   3.381 ++#define BUFFER_SAMPLES   8096	/* size for the translation buffers */
   3.382 ++#define BUF_SHIFT	5
   3.383 ++
   3.384 ++/* Sample frame data */
   3.385 ++
   3.386 ++#include "g722/g722.h"
   3.387 ++#include "slin_g722_ex.h"
   3.388 ++#include "g722_slin_ex.h"
   3.389 ++
   3.390 ++struct g722_encoder_pvt {
   3.391 ++	g722_encode_state_t g722;
   3.392 ++};
   3.393 ++
   3.394 ++struct g722_decoder_pvt {
   3.395 ++	g722_decode_state_t g722;
   3.396 ++};
   3.397 ++
   3.398 ++/*! \brief init a new instance of g722_encoder_pvt. */
   3.399 ++static int lintog722_new(struct ast_trans_pvt *pvt)
   3.400 ++{
   3.401 ++	struct g722_encoder_pvt *tmp = pvt->pvt;
   3.402 ++
   3.403 ++	g722_encode_init(&tmp->g722, 64000, G722_SAMPLE_RATE_8000);
   3.404 ++
   3.405 ++	return 0;
   3.406 ++}
   3.407 ++
   3.408 ++static int lin16tog722_new(struct ast_trans_pvt *pvt)
   3.409 ++{
   3.410 ++	struct g722_encoder_pvt *tmp = pvt->pvt;
   3.411 ++
   3.412 ++	g722_encode_init(&tmp->g722, 64000, 0);
   3.413 ++
   3.414 ++	return 0;
   3.415 ++}
   3.416 ++
   3.417 ++/*! \brief init a new instance of g722_encoder_pvt. */
   3.418 ++static int g722tolin_new(struct ast_trans_pvt *pvt)
   3.419 ++{
   3.420 ++	struct g722_decoder_pvt *tmp = pvt->pvt;
   3.421 ++
   3.422 ++	g722_decode_init(&tmp->g722, 64000, G722_SAMPLE_RATE_8000);
   3.423 ++
   3.424 ++	return 0;
   3.425 ++}
   3.426 ++
   3.427 ++static int g722tolin16_new(struct ast_trans_pvt *pvt)
   3.428 ++{
   3.429 ++	struct g722_decoder_pvt *tmp = pvt->pvt;
   3.430 ++
   3.431 ++	g722_decode_init(&tmp->g722, 64000, 0);
   3.432 ++
   3.433 ++	return 0;
   3.434 ++}
   3.435 ++
   3.436 ++static int g722tolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
   3.437 ++{
   3.438 ++	struct g722_decoder_pvt *tmp = pvt->pvt;
   3.439 ++	int out_samples;
   3.440 ++	int in_samples;
   3.441 ++
   3.442 ++	/* g722_decode expects the samples to be in the invalid samples / 2 format */
   3.443 ++	in_samples = f->samples / 2;
   3.444 ++
   3.445 ++	out_samples = g722_decode(&tmp->g722, (int16_t *) &pvt->outbuf[pvt->samples * sizeof(int16_t)], 
   3.446 ++		(uint8_t *) f->data, in_samples);
   3.447 ++
   3.448 ++	pvt->samples += out_samples;
   3.449 ++
   3.450 ++	pvt->datalen += (out_samples * sizeof(int16_t));
   3.451 ++
   3.452 ++	return 0;
   3.453 ++}
   3.454 ++
   3.455 ++static int lintog722_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
   3.456 ++{
   3.457 ++	struct g722_encoder_pvt *tmp = pvt->pvt;
   3.458 ++	int outlen;
   3.459 ++
   3.460 ++	outlen = g722_encode(&tmp->g722, (uint8_t *) (&pvt->outbuf[pvt->datalen]), 
   3.461 ++		(int16_t *) f->data, f->samples);
   3.462 ++
   3.463 ++	pvt->samples += outlen * 2;
   3.464 ++
   3.465 ++	pvt->datalen += outlen;
   3.466 ++
   3.467 ++	return 0;
   3.468 ++}
   3.469 ++
   3.470 ++static struct ast_frame *g722tolin_sample(void)
   3.471 ++{
   3.472 ++	static struct ast_frame f = {
   3.473 ++		.frametype = AST_FRAME_VOICE,
   3.474 ++		.subclass = AST_FORMAT_G722,
   3.475 ++		.datalen = sizeof(g722_slin_ex),
   3.476 ++		.samples = sizeof(g722_slin_ex) * 2,
   3.477 ++		.src = __PRETTY_FUNCTION__,
   3.478 ++		.data = g722_slin_ex,
   3.479 ++	};
   3.480 ++
   3.481 ++	return &f;
   3.482 ++}
   3.483 ++
   3.484 ++static struct ast_frame *g722tolin16_sample(void)
   3.485 ++{
   3.486 ++	static struct ast_frame f = {
   3.487 ++		.frametype = AST_FRAME_VOICE,
   3.488 ++		.subclass = AST_FORMAT_G722,
   3.489 ++		.datalen = sizeof(slin_g722_ex),
   3.490 ++		.samples = sizeof(slin_g722_ex) * 2,
   3.491 ++		.src = __PRETTY_FUNCTION__,
   3.492 ++		.data = slin_g722_ex,
   3.493 ++	};
   3.494 ++
   3.495 ++	return &f;
   3.496 ++}
   3.497 ++
   3.498 ++static struct ast_frame *lintog722_sample (void)
   3.499 ++{
   3.500 ++	static struct ast_frame f = {
   3.501 ++		.frametype = AST_FRAME_VOICE,
   3.502 ++		.subclass = AST_FORMAT_SLINEAR,
   3.503 ++		.datalen = sizeof(slin_g722_ex),
   3.504 ++		.samples = sizeof(slin_g722_ex) / sizeof(slin_g722_ex[0]),
   3.505 ++		.src = __PRETTY_FUNCTION__,
   3.506 ++		.data = slin_g722_ex,
   3.507 ++	};
   3.508 ++
   3.509 ++	return &f;
   3.510 ++}
   3.511 ++
   3.512 ++static struct ast_frame *lin16tog722_sample (void)
   3.513 ++{
   3.514 ++	static struct ast_frame f = {
   3.515 ++		.frametype = AST_FRAME_VOICE,
   3.516 ++		.subclass = AST_FORMAT_SLINEAR16,
   3.517 ++		.datalen = sizeof(slin_g722_ex),
   3.518 ++		.samples = sizeof(slin_g722_ex) / sizeof(slin_g722_ex[0]),
   3.519 ++		.src = __PRETTY_FUNCTION__,
   3.520 ++		.data = slin_g722_ex,
   3.521 ++	};
   3.522 ++
   3.523 ++	return &f;
   3.524 ++}
   3.525 ++
   3.526 ++static struct ast_translator g722tolin = {
   3.527 ++	.name = "g722tolin",
   3.528 ++	.srcfmt = AST_FORMAT_G722,
   3.529 ++	.dstfmt = AST_FORMAT_SLINEAR,
   3.530 ++	.newpvt = g722tolin_new,	/* same for both directions */
   3.531 ++	.framein = g722tolin_framein,
   3.532 ++	.sample = g722tolin_sample,
   3.533 ++	.desc_size = sizeof(struct g722_decoder_pvt),
   3.534 ++	.buffer_samples = BUFFER_SAMPLES / sizeof(int16_t),
   3.535 ++	.buf_size = BUFFER_SAMPLES,
   3.536 ++	.plc_samples = 160,
   3.537 ++};
   3.538 ++
   3.539 ++static struct ast_translator lintog722 = {
   3.540 ++	.name = "lintog722",
   3.541 ++	.srcfmt = AST_FORMAT_SLINEAR,
   3.542 ++	.dstfmt = AST_FORMAT_G722,
   3.543 ++	.newpvt = lintog722_new,	/* same for both directions */
   3.544 ++	.framein = lintog722_framein,
   3.545 ++	.sample = lintog722_sample,
   3.546 ++	.desc_size = sizeof(struct g722_encoder_pvt),
   3.547 ++	.buffer_samples = BUFFER_SAMPLES * 2,
   3.548 ++	.buf_size = BUFFER_SAMPLES,
   3.549 ++};
   3.550 ++
   3.551 ++static struct ast_translator g722tolin16 = {
   3.552 ++	.name = "g722tolin16",
   3.553 ++	.srcfmt = AST_FORMAT_G722,
   3.554 ++	.dstfmt = AST_FORMAT_SLINEAR16,
   3.555 ++	.newpvt = g722tolin16_new,	/* same for both directions */
   3.556 ++	.framein = g722tolin_framein,
   3.557 ++	.sample = g722tolin16_sample,
   3.558 ++	.desc_size = sizeof(struct g722_decoder_pvt),
   3.559 ++	.buffer_samples = BUFFER_SAMPLES / sizeof(int16_t),
   3.560 ++	.buf_size = BUFFER_SAMPLES,
   3.561 ++	.plc_samples = 160,
   3.562 ++};
   3.563 ++
   3.564 ++static struct ast_translator lin16tog722 = {
   3.565 ++	.name = "lin16tog722",
   3.566 ++	.srcfmt = AST_FORMAT_SLINEAR16,
   3.567 ++	.dstfmt = AST_FORMAT_G722,
   3.568 ++	.newpvt = lin16tog722_new,	/* same for both directions */
   3.569 ++	.framein = lintog722_framein,
   3.570 ++	.sample = lin16tog722_sample,
   3.571 ++	.desc_size = sizeof(struct g722_encoder_pvt),
   3.572 ++	.buffer_samples = BUFFER_SAMPLES * 2,
   3.573 ++	.buf_size = BUFFER_SAMPLES,
   3.574 ++};
   3.575 ++
   3.576 ++static int parse_config(int reload)
   3.577 ++{
   3.578 ++	struct ast_variable *var;
   3.579 ++	struct ast_config *cfg = ast_config_load("codecs.conf");
   3.580 ++
   3.581 ++	if (cfg == NULL)
   3.582 ++		return 0;
   3.583 ++	if (cfg == CONFIG_STATUS_FILEUNCHANGED)
   3.584 ++		return 0;
   3.585 ++	for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
   3.586 ++		if (!strcasecmp(var->name, "genericplc")) {
   3.587 ++			g722tolin.useplc = ast_true(var->value) ? 1 : 0;
   3.588 ++			if (option_verbose > 2)
   3.589 ++				ast_verbose(VERBOSE_PREFIX_3 "codec_g722: %susing generic PLC\n",
   3.590 ++					g722tolin.useplc ? "" : "not ");
   3.591 ++		}
   3.592 ++	}
   3.593 ++	ast_config_destroy(cfg);
   3.594 ++	return 0;
   3.595 ++}
   3.596 ++
   3.597 ++static int reload(void)
   3.598 ++{
   3.599 ++	if (parse_config(1))
   3.600 ++		return AST_MODULE_LOAD_DECLINE;
   3.601 ++	return AST_MODULE_LOAD_SUCCESS;
   3.602 ++}
   3.603 ++
   3.604 ++static int unload_module(void)
   3.605 ++{
   3.606 ++	int res = 0;
   3.607 ++
   3.608 ++	res |= ast_unregister_translator(&g722tolin);
   3.609 ++	res |= ast_unregister_translator(&lintog722);
   3.610 ++	res |= ast_unregister_translator(&g722tolin16);
   3.611 ++	res |= ast_unregister_translator(&lin16tog722);
   3.612 ++
   3.613 ++	return res;
   3.614 ++}
   3.615 ++
   3.616 ++static int load_module(void)
   3.617 ++{
   3.618 ++	int res = 0;
   3.619 ++
   3.620 ++	if (parse_config(0))
   3.621 ++		return AST_MODULE_LOAD_DECLINE;
   3.622 ++
   3.623 ++	res |= ast_register_translator(&g722tolin);
   3.624 ++	res |= ast_register_translator(&lintog722);
   3.625 ++	res |= ast_register_translator(&g722tolin16);
   3.626 ++	res |= ast_register_translator(&lin16tog722);
   3.627 ++
   3.628 ++	if (res) {
   3.629 ++		unload_module();
   3.630 ++		return AST_MODULE_LOAD_FAILURE;
   3.631 ++	}	
   3.632 ++
   3.633 ++	return AST_MODULE_LOAD_SUCCESS;
   3.634 ++}
   3.635 ++
   3.636 ++AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ITU G.722-64kbps G722 Transcoder",
   3.637 ++		.load = load_module,
   3.638 ++		.unload = unload_module,
   3.639 ++		.reload = reload,
   3.640 ++	       );
   3.641 +Index: codecs/g722/g722_decode.c
   3.642 +diff -Nau codecs/g722/g722_decode.c.orig codecs/g722/g722_decode.c
   3.643 +--- codecs/g722/g722_decode.c.orig	1970-01-01 01:00:00.000000000 +0100
   3.644 ++++ codecs/g722/g722_decode.c	2009-04-24 00:30:33.000000000 +0200
   3.645 +@@ -0,0 +1,398 @@
   3.646 ++/*
   3.647 ++ * SpanDSP - a series of DSP components for telephony
   3.648 ++ *
   3.649 ++ * g722_decode.c - The ITU G.722 codec, decode part.
   3.650 ++ *
   3.651 ++ * Written by Steve Underwood <steveu@coppice.org>
   3.652 ++ *
   3.653 ++ * Copyright (C) 2005 Steve Underwood
   3.654 ++ *
   3.655 ++ *  Despite my general liking of the GPL, I place my own contributions 
   3.656 ++ *  to this code in the public domain for the benefit of all mankind -
   3.657 ++ *  even the slimy ones who might try to proprietize my work and use it
   3.658 ++ *  to my detriment.
   3.659 ++ *
   3.660 ++ * Based in part on a single channel G.722 codec which is:
   3.661 ++ *
   3.662 ++ * Copyright (c) CMU 1993
   3.663 ++ * Computer Science, Speech Group
   3.664 ++ * Chengxiang Lu and Alex Hauptmann
   3.665 ++ *
   3.666 ++ * $Id: g722_decode.c 48661 2006-12-21 00:08:21Z mattf $
   3.667 ++ */
   3.668 ++
   3.669 ++/*! \file */
   3.670 ++
   3.671 ++#ifdef HAVE_CONFIG_H
   3.672 ++#include <config.h>
   3.673 ++#endif
   3.674 ++
   3.675 ++#include <stdio.h>
   3.676 ++#include <inttypes.h>
   3.677 ++#include <memory.h>
   3.678 ++#include <stdlib.h>
   3.679 ++#if 0
   3.680 ++#include <tgmath.h>
   3.681 ++#endif
   3.682 ++
   3.683 ++#include "g722.h"
   3.684 ++
   3.685 ++#if !defined(FALSE)
   3.686 ++#define FALSE 0
   3.687 ++#endif
   3.688 ++#if !defined(TRUE)
   3.689 ++#define TRUE (!FALSE)
   3.690 ++#endif
   3.691 ++
   3.692 ++static __inline__ int16_t saturate(int32_t amp)
   3.693 ++{
   3.694 ++    int16_t amp16;
   3.695 ++
   3.696 ++    /* Hopefully this is optimised for the common case - not clipping */
   3.697 ++    amp16 = (int16_t) amp;
   3.698 ++    if (amp == amp16)
   3.699 ++        return amp16;
   3.700 ++    if (amp > INT16_MAX)
   3.701 ++        return  INT16_MAX;
   3.702 ++    return  INT16_MIN;
   3.703 ++}
   3.704 ++/*- End of function --------------------------------------------------------*/
   3.705 ++
   3.706 ++static void block4(g722_decode_state_t *s, int band, int d);
   3.707 ++
   3.708 ++static void block4(g722_decode_state_t *s, int band, int d)
   3.709 ++{
   3.710 ++    int wd1;
   3.711 ++    int wd2;
   3.712 ++    int wd3;
   3.713 ++    int i;
   3.714 ++
   3.715 ++    /* Block 4, RECONS */
   3.716 ++    s->band[band].d[0] = d;
   3.717 ++    s->band[band].r[0] = saturate(s->band[band].s + d);
   3.718 ++
   3.719 ++    /* Block 4, PARREC */
   3.720 ++    s->band[band].p[0] = saturate(s->band[band].sz + d);
   3.721 ++
   3.722 ++    /* Block 4, UPPOL2 */
   3.723 ++    for (i = 0;  i < 3;  i++)
   3.724 ++        s->band[band].sg[i] = s->band[band].p[i] >> 15;
   3.725 ++    wd1 = saturate(s->band[band].a[1] << 2);
   3.726 ++
   3.727 ++    wd2 = (s->band[band].sg[0] == s->band[band].sg[1])  ?  -wd1  :  wd1;
   3.728 ++    if (wd2 > 32767)
   3.729 ++        wd2 = 32767;
   3.730 ++    wd3 = (s->band[band].sg[0] == s->band[band].sg[2])  ?  128  :  -128;
   3.731 ++    wd3 += (wd2 >> 7);
   3.732 ++    wd3 += (s->band[band].a[2]*32512) >> 15;
   3.733 ++    if (wd3 > 12288)
   3.734 ++        wd3 = 12288;
   3.735 ++    else if (wd3 < -12288)
   3.736 ++        wd3 = -12288;
   3.737 ++    s->band[band].ap[2] = wd3;
   3.738 ++
   3.739 ++    /* Block 4, UPPOL1 */
   3.740 ++    s->band[band].sg[0] = s->band[band].p[0] >> 15;
   3.741 ++    s->band[band].sg[1] = s->band[band].p[1] >> 15;
   3.742 ++    wd1 = (s->band[band].sg[0] == s->band[band].sg[1])  ?  192  :  -192;
   3.743 ++    wd2 = (s->band[band].a[1]*32640) >> 15;
   3.744 ++
   3.745 ++    s->band[band].ap[1] = saturate(wd1 + wd2);
   3.746 ++    wd3 = saturate(15360 - s->band[band].ap[2]);
   3.747 ++    if (s->band[band].ap[1] > wd3)
   3.748 ++        s->band[band].ap[1] = wd3;
   3.749 ++    else if (s->band[band].ap[1] < -wd3)
   3.750 ++        s->band[band].ap[1] = -wd3;
   3.751 ++
   3.752 ++    /* Block 4, UPZERO */
   3.753 ++    wd1 = (d == 0)  ?  0  :  128;
   3.754 ++    s->band[band].sg[0] = d >> 15;
   3.755 ++    for (i = 1;  i < 7;  i++)
   3.756 ++    {
   3.757 ++        s->band[band].sg[i] = s->band[band].d[i] >> 15;
   3.758 ++        wd2 = (s->band[band].sg[i] == s->band[band].sg[0])  ?  wd1  :  -wd1;
   3.759 ++        wd3 = (s->band[band].b[i]*32640) >> 15;
   3.760 ++        s->band[band].bp[i] = saturate(wd2 + wd3);
   3.761 ++    }
   3.762 ++
   3.763 ++    /* Block 4, DELAYA */
   3.764 ++    for (i = 6;  i > 0;  i--)
   3.765 ++    {
   3.766 ++        s->band[band].d[i] = s->band[band].d[i - 1];
   3.767 ++        s->band[band].b[i] = s->band[band].bp[i];
   3.768 ++    }
   3.769 ++    
   3.770 ++    for (i = 2;  i > 0;  i--)
   3.771 ++    {
   3.772 ++        s->band[band].r[i] = s->band[band].r[i - 1];
   3.773 ++        s->band[band].p[i] = s->band[band].p[i - 1];
   3.774 ++        s->band[band].a[i] = s->band[band].ap[i];
   3.775 ++    }
   3.776 ++
   3.777 ++    /* Block 4, FILTEP */
   3.778 ++    wd1 = saturate(s->band[band].r[1] + s->band[band].r[1]);
   3.779 ++    wd1 = (s->band[band].a[1]*wd1) >> 15;
   3.780 ++    wd2 = saturate(s->band[band].r[2] + s->band[band].r[2]);
   3.781 ++    wd2 = (s->band[band].a[2]*wd2) >> 15;
   3.782 ++    s->band[band].sp = saturate(wd1 + wd2);
   3.783 ++
   3.784 ++    /* Block 4, FILTEZ */
   3.785 ++    s->band[band].sz = 0;
   3.786 ++    for (i = 6;  i > 0;  i--)
   3.787 ++    {
   3.788 ++        wd1 = saturate(s->band[band].d[i] + s->band[band].d[i]);
   3.789 ++        s->band[band].sz += (s->band[band].b[i]*wd1) >> 15;
   3.790 ++    }
   3.791 ++    s->band[band].sz = saturate(s->band[band].sz);
   3.792 ++
   3.793 ++    /* Block 4, PREDIC */
   3.794 ++    s->band[band].s = saturate(s->band[band].sp + s->band[band].sz);
   3.795 ++}
   3.796 ++/*- End of function --------------------------------------------------------*/
   3.797 ++
   3.798 ++g722_decode_state_t *g722_decode_init(g722_decode_state_t *s, int rate, int options)
   3.799 ++{
   3.800 ++    if (s == NULL)
   3.801 ++    {
   3.802 ++        if ((s = (g722_decode_state_t *) malloc(sizeof(*s))) == NULL)
   3.803 ++            return NULL;
   3.804 ++    }
   3.805 ++    memset(s, 0, sizeof(*s));
   3.806 ++    if (rate == 48000)
   3.807 ++        s->bits_per_sample = 6;
   3.808 ++    else if (rate == 56000)
   3.809 ++        s->bits_per_sample = 7;
   3.810 ++    else
   3.811 ++        s->bits_per_sample = 8;
   3.812 ++    if ((options & G722_SAMPLE_RATE_8000))
   3.813 ++        s->eight_k = TRUE;
   3.814 ++    if ((options & G722_PACKED)  &&  s->bits_per_sample != 8)
   3.815 ++        s->packed = TRUE;
   3.816 ++    else
   3.817 ++        s->packed = FALSE;
   3.818 ++    s->band[0].det = 32;
   3.819 ++    s->band[1].det = 8;
   3.820 ++    return s;
   3.821 ++}
   3.822 ++/*- End of function --------------------------------------------------------*/
   3.823 ++
   3.824 ++int g722_decode_release(g722_decode_state_t *s)
   3.825 ++{
   3.826 ++    free(s);
   3.827 ++    return 0;
   3.828 ++}
   3.829 ++/*- End of function --------------------------------------------------------*/
   3.830 ++
   3.831 ++int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[], int len)
   3.832 ++{
   3.833 ++    static const int wl[8] = {-60, -30, 58, 172, 334, 538, 1198, 3042 };
   3.834 ++    static const int rl42[16] = {0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3,  2, 1, 0 };
   3.835 ++    static const int ilb[32] =
   3.836 ++    {
   3.837 ++        2048, 2093, 2139, 2186, 2233, 2282, 2332,
   3.838 ++        2383, 2435, 2489, 2543, 2599, 2656, 2714,
   3.839 ++        2774, 2834, 2896, 2960, 3025, 3091, 3158,
   3.840 ++        3228, 3298, 3371, 3444, 3520, 3597, 3676,
   3.841 ++        3756, 3838, 3922, 4008
   3.842 ++    };
   3.843 ++    static const int wh[3] = {0, -214, 798};
   3.844 ++    static const int rh2[4] = {2, 1, 2, 1};
   3.845 ++    static const int qm2[4] = {-7408, -1616,  7408,   1616};
   3.846 ++    static const int qm4[16] = 
   3.847 ++    {
   3.848 ++              0, -20456, -12896,  -8968, 
   3.849 ++          -6288,  -4240,  -2584,  -1200,
   3.850 ++          20456,  12896,   8968,   6288,
   3.851 ++           4240,   2584,   1200,      0
   3.852 ++    };
   3.853 ++    static const int qm5[32] =
   3.854 ++    {
   3.855 ++           -280,   -280, -23352, -17560,
   3.856 ++         -14120, -11664,  -9752,  -8184,
   3.857 ++          -6864,  -5712,  -4696,  -3784,
   3.858 ++          -2960,  -2208,  -1520,   -880,
   3.859 ++          23352,  17560,  14120,  11664,
   3.860 ++           9752,   8184,   6864,   5712,
   3.861 ++           4696,   3784,   2960,   2208,
   3.862 ++           1520,    880,    280,   -280
   3.863 ++    };
   3.864 ++    static const int qm6[64] =
   3.865 ++    {
   3.866 ++           -136,   -136,   -136,   -136,
   3.867 ++         -24808, -21904, -19008, -16704,
   3.868 ++         -14984, -13512, -12280, -11192,
   3.869 ++         -10232,  -9360,  -8576,  -7856,
   3.870 ++          -7192,  -6576,  -6000,  -5456,
   3.871 ++          -4944,  -4464,  -4008,  -3576,
   3.872 ++          -3168,  -2776,  -2400,  -2032,
   3.873 ++          -1688,  -1360,  -1040,   -728,
   3.874 ++          24808,  21904,  19008,  16704,
   3.875 ++          14984,  13512,  12280,  11192,
   3.876 ++          10232,   9360,   8576,   7856,
   3.877 ++           7192,   6576,   6000,   5456,
   3.878 ++           4944,   4464,   4008,   3576,
   3.879 ++           3168,   2776,   2400,   2032,
   3.880 ++           1688,   1360,   1040,    728,
   3.881 ++            432,    136,   -432,   -136
   3.882 ++    };
   3.883 ++    static const int qmf_coeffs[12] =
   3.884 ++    {
   3.885 ++           3,  -11,   12,   32, -210,  951, 3876, -805,  362, -156,   53,  -11,
   3.886 ++    };
   3.887 ++
   3.888 ++    int dlowt;
   3.889 ++    int rlow;
   3.890 ++    int ihigh;
   3.891 ++    int dhigh;
   3.892 ++    int rhigh;
   3.893 ++    int xout1;
   3.894 ++    int xout2;
   3.895 ++    int wd1;
   3.896 ++    int wd2;
   3.897 ++    int wd3;
   3.898 ++    int code;
   3.899 ++    int outlen;
   3.900 ++    int i;
   3.901 ++    int j;
   3.902 ++
   3.903 ++    outlen = 0;
   3.904 ++    rhigh = 0;
   3.905 ++    for (j = 0;  j < len;  )
   3.906 ++    {
   3.907 ++        if (s->packed)
   3.908 ++        {
   3.909 ++            /* Unpack the code bits */
   3.910 ++            if (s->in_bits < s->bits_per_sample)
   3.911 ++            {
   3.912 ++                s->in_buffer |= (g722_data[j++] << s->in_bits);
   3.913 ++                s->in_bits += 8;
   3.914 ++            }
   3.915 ++            code = s->in_buffer & ((1 << s->bits_per_sample) - 1);
   3.916 ++            s->in_buffer >>= s->bits_per_sample;
   3.917 ++            s->in_bits -= s->bits_per_sample;
   3.918 ++        }
   3.919 ++        else
   3.920 ++        {
   3.921 ++            code = g722_data[j++];
   3.922 ++        }
   3.923 ++
   3.924 ++        switch (s->bits_per_sample)
   3.925 ++        {
   3.926 ++        default:
   3.927 ++        case 8:
   3.928 ++            wd1 = code & 0x3F;
   3.929 ++            ihigh = (code >> 6) & 0x03;
   3.930 ++            wd2 = qm6[wd1];
   3.931 ++            wd1 >>= 2;
   3.932 ++            break;
   3.933 ++        case 7:
   3.934 ++            wd1 = code & 0x1F;
   3.935 ++            ihigh = (code >> 5) & 0x03;
   3.936 ++            wd2 = qm5[wd1];
   3.937 ++            wd1 >>= 1;
   3.938 ++            break;
   3.939 ++        case 6:
   3.940 ++            wd1 = code & 0x0F;
   3.941 ++            ihigh = (code >> 4) & 0x03;
   3.942 ++            wd2 = qm4[wd1];
   3.943 ++            break;
   3.944 ++        }
   3.945 ++        /* Block 5L, LOW BAND INVQBL */
   3.946 ++        wd2 = (s->band[0].det*wd2) >> 15;
   3.947 ++        /* Block 5L, RECONS */
   3.948 ++        rlow = s->band[0].s + wd2;
   3.949 ++        /* Block 6L, LIMIT */
   3.950 ++        if (rlow > 16383)
   3.951 ++            rlow = 16383;
   3.952 ++        else if (rlow < -16384)
   3.953 ++            rlow = -16384;
   3.954 ++
   3.955 ++        /* Block 2L, INVQAL */
   3.956 ++        wd2 = qm4[wd1];
   3.957 ++        dlowt = (s->band[0].det*wd2) >> 15;
   3.958 ++
   3.959 ++        /* Block 3L, LOGSCL */
   3.960 ++        wd2 = rl42[wd1];
   3.961 ++        wd1 = (s->band[0].nb*127) >> 7;
   3.962 ++        wd1 += wl[wd2];
   3.963 ++        if (wd1 < 0)
   3.964 ++            wd1 = 0;
   3.965 ++        else if (wd1 > 18432)
   3.966 ++            wd1 = 18432;
   3.967 ++        s->band[0].nb = wd1;
   3.968 ++            
   3.969 ++        /* Block 3L, SCALEL */
   3.970 ++        wd1 = (s->band[0].nb >> 6) & 31;
   3.971 ++        wd2 = 8 - (s->band[0].nb >> 11);
   3.972 ++        wd3 = (wd2 < 0)  ?  (ilb[wd1] << -wd2)  :  (ilb[wd1] >> wd2);
   3.973 ++        s->band[0].det = wd3 << 2;
   3.974 ++
   3.975 ++        block4(s, 0, dlowt);
   3.976 ++        
   3.977 ++        if (!s->eight_k)
   3.978 ++        {
   3.979 ++            /* Block 2H, INVQAH */
   3.980 ++            wd2 = qm2[ihigh];
   3.981 ++            dhigh = (s->band[1].det*wd2) >> 15;
   3.982 ++            /* Block 5H, RECONS */
   3.983 ++            rhigh = dhigh + s->band[1].s;
   3.984 ++            /* Block 6H, LIMIT */
   3.985 ++            if (rhigh > 16383)
   3.986 ++                rhigh = 16383;
   3.987 ++            else if (rhigh < -16384)
   3.988 ++                rhigh = -16384;
   3.989 ++
   3.990 ++            /* Block 2H, INVQAH */
   3.991 ++            wd2 = rh2[ihigh];
   3.992 ++            wd1 = (s->band[1].nb*127) >> 7;
   3.993 ++            wd1 += wh[wd2];
   3.994 ++            if (wd1 < 0)
   3.995 ++                wd1 = 0;
   3.996 ++            else if (wd1 > 22528)
   3.997 ++                wd1 = 22528;
   3.998 ++            s->band[1].nb = wd1;
   3.999 ++            
  3.1000 ++            /* Block 3H, SCALEH */
  3.1001 ++            wd1 = (s->band[1].nb >> 6) & 31;
  3.1002 ++            wd2 = 10 - (s->band[1].nb >> 11);
  3.1003 ++            wd3 = (wd2 < 0)  ?  (ilb[wd1] << -wd2)  :  (ilb[wd1] >> wd2);
  3.1004 ++            s->band[1].det = wd3 << 2;
  3.1005 ++
  3.1006 ++            block4(s, 1, dhigh);
  3.1007 ++        }
  3.1008 ++
  3.1009 ++        if (s->itu_test_mode)
  3.1010 ++        {
  3.1011 ++            amp[outlen++] = (int16_t) (rlow << 1);
  3.1012 ++            amp[outlen++] = (int16_t) (rhigh << 1);
  3.1013 ++        }
  3.1014 ++        else
  3.1015 ++        {
  3.1016 ++            if (s->eight_k)
  3.1017 ++            {
  3.1018 ++                amp[outlen++] = (int16_t) rlow;
  3.1019 ++            }
  3.1020 ++            else
  3.1021 ++            {
  3.1022 ++                /* Apply the receive QMF */
  3.1023 ++                for (i = 0;  i < 22;  i++)
  3.1024 ++                    s->x[i] = s->x[i + 2];
  3.1025 ++                s->x[22] = rlow + rhigh;
  3.1026 ++                s->x[23] = rlow - rhigh;
  3.1027 ++
  3.1028 ++                xout1 = 0;
  3.1029 ++                xout2 = 0;
  3.1030 ++                for (i = 0;  i < 12;  i++)
  3.1031 ++                {
  3.1032 ++                    xout2 += s->x[2*i]*qmf_coeffs[i];
  3.1033 ++                    xout1 += s->x[2*i + 1]*qmf_coeffs[11 - i];
  3.1034 ++                }
  3.1035 ++                amp[outlen++] = (int16_t) (xout1 >> 12);
  3.1036 ++                amp[outlen++] = (int16_t) (xout2 >> 12);
  3.1037 ++            }
  3.1038 ++        }
  3.1039 ++    }
  3.1040 ++    return outlen;
  3.1041 ++}
  3.1042 ++/*- End of function --------------------------------------------------------*/
  3.1043 ++/*- End of file ------------------------------------------------------------*/
  3.1044 +Index: codecs/g722/g722_encode.c
  3.1045 +diff -Nau codecs/g722/g722_encode.c.orig codecs/g722/g722_encode.c
  3.1046 +--- codecs/g722/g722_encode.c.orig	1970-01-01 01:00:00.000000000 +0100
  3.1047 ++++ codecs/g722/g722_encode.c	2009-04-24 00:30:33.000000000 +0200
  3.1048 +@@ -0,0 +1,400 @@
  3.1049 ++/*
  3.1050 ++ * SpanDSP - a series of DSP components for telephony
  3.1051 ++ *
  3.1052 ++ * g722_encode.c - The ITU G.722 codec, encode part.
  3.1053 ++ *
  3.1054 ++ * Written by Steve Underwood <steveu@coppice.org>
  3.1055 ++ *
  3.1056 ++ * Copyright (C) 2005 Steve Underwood
  3.1057 ++ *
  3.1058 ++ * All rights reserved.
  3.1059 ++ *
  3.1060 ++ *  Despite my general liking of the GPL, I place my own contributions 
  3.1061 ++ *  to this code in the public domain for the benefit of all mankind -
  3.1062 ++ *  even the slimy ones who might try to proprietize my work and use it
  3.1063 ++ *  to my detriment.
  3.1064 ++ *
  3.1065 ++ * Based on a single channel 64kbps only G.722 codec which is:
  3.1066 ++ *
  3.1067 ++ *****    Copyright (c) CMU    1993      *****
  3.1068 ++ * Computer Science, Speech Group
  3.1069 ++ * Chengxiang Lu and Alex Hauptmann
  3.1070 ++ *
  3.1071 ++ * $Id: g722_encode.c 48661 2006-12-21 00:08:21Z mattf $
  3.1072 ++ */
  3.1073 ++
  3.1074 ++/*! \file */
  3.1075 ++
  3.1076 ++#ifdef HAVE_CONFIG_H
  3.1077 ++#include <config.h>
  3.1078 ++#endif
  3.1079 ++
  3.1080 ++#include <stdio.h>
  3.1081 ++#include <inttypes.h>
  3.1082 ++#include <memory.h>
  3.1083 ++#include <stdlib.h>
  3.1084 ++#if 0
  3.1085 ++#include <tgmath.h>
  3.1086 ++#endif
  3.1087 ++
  3.1088 ++#include "g722.h"
  3.1089 ++
  3.1090 ++#if !defined(FALSE)
  3.1091 ++#define FALSE 0
  3.1092 ++#endif
  3.1093 ++#if !defined(TRUE)
  3.1094 ++#define TRUE (!FALSE)
  3.1095 ++#endif
  3.1096 ++
  3.1097 ++static __inline__ int16_t saturate(int32_t amp)
  3.1098 ++{
  3.1099 ++    int16_t amp16;
  3.1100 ++
  3.1101 ++    /* Hopefully this is optimised for the common case - not clipping */
  3.1102 ++    amp16 = (int16_t) amp;
  3.1103 ++    if (amp == amp16)
  3.1104 ++        return amp16;
  3.1105 ++    if (amp > INT16_MAX)
  3.1106 ++        return  INT16_MAX;
  3.1107 ++    return  INT16_MIN;
  3.1108 ++}
  3.1109 ++/*- End of function --------------------------------------------------------*/
  3.1110 ++
  3.1111 ++static void block4(g722_encode_state_t *s, int band, int d)
  3.1112 ++{
  3.1113 ++    int wd1;
  3.1114 ++    int wd2;
  3.1115 ++    int wd3;
  3.1116 ++    int i;
  3.1117 ++
  3.1118 ++    /* Block 4, RECONS */
  3.1119 ++    s->band[band].d[0] = d;
  3.1120 ++    s->band[band].r[0] = saturate(s->band[band].s + d);
  3.1121 ++
  3.1122 ++    /* Block 4, PARREC */
  3.1123 ++    s->band[band].p[0] = saturate(s->band[band].sz + d);
  3.1124 ++
  3.1125 ++    /* Block 4, UPPOL2 */
  3.1126 ++    for (i = 0;  i < 3;  i++)
  3.1127 ++        s->band[band].sg[i] = s->band[band].p[i] >> 15;
  3.1128 ++    wd1 = saturate(s->band[band].a[1] << 2);
  3.1129 ++
  3.1130 ++    wd2 = (s->band[band].sg[0] == s->band[band].sg[1])  ?  -wd1  :  wd1;
  3.1131 ++    if (wd2 > 32767)
  3.1132 ++        wd2 = 32767;
  3.1133 ++    wd3 = (wd2 >> 7) + ((s->band[band].sg[0] == s->band[band].sg[2])  ?  128  :  -128);
  3.1134 ++    wd3 += (s->band[band].a[2]*32512) >> 15;
  3.1135 ++    if (wd3 > 12288)
  3.1136 ++        wd3 = 12288;
  3.1137 ++    else if (wd3 < -12288)
  3.1138 ++        wd3 = -12288;
  3.1139 ++    s->band[band].ap[2] = wd3;
  3.1140 ++
  3.1141 ++    /* Block 4, UPPOL1 */
  3.1142 ++    s->band[band].sg[0] = s->band[band].p[0] >> 15;
  3.1143 ++    s->band[band].sg[1] = s->band[band].p[1] >> 15;
  3.1144 ++    wd1 = (s->band[band].sg[0] == s->band[band].sg[1])  ?  192  :  -192;
  3.1145 ++    wd2 = (s->band[band].a[1]*32640) >> 15;
  3.1146 ++
  3.1147 ++    s->band[band].ap[1] = saturate(wd1 + wd2);
  3.1148 ++    wd3 = saturate(15360 - s->band[band].ap[2]);
  3.1149 ++    if (s->band[band].ap[1] > wd3)
  3.1150 ++        s->band[band].ap[1] = wd3;
  3.1151 ++    else if (s->band[band].ap[1] < -wd3)
  3.1152 ++        s->band[band].ap[1] = -wd3;
  3.1153 ++
  3.1154 ++    /* Block 4, UPZERO */
  3.1155 ++    wd1 = (d == 0)  ?  0  :  128;
  3.1156 ++    s->band[band].sg[0] = d >> 15;
  3.1157 ++    for (i = 1;  i < 7;  i++)
  3.1158 ++    {
  3.1159 ++        s->band[band].sg[i] = s->band[band].d[i] >> 15;
  3.1160 ++        wd2 = (s->band[band].sg[i] == s->band[band].sg[0])  ?  wd1  :  -wd1;
  3.1161 ++        wd3 = (s->band[band].b[i]*32640) >> 15;
  3.1162 ++        s->band[band].bp[i] = saturate(wd2 + wd3);
  3.1163 ++    }
  3.1164 ++
  3.1165 ++    /* Block 4, DELAYA */
  3.1166 ++    for (i = 6;  i > 0;  i--)
  3.1167 ++    {
  3.1168 ++        s->band[band].d[i] = s->band[band].d[i - 1];
  3.1169 ++        s->band[band].b[i] = s->band[band].bp[i];
  3.1170 ++    }
  3.1171 ++    
  3.1172 ++    for (i = 2;  i > 0;  i--)
  3.1173 ++    {
  3.1174 ++        s->band[band].r[i] = s->band[band].r[i - 1];
  3.1175 ++        s->band[band].p[i] = s->band[band].p[i - 1];
  3.1176 ++        s->band[band].a[i] = s->band[band].ap[i];
  3.1177 ++    }
  3.1178 ++
  3.1179 ++    /* Block 4, FILTEP */
  3.1180 ++    wd1 = saturate(s->band[band].r[1] + s->band[band].r[1]);
  3.1181 ++    wd1 = (s->band[band].a[1]*wd1) >> 15;
  3.1182 ++    wd2 = saturate(s->band[band].r[2] + s->band[band].r[2]);
  3.1183 ++    wd2 = (s->band[band].a[2]*wd2) >> 15;
  3.1184 ++    s->band[band].sp = saturate(wd1 + wd2);
  3.1185 ++
  3.1186 ++    /* Block 4, FILTEZ */
  3.1187 ++    s->band[band].sz = 0;
  3.1188 ++    for (i = 6;  i > 0;  i--)
  3.1189 ++    {
  3.1190 ++        wd1 = saturate(s->band[band].d[i] + s->band[band].d[i]);
  3.1191 ++        s->band[band].sz += (s->band[band].b[i]*wd1) >> 15;
  3.1192 ++    }
  3.1193 ++    s->band[band].sz = saturate(s->band[band].sz);
  3.1194 ++
  3.1195 ++    /* Block 4, PREDIC */
  3.1196 ++    s->band[band].s = saturate(s->band[band].sp + s->band[band].sz);
  3.1197 ++}
  3.1198 ++/*- End of function --------------------------------------------------------*/
  3.1199 ++
  3.1200 ++g722_encode_state_t *g722_encode_init(g722_encode_state_t *s, int rate, int options)
  3.1201 ++{
  3.1202 ++    if (s == NULL)
  3.1203 ++    {
  3.1204 ++        if ((s = (g722_encode_state_t *) malloc(sizeof(*s))) == NULL)
  3.1205 ++            return NULL;
  3.1206 ++    }
  3.1207 ++    memset(s, 0, sizeof(*s));
  3.1208 ++    if (rate == 48000)
  3.1209 ++        s->bits_per_sample = 6;
  3.1210 ++    else if (rate == 56000)
  3.1211 ++        s->bits_per_sample = 7;
  3.1212 ++    else
  3.1213 ++        s->bits_per_sample = 8;
  3.1214 ++    if ((options & G722_SAMPLE_RATE_8000))
  3.1215 ++        s->eight_k = TRUE;
  3.1216 ++    if ((options & G722_PACKED)  &&  s->bits_per_sample != 8)
  3.1217 ++        s->packed = TRUE;
  3.1218 ++    else
  3.1219 ++        s->packed = FALSE;
  3.1220 ++    s->band[0].det = 32;
  3.1221 ++    s->band[1].det = 8;
  3.1222 ++    return s;
  3.1223 ++}
  3.1224 ++/*- End of function --------------------------------------------------------*/
  3.1225 ++
  3.1226 ++int g722_encode_release(g722_encode_state_t *s)
  3.1227 ++{
  3.1228 ++    free(s);
  3.1229 ++    return 0;
  3.1230 ++}
  3.1231 ++/*- End of function --------------------------------------------------------*/
  3.1232 ++
  3.1233 ++int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[], int len)
  3.1234 ++{
  3.1235 ++    static const int q6[32] =
  3.1236 ++    {
  3.1237 ++           0,   35,   72,  110,  150,  190,  233,  276,
  3.1238 ++         323,  370,  422,  473,  530,  587,  650,  714,
  3.1239 ++         786,  858,  940, 1023, 1121, 1219, 1339, 1458,
  3.1240 ++        1612, 1765, 1980, 2195, 2557, 2919,    0,    0
  3.1241 ++    };
  3.1242 ++    static const int iln[32] =
  3.1243 ++    {
  3.1244 ++         0, 63, 62, 31, 30, 29, 28, 27,
  3.1245 ++        26, 25, 24, 23, 22, 21, 20, 19,
  3.1246 ++        18, 17, 16, 15, 14, 13, 12, 11,
  3.1247 ++        10,  9,  8,  7,  6,  5,  4,  0
  3.1248 ++    };
  3.1249 ++    static const int ilp[32] =
  3.1250 ++    {
  3.1251 ++         0, 61, 60, 59, 58, 57, 56, 55,
  3.1252 ++        54, 53, 52, 51, 50, 49, 48, 47,
  3.1253 ++        46, 45, 44, 43, 42, 41, 40, 39,
  3.1254 ++        38, 37, 36, 35, 34, 33, 32,  0
  3.1255 ++    };
  3.1256 ++    static const int wl[8] =
  3.1257 ++    {
  3.1258 ++        -60, -30, 58, 172, 334, 538, 1198, 3042
  3.1259 ++    };
  3.1260 ++    static const int rl42[16] =
  3.1261 ++    {
  3.1262 ++        0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 0
  3.1263 ++    };
  3.1264 ++    static const int ilb[32] =
  3.1265 ++    {
  3.1266 ++        2048, 2093, 2139, 2186, 2233, 2282, 2332,
  3.1267 ++        2383, 2435, 2489, 2543, 2599, 2656, 2714,
  3.1268 ++        2774, 2834, 2896, 2960, 3025, 3091, 3158,
  3.1269 ++        3228, 3298, 3371, 3444, 3520, 3597, 3676,
  3.1270 ++        3756, 3838, 3922, 4008
  3.1271 ++    };
  3.1272 ++    static const int qm4[16] =
  3.1273 ++    {
  3.1274 ++             0, -20456, -12896, -8968,
  3.1275 ++         -6288,  -4240,  -2584, -1200,
  3.1276 ++         20456,  12896,   8968,  6288,
  3.1277 ++          4240,   2584,   1200,     0
  3.1278 ++    };
  3.1279 ++    static const int qm2[4] =
  3.1280 ++    {
  3.1281 ++        -7408,  -1616,   7408,   1616
  3.1282 ++    };
  3.1283 ++    static const int qmf_coeffs[12] =
  3.1284 ++    {
  3.1285 ++           3,  -11,   12,   32, -210,  951, 3876, -805,  362, -156,   53,  -11,
  3.1286 ++    };
  3.1287 ++    static const int ihn[3] = {0, 1, 0};
  3.1288 ++    static const int ihp[3] = {0, 3, 2};
  3.1289 ++    static const int wh[3] = {0, -214, 798};
  3.1290 ++    static const int rh2[4] = {2, 1, 2, 1};
  3.1291 ++
  3.1292 ++    int dlow;
  3.1293 ++    int dhigh;
  3.1294 ++    int el;
  3.1295 ++    int wd;
  3.1296 ++    int wd1;
  3.1297 ++    int ril;
  3.1298 ++    int wd2;
  3.1299 ++    int il4;
  3.1300 ++    int ih2;
  3.1301 ++    int wd3;
  3.1302 ++    int eh;
  3.1303 ++    int mih;
  3.1304 ++    int i;
  3.1305 ++    int j;
  3.1306 ++    /* Low and high band PCM from the QMF */
  3.1307 ++    int xlow;
  3.1308 ++    int xhigh;
  3.1309 ++    int g722_bytes;
  3.1310 ++    /* Even and odd tap accumulators */
  3.1311 ++    int sumeven;
  3.1312 ++    int sumodd;
  3.1313 ++    int ihigh;
  3.1314 ++    int ilow;
  3.1315 ++    int code;
  3.1316 ++
  3.1317 ++    g722_bytes = 0;
  3.1318 ++    xhigh = 0;
  3.1319 ++    for (j = 0;  j < len;  )
  3.1320 ++    {
  3.1321 ++        if (s->itu_test_mode)
  3.1322 ++        {
  3.1323 ++            xlow =
  3.1324 ++            xhigh = amp[j++] >> 1;
  3.1325 ++        }
  3.1326 ++        else
  3.1327 ++        {
  3.1328 ++            if (s->eight_k)
  3.1329 ++            {
  3.1330 ++                xlow = amp[j++];
  3.1331 ++            }
  3.1332 ++            else
  3.1333 ++            {
  3.1334 ++                /* Apply the transmit QMF */
  3.1335 ++                /* Shuffle the buffer down */
  3.1336 ++                for (i = 0;  i < 22;  i++)
  3.1337 ++                    s->x[i] = s->x[i + 2];
  3.1338 ++                s->x[22] = amp[j++];
  3.1339 ++                s->x[23] = amp[j++];
  3.1340 ++    
  3.1341 ++                /* Discard every other QMF output */
  3.1342 ++                sumeven = 0;
  3.1343 ++                sumodd = 0;
  3.1344 ++                for (i = 0;  i < 12;  i++)
  3.1345 ++                {
  3.1346 ++                    sumodd += s->x[2*i]*qmf_coeffs[i];
  3.1347 ++                    sumeven += s->x[2*i + 1]*qmf_coeffs[11 - i];
  3.1348 ++                }
  3.1349 ++                xlow = (sumeven + sumodd) >> 13;
  3.1350 ++                xhigh = (sumeven - sumodd) >> 13;
  3.1351 ++            }
  3.1352 ++        }
  3.1353 ++        /* Block 1L, SUBTRA */
  3.1354 ++        el = saturate(xlow - s->band[0].s);
  3.1355 ++
  3.1356 ++        /* Block 1L, QUANTL */
  3.1357 ++        wd = (el >= 0)  ?  el  :  -(el + 1);
  3.1358 ++
  3.1359 ++        for (i = 1;  i < 30;  i++)
  3.1360 ++        {
  3.1361 ++            wd1 = (q6[i]*s->band[0].det) >> 12;
  3.1362 ++            if (wd < wd1)
  3.1363 ++                break;
  3.1364 ++        }
  3.1365 ++        ilow = (el < 0)  ?  iln[i]  :  ilp[i];
  3.1366 ++
  3.1367 ++        /* Block 2L, INVQAL */
  3.1368 ++        ril = ilow >> 2;
  3.1369 ++        wd2 = qm4[ril];
  3.1370 ++        dlow = (s->band[0].det*wd2) >> 15;
  3.1371 ++
  3.1372 ++        /* Block 3L, LOGSCL */
  3.1373 ++        il4 = rl42[ril];
  3.1374 ++        wd = (s->band[0].nb*127) >> 7;
  3.1375 ++        s->band[0].nb = wd + wl[il4];
  3.1376 ++        if (s->band[0].nb < 0)
  3.1377 ++            s->band[0].nb = 0;
  3.1378 ++        else if (s->band[0].nb > 18432)
  3.1379 ++            s->band[0].nb = 18432;
  3.1380 ++
  3.1381 ++        /* Block 3L, SCALEL */
  3.1382 ++        wd1 = (s->band[0].nb >> 6) & 31;
  3.1383 ++        wd2 = 8 - (s->band[0].nb >> 11);
  3.1384 ++        wd3 = (wd2 < 0)  ?  (ilb[wd1] << -wd2)  :  (ilb[wd1] >> wd2);
  3.1385 ++        s->band[0].det = wd3 << 2;
  3.1386 ++
  3.1387 ++        block4(s, 0, dlow);
  3.1388 ++        
  3.1389 ++        if (s->eight_k)
  3.1390 ++        {
  3.1391 ++            /* Just leave the high bits as zero */
  3.1392 ++            code = (0xC0 | ilow) >> (8 - s->bits_per_sample);
  3.1393 ++        }
  3.1394 ++        else
  3.1395 ++        {
  3.1396 ++            /* Block 1H, SUBTRA */
  3.1397 ++            eh = saturate(xhigh - s->band[1].s);
  3.1398 ++
  3.1399 ++            /* Block 1H, QUANTH */
  3.1400 ++            wd = (eh >= 0)  ?  eh  :  -(eh + 1);
  3.1401 ++            wd1 = (564*s->band[1].det) >> 12;
  3.1402 ++            mih = (wd >= wd1)  ?  2  :  1;
  3.1403 ++            ihigh = (eh < 0)  ?  ihn[mih]  :  ihp[mih];
  3.1404 ++
  3.1405 ++            /* Block 2H, INVQAH */
  3.1406 ++            wd2 = qm2[ihigh];
  3.1407 ++            dhigh = (s->band[1].det*wd2) >> 15;
  3.1408 ++
  3.1409 ++            /* Block 3H, LOGSCH */
  3.1410 ++            ih2 = rh2[ihigh];
  3.1411 ++            wd = (s->band[1].nb*127) >> 7;
  3.1412 ++            s->band[1].nb = wd + wh[ih2];
  3.1413 ++            if (s->band[1].nb < 0)
  3.1414 ++                s->band[1].nb = 0;
  3.1415 ++            else if (s->band[1].nb > 22528)
  3.1416 ++                s->band[1].nb = 22528;
  3.1417 ++
  3.1418 ++            /* Block 3H, SCALEH */
  3.1419 ++            wd1 = (s->band[1].nb >> 6) & 31;
  3.1420 ++            wd2 = 10 - (s->band[1].nb >> 11);
  3.1421 ++            wd3 = (wd2 < 0)  ?  (ilb[wd1] << -wd2)  :  (ilb[wd1] >> wd2);
  3.1422 ++            s->band[1].det = wd3 << 2;
  3.1423 ++
  3.1424 ++            block4(s, 1, dhigh);
  3.1425 ++            code = ((ihigh << 6) | ilow) >> (8 - s->bits_per_sample);
  3.1426 ++        }
  3.1427 ++
  3.1428 ++        if (s->packed)
  3.1429 ++        {
  3.1430 ++            /* Pack the code bits */
  3.1431 ++            s->out_buffer |= (code << s->out_bits);
  3.1432 ++            s->out_bits += s->bits_per_sample;
  3.1433 ++            if (s->out_bits >= 8)
  3.1434 ++            {
  3.1435 ++                g722_data[g722_bytes++] = (uint8_t) (s->out_buffer & 0xFF);
  3.1436 ++                s->out_bits -= 8;
  3.1437 ++                s->out_buffer >>= 8;
  3.1438 ++            }
  3.1439 ++        }
  3.1440 ++        else
  3.1441 ++        {
  3.1442 ++            g722_data[g722_bytes++] = (uint8_t) code;
  3.1443 ++        }
  3.1444 ++    }
  3.1445 ++    return g722_bytes;
  3.1446 ++}
  3.1447 ++/*- End of function --------------------------------------------------------*/
  3.1448 ++/*- End of file ------------------------------------------------------------*/
  3.1449 +Index: codecs/g722/g722.h
  3.1450 +diff -Nau codecs/g722/g722.h.orig codecs/g722/g722.h
  3.1451 +--- codecs/g722/g722.h.orig	1970-01-01 01:00:00.000000000 +0100
  3.1452 ++++ codecs/g722/g722.h	2009-04-24 00:30:33.000000000 +0200
  3.1453 +@@ -0,0 +1,148 @@
  3.1454 ++/*
  3.1455 ++ * SpanDSP - a series of DSP components for telephony
  3.1456 ++ *
  3.1457 ++ * g722.h - The ITU G.722 codec.
  3.1458 ++ *
  3.1459 ++ * Written by Steve Underwood <steveu@coppice.org>
  3.1460 ++ *
  3.1461 ++ * Copyright (C) 2005 Steve Underwood
  3.1462 ++ *
  3.1463 ++ *  Despite my general liking of the GPL, I place my own contributions 
  3.1464 ++ *  to this code in the public domain for the benefit of all mankind -
  3.1465 ++ *  even the slimy ones who might try to proprietize my work and use it
  3.1466 ++ *  to my detriment.
  3.1467 ++ *
  3.1468 ++ * Based on a single channel G.722 codec which is:
  3.1469 ++ *
  3.1470 ++ *****    Copyright (c) CMU    1993      *****
  3.1471 ++ * Computer Science, Speech Group
  3.1472 ++ * Chengxiang Lu and Alex Hauptmann
  3.1473 ++ *
  3.1474 ++ * $Id: g722.h 48959 2006-12-25 06:42:15Z rizzo $
  3.1475 ++ */
  3.1476 ++
  3.1477 ++
  3.1478 ++/*! \file */
  3.1479 ++
  3.1480 ++#if !defined(_G722_H_)
  3.1481 ++#define _G722_H_
  3.1482 ++
  3.1483 ++/*! \page g722_page G.722 encoding and decoding
  3.1484 ++\section g722_page_sec_1 What does it do?
  3.1485 ++The G.722 module is a bit exact implementation of the ITU G.722 specification for all three
  3.1486 ++specified bit rates - 64000bps, 56000bps and 48000bps. It passes the ITU tests.
  3.1487 ++
  3.1488 ++To allow fast and flexible interworking with narrow band telephony, the encoder and decoder
  3.1489 ++support an option for the linear audio to be an 8k samples/second stream. In this mode the
  3.1490 ++codec is considerably faster, and still fully compatible with wideband terminals using G.722.
  3.1491 ++
  3.1492 ++\section g722_page_sec_2 How does it work?
  3.1493 ++???.
  3.1494 ++*/
  3.1495 ++
  3.1496 ++enum
  3.1497 ++{
  3.1498 ++    G722_SAMPLE_RATE_8000 = 0x0001,
  3.1499 ++    G722_PACKED = 0x0002
  3.1500 ++};
  3.1501 ++
  3.1502 ++#ifndef INT16_MAX
  3.1503 ++#define INT16_MAX       32767
  3.1504 ++#endif
  3.1505 ++#ifndef INT16_MIN
  3.1506 ++#define INT16_MIN       (-32768)
  3.1507 ++#endif
  3.1508 ++
  3.1509 ++typedef struct
  3.1510 ++{
  3.1511 ++    /*! TRUE if the operating in the special ITU test mode, with the band split filters
  3.1512 ++             disabled. */
  3.1513 ++    int itu_test_mode;
  3.1514 ++    /*! TRUE if the G.722 data is packed */
  3.1515 ++    int packed;
  3.1516 ++    /*! TRUE if encode from 8k samples/second */
  3.1517 ++    int eight_k;
  3.1518 ++    /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */
  3.1519 ++    int bits_per_sample;
  3.1520 ++
  3.1521 ++    /*! Signal history for the QMF */
  3.1522 ++    int x[24];
  3.1523 ++
  3.1524 ++    struct
  3.1525 ++    {
  3.1526 ++        int s;
  3.1527 ++        int sp;
  3.1528 ++        int sz;
  3.1529 ++        int r[3];
  3.1530 ++        int a[3];
  3.1531 ++        int ap[3];
  3.1532 ++        int p[3];
  3.1533 ++        int d[7];
  3.1534 ++        int b[7];
  3.1535 ++        int bp[7];
  3.1536 ++        int sg[7];
  3.1537 ++        int nb;
  3.1538 ++        int det;
  3.1539 ++    } band[2];
  3.1540 ++
  3.1541 ++    unsigned int in_buffer;
  3.1542 ++    int in_bits;
  3.1543 ++    unsigned int out_buffer;
  3.1544 ++    int out_bits;
  3.1545 ++} g722_encode_state_t;
  3.1546 ++
  3.1547 ++typedef struct
  3.1548 ++{
  3.1549 ++    /*! TRUE if the operating in the special ITU test mode, with the band split filters
  3.1550 ++             disabled. */
  3.1551 ++    int itu_test_mode;
  3.1552 ++    /*! TRUE if the G.722 data is packed */
  3.1553 ++    int packed;
  3.1554 ++    /*! TRUE if decode to 8k samples/second */
  3.1555 ++    int eight_k;
  3.1556 ++    /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */
  3.1557 ++    int bits_per_sample;
  3.1558 ++
  3.1559 ++    /*! Signal history for the QMF */
  3.1560 ++    int x[24];
  3.1561 ++
  3.1562 ++    struct
  3.1563 ++    {
  3.1564 ++        int s;
  3.1565 ++        int sp;
  3.1566 ++        int sz;
  3.1567 ++        int r[3];
  3.1568 ++        int a[3];
  3.1569 ++        int ap[3];
  3.1570 ++        int p[3];
  3.1571 ++        int d[7];
  3.1572 ++        int b[7];
  3.1573 ++        int bp[7];
  3.1574 ++        int sg[7];
  3.1575 ++        int nb;
  3.1576 ++        int det;
  3.1577 ++    } band[2];
  3.1578 ++    
  3.1579 ++    unsigned int in_buffer;
  3.1580 ++    int in_bits;
  3.1581 ++    unsigned int out_buffer;
  3.1582 ++    int out_bits;
  3.1583 ++} g722_decode_state_t;
  3.1584 ++
  3.1585 ++#ifdef __cplusplus
  3.1586 ++extern "C" {
  3.1587 ++#endif
  3.1588 ++
  3.1589 ++g722_encode_state_t *g722_encode_init(g722_encode_state_t *s, int rate, int options);
  3.1590 ++int g722_encode_release(g722_encode_state_t *s);
  3.1591 ++int g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[], int len);
  3.1592 ++
  3.1593 ++g722_decode_state_t *g722_decode_init(g722_decode_state_t *s, int rate, int options);
  3.1594 ++int g722_decode_release(g722_decode_state_t *s);
  3.1595 ++int g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[], int len);
  3.1596 ++
  3.1597 ++#ifdef __cplusplus
  3.1598 ++}
  3.1599 ++#endif
  3.1600 ++
  3.1601 ++#endif
  3.1602 +Index: codecs/g722/Makefile
  3.1603 +diff -Nau codecs/g722/Makefile.orig codecs/g722/Makefile
  3.1604 +--- codecs/g722/Makefile.orig	1970-01-01 01:00:00.000000000 +0100
  3.1605 ++++ codecs/g722/Makefile	2009-04-24 00:30:33.000000000 +0200
  3.1606 +@@ -0,0 +1,18 @@
  3.1607 ++LIB=libg722.a
  3.1608 ++CFLAGS+=-fPIC
  3.1609 ++
  3.1610 ++include $(ASTTOPDIR)/Makefile.rules
  3.1611 ++
  3.1612 ++OBJS=g722_encode.o g722_decode.o
  3.1613 ++
  3.1614 ++all: $(LIB)
  3.1615 ++
  3.1616 ++$(LIB): $(OBJS)
  3.1617 ++	$(ECHO_PREFIX) echo "   [AR] $^ -> $@"
  3.1618 ++	$(CMD_PREFIX) $(AR) cr $@ $^
  3.1619 ++	$(CMD_PREFIX) $(RANLIB) $@
  3.1620 ++
  3.1621 ++clean:
  3.1622 ++	rm -f $(LIB) *.o
  3.1623 ++	rm -f .*.o.d
  3.1624 ++	rm -f *.s *.i
  3.1625 +Index: codecs/g722_slin_ex.h
  3.1626 +diff -Nau codecs/g722_slin_ex.h.orig codecs/g722_slin_ex.h
  3.1627 +--- codecs/g722_slin_ex.h.orig	1970-01-01 01:00:00.000000000 +0100
  3.1628 ++++ codecs/g722_slin_ex.h	2009-04-24 00:30:33.000000000 +0200
  3.1629 +@@ -0,0 +1,25 @@
  3.1630 ++/*! \file
  3.1631 ++ * \brief g722_slin_ex.h --
  3.1632 ++ *
  3.1633 ++ *	4-bit ADPCM data, 20 milliseconds worth at 8 kHz.
  3.1634 ++ *
  3.1635 ++ * Source: g723.example
  3.1636 ++ *
  3.1637 ++ * Copyright (C) 2001-2005, Digium Inc.
  3.1638 ++ *
  3.1639 ++ * Distributed under the terms of the GNU General Public License
  3.1640 ++ *
  3.1641 ++ */
  3.1642 ++
  3.1643 ++static unsigned char g722_slin_ex[] = {
  3.1644 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1645 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1646 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1647 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1648 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1649 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1650 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1651 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1652 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  3.1653 ++	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  3.1654 ++};
  3.1655 +Index: codecs/Makefile
  3.1656 +diff -Nau codecs/Makefile.orig codecs/Makefile
  3.1657 +--- codecs/Makefile.orig	2008-03-26 17:42:35.000000000 +0100
  3.1658 ++++ codecs/Makefile	2009-04-24 00:30:33.000000000 +0200
  3.1659 +@@ -31,6 +31,7 @@
  3.1660 + 
  3.1661 + LIBILBC:=ilbc/libilbc.a
  3.1662 + LIBLPC10:=lpc10/liblpc10.a
  3.1663 ++LIBG722:=g722/libg722.a
  3.1664 + 
  3.1665 + all: _all
  3.1666 + 
  3.1667 +@@ -45,6 +46,7 @@
  3.1668 + 	$(MAKE) -C gsm clean
  3.1669 + 	$(MAKE) -C lpc10 clean
  3.1670 + 	$(MAKE) -C ilbc clean
  3.1671 ++	$(MAKE) -C g722 clean
  3.1672 + 
  3.1673 + gsm/lib/libgsm.a:
  3.1674 + 	@mkdir -p gsm/lib
  3.1675 +@@ -59,3 +61,8 @@
  3.1676 + 	@$(MAKE) -C ilbc all ASTCFLAGS="$(filter-out -Wmissing-prototypes -Wmissing-declarations,$(ASTCFLAGS)) $(AST_NO_STRICT_OVERFLOW)"
  3.1677 + 
  3.1678 + $(if $(filter codec_ilbc,$(EMBEDDED_MODS)),modules.link,codec_ilbc.so): $(LIBILBC)
  3.1679 ++
  3.1680 ++$(LIBG722):
  3.1681 ++	@$(MAKE) -C g722 all
  3.1682 ++
  3.1683 ++$(if $(filter codec_g722,$(EMBEDDED_MODS)),modules.link,codec_g722.so): $(LIBG722)
  3.1684 +Index: codecs/slin_g722_ex.h
  3.1685 +diff -Nau codecs/slin_g722_ex.h.orig codecs/slin_g722_ex.h
  3.1686 +--- codecs/slin_g722_ex.h.orig	1970-01-01 01:00:00.000000000 +0100
  3.1687 ++++ codecs/slin_g722_ex.h	2009-04-24 00:30:33.000000000 +0200
  3.1688 +@@ -0,0 +1,25 @@
  3.1689 ++/*! \file
  3.1690 ++ * \brief slin_g722_ex.h --
  3.1691 ++ *
  3.1692 ++ *	Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
  3.1693 ++ *
  3.1694 ++ * Source: g723.example
  3.1695 ++ *
  3.1696 ++ * Copyright (C) 2001-2005, Digium Inc.
  3.1697 ++ *
  3.1698 ++ * Distributed under the terms of the GNU General Public License
  3.1699 ++ *
  3.1700 ++ */
  3.1701 ++
  3.1702 ++static signed short slin_g722_ex[] = {
  3.1703 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1704 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1705 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1706 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1707 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1708 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1709 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1710 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1711 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  3.1712 ++	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
  3.1713 ++};
  3.1714 +Index: configure
  3.1715 +diff -Nau configure.orig configure
  3.1716 +--- configure.orig	2009-02-18 21:06:45.000000000 +0100
  3.1717 ++++ configure	2009-04-24 00:30:33.000000000 +0200
  3.1718 +@@ -11143,6 +11143,61 @@
  3.1719 + 
  3.1720 + fi
  3.1721 + 
  3.1722 ++{ echo "$as_me:$LINENO: checking for tm_gmtoff in struct tm" >&5
  3.1723 ++echo $ECHO_N "checking for tm_gmtoff in struct tm... $ECHO_C" >&6; }
  3.1724 ++if test "${ac_cv_struct_tm_gmtoff+set}" = set; then
  3.1725 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1726 ++else
  3.1727 ++  cat >conftest.$ac_ext <<_ACEOF
  3.1728 ++/* confdefs.h.  */
  3.1729 ++_ACEOF
  3.1730 ++cat confdefs.h >>conftest.$ac_ext
  3.1731 ++cat >>conftest.$ac_ext <<_ACEOF
  3.1732 ++/* end confdefs.h.  */
  3.1733 ++$ac_includes_default
  3.1734 ++#include <sys/types.h>
  3.1735 ++#include <$ac_cv_struct_tm>
  3.1736 ++int main() {
  3.1737 ++struct tm tm; tm.tm_gmtoff;
  3.1738 ++; return 0; }
  3.1739 ++_ACEOF
  3.1740 ++rm -f conftest.$ac_objext
  3.1741 ++if { (ac_try="$ac_compile"
  3.1742 ++case "(($ac_try" in
  3.1743 ++  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  3.1744 ++  *) ac_try_echo=$ac_try;;
  3.1745 ++esac
  3.1746 ++eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  3.1747 ++  (eval "$ac_compile") 2>conftest.er1
  3.1748 ++  ac_status=$?
  3.1749 ++  grep -v '^ *+' conftest.er1 >conftest.err
  3.1750 ++  rm -f conftest.er1
  3.1751 ++  cat conftest.err >&5
  3.1752 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1753 ++  (exit $ac_status); } && {
  3.1754 ++	 test -z "$ac_c_werror_flag" ||
  3.1755 ++	 test ! -s conftest.err
  3.1756 ++       } && test -s conftest.$ac_objext; then
  3.1757 ++  ac_cv_struct_tm_gmtoff=yes
  3.1758 ++else
  3.1759 ++  echo "$as_me: failed program was:" >&5
  3.1760 ++sed 's/^/| /' conftest.$ac_ext >&5
  3.1761 ++
  3.1762 ++	ac_cv_struct_tm_gmtoff=no
  3.1763 ++fi
  3.1764 ++
  3.1765 ++rm -f conftest*
  3.1766 ++fi
  3.1767 ++{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm_gmtoff" >&5
  3.1768 ++echo "${ECHO_T}$ac_cv_struct_tm_gmtoff" >&6; }
  3.1769 ++if test $ac_cv_struct_tm_gmtoff = yes; then
  3.1770 ++
  3.1771 ++cat >>confdefs.h <<\_ACEOF
  3.1772 ++#define TM_GMTOFF 1
  3.1773 ++_ACEOF
  3.1774 ++
  3.1775 ++fi
  3.1776 ++
  3.1777 + { echo "$as_me:$LINENO: checking for working volatile" >&5
  3.1778 + echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; }
  3.1779 + if test "${ac_cv_c_volatile+set}" = set; then
  3.1780 +Index: include/asterisk/config.h
  3.1781 +diff -Nau include/asterisk/config.h.orig include/asterisk/config.h
  3.1782 +--- include/asterisk/config.h.orig	2009-02-18 19:30:38.000000000 +0100
  3.1783 ++++ include/asterisk/config.h	2009-04-24 00:30:33.000000000 +0200
  3.1784 +@@ -33,6 +33,8 @@
  3.1785 + 
  3.1786 + struct ast_category;
  3.1787 + 
  3.1788 ++#define	CONFIG_STATUS_FILEUNCHANGED	(void *)-1
  3.1789 ++
  3.1790 + struct ast_variable {
  3.1791 + 	char *name;
  3.1792 + 	char *value;
  3.1793 +Index: include/asterisk/frame.h
  3.1794 +diff -Nau include/asterisk/frame.h.orig include/asterisk/frame.h
  3.1795 +--- include/asterisk/frame.h.orig	2009-03-05 19:22:16.000000000 +0100
  3.1796 ++++ include/asterisk/frame.h	2009-04-24 00:30:33.000000000 +0200
  3.1797 +@@ -260,6 +260,8 @@
  3.1798 + #define AST_FORMAT_G726		(1 << 11)
  3.1799 + /*! G.722 */
  3.1800 + #define AST_FORMAT_G722		(1 << 12)
  3.1801 ++/*! Raw 16-bit Signed Linear (16000 Hz) PCM */
  3.1802 ++#define AST_FORMAT_SLINEAR16   (1 << 15)
  3.1803 + /*! Unsupported audio bits */
  3.1804 + #define AST_FORMAT_AUDIO_UNDEFINED	((1 << 13) | (1 << 14) | (1 << 15))
  3.1805 + /*! Maximum audio format */
  3.1806 +Index: main/editline/np/vis.h
  3.1807 +diff -Nau main/editline/np/vis.h.orig main/editline/np/vis.h
  3.1808 +--- main/editline/np/vis.h.orig	2006-08-21 04:11:39.000000000 +0200
  3.1809 ++++ main/editline/np/vis.h	2009-04-24 00:30:33.000000000 +0200
  3.1810 +@@ -76,6 +76,22 @@
  3.1811 + 
  3.1812 + #include <sys/cdefs.h>
  3.1813 + 
  3.1814 ++/* correct nonportable unsigned type usage */
  3.1815 ++#if !defined(__FreeBSD__) && !defined(__linux__)
  3.1816 ++#ifndef u_int64_t
  3.1817 ++#define u_int64_t unsigned long long
  3.1818 ++#endif
  3.1819 ++#ifndef u_int32_t
  3.1820 ++#define u_int32_t unsigned int
  3.1821 ++#endif
  3.1822 ++#ifndef u_int16_t
  3.1823 ++#define u_int16_t unsigned short
  3.1824 ++#endif
  3.1825 ++#ifndef u_int6_t
  3.1826 ++#define u_int8_t unsigned char
  3.1827 ++#endif
  3.1828 ++#endif
  3.1829 ++
  3.1830 + __BEGIN_DECLS
  3.1831 + char	*vis __P((char *, int, int, int));
  3.1832 + char	*svis __P((char *, int, int, int, const char *));
  3.1833 +Index: main/stdtime/localtime.c
  3.1834 +diff -Nau main/stdtime/localtime.c.orig main/stdtime/localtime.c
  3.1835 +--- main/stdtime/localtime.c.orig	2008-09-27 17:00:48.000000000 +0200
  3.1836 ++++ main/stdtime/localtime.c	2009-04-24 00:30:33.000000000 +0200
  3.1837 +@@ -1134,9 +1134,9 @@
  3.1838 + 	*/
  3.1839 + 	result = timesub(&t, ttisp->tt_gmtoff, sp, tmp);
  3.1840 + 	tmp->tm_isdst = ttisp->tt_isdst;
  3.1841 +-#ifndef SOLARIS /* Solaris doesn't have this element */
  3.1842 ++#ifdef TM_GMTOFF
  3.1843 + 	tmp->tm_gmtoff = ttisp->tt_gmtoff;
  3.1844 +-#endif
  3.1845 ++#endif /* defined TM_GMTOFF */
  3.1846 + #ifdef TM_ZONE
  3.1847 + 	tmp->TM_ZONE = &sp->chars[ttisp->tt_abbrind];
  3.1848 + #endif /* defined TM_ZONE */
  3.1849 +Index: Makefile.moddir_rules
  3.1850 +diff -Nau Makefile.moddir_rules.orig Makefile.moddir_rules
  3.1851 +--- Makefile.moddir_rules.orig	2008-11-26 19:36:24.000000000 +0100
  3.1852 ++++ Makefile.moddir_rules	2009-04-24 00:30:33.000000000 +0200
  3.1853 +@@ -69,7 +69,9 @@
  3.1854 + 	rm -f modules.link
  3.1855 + 
  3.1856 + install:: all
  3.1857 ++ifneq ($(LOADABLE_MODS),)
  3.1858 + 	for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
  3.1859 ++endif
  3.1860 + 
  3.1861 + uninstall::
  3.1862 + 
  3.1863 +Index: res/res_features.c
  3.1864 +diff -Nau res/res_features.c.orig res/res_features.c
  3.1865 +--- res/res_features.c.orig	2009-03-03 19:27:09.000000000 +0100
  3.1866 ++++ res/res_features.c	2009-04-24 00:30:33.000000000 +0200
  3.1867 +@@ -732,6 +732,10 @@
  3.1868 + 			snprintf(args, len, "%s|%s|m", S_OR(touch_format, "wav"), touch_filename);
  3.1869 + 		}
  3.1870 + 
  3.1871 ++		for( x = 0; x < strlen(touch_filename); x++) {
  3.1872 ++			if (touch_filename[x] == '/')
  3.1873 ++				touch_filename[x] = '-';
  3.1874 ++		}
  3.1875 + 		for( x = 0; x < strlen(args); x++) {
  3.1876 + 			if (args[x] == '/')
  3.1877 + 				args[x] = '-';
  3.1878 +@@ -2774,6 +2778,293 @@
  3.1879 + 	}
  3.1880 + }
  3.1881 + 
  3.1882 ++static char mandescr_bridge[] =
  3.1883 ++"Description: Bridge together two channels already in the PBX\n"
  3.1884 ++"Variables: ( Headers marked with * are required )\n"
  3.1885 ++"   *Channel1: Channel to Bridge to Channel2\n"
  3.1886 ++"   *Channel2: Channel to Bridge to Channel1\n"
  3.1887 ++"        Tone: (Yes|No) Play courtesy tone to Channel 2\n"
  3.1888 ++"\n";
  3.1889 ++
  3.1890 ++/*!
  3.1891 ++ * \brief Actual bridge
  3.1892 ++ * \param chan
  3.1893 ++ * \param tmpchan
  3.1894 ++ * 
  3.1895 ++ * Stop hold music, lock both channels, masq channels,
  3.1896 ++ * after bridge return channel to next priority.
  3.1897 ++*/
  3.1898 ++static void do_bridge_masquerade(struct ast_channel *chan, struct ast_channel *tmpchan)
  3.1899 ++{
  3.1900 ++	ast_moh_stop(chan);
  3.1901 ++	ast_channel_lock(chan);
  3.1902 ++	ast_setstate(tmpchan, chan->_state);
  3.1903 ++	tmpchan->readformat = chan->readformat;
  3.1904 ++	tmpchan->writeformat = chan->writeformat;
  3.1905 ++	ast_channel_masquerade(tmpchan, chan);
  3.1906 ++	ast_channel_lock(tmpchan);
  3.1907 ++	ast_do_masquerade(tmpchan);
  3.1908 ++	/* when returning from bridge, the channel will continue at the next priority */
  3.1909 ++	ast_explicit_goto(tmpchan, chan->context, chan->exten, chan->priority + 1);
  3.1910 ++	ast_channel_unlock(tmpchan);
  3.1911 ++	ast_channel_unlock(chan);
  3.1912 ++}
  3.1913 ++
  3.1914 ++/*!
  3.1915 ++ * \brief Bridge channels together
  3.1916 ++ * \param s
  3.1917 ++ * \param m
  3.1918 ++ * 
  3.1919 ++ * Make sure valid channels were specified, 
  3.1920 ++ * send errors if any of the channels could not be found/locked, answer channels if needed,
  3.1921 ++ * create the placeholder channels and grab the other channels 
  3.1922 ++ * make the channels compatible, send error if we fail doing so 
  3.1923 ++ * setup the bridge thread object and start the bridge.
  3.1924 ++ * 
  3.1925 ++ * \retval 0 on success or on incorrect use.
  3.1926 ++ * \retval 1 on failure to bridge channels.
  3.1927 ++*/
  3.1928 ++static int action_bridge(struct mansession *s, const struct message *m)
  3.1929 ++{
  3.1930 ++	const char *channela = astman_get_header(m, "Channel1");
  3.1931 ++	const char *channelb = astman_get_header(m, "Channel2");
  3.1932 ++	const char *playtone = astman_get_header(m, "Tone");
  3.1933 ++	struct ast_channel *chana = NULL, *chanb = NULL;
  3.1934 ++	struct ast_channel *tmpchana = NULL, *tmpchanb = NULL;
  3.1935 ++	struct ast_bridge_thread_obj *tobj = NULL;
  3.1936 ++
  3.1937 ++	/* make sure valid channels were specified */
  3.1938 ++	if (!ast_strlen_zero(channela) && !ast_strlen_zero(channelb)) {
  3.1939 ++		chana = ast_get_channel_by_name_prefix_locked(channela, strlen(channela));
  3.1940 ++		chanb = ast_get_channel_by_name_prefix_locked(channelb, strlen(channelb));
  3.1941 ++		if (chana)
  3.1942 ++			ast_channel_unlock(chana);
  3.1943 ++		if (chanb)
  3.1944 ++			ast_channel_unlock(chanb);
  3.1945 ++
  3.1946 ++		/* send errors if any of the channels could not be found/locked */
  3.1947 ++		if (!chana) {
  3.1948 ++			char buf[256];
  3.1949 ++			snprintf(buf, sizeof(buf), "Channel1 does not exist: %s", channela);
  3.1950 ++			astman_send_error(s, m, buf);
  3.1951 ++			return 0;
  3.1952 ++		}
  3.1953 ++		if (!chanb) {
  3.1954 ++			char buf[256];
  3.1955 ++			snprintf(buf, sizeof(buf), "Channel2 does not exist: %s", channelb);
  3.1956 ++			astman_send_error(s, m, buf);
  3.1957 ++			return 0;
  3.1958 ++		}
  3.1959 ++	} else {
  3.1960 ++		astman_send_error(s, m, "Missing channel parameter in request");
  3.1961 ++		return 0;
  3.1962 ++	}
  3.1963 ++
  3.1964 ++	/* Answer the channels if needed */
  3.1965 ++	if (chana->_state != AST_STATE_UP)
  3.1966 ++		ast_answer(chana);
  3.1967 ++	if (chanb->_state != AST_STATE_UP)
  3.1968 ++		ast_answer(chanb);
  3.1969 ++
  3.1970 ++	/* create the placeholder channels and grab the other channels */
  3.1971 ++	if (!(tmpchana = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, 
  3.1972 ++		NULL, NULL, 0, "Bridge/%s", chana->name))) {
  3.1973 ++		astman_send_error(s, m, "Unable to create temporary channel!");
  3.1974 ++		return 1;
  3.1975 ++	}
  3.1976 ++
  3.1977 ++	if (!(tmpchanb = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, 
  3.1978 ++		NULL, NULL, 0, "Bridge/%s", chanb->name))) {
  3.1979 ++		astman_send_error(s, m, "Unable to create temporary channels!");
  3.1980 ++		ast_channel_free(tmpchana);
  3.1981 ++		return 1;
  3.1982 ++	}
  3.1983 ++
  3.1984 ++	do_bridge_masquerade(chana, tmpchana);
  3.1985 ++	do_bridge_masquerade(chanb, tmpchanb);
  3.1986 ++	
  3.1987 ++	/* make the channels compatible, send error if we fail doing so */
  3.1988 ++	if (ast_channel_make_compatible(tmpchana, tmpchanb)) {
  3.1989 ++		ast_log(LOG_WARNING, "Could not make channels %s and %s compatible for manager bridge\n", tmpchana->name, tmpchanb->name);
  3.1990 ++		astman_send_error(s, m, "Could not make channels compatible for manager bridge");
  3.1991 ++		ast_hangup(tmpchana);
  3.1992 ++		ast_hangup(tmpchanb);
  3.1993 ++		return 1;
  3.1994 ++	}
  3.1995 ++
  3.1996 ++	/* setup the bridge thread object and start the bridge */
  3.1997 ++	if (!(tobj = ast_calloc(1, sizeof(*tobj)))) {
  3.1998 ++		ast_log(LOG_WARNING, "Unable to spawn a new bridge thread on %s and %s: %s\n", tmpchana->name, tmpchanb->name, strerror(errno));
  3.1999 ++		astman_send_error(s, m, "Unable to spawn a new bridge thread");
  3.2000 ++		ast_hangup(tmpchana);
  3.2001 ++		ast_hangup(tmpchanb);
  3.2002 ++		return 1;
  3.2003 ++	}
  3.2004 ++
  3.2005 ++	tobj->chan = tmpchana;
  3.2006 ++	tobj->peer = tmpchanb;
  3.2007 ++	
  3.2008 ++	if (ast_true(playtone)) {
  3.2009 ++		if (!ast_strlen_zero(xfersound) && !ast_streamfile(tmpchanb, xfersound, tmpchanb->language)) {
  3.2010 ++			if (ast_waitstream(tmpchanb, "") < 0)
  3.2011 ++				ast_log(LOG_WARNING, "Failed to play a courtesy tone on chan %s\n", tmpchanb->name);
  3.2012 ++		}
  3.2013 ++	}
  3.2014 ++
  3.2015 ++	ast_bridge_call_thread_launch(tobj);
  3.2016 ++
  3.2017 ++	astman_send_ack(s, m, "Launched bridge thread with success");
  3.2018 ++
  3.2019 ++	return 0;
  3.2020 ++}
  3.2021 ++
  3.2022 ++static char *app_bridge = "Bridge";
  3.2023 ++static char *bridge_synopsis = "Bridge two channels";
  3.2024 ++static char *bridge_descrip =
  3.2025 ++"Usage: Bridge(channel[,options])\n"
  3.2026 ++"	Allows the ability to bridge two channels via the dialplan.\n"
  3.2027 ++"The current channel is bridged to the specified 'channel'.\n"
  3.2028 ++"  Options:\n"
  3.2029 ++"    p - Play a courtesy tone to 'channel'.\n"
  3.2030 ++"This application sets the following channel variable upon completion:\n"
  3.2031 ++" BRIDGERESULT    The result of the bridge attempt as a text string, one of\n"
  3.2032 ++"           SUCCESS | FAILURE | LOOP | NONEXISTENT | INCOMPATIBLE\n";
  3.2033 ++
  3.2034 ++enum {
  3.2035 ++	BRIDGE_OPT_PLAYTONE = (1 << 0),
  3.2036 ++};
  3.2037 ++
  3.2038 ++AST_APP_OPTIONS(bridge_exec_options, BEGIN_OPTIONS
  3.2039 ++	AST_APP_OPTION('p', BRIDGE_OPT_PLAYTONE)
  3.2040 ++END_OPTIONS );
  3.2041 ++
  3.2042 ++/*!
  3.2043 ++ * \brief Bridge channels
  3.2044 ++ * \param chan
  3.2045 ++ * \param data channel to bridge with.
  3.2046 ++ * 
  3.2047 ++ * Split data, check we aren't bridging with ourself, check valid channel,
  3.2048 ++ * answer call if not already, check compatible channels, setup bridge config
  3.2049 ++ * now bridge call, if transfered party hangs up return to PBX extension.
  3.2050 ++*/
  3.2051 ++static int bridge_exec(struct ast_channel *chan, void *data)
  3.2052 ++{
  3.2053 ++	struct ast_channel *current_dest_chan, *final_dest_chan;
  3.2054 ++	char *tmp_data  = NULL;
  3.2055 ++	struct ast_flags opts = { 0, };
  3.2056 ++	struct ast_bridge_config bconfig = { { 0, }, };
  3.2057 ++
  3.2058 ++	AST_DECLARE_APP_ARGS(args,
  3.2059 ++		AST_APP_ARG(dest_chan);
  3.2060 ++		AST_APP_ARG(options);
  3.2061 ++	);
  3.2062 ++	
  3.2063 ++	if (ast_strlen_zero(data)) {
  3.2064 ++		ast_log(LOG_WARNING, "Bridge require at least 1 argument specifying the other end of the bridge\n");
  3.2065 ++		return -1;
  3.2066 ++	}
  3.2067 ++
  3.2068 ++	tmp_data = ast_strdupa(data);
  3.2069 ++	AST_STANDARD_APP_ARGS(args, tmp_data);
  3.2070 ++	if (!ast_strlen_zero(args.options))
  3.2071 ++		ast_app_parse_options(bridge_exec_options, &opts, NULL, args.options);
  3.2072 ++
  3.2073 ++	/* avoid bridge with ourselves */
  3.2074 ++	if (!strncmp(chan->name, args.dest_chan, 
  3.2075 ++		strlen(chan->name) < strlen(args.dest_chan) ? 
  3.2076 ++		strlen(chan->name) : strlen(args.dest_chan))) {
  3.2077 ++		ast_log(LOG_WARNING, "Unable to bridge channel %s with itself\n", chan->name);
  3.2078 ++		manager_event(EVENT_FLAG_CALL, "BridgeExec",
  3.2079 ++					"Response: Failed\r\n"
  3.2080 ++					"Reason: Unable to bridge channel to itself\r\n"
  3.2081 ++					"Channel1: %s\r\n"
  3.2082 ++					"Channel2: %s\r\n",
  3.2083 ++					chan->name, args.dest_chan);
  3.2084 ++		pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "LOOP");
  3.2085 ++		return 0;
  3.2086 ++	}
  3.2087 ++
  3.2088 ++	/* make sure we have a valid end point */
  3.2089 ++	if (!(current_dest_chan = ast_get_channel_by_name_prefix_locked(args.dest_chan, 
  3.2090 ++		strlen(args.dest_chan)))) {
  3.2091 ++		ast_log(LOG_WARNING, "Bridge failed because channel %s does not exist or we "
  3.2092 ++			"cannot get its lock\n", args.dest_chan);
  3.2093 ++		manager_event(EVENT_FLAG_CALL, "BridgeExec",
  3.2094 ++					"Response: Failed\r\n"
  3.2095 ++					"Reason: Cannot grab end point\r\n"
  3.2096 ++					"Channel1: %s\r\n"
  3.2097 ++					"Channel2: %s\r\n", chan->name, args.dest_chan);
  3.2098 ++		pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "NONEXISTENT");
  3.2099 ++		return 0;
  3.2100 ++	}
  3.2101 ++	ast_channel_unlock(current_dest_chan);
  3.2102 ++
  3.2103 ++	/* answer the channel if needed */
  3.2104 ++	if (current_dest_chan->_state != AST_STATE_UP)
  3.2105 ++		ast_answer(current_dest_chan);
  3.2106 ++
  3.2107 ++	/* try to allocate a place holder where current_dest_chan will be placed */
  3.2108 ++	if (!(final_dest_chan = ast_channel_alloc(0, AST_STATE_DOWN, NULL, NULL, NULL, 
  3.2109 ++		NULL, NULL, 0, "Bridge/%s", current_dest_chan->name))) {
  3.2110 ++		ast_log(LOG_WARNING, "Cannot create placeholder channel for chan %s\n", args.dest_chan);
  3.2111 ++		manager_event(EVENT_FLAG_CALL, "BridgeExec",
  3.2112 ++					"Response: Failed\r\n"
  3.2113 ++					"Reason: cannot create placeholder\r\n"
  3.2114 ++					"Channel1: %s\r\n"
  3.2115 ++					"Channel2: %s\r\n", chan->name, args.dest_chan);
  3.2116 ++	}
  3.2117 ++	do_bridge_masquerade(current_dest_chan, final_dest_chan);
  3.2118 ++
  3.2119 ++	/* now current_dest_chan is a ZOMBIE and with softhangup set to 1 and final_dest_chan is our end point */
  3.2120 ++	/* try to make compatible, send error if we fail */
  3.2121 ++	if (ast_channel_make_compatible(chan, final_dest_chan) < 0) {
  3.2122 ++		ast_log(LOG_WARNING, "Could not make channels %s and %s compatible for bridge\n", chan->name, final_dest_chan->name);
  3.2123 ++		manager_event(EVENT_FLAG_CALL, "BridgeExec",
  3.2124 ++					"Response: Failed\r\n"
  3.2125 ++					"Reason: Could not make channels compatible for bridge\r\n"
  3.2126 ++					"Channel1: %s\r\n"
  3.2127 ++					"Channel2: %s\r\n", chan->name, final_dest_chan->name);
  3.2128 ++		ast_hangup(final_dest_chan); /* may be we should return this channel to the PBX? */
  3.2129 ++		pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "INCOMPATIBLE");
  3.2130 ++		return 0;
  3.2131 ++	}
  3.2132 ++
  3.2133 ++	/* Report that the bridge will be successfull */
  3.2134 ++	manager_event(EVENT_FLAG_CALL, "BridgeExec",
  3.2135 ++				"Response: Success\r\n"
  3.2136 ++				"Channel1: %s\r\n"
  3.2137 ++				"Channel2: %s\r\n", chan->name, final_dest_chan->name);
  3.2138 ++
  3.2139 ++	/* we have 2 valid channels to bridge, now it is just a matter of setting up the bridge config and starting the bridge */	
  3.2140 ++	if (ast_test_flag(&opts, BRIDGE_OPT_PLAYTONE) && !ast_strlen_zero(xfersound)) {
  3.2141 ++		if (!ast_streamfile(final_dest_chan, xfersound, final_dest_chan->language)) {
  3.2142 ++			if (ast_waitstream(final_dest_chan, "") < 0)
  3.2143 ++				ast_log(LOG_WARNING, "Failed to play courtesy tone on %s\n", final_dest_chan->name);
  3.2144 ++		}
  3.2145 ++	}
  3.2146 ++	
  3.2147 ++	/* do the bridge */
  3.2148 ++	ast_bridge_call(chan, final_dest_chan, &bconfig);
  3.2149 ++
  3.2150 ++	/* the bridge has ended, set BRIDGERESULT to SUCCESS. If the other channel has not been hung up, return it to the PBX */
  3.2151 ++	pbx_builtin_setvar_helper(chan, "BRIDGERESULT", "SUCCESS");
  3.2152 ++	if (!ast_check_hangup(final_dest_chan)) {
  3.2153 ++		ast_log(LOG_EVENT, "starting new PBX in %s,%s,%d for chan %s\n", 
  3.2154 ++			final_dest_chan->context, final_dest_chan->exten, 
  3.2155 ++			final_dest_chan->priority, final_dest_chan->name);
  3.2156 ++
  3.2157 ++		if (ast_pbx_start(final_dest_chan) != AST_PBX_SUCCESS) {
  3.2158 ++			ast_log(LOG_WARNING, "FAILED continuing PBX on dest chan %s\n", final_dest_chan->name);
  3.2159 ++			ast_hangup(final_dest_chan);
  3.2160 ++		} else
  3.2161 ++			ast_log(LOG_EVENT, "SUCCESS continuing PBX on chan %s\n", final_dest_chan->name);
  3.2162 ++	} else {
  3.2163 ++		ast_log(LOG_EVENT, "hangup chan %s since the other endpoint has hung up\n", final_dest_chan->name);
  3.2164 ++		ast_hangup(final_dest_chan);
  3.2165 ++	}
  3.2166 ++
  3.2167 ++	return 0;
  3.2168 ++}
  3.2169 + 
  3.2170 + static int load_config(void) 
  3.2171 + {
  3.2172 +@@ -3034,6 +3325,8 @@
  3.2173 + {
  3.2174 + 	int res;
  3.2175 + 	
  3.2176 ++	ast_register_application(app_bridge, bridge_exec, bridge_synopsis, bridge_descrip);
  3.2177 ++
  3.2178 + 	memset(parking_ext, 0, sizeof(parking_ext));
  3.2179 + 	memset(parking_con, 0, sizeof(parking_con));
  3.2180 + 
  3.2181 +@@ -3048,6 +3341,7 @@
  3.2182 + 		ast_manager_register("ParkedCalls", 0, manager_parking_status, "List parked calls" );
  3.2183 + 		ast_manager_register2("Park", EVENT_FLAG_CALL, manager_park,
  3.2184 + 			"Park a channel", mandescr_park); 
  3.2185 ++		ast_manager_register2("Bridge", EVENT_FLAG_CALL, action_bridge, "Bridge two channels already in the PBX", mandescr_bridge);
  3.2186 + 	}
  3.2187 + 
  3.2188 + 	res |= ast_devstate_prov_add("Park", metermaidstate);
  3.2189 +Index: apps/app_voicemail.c
  3.2190 +diff -Nau apps/app_voicemail.c.orig apps/app_voicemail.c
  3.2191 +--- apps/app_voicemail.c.orig	2009-04-25 02:38:20.343758775 +0200
  3.2192 ++++ apps/app_voicemail.c	2009-04-25 19:56:25.287569363 +0200
  3.2193 +@@ -115,6 +115,7 @@
  3.2194 + static char imapport[8];
  3.2195 + static char imapflags[128];
  3.2196 + static char imapfolder[64];
  3.2197 ++static int  imapsubfold = 0;
  3.2198 + static char authuser[32];
  3.2199 + static char authpassword[42];
  3.2200 + 
  3.2201 +@@ -4313,6 +4314,7 @@
  3.2202 + 	/* we must use mbox(x) folder names, and copy the message there */
  3.2203 + 	/* simple. huh? */
  3.2204 + 	char sequence[10];
  3.2205 ++	char folder[256];
  3.2206 + 	/* get the real IMAP message number for this message */
  3.2207 + 	snprintf(sequence, sizeof(sequence), "%ld", vms->msgArray[msg]);
  3.2208 + 	if (option_debug > 2)
  3.2209 +@@ -4323,11 +4325,21 @@
  3.2210 + 	} else if (box == 0) {
  3.2211 + 		mail_clearflag(vms->mailstream, sequence, "\\Seen");
  3.2212 + 	}
  3.2213 +-	if (!strcasecmp(mbox(0), vms->curbox) && (box == 0 || box == 1)) {
  3.2214 ++	if ((!strcasecmp(mbox(0), vms->curbox) || \
  3.2215 ++        !strcasecmp(mbox(1), vms->curbox)) && \
  3.2216 ++        (box == 0 || box == 1)) {  /* Don't copy data, just change Seen flag */
  3.2217 + 		ast_mutex_unlock(&vms->lock);
  3.2218 + 		return 0;
  3.2219 +-	} else {
  3.2220 +-		int res = !mail_copy(vms->mailstream,sequence,(char *) mbox(box)); 
  3.2221 ++	} else if (box > 1) {          /* Do copy data using INBOX or subfolder */
  3.2222 ++		if (imapsubfold == 1)
  3.2223 ++			snprintf(folder, sizeof(folder), "%s%c%s", imapfolder, delimiter, mbox(box));
  3.2224 ++		else
  3.2225 ++			strncpy(folder, mbox(box), sizeof(folder));
  3.2226 ++		int res = !mail_copy(vms->mailstream,sequence,folder);
  3.2227 ++		ast_mutex_unlock(&vms->lock);
  3.2228 ++		return res;
  3.2229 ++	} else {  /* Copy data to INBOX delegating new/old status to Seen flag */
  3.2230 ++		int res = !mail_copy(vms->mailstream,sequence,imapfolder);
  3.2231 + 		ast_mutex_unlock(&vms->lock);
  3.2232 + 		return res;
  3.2233 + 	}
  3.2234 +@@ -7686,6 +7698,10 @@
  3.2235 + #ifndef IMAP_STORAGE
  3.2236 + 				} else if (!cmd) {
  3.2237 + 					vms.deleted[vms.curmsg] = 1;
  3.2238 ++#else
  3.2239 ++				} else if (!cmd && (folder_int(vms.curbox) > 1  || box > 1)) {
  3.2240 ++					vms.deleted[vms.curmsg] = 1;  /* Enforce deletion after */
  3.2241 ++					deleted = 1;                  /* successful copy op */
  3.2242 + #endif
  3.2243 + 				} else {
  3.2244 + 					vms.deleted[vms.curmsg] = 0;
  3.2245 +@@ -8198,6 +8214,7 @@
  3.2246 + 	const char *imap_port;
  3.2247 + 	const char *imap_flags;
  3.2248 + 	const char *imap_folder;
  3.2249 ++	const char *imap_use_subfold;
  3.2250 + 	const char *auth_user;
  3.2251 + 	const char *auth_password;
  3.2252 + 	const char *expunge_on_hangup;
  3.2253 +@@ -8342,6 +8359,15 @@
  3.2254 + 		} else {
  3.2255 + 			ast_copy_string(imapfolder,"INBOX", sizeof(imapfolder));
  3.2256 + 		}
  3.2257 ++		/* IMAP saved (sub)folder location policy */
  3.2258 ++		if ((imap_use_subfold = ast_variable_retrieve(cfg, "general", "imapsubfold"))) {
  3.2259 ++			if (ast_false(imap_use_subfold))
  3.2260 ++				imapsubfold = 0;
  3.2261 ++			else
  3.2262 ++				imapsubfold = 1;
  3.2263 ++		} else {
  3.2264 ++			imapsubfold = 0;
  3.2265 ++		}
  3.2266 + 
  3.2267 + 		/* There is some very unorthodox casting done here. This is due
  3.2268 + 		 * to the way c-client handles the argument passed in. It expects a 
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/asterisk/asterisk.patch.parseavp	Mon Apr 27 12:19:05 2009 +0200
     4.3 @@ -0,0 +1,17 @@
     4.4 +Index: channels/chan_sip.c
     4.5 +diff -Nau channels/chan_sip.c.orig channels/chan_sip.c
     4.6 +--- channels/chan_sip.c.orig	2009-04-24 00:54:30.000000000 +0200
     4.7 ++++ channels/chan_sip.c	2009-04-24 00:56:15.000000000 +0200
     4.8 +@@ -5214,8 +5214,10 @@
     4.9 + 
    4.10 + 		numberofports = 1;
    4.11 + 		len = -1;
    4.12 +-		if ((sscanf(m, "audio %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2 && len > 0) ||
    4.13 +-		    (sscanf(m, "audio %d RTP/AVP %n", &x, &len) == 1 && len > 0)) {
    4.14 ++		if (((sscanf(m, "audio %d/%d RTP/AVP %n", &x, &numberofports, &len) == 2) && (len > 0)) ||
    4.15 ++			((sscanf(m, "audio %d/%d RTP/SAVP %n", &x, &numberofports, &len) == 2) && (len > 0)) ||
    4.16 ++			((sscanf(m, "audio %d RTP/AVP %n", &x, &len) == 1) && (len > 0)) ||
    4.17 ++			((sscanf(m, "audio %d RTP/SAVP %n", &x, &len) == 1) && (len > 0))) {
    4.18 + 			audio = TRUE;
    4.19 + 			numberofmediastreams++;
    4.20 + 			/* Found audio stream in this media definition */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/asterisk/asterisk.patch.proxymwi	Mon Apr 27 12:19:05 2009 +0200
     5.3 @@ -0,0 +1,24 @@
     5.4 +Index: channels/chan_sip.c
     5.5 +diff -Nau channels/chan_sip.c.orig channels/chan_sip.c
     5.6 +--- channels/chan_sip.c.orig	2009-04-24 00:51:58.000000000 +0200
     5.7 ++++ channels/chan_sip.c	2009-04-24 00:52:33.000000000 +0200
     5.8 +@@ -16428,6 +16428,7 @@
     5.9 + 	/* Called with peerl lock, but releases it */
    5.10 + 	struct sip_pvt *p;
    5.11 + 	int newmsgs, oldmsgs;
    5.12 ++	char *s = NULL;
    5.13 + 
    5.14 + 	/* Do we have an IP address? If not, skip this peer */
    5.15 + 	if (!peer->addr.sin_addr.s_addr && !peer->defaddr.sin_addr.s_addr) 
    5.16 +@@ -16461,6 +16462,11 @@
    5.17 + 		/* Recalculate our side, and recalculate Call ID */
    5.18 + 		if (ast_sip_ouraddrfor(&p->sa.sin_addr, &p->ourip))
    5.19 + 			p->ourip = __ourip;
    5.20 ++		/* Set the username = mailbox and remove the context */
    5.21 ++		ast_string_field_build(p, username, "%s", peer->name);
    5.22 ++		s = strchr(p->username, '@');
    5.23 ++		if (s != NULL)
    5.24 ++			*s = 0;
    5.25 + 		build_via(p);
    5.26 + 		build_callid_pvt(p);
    5.27 + 		/* Destroy this session after 32 secs */
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/asterisk/asterisk.patch.xfersips	Mon Apr 27 12:19:05 2009 +0200
     6.3 @@ -0,0 +1,36 @@
     6.4 +Index: channels/chan_sip.c
     6.5 +diff -Nau channels/chan_sip.c.orig channels/chan_sip.c
     6.6 +--- channels/chan_sip.c.orig	2009-04-24 00:48:57.000000000 +0200
     6.7 ++++ channels/chan_sip.c	2009-04-24 00:49:21.000000000 +0200
     6.8 +@@ -18771,6 +18771,7 @@
     6.9 + \todo	Fix this function so that we wait for reply to the REFER and
    6.10 + 	react to errors, denials or other issues the other end might have.
    6.11 +  */
    6.12 ++/* MSvB: Paramater dest may be SIPS encoded, having '@@' before host */
    6.13 + static int sip_sipredirect(struct sip_pvt *p, const char *dest)
    6.14 + {
    6.15 + 	char *cdest;
    6.16 +@@ -18780,7 +18781,7 @@
    6.17 + 	cdest = ast_strdupa(dest);
    6.18 + 	
    6.19 + 	extension = strsep(&cdest, "@");
    6.20 +-	host = strsep(&cdest, ":");
    6.21 ++	host = strsep(&cdest, ":");		/* MSvB: Could begin with '@' if SIPS */
    6.22 + 	port = strsep(&cdest, ":");
    6.23 + 	if (ast_strlen_zero(extension)) {
    6.24 + 		ast_log(LOG_ERROR, "Missing mandatory argument: extension\n");
    6.25 +@@ -18813,7 +18814,13 @@
    6.26 + 		}
    6.27 + 	}
    6.28 + 
    6.29 +-	ast_string_field_build(p, our_contact, "Transfer <sip:%s@%s%s%s>", extension, host, port ? ":" : "", port ? port : "");
    6.30 ++	if (host && *host == '@') {
    6.31 ++		ast_log(LOG_DEBUG, "Decoding TLS incapable Asterisk SIP URI to a standard SIPS URI before redirecting via 302 Moved Temporarily\n");
    6.32 ++		ast_string_field_build(p, our_contact, "Transfer <sips:%s@%s%s%s>", extension, host + 1, port ? ":" : "", port ? port : "");
    6.33 ++    }
    6.34 ++	else
    6.35 ++		ast_string_field_build(p, our_contact, "Transfer <sip:%s@%s%s%s>", extension, host, port ? ":" : "", port ? port : "");
    6.36 ++
    6.37 + 	transmit_response_reliable(p, "302 Moved Temporarily", &p->initreq);
    6.38 + 
    6.39 + 	sip_scheddestroy(p, SIP_TRANS_TIMEOUT);	/* Make sure we stop send this reply. */
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/asterisk/asterisk.spec	Mon Apr 27 12:19:05 2009 +0200
     7.3 @@ -0,0 +1,544 @@
     7.4 +##
     7.5 +##  asterisk.spec -- OpenPKG RPM Package Specification
     7.6 +##  Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
     7.7 +##  Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
     7.8 +##
     7.9 +##  Permission to use, copy, modify, and distribute this software for
    7.10 +##  any purpose with or without fee is hereby granted, provided that
    7.11 +##  the above copyright notice and this permission notice appear in all
    7.12 +##  copies.
    7.13 +##
    7.14 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    7.15 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    7.16 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    7.17 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    7.18 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    7.19 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    7.20 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    7.21 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    7.22 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    7.23 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    7.24 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    7.25 +##  SUCH DAMAGE.
    7.26 +##
    7.27 +
    7.28 +#   package component versions
    7.29 +%define       V_langsounds    1.4.12
    7.30 +%define       V_extrasounds   1.4.9
    7.31 +%define       V_amoomasounds  1.4
    7.32 +%define       V_customsounds  1.0
    7.33 +%define       V_chan_capi     1.1.2
    7.34 +
    7.35 +#   package information
    7.36 +Name:         asterisk
    7.37 +Summary:      Private Branch Exchange (PBX) for VoIP
    7.38 +URL:          http://www.asterisk.org/
    7.39 +Vendor:       Mark Spencer et al.
    7.40 +Packager:     Michael Schloh von Bennewitz
    7.41 +Distribution: Michael Schloh von Bennewitz
    7.42 +Class:        EVAL
    7.43 +Group:        VoIP
    7.44 +License:      GPL
    7.45 +Version:      1.4.24.1
    7.46 +Release:      20090422
    7.47 +
    7.48 +#   package options
    7.49 +%option       with_libpri     yes
    7.50 +%option       with_xfersips   yes
    7.51 +%option       with_proxymwi   yes
    7.52 +%option       with_parseavp   yes
    7.53 +%option       with_radius     no
    7.54 +%option       with_sqlite     no
    7.55 +%option       with_pgsql      no
    7.56 +%option       with_curl       no
    7.57 +%option       with_imap       no
    7.58 +%option       with_astman     no
    7.59 +%option       with_capi       no
    7.60 +%option       with_zaptel     no
    7.61 +%option       with_smdipoll   10
    7.62 +
    7.63 +#   list of sources
    7.64 +Source0:      http://downloads.digium.com/pub/asterisk/releases/asterisk-%{version}.tar.gz
    7.65 +Source1:      ftp://ftp.chan-capi.org/chan-capi/chan_capi-%{V_chan_capi}.tar.gz
    7.66 +Source2:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-alaw.tar.gz
    7.67 +Source3:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-g722.tar.gz
    7.68 +Source4:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-g729.tar.gz
    7.69 +Source5:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-gsm.tar.gz
    7.70 +Source6:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-moh-freeplay-ulaw.tar.gz
    7.71 +Source7:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-alaw-%{V_extrasounds}.tar.gz
    7.72 +Source8:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-g722-%{V_extrasounds}.tar.gz
    7.73 +Source9:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-g729-%{V_extrasounds}.tar.gz
    7.74 +Source10:      http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-gsm-%{V_extrasounds}.tar.gz
    7.75 +Source11:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-extra-sounds-en-ulaw-%{V_extrasounds}.tar.gz
    7.76 +Source12:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-alaw-%{V_langsounds}.tar.gz
    7.77 +Source13:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-g722-%{V_langsounds}.tar.gz
    7.78 +Source14:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-g729-%{V_langsounds}.tar.gz
    7.79 +Source15:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-%{V_langsounds}.tar.gz
    7.80 +Source16:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-ulaw-%{V_langsounds}.tar.gz
    7.81 +Source17:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-alaw-%{V_langsounds}.tar.gz
    7.82 +Source18:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-g722-%{V_langsounds}.tar.gz
    7.83 +Source19:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-g729-%{V_langsounds}.tar.gz
    7.84 +Source20:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-gsm-%{V_langsounds}.tar.gz
    7.85 +Source21:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-es-ulaw-%{V_langsounds}.tar.gz
    7.86 +Source22:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-alaw-%{V_langsounds}.tar.gz
    7.87 +Source23:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-g722-%{V_langsounds}.tar.gz
    7.88 +Source24:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-g729-%{V_langsounds}.tar.gz
    7.89 +Source25:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-gsm-%{V_langsounds}.tar.gz
    7.90 +Source26:     http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-fr-ulaw-%{V_langsounds}.tar.gz
    7.91 +Source27:     http://www.amooma.de/asterisk/sprachbausteine/asterisk-%{V_amoomasounds}-de-prompts.tar.gz
    7.92 +Source28:     http://www.amooma.de/asterisk/sprachbausteine/asterisk-core-sounds-de-gsm-current.tar.gz
    7.93 +Source29:     ftp://ftp.europalab.com/pub/sfw/machsnds/de-digits/de-digits-%{V_customsounds}.tar.bz2
    7.94 +Source30:     asterisk.conf
    7.95 +Source31:     amd.conf
    7.96 +Source32:     capi.conf
    7.97 +Source33:     cdr.conf
    7.98 +Source34:     cdr_custom.conf
    7.99 +Source35:     codecs.conf
   7.100 +Source36:     dundi.conf
   7.101 +Source37:     enum.conf
   7.102 +Source38:     extensions.conf
   7.103 +Source39:     features.conf
   7.104 +Source40:     festival.conf
   7.105 +Source41:     followme.conf
   7.106 +Source42:     indications.conf
   7.107 +Source33:     logger.conf
   7.108 +Source34:     manager.conf
   7.109 +Source45:     meetme.conf
   7.110 +Source46:     misdn.conf
   7.111 +Source47:     modules.conf
   7.112 +Source48:     musiconhold.conf
   7.113 +Source49:     privacy.conf
   7.114 +Source50:     rpt.conf
   7.115 +Source51:     rtp.conf
   7.116 +Source52:     say.conf
   7.117 +Source53:     sip.conf
   7.118 +Source54:     sip_notify.conf
   7.119 +Source55:     sla.conf
   7.120 +Source56:     voicemail.conf
   7.121 +Source57:     zapata.conf
   7.122 +Source58:     rc.asterisk
   7.123 +Source59:     wakeup.agi
   7.124 +Patch0:       asterisk.patch
   7.125 +Patch1:       asterisk.patch.xfersips
   7.126 +Patch2:       asterisk.patch.proxymwi
   7.127 +Patch3:       asterisk.patch.parseavp
   7.128 +
   7.129 +#   build information
   7.130 +Prefix:       %{l_prefix}
   7.131 +BuildRoot:    %{l_buildroot}
   7.132 +BuildPreReq:  OpenPKG, openpkg >= 20040130, pkgconfig, awk, grep
   7.133 +PreReq:       OpenPKG, openpkg >= 20040130
   7.134 +BuildPreReq:  ncurses, openssl, zlib
   7.135 +PreReq:       ncurses, openssl, zlib
   7.136 +BuildPreReq:  speex, vorbis-libs, sox
   7.137 +PreReq:       speex, vorbis-libs, sox
   7.138 +%if "%{with_libpri}" == "yes"
   7.139 +BuildPreReq:  libpri
   7.140 +PreReq:       libpri
   7.141 +%endif
   7.142 +%if "%{with_radius}" == "yes"
   7.143 +BuildPreReq:  radiusclient
   7.144 +PreReq:       radiusclient
   7.145 +%endif
   7.146 +%if "%{with_sqlite}" == "yes"
   7.147 +BuildPreReq:  sqlite
   7.148 +PreReq:       sqlite
   7.149 +%endif
   7.150 +%if "%{with_pgsql}" == "yes"
   7.151 +BuildPreReq:  postgresql
   7.152 +PreReq:       postgresql
   7.153 +%endif
   7.154 +%if "%{with_curl}" == "yes"
   7.155 +BuildPreReq:  curl
   7.156 +PreReq:       curl
   7.157 +%endif
   7.158 +%if "%{with_imap}" == "yes"
   7.159 +BuildPreReq:  imap
   7.160 +PreReq:       imap
   7.161 +%endif
   7.162 +%if "%{with_astman}" == "yes"
   7.163 +BuildPreReq:  newt
   7.164 +PreReq:       newt
   7.165 +%endif
   7.166 +AutoReq:      no
   7.167 +AutoReqProv:  no
   7.168 +
   7.169 +%description
   7.170 +    Asterisk is a complete Private Branch Exchange (PBX) in software.
   7.171 +    It provides all of the features you would expect from a PBX and
   7.172 +    more. Asterisk does Voice over IP (VoIP) in many protocols. Asterisk
   7.173 +    provides Voicemail services with Directory, Call Conferencing,
   7.174 +    Interactive Voice Response and Call Queuing. It has support for
   7.175 +    three-way calling, caller ID services, ADSI, SIP, etc. Asterisk
   7.176 +    needs no additional hardware for VoIP.
   7.177 +
   7.178 +    This copy of Asterisk is optionally patched to allow the asterisk
   7.179 +    server to respond to SIP/TLS transfer requests using the Transfer()
   7.180 +    application. Should this option be chosen, the asterisk server
   7.181 +    successfully dispatches all transfer destinations using 'SIPS'
   7.182 +    technology by means of the standard SIP/2.0 302 Moved Temporarily
   7.183 +    message, with a URI resembling <sips:extension@hostname.tld:port>.
   7.184 +
   7.185 +    This copy of Asterisk is optionally patched as well to enclose the
   7.186 +    correct user name in NOTIFY messages when MWI logic detects changes
   7.187 +    in the state of Messages-Waiting. Asterisk will send NOTIFY messages
   7.188 +    with the URI 'user@hostname' instead of simply 'hostname'. This can
   7.189 +    be used by a external SIP proxy to route the MWI to the correct phone.
   7.190 +
   7.191 +%track
   7.192 +    prog asterisk = {
   7.193 +        version   = %{version}
   7.194 +        url       = http://downloads.digium.com/pub/asterisk/releases/
   7.195 +        regex     = asterisk-(__VER__)\.tar\.gz
   7.196 +    }
   7.197 +
   7.198 +%prep
   7.199 +    %setup -q -n asterisk-%{version}
   7.200 +    %setup -q -n asterisk-%{version} -D -T -a 1
   7.201 +    %patch -p0
   7.202 +%if "%{with_xfersips}" == "yes"
   7.203 +    %patch -p0 -P 1
   7.204 +%endif
   7.205 +%if "%{with_proxymwi}" == "yes"
   7.206 +    %patch -p0 -P 2
   7.207 +%endif
   7.208 +%if "%{with_parseavp}" == "yes"
   7.209 +    %patch -p0 -P 3
   7.210 +%endif
   7.211 +
   7.212 +    #   link install-sh to where Makefiles expect it
   7.213 +    for dir in agi utils res channels pbx apps codecs formats cdr funcs main; do
   7.214 +        ( cd $dir && ln -s ../install-sh ) || exit $?
   7.215 +    done
   7.216 +
   7.217 +    #   apply corrections
   7.218 +    case "%{l_platform -t}" in
   7.219 +        *-sunos* )
   7.220 +            %{l_shtool} subst \
   7.221 +                -e 's|\(tmp->tm_gmtoff = ttisp->tt_gmtoff;\)|/*\1*/|' \
   7.222 +                main/stdtime/localtime.c
   7.223 +            ;;
   7.224 +    esac
   7.225 +    %{l_shtool} subst \
   7.226 +        -e 's;sysconfdir=/etc;true;' \
   7.227 +        -e 's;mandir=/usr/share/man;true;' \
   7.228 +        -e 's;localstatedir=/var;true;' \
   7.229 +        -e 's;\(radiusclient\)-ng;\1;g' \
   7.230 +        -e 's;\(\-lsqlite\);\13;g' \
   7.231 +        -e 's;\(sqlite\)\(\.h\);\13\2;g' \
   7.232 +        -e 's;\(sqlite\)\(_exec\);\13\2;g' \
   7.233 +        -e 's;^\(LIBS="-lvorbis\);\1 ${OGG_LIB};' \
   7.234 +        -e 's;\(#include <\${NCURSES_DIR}/include\);\1/ncurses;' \
   7.235 +        -e 's;-I${IMAP_TK_DIR}/c-client;-I${IMAP_TK_DIR}/include/imap;g' \
   7.236 +        -e 's;${IMAP_TK_DIR}/c-client/c-client\.a;-limap -lssl -lcrypto -lcrypt;g' \
   7.237 +        configure
   7.238 +    %{l_shtool} subst \
   7.239 +        -e 's; *-I/usr/local/ssl/include;;g' \
   7.240 +        -e 's;/opt/ssl/include;%{l_prefix}/include;g' \
   7.241 +        -e 's;/usr/local;%{l_prefix};g' \
   7.242 +        -e 's;^\(MOD_SUBDIR_CFLAGS=.*\ *\)$;\1 -I%{l_prefix}/include;' \
   7.243 +        -e 's;^\( *ASTETCDIR\)=.*;\1=$(sysconfdir)/asterisk;g' \
   7.244 +        -e 's;^\( *ASTLIBDIR\)=.*;\1=$(libdir)/asterisk;g' \
   7.245 +        -e 's;^\( *ASTHEADERDIR\)=.*;\1=$(includedir)/asterisk;g' \
   7.246 +        -e 's;^\( *ASTBINDIR\)=.*;\1=$(bindir);g' \
   7.247 +        -e 's;^\( *ASTSBINDIR\)=.*;\1=$(sbindir);g' \
   7.248 +        -e 's;^\( *ASTSPOOLDIR\)=.*;\1=$(localstatedir)/asterisk/spool;g' \
   7.249 +        -e 's;^\( *ASTLOGDIR\)=.*;\1=$(localstatedir)/asterisk/log;g' \
   7.250 +        -e 's;^\( *ASTVARRUNDIR\)=.*;\1=$(localstatedir)/asterisk/run;g' \
   7.251 +        -e 's;^\( *ASTMANDIR\)=.*;\1=$(mandir);g' \
   7.252 +        -e 's;^\( *ASTVARLIBDIR\)=.*;\1=$(localstatedir)/asterisk/lib;g' \
   7.253 +        -e 's;^\( *ASTVARRUNDIR\)=.*;\1=$(localstatedir)/asterisk/run;g' \
   7.254 +        -e 's;^\( *ASTDATADIR\):*=.*;\1=$(datadir)/asterisk;g' \
   7.255 +        -e 's/\(for f in\) \(\$(OLDMODS); do \\\)$/\1 "warning:" \2/' \
   7.256 +        Makefile
   7.257 +        #-e 's;\(ASTSPOOLDIR=\$(localstatedir)\)\(/spool\)\(/asterisk\);\1\3\2;' \
   7.258 +        #-e 's;\(ASTLOGDIR=\$(localstatedir)\)\(/log\)\(/asterisk\);\1\3\2;' \
   7.259 +        #-e 's;\(ASTVARRUNDIR=\$(localstatedir)\)\(/run\);\1/asterisk\2;' \
   7.260 +        #-e 's;\(ASTVARRUNDIR=\$(localstatedir)\)\(/run\)\(/asterisk\);\1\3\2;' \
   7.261 +        #-e 's;\(ASTVARLIBDIR=\$(localstatedir)\)\(/lib\)\(/asterisk\);\1\3\2;' \
   7.262 +        #-e 's;\(ASTDATADIR:=\)\$(ASTVARLIBDIR);\1$(prefix)/share/asterisk;' \
   7.263 +        #Makefile
   7.264 +    %{l_shtool} subst \
   7.265 +        -e 's; *-L/usr/local/ssl/lib;;g' \
   7.266 +        -e 's;/opt/ssl/lib;%{l_prefix}/lib;g' \
   7.267 +        -e 's;/usr/local;%{l_prefix};g' \
   7.268 +        -e 's;\(ASTLINK=\)$;\1-Wl,--export-dynamic;g' \
   7.269 +        main/Makefile
   7.270 +    %{l_shtool} subst \
   7.271 +        -e 's;LOG_WARNING\(, "Failed to perform seek\);LOG_DEBUG\1;g' \
   7.272 +        main/channel.c
   7.273 +    %{l_shtool} subst \
   7.274 +        -e 's;LOG_WARNING\(, "[^ ][^ ]* is not supported\);LOG_DEBUG\1;g' \
   7.275 +        formats/format_ogg_vorbis.c
   7.276 +    %{l_shtool} subst \
   7.277 +        -e 's;\(/etc/radiusclient-ng/radiusclient.conf\);%{l_prefix}\1;g' \
   7.278 +        -e 's;\(radiusclient\)-ng;\1;g' \
   7.279 +        cdr/cdr_radius.c
   7.280 +    %{l_shtool} subst \
   7.281 +        -e 's;\(sqlite\)\(\.h\);\13\2;g' \
   7.282 +        cdr/cdr_sqlite.c
   7.283 +    %{l_shtool} subst \
   7.284 +        -e 's;\(#define DEFAULT_POLLING_INTERVAL\)  *.*;\1 %{with_smdipoll};' \
   7.285 +        res/res_smdi.c
   7.286 +    %{l_shtool} subst \
   7.287 +        -e 's;\(ASTERISK_HEADER_DIR=\).*;\1%{l_prefix}/include;g' \
   7.288 +        -e 's;\(MODULES_DIR=\).*;\1%{l_prefix}/lib/asterisk/modules;g' \
   7.289 +        -e 's;\(CONFIG_DIR=\).*;\1%{l_prefix}/etc/asterisk;g' \
   7.290 +        -e 's;\(\$(MODULES_DIR)\);$(DESTDIR)\1;g' \
   7.291 +        -e 's;\${CONFIG_DIR};$(DESTDIR)$(CONFIG_DIR);g' \
   7.292 +        chan_capi-%{V_chan_capi}/Makefile
   7.293 +
   7.294 +#    #   optionally specify CPU
   7.295 +#    %{l_shtool} subst \
   7.296 +#        -e 's;build_cpu=\$1;build_cpu=i586;' \
   7.297 +#        -e 's;host_cpu=\$1;host_cpu=i586;' \
   7.298 +#        configure
   7.299 +
   7.300 +%build
   7.301 +    #   apply platform build rules
   7.302 +    libs="`pkg-config openssl speex --libs-only-l`"
   7.303 +%if "%{with_curl}" == "yes"
   7.304 +    libs="$libs `pkg-config libcurl --libs-only-l`"
   7.305 +%endif
   7.306 +%if "%{with_sqlite}" == "yes"
   7.307 +    libs="$libs `pkg-config sqlite3 --libs-only-l`"
   7.308 +%endif
   7.309 +%if "%{with_pgsql}" == "yes"
   7.310 +    libs="-lpq $libs"
   7.311 +%endif
   7.312 +%if "%{with_radius}" == "yes"
   7.313 +    libs="$libs -lradiusclient"
   7.314 +%endif
   7.315 +%if "%{with_libpri}" == "yes"
   7.316 +    libs="$libs -lpri"
   7.317 +%endif
   7.318 +    case "%{l_platform -t}" in
   7.319 +        *-linux*    ) libs="$libs -lrt" ;;
   7.320 +        *-sunos*    ) libs="$libs -lrt" ;;
   7.321 +    esac
   7.322 +
   7.323 +    #   configure package
   7.324 +    CC="%{l_cc}" \
   7.325 +    CFLAGS="%{l_cflags -O}" \
   7.326 +%if "%{with_imap}" == "yes"
   7.327 +    CPPFLAGS="%{l_cppflags imap ncurses}" \
   7.328 +%else
   7.329 +    CPPFLAGS="%{l_cppflags ncurses}" \
   7.330 +%endif
   7.331 +    LDFLAGS="%{l_ldflags}" \
   7.332 +    LIBS="$libs" \
   7.333 +    ./configure \
   7.334 +        --prefix=%{l_prefix} \
   7.335 +        --mandir=%{l_prefix}/man \
   7.336 +        --with-ncurses=%{l_prefix} \
   7.337 +%if "%{with_libpri}" == "yes"
   7.338 +        --with-pri=%{l_prefix} \
   7.339 +%else
   7.340 +        --with-pri=no \
   7.341 +%endif
   7.342 +        --with-ssl=%{l_prefix} \
   7.343 +%if "%{with_radius}" == "yes"
   7.344 +        --with-radius=%{l_prefix} \
   7.345 +%else
   7.346 +        --with-radius=no \
   7.347 +%endif
   7.348 +%if "%{with_sqlite}" == "yes"
   7.349 +        --with-sqlite=%{l_prefix} \
   7.350 +%else
   7.351 +        --with-sqlite=no \
   7.352 +%endif
   7.353 +%if "%{with_postgresql}" == "yes"
   7.354 +        --with-postgres=%{l_prefix} \
   7.355 +%else
   7.356 +        --with-postgres=no \
   7.357 +%endif
   7.358 +%if "%{with_curl}" == "yes"
   7.359 +        --with-curl=%{l_prefix} \
   7.360 +%else
   7.361 +        --with-curl=no \
   7.362 +%endif
   7.363 +%if "%{with_imap}" == "yes"
   7.364 +        --with-imap=%{l_prefix} \
   7.365 +        --disable-largefile \
   7.366 +%else
   7.367 +        --with-imap=no \
   7.368 +%endif
   7.369 +%if "%{with_astman}" == "yes"
   7.370 +        --with-newt=%{l_prefix} \
   7.371 +%else
   7.372 +        --with-newt=no \
   7.373 +%endif
   7.374 +        --with-speex=%{l_prefix} \
   7.375 +        --with-speexdsp=%{l_prefix} \
   7.376 +        --with-ogg=%{l_prefix} \
   7.377 +        --with-vorbis=%{l_prefix} \
   7.378 +        --with-z=%{l_prefix}
   7.379 +
   7.380 +    #   build package
   7.381 +    %{l_make} %{l_mflags -O} menuselect/menuselect menuselect-tree
   7.382 +    menuselect/menuselect --check-deps menuselect.makeopts
   7.383 +    %{l_shtool} subst \
   7.384 +        -e 's;\(MENUSELECT_MOH=\).*;\1;' \
   7.385 +        -e 's;\(MENUSELECT_CORE_SOUNDS=\).*;\1;' \
   7.386 +        -e 's;\(MENUSELECT_EXTRA_SOUNDS=\).*;\1;' \
   7.387 +        menuselect.makeopts
   7.388 +%if "%{with_imap}" == "yes"
   7.389 +    %{l_shtool} subst \
   7.390 +        -e 's;\(MENUSELECT_OPTS_app_voicemail=\)$;\1IMAP_STORAGE;' \
   7.391 +        menuselect.makeopts
   7.392 +%endif
   7.393 +    %{l_make} %{l_mflags -O} EXTLIBS="$libs" NOISY_BUILD=yes
   7.394 +%if "%{with_capi}" == "yes"
   7.395 +    ( cd chan_capi-%{V_chan_capi}
   7.396 +      %{l_make} %{l_mflags -O}
   7.397 +    ) || exit $?
   7.398 +%endif
   7.399 +
   7.400 +%install
   7.401 +    rm -rf $RPM_BUILD_ROOT
   7.402 +
   7.403 +    #   install package
   7.404 +    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   7.405 +%if "%{with_capi}" == "yes"
   7.406 +    ( cd chan_capi-%{V_chan_capi}
   7.407 +      %{l_make} %{l_mflags} install samples DESTDIR=$RPM_BUILD_ROOT
   7.408 +    ) || exit $?
   7.409 +%endif
   7.410 +
   7.411 +    #   install all sound prompt files
   7.412 +    for codec in alaw ulaw g722 g729 gsm; do
   7.413 +        for lang in es fr; do
   7.414 +            ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang}
   7.415 +              %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-${lang}-${codec}-%{V_langsounds}.tar.gz
   7.416 +            ) || exit $?
   7.417 +        done
   7.418 +        ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds
   7.419 +          %{l_tar} zxf %{_sourcedir}/asterisk-extra-sounds-en-${codec}-%{V_extrasounds}.tar.gz
   7.420 +          %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-en-${codec}-%{V_langsounds}.tar.gz
   7.421 +        ) || exit $?
   7.422 +    done
   7.423 +
   7.424 +    #   install special case sound files
   7.425 +    ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds
   7.426 +      %{l_tar} jxf %{SOURCE de-digits-%{V_customsounds}.tar.bz2}
   7.427 +      %{l_tar} zxf %{SOURCE asterisk-core-sounds-de-gsm-current.tar.gz}
   7.428 +      cd de
   7.429 +      %{l_tar} zxf %{_sourcedir}/asterisk-%{V_amoomasounds}-de-prompts.tar.gz
   7.430 +      mv -f de/* . && rm -rf de
   7.431 +      mv -f dictate/de/* letters/ && rm -rf dictate/de
   7.432 +      mv -f digits/de/* letters/ && rm -rf digits/de
   7.433 +      mv -f letters/de/* letters/ && rm -rf letters/de
   7.434 +      mv -f phonetic/de/* letters/ && rm -rf phonetic/de
   7.435 +    ) || exit $?
   7.436 +
   7.437 +    #   install additional music on hold files
   7.438 +    ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/moh
   7.439 +      for codec in alaw ulaw g722 g729 gsm; do
   7.440 +          %{l_tar} zxf %{_sourcedir}/asterisk-moh-freeplay-${codec}.tar.gz
   7.441 +      done
   7.442 +    ) || exit $?
   7.443 +
   7.444 +#    #   install nonstandard voicemail prompts
   7.445 +#    %{l_shtool} mkdir -f -p -m 755 \
   7.446 +#        $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/voicemail/default/%{exten}/unavail
   7.447 +#    %{l_shtool} install -c -m 660 \
   7.448 +#        %{_sourcedir}/ansage-%{V_ansage}.wav} \
   7.449 +#        $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/voicemail/default/%{exten}/unavail.wav
   7.450 +
   7.451 +    #   install default configuration
   7.452 +    %{l_shtool} install -c -m 660 %{l_value -s -a} \
   7.453 +        %{SOURCE asterisk.conf} \
   7.454 +        %{SOURCE amd.conf} \
   7.455 +        %{SOURCE cdr.conf} \
   7.456 +        %{SOURCE codecs.conf} \
   7.457 +        %{SOURCE extensions.conf} \
   7.458 +        %{SOURCE features.conf} \
   7.459 +        %{SOURCE festival.conf} \
   7.460 +        %{SOURCE followme.conf} \
   7.461 +        %{SOURCE indications.conf} \
   7.462 +        %{SOURCE logger.conf} \
   7.463 +        %{SOURCE manager.conf} \
   7.464 +        %{SOURCE meetme.conf} \
   7.465 +        %{SOURCE modules.conf} \
   7.466 +        %{SOURCE musiconhold.conf} \
   7.467 +        %{SOURCE rtp.conf} \
   7.468 +        %{SOURCE sip.conf} \
   7.469 +        %{SOURCE sla.conf} \
   7.470 +        %{SOURCE voicemail.conf} \
   7.471 +        %{SOURCE zapata.conf} \
   7.472 +        $RPM_BUILD_ROOT%{l_prefix}/etc/asterisk/
   7.473 +
   7.474 +    #   install runcommand script
   7.475 +    %{l_shtool} mkdir -f -p -m 755 \
   7.476 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   7.477 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   7.478 +        %{SOURCE rc.asterisk} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   7.479 +
   7.480 +    #   install additional AGI scripts
   7.481 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   7.482 +        %{SOURCE wakeup.agi} $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/agi-bin/
   7.483 +
   7.484 +    #   correct installation hierarchy
   7.485 +    %{l_shtool} mkdir -f -p -m 755 \
   7.486 +        $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/lib \
   7.487 +        $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/outgoing
   7.488 +
   7.489 +    #   remove unused components
   7.490 +    rm -rf \
   7.491 +        $RPM_BUILD_ROOT%{l_prefix}/bin \
   7.492 +        $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/images \
   7.493 +        $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/de/.DS_Store \
   7.494 +        $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/de/autogen.sh \
   7.495 +        >/dev/null 2>&1 || true
   7.496 +
   7.497 +    #   adjust inconsistent names
   7.498 +    for bin in $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/agi-bin/*.*; do
   7.499 +        mv $bin `echo $bin | sed -e 's;\.[^.]*$;;'`
   7.500 +    done
   7.501 +
   7.502 +    #   strip down installation
   7.503 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* \
   7.504 +          $RPM_BUILD_ROOT%{l_prefix}/sbin/* \
   7.505 +          $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules/* \
   7.506 +          $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/agi-bin/* \
   7.507 +          >/dev/null 2>&1 || true
   7.508 +
   7.509 +    #   determine installation files
   7.510 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
   7.511 +        '%config %attr(660,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/asterisk/*' \
   7.512 +        '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/*' \
   7.513 +        '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/dictate' \
   7.514 +        '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/digits' \
   7.515 +        '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/followme' \
   7.516 +        '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/letters' \
   7.517 +        '%config %attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/share/asterisk/sounds/de/phonetic' \
   7.518 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/asterisk/*' \
   7.519 +        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/asterisk/*/*'
   7.520 +
   7.521 +%files -f files
   7.522 +
   7.523 +%clean
   7.524 +    rm -rf $RPM_BUILD_ROOT
   7.525 +
   7.526 +%post
   7.527 +    #   after upgrade, restart service
   7.528 +    [ $1 -eq 2 ] || exit 0
   7.529 +    eval `%{l_rc} asterisk status 2>/dev/null`
   7.530 +    [ ".$asterisk_active" = .yes ] && %{l_rc} asterisk restart
   7.531 +    exit 0
   7.532 +
   7.533 +%preun
   7.534 +    #   before erase, stop service and remove log files
   7.535 +    [ $1 -eq 0 ] || exit 0
   7.536 +    %{l_rc} asterisk stop 2>/dev/null
   7.537 +    rm  -f $RPM_INSTALL_PREFIX/var/asterisk/lib/*       >/dev/null 2>&1 || true
   7.538 +    rm  -f $RPM_INSTALL_PREFIX/var/asterisk/log/*       >/dev/null 2>&1 || true
   7.539 +    rm  -f $RPM_INSTALL_PREFIX/var/asterisk/log/cdr-*/* >/dev/null 2>&1 || true
   7.540 +    rm  -f $RPM_INSTALL_PREFIX/var/asterisk/run/*       >/dev/null 2>&1 || true
   7.541 +    for deldir in meetme outgoing system tmp; do
   7.542 +        rm -rf \
   7.543 +            $RPM_INSTALL_PREFIX/var/asterisk/spool/$deldir \
   7.544 +            >/dev/null 2>&1 || true
   7.545 +    done
   7.546 +    exit 0
   7.547 +
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/asterisk/capi.conf	Mon Apr 27 12:19:05 2009 +0200
     8.3 @@ -0,0 +1,34 @@
     8.4 +;;
     8.5 +;;  capi.conf -- Asterisk ISDN/CAPI channel configuration
     8.6 +;;
     8.7 +
     8.8 +;[general]
     8.9 +;nationalprefix        = 0
    8.10 +;internationalprefix   = 00
    8.11 +;rxgain                = 1.0
    8.12 +;txgain                = 1.0
    8.13 +;ulaw                  = no
    8.14 +;debug                 = yes
    8.15 +
    8.16 +;[ISDN1]
    8.17 +;isdnmode              = msn
    8.18 +;incomingmsn           = *
    8.19 +;controller            = 0
    8.20 +;group                 = 1
    8.21 +;;prefix                = 0
    8.22 +;softdtmf              = off
    8.23 +;relaxdtmf             = off
    8.24 +;accountcode           =
    8.25 +;context               = external
    8.26 +;holdtype              = local
    8.27 +;immediate             = yes
    8.28 +;echocancel            = no
    8.29 +;echosquelch           = no
    8.30 +;echotail              = 64
    8.31 +;bridge                = yes
    8.32 +;callgroup             = 1
    8.33 +;deflect               = 1234567
    8.34 +;devices               = 2
    8.35 +;wait_silence_samples  = 1000
    8.36 +;dtmf_generate         = yes
    8.37 +
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/asterisk/cdr.conf	Mon Apr 27 12:19:05 2009 +0200
     9.3 @@ -0,0 +1,148 @@
     9.4 +;
     9.5 +; Asterisk Call Detail Record engine configuration
     9.6 +;
     9.7 +; CDR is Call Detail Record, which provides logging services via a variety of
     9.8 +; pluggable backend modules.  Detailed call information can be recorded to
     9.9 +; databases, files, etc.  Useful for billing, fraud prevention, compliance with
    9.10 +; Sarbanes-Oxley aka The Enron Act, QOS evaluations, and more.
    9.11 +;
    9.12 +
    9.13 +;[general]
    9.14 +
    9.15 +; Define whether or not to use CDR logging.  Setting this to "no" will override
    9.16 +; any loading of backend CDR modules.  Default is "yes".
    9.17 +;enable=yes
    9.18 +
    9.19 +; Define whether or not to log unanswered calls. Setting this to "yes" will
    9.20 +; report every attempt to ring a phone in dialing attempts, when it was not 
    9.21 +; answered. For example, if you try to dial 3 extensions, and this option is "yes",
    9.22 +; you will get 3 CDR's, one for each phone that was rung. Default is "no". Some
    9.23 +; find this information horribly useless. Others find it very valuable. Note, in "yes"
    9.24 +; mode, you will see one CDR, with one of the call targets on one side, and the originating
    9.25 +; channel on the other, and then one CDR for each channel attempted. This may seem 
    9.26 +; redundant, but cannot be helped.
    9.27 +;unanswered = no
    9.28 +
    9.29 +; Define the CDR batch mode, where instead of posting the CDR at the end of
    9.30 +; every call, the data will be stored in a buffer to help alleviate load on the
    9.31 +; asterisk server.  Default is "no".
    9.32 +;
    9.33 +; WARNING WARNING WARNING
    9.34 +; Use of batch mode may result in data loss after unsafe asterisk termination
    9.35 +; ie. software crash, power failure, kill -9, etc.
    9.36 +; WARNING WARNING WARNING
    9.37 +;
    9.38 +;batch=no
    9.39 +
    9.40 +; Define the maximum number of CDRs to accumulate in the buffer before posting
    9.41 +; them to the backend engines.  'batch' must be set to 'yes'.  Default is 100.
    9.42 +;size=100
    9.43 +
    9.44 +; Define the maximum time to accumulate CDRs in the buffer before posting them
    9.45 +; to the backend engines.  If this time limit is reached, then it will post the
    9.46 +; records, regardless of the value defined for 'size'.  'batch' must be set to
    9.47 +; 'yes'.  Note that time is in seconds.  Default is 300 (5 minutes).
    9.48 +;time=300
    9.49 +
    9.50 +; The CDR engine uses the internal asterisk scheduler to determine when to post
    9.51 +; records.  Posting can either occur inside the scheduler thread, or a new
    9.52 +; thread can be spawned for the submission of every batch.  For small batches,
    9.53 +; it might be acceptable to just use the scheduler thread, so set this to "yes".
    9.54 +; For large batches, say anything over size=10, a new thread is recommended, so
    9.55 +; set this to "no".  Default is "no".
    9.56 +;scheduleronly=no
    9.57 +
    9.58 +; When shutting down asterisk, you can block until the CDRs are submitted.  If
    9.59 +; you don't, then data will likely be lost.  You can always check the size of
    9.60 +; the CDR batch buffer with the CLI "cdr status" command.  To enable blocking on
    9.61 +; submission of CDR data during asterisk shutdown, set this to "yes".  Default
    9.62 +; is "yes".
    9.63 +;safeshutdown=yes
    9.64 +
    9.65 +; Normally, CDR's are not closed out until after all extensions are finished
    9.66 +; executing.  By enabling this option, the CDR will be ended before executing
    9.67 +; the "h" extension so that CDR values such as "end" and "billsec" may be
    9.68 +; retrieved inside of of this extension.
    9.69 +;endbeforehexten=no
    9.70 +
    9.71 +;
    9.72 +;
    9.73 +; CHOOSING A CDR "BACKEND"  (what kind of output to generate)
    9.74 +;
    9.75 +; To choose a backend, you have to make sure either the right category is 
    9.76 +; defined in this file, or that the appropriate config file exists, and has the 
    9.77 +; proper definitions in it. If there are any problems, usually, the entry will
    9.78 +; silently ignored, and you get no output.
    9.79 +; 
    9.80 +; Also, please note that you can generate CDR records in as many formats as you 
    9.81 +; wish. If you configure 5 different CDR formats, then each event will be logged
    9.82 +; in 5 different places! In the example config files, all formats are commented
    9.83 +; out except for the cdr-csv format.
    9.84 +;
    9.85 +; Here are all the possible back ends:
    9.86 +;
    9.87 +;   csv, custom, manager, odbc, pgsql, radius, sqlite, tds 
    9.88 +;    (also, mysql is available via the asterisk-addons, due to licensing
    9.89 +;     requirements)
    9.90 +;   (please note, also, that other backends can be created, by creating
    9.91 +;    a new backend module in the source cdr/ directory!)
    9.92 +;
    9.93 +; Some of the modules required to provide these backends will not build or install
    9.94 +; unless some dependency requirements are met. Examples of this are pgsql, odbc,
    9.95 +; etc. If you are not getting output as you would expect, the first thing to do
    9.96 +; is to run the command "make menuselect", and check what modules are available,
    9.97 +; by looking in the "2. Call Detail Recording" option in the main menu. If your
    9.98 +; backend is marked with XXX, you know that the "configure" command could not find
    9.99 +; the required libraries for that option.
   9.100 +;
   9.101 +; To get CDRs to be logged to the plain-jane /var/log/asterisk/cdr-csv/Master.csv 
   9.102 +; file, define the [csv] category in this file. No database necessary. The example
   9.103 +; config files are set up to provide this kind of output by default.
   9.104 +;
   9.105 +; To get custom csv CDR records, make sure the cdr_custom.conf file
   9.106 +; is present, and contains the proper [mappings] section. The advantage to
   9.107 +; using this backend, is that you can define which fields to output, and in
   9.108 +; what order. By default, the example configs are set up to mimic the cdr-csv
   9.109 +; output. If you don't make any changes to the mappings, you are basically generating
   9.110 +; the same thing as cdr-csv, but expending more CPU cycles to do so!
   9.111 +;
   9.112 +; To get manager events generated, make sure the cdr_manager.conf file exists,
   9.113 +; and the [general] section is defined, with the single variable 'enabled = yes'.
   9.114 +;
   9.115 +; For odbc, make sure all the proper libs are installed, that "make menuselect"
   9.116 +; shows that the modules are available, and the cdr_odbc.conf file exists, and
   9.117 +; has a [global] section with the proper variables defined.
   9.118 +;
   9.119 +; For pgsql, make sure all the proper libs are installed, that "make menuselect"
   9.120 +; shows that the modules are available, and the cdr_pgsql.conf file exists, and
   9.121 +; has a [global] section with the proper variables defined.
   9.122 +;
   9.123 +; For logging to radius databases, make sure all the proper libs are installed, that 
   9.124 +; "make menuselect" shows that the modules are available, and the [radius]
   9.125 +; category is defined in this file, and in that section, make sure the 'radiuscfg'
   9.126 +; variable is properly pointing to an existing radiusclient.conf file.
   9.127 +;
   9.128 +; For logging to sqlite databases, make sure the 'cdr.db' file exists in the log directory,
   9.129 +; which is usually /var/log/asterisk. Of course, the proper libraries should be available
   9.130 +; during the 'configure' operation.
   9.131 +;
   9.132 +; For tds logging, make sure the proper libraries are available during the 'configure' 
   9.133 +; phase, and that cdr_tds.conf exists and is properly set up with a [global] category.
   9.134 +;
   9.135 +; Also, remember, that if you wish to log CDR info to a database, you will have to define
   9.136 +; a specific table in that databse to make things work! See the doc directory for more details
   9.137 +; on how to create this table in each database.
   9.138 +;
   9.139 +
   9.140 +;[csv]
   9.141 +;usegmtime=yes    ; log date/time in GMT.  Default is "no"
   9.142 +;loguniqueid=yes  ; log uniqueid.  Default is "no
   9.143 +;loguserfield=yes ; log user field.  Default is "no
   9.144 +
   9.145 +;[radius]
   9.146 +;usegmtime=yes    ; log date/time in GMT
   9.147 +;loguniqueid=yes  ; log uniqueid
   9.148 +;loguserfield=yes ; log user field
   9.149 +; Set this to the location of the radiusclient-ng configuration file
   9.150 +; The default is /etc/radiusclient-ng/radiusclient.conf
   9.151 +;radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/asterisk/cdr_custom.conf	Mon Apr 27 12:19:05 2009 +0200
    10.3 @@ -0,0 +1,10 @@
    10.4 +;
    10.5 +; Mappings for custom config file
    10.6 +;
    10.7 +; to get your csv output in a format tailored to your liking, uncomment the following
    10.8 +; and look for the output in the cdr-custom/Master.csv file (usually in /var/log/asterisk).
    10.9 +; 
   10.10 +;
   10.11 +;[mappings]
   10.12 +;Master.csv => "${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration)}","${CDR(billsec)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}"
   10.13 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/asterisk/codecs.conf	Mon Apr 27 12:19:05 2009 +0200
    11.3 @@ -0,0 +1,65 @@
    11.4 +;[speex]
    11.5 +; CBR encoding quality [0..10]
    11.6 +; used only when vbr = false
    11.7 +;quality => 3
    11.8 +
    11.9 +; codec complexity [0..10]
   11.10 +; tradeoff between cpu/quality
   11.11 +;complexity => 2
   11.12 +
   11.13 +; perceptual enhancement [true / false]
   11.14 +; improves clarity of decoded speech
   11.15 +;enhancement => true
   11.16 +
   11.17 +; voice activity detection [true / false]
   11.18 +; reduces bitrate when no voice detected, used only for CBR
   11.19 +; (implicit in VBR/ABR)
   11.20 +;vad => true
   11.21 +
   11.22 +; variable bit rate [true / false]
   11.23 +; uses bit rate proportionate to voice complexity
   11.24 +;vbr => true
   11.25 +
   11.26 +; available bit rate [bps, 0 = off]
   11.27 +; encoding quality modulated to match this target bit rate
   11.28 +; not recommended with dtx or pp_vad - may cause bandwidth spikes
   11.29 +;abr => 0
   11.30 +
   11.31 +; VBR encoding quality [0-10]
   11.32 +; floating-point values allowed
   11.33 +;vbr_quality => 4
   11.34 +
   11.35 +; discontinuous transmission [true / false]
   11.36 +; stops transmitting completely when silence is detected
   11.37 +; pp_vad is far more effective but more CPU intensive
   11.38 +;dtx => false
   11.39 +
   11.40 +; preprocessor configuration
   11.41 +; these options only affect Speex v1.1.8 or newer
   11.42 +
   11.43 +; enable preprocessor [true / false]
   11.44 +; allows dsp functionality below but incurs CPU overhead
   11.45 +;preprocess => false
   11.46 +
   11.47 +; preproc voice activity detection [true / false]
   11.48 +; more advanced equivalent of DTX, based on voice frequencies
   11.49 +;pp_vad => false
   11.50 +
   11.51 +; preproc automatic gain control [true / false]
   11.52 +;pp_agc => false
   11.53 +;pp_agc_level => 8000
   11.54 +
   11.55 +; preproc denoiser [true / false]
   11.56 +;pp_denoise => false
   11.57 +
   11.58 +; preproc dereverb [true / false]
   11.59 +;pp_dereverb => false
   11.60 +;pp_dereverb_decay => 0.4
   11.61 +;pp_dereverb_level => 0.3
   11.62 +
   11.63 +
   11.64 +;[plc]
   11.65 +; for all codecs which do not support native PLC
   11.66 +; this determines whether to perform generic PLC
   11.67 +; there is a minor performance penalty for this
   11.68 +;genericplc => true
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/asterisk/dundi.conf	Mon Apr 27 12:19:05 2009 +0200
    12.3 @@ -0,0 +1,239 @@
    12.4 +;
    12.5 +; DUNDi configuration file
    12.6 +; 
    12.7 +; For more information about DUNDi, see http://www.dundi.com
    12.8 +;
    12.9 +;
   12.10 +;[general]
   12.11 +;
   12.12 +; The "general" section contains general parameters relating
   12.13 +; to the operation of the dundi client and server.
   12.14 +;
   12.15 +; The first part should be your complete contact information
   12.16 +; should someone else in your peer group need to contact you.
   12.17 +;
   12.18 +;department=Your Department
   12.19 +;organization=Your Company, Inc.
   12.20 +;locality=Your City
   12.21 +;stateprov=ST
   12.22 +;country=US
   12.23 +;email=your@email.com
   12.24 +;phone=+12565551212
   12.25 +;
   12.26 +;
   12.27 +; Specify bind address and port number.  Default is
   12.28 +; 4520
   12.29 +;
   12.30 +;bindaddr=0.0.0.0
   12.31 +;port=4520
   12.32 +;
   12.33 +; Our entity identifier (Should generally be the MAC address of the
   12.34 +; machine it's running on.  Defaults to the first eth address, but you
   12.35 +; can override it here, as long as you set it to the MAC of *something*
   12.36 +; you own!)
   12.37 +;
   12.38 +;entityid=00:07:E9:3B:76:60
   12.39 +;
   12.40 +; Peers shall cache our query responses for the specified time,
   12.41 +; given in seconds. Default is 3600.
   12.42 +;
   12.43 +;cachetime=3600
   12.44 +;
   12.45 +; This defines the max depth in which to search the DUNDi system.
   12.46 +; Note that the maximum time that we will wait for a response is
   12.47 +; (2000 + 200 * ttl) ms.
   12.48 +;
   12.49 +;ttl=32
   12.50 +;
   12.51 +; If we don't get ACK to our DPDISCOVER within 2000ms, and autokill is set
   12.52 +; to yes, then we cancel the whole thing (that's enough time for one 
   12.53 +; retransmission only).  This is used to keep things from stalling for a long
   12.54 +; time for a host that is not available, but would be ill advised for bad 
   12.55 +; connections.  In addition to 'yes' or 'no' you can also specify a number
   12.56 +; of milliseconds.  See 'qualify' for individual peers to turn on for just
   12.57 +; a specific peer.
   12.58 +;
   12.59 +;autokill=yes
   12.60 +;
   12.61 +; pbx_dundi creates a rotating key called "secret", under the family
   12.62 +; 'secretpath'.  The default family is dundi (resulting in 
   12.63 +; the key being held at dundi/secret).
   12.64 +;
   12.65 +;secretpath=dundi
   12.66 +;
   12.67 +; The 'storehistory' option (also changeable at runtime with
   12.68 +; 'dundi store history' and 'dundi no store history') will
   12.69 +; cause the DUNDi engine to keep track of the last several
   12.70 +; queries and the amount of time each query took to execute
   12.71 +; for the purpose of tracking slow nodes.  This option is
   12.72 +; off by default due to performance impacts.
   12.73 +;
   12.74 +;storehistory=yes
   12.75 +
   12.76 +;[mappings]
   12.77 +;
   12.78 +; The "mappings" section maps DUNDi contexts
   12.79 +; to contexts on the local asterisk system.  Remember
   12.80 +; that numbers that are made available under the e164 
   12.81 +; DUNDi context are regulated by the DUNDi General Peering 
   12.82 +; Agreement (GPA) if you are a member of the DUNDi E.164
   12.83 +; Peering System.
   12.84 +;
   12.85 +; dundi_context => local_context,weight,tech,dest[,options]]
   12.86 +;
   12.87 +; 'dundi_context' is the name of the context being requested
   12.88 +; within the DUNDi request
   12.89 +;
   12.90 +; 'local_context' is the name of the context on the local system
   12.91 +; in which numbers can be looked up for which responses shall be given.
   12.92 +;
   12.93 +; 'weight' is the weight to use for the responses provided from this
   12.94 +; mapping.  The number must be >= 0 and < 60000.  Since it is totally
   12.95 +; valid to receive multiple responses to a query, responses received
   12.96 +; with a lower weight are tried first.  Note that the weight has a
   12.97 +; special meaning in the e164 context - see the GPA for more details.
   12.98 +;
   12.99 +; 'tech' is the technology to use (IAX, SIP, H323)
  12.100 +;
  12.101 +; 'dest' is the destination to supply for reaching that number.  The
  12.102 +; following variables can be used in the destination string and will
  12.103 +; be automatically substituted:
  12.104 +; ${NUMBER}: The number being requested
  12.105 +; ${IPADDR}: The IP address to connect to
  12.106 +; ${SECRET}: The current rotating secret key to be used
  12.107 +;
  12.108 +; Further options may include:
  12.109 +;
  12.110 +; nounsolicited:  No unsolicited calls of any type permitted via this 
  12.111 +;                 route
  12.112 +; nocomunsolicit: No commercial unsolicited calls permitted via 
  12.113 +;                 this route
  12.114 +; residential:    This number is known to be a residence
  12.115 +; commercial:     This number is known to be a business
  12.116 +; mobile:         This number is known to be a mobile phone
  12.117 +; nocomunsolicit: No commercial unsolicited calls permitted via 
  12.118 +;                 this route
  12.119 +; nopartial:      Do not search for partial matches
  12.120 +;
  12.121 +; There *must* exist an entry in mappings for DUNDi to respond
  12.122 +; to any request, although it may be empty.
  12.123 +;
  12.124 +;e164 => dundi-e164-canonical,0,IAX2,dundi:${SECRET}@${IPADDR}/${NUMBER},nounsolicited,nocomunsolicit,nopartial
  12.125 +;e164 => dundi-e164-customers,100,IAX2,dundi:${SECRET}@${IPADDR}/${NUMBER},nounsolicited,nocomunsolicit,nopartial
  12.126 +;e164 => dundi-e164-via-pstn,400,IAX2,dundi:${SECRET}@${IPADDR}/${NUMBER},nounsolicited,nocomunsolicit,nopartial
  12.127 +
  12.128 +;digexten => default,0,IAX2,guest@lappy/${NUMBER}
  12.129 +;asdf =>
  12.130 +
  12.131 +
  12.132 +;
  12.133 +;
  12.134 +; The remaining sections represent the peers
  12.135 +; that we fundamentally trust.  The section name
  12.136 +; represents the name and optionally at a specific
  12.137 +; DUNDi context if you want the trust to be established
  12.138 +; for only a specific DUNDi context.
  12.139 +;
  12.140 +; inkey - What key they will be authenticating to us with
  12.141 +;
  12.142 +; outkey - What key we use to authenticate to them
  12.143 +;
  12.144 +; host - What their host is
  12.145 +;
  12.146 +; order - What search order to use.  May be 'primary', 'secondary', 
  12.147 +;         'tertiary' or 'quartiary'.  In large systems, it is beneficial
  12.148 +;         to only query one up-stream host in order to maximize caching
  12.149 +;         value.  Adding one with primary and one with secondary gives you
  12.150 +;         redundancy without sacrificing performance.
  12.151 +;
  12.152 +; include - Includes this peer when searching a particular context
  12.153 +;           for lookup (set "all" to perform all lookups with that
  12.154 +;           host.  This is also the context in which peers are permitted
  12.155 +;           to precache.
  12.156 +;
  12.157 +; noinclude - Disincludes this peer when searching a particular context
  12.158 +;             for lookup (set "all" to perform no lookups with that
  12.159 +;             host.
  12.160 +;
  12.161 +; permit - Permits this peer to search a given DUNDi context on
  12.162 +;          the local system.  Set "all" to permit this host to
  12.163 +;          lookup all contexts.  This is also a context for which
  12.164 +;          we will create/forward PRECACHE commands.
  12.165 +;
  12.166 +; deny -   Denies this peer to search a given DUNDi context on
  12.167 +;          the local system.  Set "all" to deny this host to
  12.168 +;          lookup all contexts.
  12.169 +;
  12.170 +; model - inbound, outbound, or symmetric for whether we receive 
  12.171 +;         requests only, transmit requests only, or do both.
  12.172 +;
  12.173 +; precache - Utilize/Permit precaching with this peer (to pre
  12.174 +;            cache means to provide an answer when no request
  12.175 +;            was made and is used so that machines with few
  12.176 +;            routes can push those routes up a to a higher level).
  12.177 +;            outgoing means we send precache routes to this peer,
  12.178 +;            incoming means we permit this peer to send us
  12.179 +;            precache routes.  symmetric means we do both.
  12.180 +;
  12.181 +; Note: You cannot mix symmetric/outbound model with symmetric/inbound
  12.182 +; precache, nor can you mix symmetric/inbound model with symmetric/outbound
  12.183 +; precache.
  12.184 +;
  12.185 +;
  12.186 +; The '*' peer is special and matches an unspecified entity
  12.187 +;
  12.188 +
  12.189 +;
  12.190 +; Sample Primary e164 DUNDi peer
  12.191 +;
  12.192 +;[00:50:8B:F3:75:BB]
  12.193 +;model = symmetric
  12.194 +;host = 64.215.96.114
  12.195 +;inkey = digium
  12.196 +;outkey = misery
  12.197 +;include = e164
  12.198 +;permit = e164
  12.199 +;qualify = yes
  12.200 +
  12.201 +;
  12.202 +; Sample Secondary e164 DUNDi peer
  12.203 +;
  12.204 +;[00:A0:C9:96:92:84]
  12.205 +;model = symmetric
  12.206 +;host = misery.digium.com
  12.207 +;inkey = misery
  12.208 +;outkey = ourkey
  12.209 +;include = e164
  12.210 +;permit = e164
  12.211 +;qualify = yes
  12.212 +;order = secondary
  12.213 +
  12.214 +;
  12.215 +; Sample "push mode" downstream host
  12.216 +;
  12.217 +;[00:0C:76:96:75:28]
  12.218 +;model = inbound
  12.219 +;host = dynamic
  12.220 +;precache = inbound
  12.221 +;inkey = littleguy
  12.222 +;outkey = ourkey
  12.223 +;include = e164	; In this case used only for precaching
  12.224 +;permit = e164      
  12.225 +;qualify = yes
  12.226 +
  12.227 +;
  12.228 +; Sample "push mode" upstream host
  12.229 +;
  12.230 +;[00:07:E9:3B:76:60]
  12.231 +;model = outbound
  12.232 +;precache = outbound
  12.233 +;host = 216.207.245.34
  12.234 +;register = yes
  12.235 +;inkey = dhcp34
  12.236 +;permit = all ; In this case used only for precaching
  12.237 +;include = all 
  12.238 +;qualify = yes
  12.239 +;outkey=foo
  12.240 +
  12.241 +;[*]
  12.242 +;
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/asterisk/enum.conf	Mon Apr 27 12:19:05 2009 +0200
    13.3 @@ -0,0 +1,22 @@
    13.4 +;
    13.5 +; ENUM Configuration for resolving phone numbers over DNS
    13.6 +;
    13.7 +; Sample config for Asterisk
    13.8 +; This file is reloaded at "module reload enum" in the CLI
    13.9 +;
   13.10 +;[general]
   13.11 +;
   13.12 +; The search list for domains may be customized.  Domains are searched
   13.13 +; in the order they are listed here.
   13.14 +;
   13.15 +;search => e164.arpa
   13.16 +;
   13.17 +; If you'd like to use the E.164.org public ENUM registry in addition
   13.18 +; to the official e164.arpa one, uncomment the following line
   13.19 +;
   13.20 +;search => e164.org
   13.21 +;
   13.22 +; As there are more H323 drivers available you have to select to which
   13.23 +; drive a H323 URI will map. Default is "H323".
   13.24 +;
   13.25 +;h323driver => H323
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/asterisk/extensions.conf	Mon Apr 27 12:19:05 2009 +0200
    14.3 @@ -0,0 +1,614 @@
    14.4 +; extensions.conf - the Asterisk dial plan
    14.5 +;
    14.6 +; Static extension configuration file, used by
    14.7 +; the pbx_config module. This is where you configure all your 
    14.8 +; inbound and outbound calls in Asterisk. 
    14.9 +; 
   14.10 +; This configuration file is reloaded 
   14.11 +; - With the "dialplan reload" command in the CLI
   14.12 +; - With the "reload" command (that reloads everything) in the CLI
   14.13 +
   14.14 +;
   14.15 +; The "General" category is for certain variables.  
   14.16 +;
   14.17 +;[general]
   14.18 +;
   14.19 +; If static is set to no, or omitted, then the pbx_config will rewrite
   14.20 +; this file when extensions are modified.  Remember that all comments
   14.21 +; made in the file will be lost when that happens. 
   14.22 +;
   14.23 +; XXX Not yet implemented XXX
   14.24 +;
   14.25 +;static=yes
   14.26 +;
   14.27 +; if static=yes and writeprotect=no, you can save dialplan by
   14.28 +; CLI command "dialplan save" too
   14.29 +;
   14.30 +;writeprotect=no
   14.31 +;
   14.32 +; If autofallthrough is set, then if an extension runs out of
   14.33 +; things to do, it will terminate the call with BUSY, CONGESTION
   14.34 +; or HANGUP depending on Asterisk's best guess. This is the default.
   14.35 +;
   14.36 +; If autofallthrough is not set, then if an extension runs out of 
   14.37 +; things to do, Asterisk will wait for a new extension to be dialed 
   14.38 +; (this is the original behavior of Asterisk 1.0 and earlier).
   14.39 +;
   14.40 +;autofallthrough=no
   14.41 +;
   14.42 +; If clearglobalvars is set, global variables will be cleared 
   14.43 +; and reparsed on an extensions reload, or Asterisk reload.
   14.44 +;
   14.45 +; If clearglobalvars is not set, then global variables will persist
   14.46 +; through reloads, and even if deleted from the extensions.conf or
   14.47 +; one of its included files, will remain set to the previous value.
   14.48 +;
   14.49 +; NOTE: A complication sets in, if you put your global variables into
   14.50 +; the AEL file, instead of the extensions.conf file. With clearglobalvars
   14.51 +; set, a "reload" will often leave the globals vars cleared, because it
   14.52 +; is not unusual to have extensions.conf (which will have no globals)
   14.53 +; load after the extensions.ael file (where the global vars are stored).
   14.54 +; So, with "reload" in this particular situation, first the AEL file will
   14.55 +; clear and then set all the global vars, then, later, when the extensions.conf
   14.56 +; file is loaded, the global vars are all cleared, and then not set, because
   14.57 +; they are not stored in the extensions.conf file.
   14.58 +;
   14.59 +;clearglobalvars=no
   14.60 +;
   14.61 +; If priorityjumping is set to 'yes', then applications that support
   14.62 +; 'jumping' to a different priority based on the result of their operations
   14.63 +; will do so (this is backwards compatible behavior with pre-1.2 releases
   14.64 +; of Asterisk). Individual applications can also be requested to do this
   14.65 +; by passing a 'j' option in their arguments.
   14.66 +;
   14.67 +;priorityjumping=yes
   14.68 +;
   14.69 +; User context is where entries from users.conf are registered.  The
   14.70 +; default value is 'default'
   14.71 +;
   14.72 +;userscontext=default
   14.73 +;
   14.74 +; You can include other config files, use the #include command
   14.75 +; (without the ';'). Note that this is different from the "include" command
   14.76 +; that includes contexts within other contexts. The #include command works
   14.77 +; in all asterisk configuration files.
   14.78 +;#include "filename.conf"
   14.79 +
   14.80 +; The "Globals" category contains global variables that can be referenced
   14.81 +; in the dialplan with the GLOBAL dialplan function:
   14.82 +; ${GLOBAL(VARIABLE)}
   14.83 +; ${${GLOBAL(VARIABLE)}} or ${text${GLOBAL(VARIABLE)}} or any hybrid
   14.84 +; Unix/Linux environmental variables can be reached with the ENV dialplan
   14.85 +; function: ${ENV(VARIABLE)}
   14.86 +;
   14.87 +;[globals]
   14.88 +;CONSOLE=Console/dsp				; Console interface for demo
   14.89 +;CONSOLE=Zap/1
   14.90 +;CONSOLE=Phone/phone0
   14.91 +;IAXINFO=guest					; IAXtel username/password
   14.92 +;IAXINFO=myuser:mypass
   14.93 +;TRUNK=Zap/G2					; Trunk interface
   14.94 +;
   14.95 +; Note the 'G2' in the TRUNK variable above. It specifies which group (defined
   14.96 +; in zapata.conf) to dial, i.e. group 2, and how to choose a channel to use in
   14.97 +; the specified group. The four possible options are:
   14.98 +;
   14.99 +; g: select the lowest-numbered non-busy Zap channel
  14.100 +;    (aka. ascending sequential hunt group).
  14.101 +; G: select the highest-numbered non-busy Zap channel
  14.102 +;    (aka. descending sequential hunt group).
  14.103 +; r: use a round-robin search, starting at the next highest channel than last
  14.104 +;    time (aka. ascending rotary hunt group).
  14.105 +; R: use a round-robin search, starting at the next lowest channel than last
  14.106 +;    time (aka. descending rotary hunt group).
  14.107 +;
  14.108 +;TRUNKMSD=1					; MSD digits to strip (usually 1 or 0)
  14.109 +;TRUNK=IAX2/user:pass@provider
  14.110 +
  14.111 +;
  14.112 +; Any category other than "General" and "Globals" represent 
  14.113 +; extension contexts, which are collections of extensions.  
  14.114 +;
  14.115 +; Extension names may be numbers, letters, or combinations
  14.116 +; thereof. If an extension name is prefixed by a '_'
  14.117 +; character, it is interpreted as a pattern rather than a
  14.118 +; literal.  In patterns, some characters have special meanings:
  14.119 +;
  14.120 +;   X - any digit from 0-9
  14.121 +;   Z - any digit from 1-9
  14.122 +;   N - any digit from 2-9
  14.123 +;   [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
  14.124 +;   . - wildcard, matches anything remaining (e.g. _9011. matches 
  14.125 +;	anything starting with 9011 excluding 9011 itself)
  14.126 +;   ! - wildcard, causes the matching process to complete as soon as
  14.127 +;       it can unambiguously determine that no other matches are possible
  14.128 +;
  14.129 +; For example the extension _NXXXXXX would match normal 7 digit dialings, 
  14.130 +; while _1NXXNXXXXXX would represent an area code plus phone number
  14.131 +; preceded by a one.
  14.132 +;
  14.133 +; Each step of an extension is ordered by priority, which must
  14.134 +; always start with 1 to be considered a valid extension.  The priority
  14.135 +; "next" or "n" means the previous priority plus one, regardless of whether
  14.136 +; the previous priority was associated with the current extension or not.
  14.137 +; The priority "same" or "s" means the same as the previously specified
  14.138 +; priority, again regardless of whether the previous entry was for the
  14.139 +; same extension.  Priorities may be immediately followed by a plus sign
  14.140 +; and another integer to add that amount (most useful with 's' or 'n').  
  14.141 +; Priorities may then also have an alias, or label, in 
  14.142 +; parenthesis after their name which can be used in goto situations
  14.143 +;
  14.144 +; Contexts contain several lines, one for each step of each
  14.145 +; extension, which can take one of two forms as listed below,
  14.146 +; with the first form being preferred. 
  14.147 +;
  14.148 +;[context]
  14.149 +;exten => someexten,{priority|label{+|-}offset}[(alias)],application(arg1,arg2,...)
  14.150 +;exten => someexten,{priority|label{+|-}offset}[(alias)],application,arg1|arg2...
  14.151 +;
  14.152 +; Included Contexts
  14.153 +;
  14.154 +; One may include another context in the current one as well, optionally with a
  14.155 +; date and time.  Included contexts are included in the order
  14.156 +; they are listed.
  14.157 +; The reason a context would include other contexts is for their 
  14.158 +; extensions.
  14.159 +; The algorithm to find an extension is recursive, and works in this
  14.160 +; fashion: 
  14.161 +;	 first, given a stack on which to store context references, 
  14.162 +;           push the context to find the extension onto the stack...
  14.163 +;    a) Try to find a matching extension in the context at the top of 
  14.164 +;       the stack, and, if found, begin executing the priorities
  14.165 +;       there in sequence.
  14.166 +;    b) If not found, Search the switches, if any declared, in
  14.167 +;       sequence.
  14.168 +;    c) If still not found, for each include, push that context onto 
  14.169 +;       the top of the context stack, and recurse to a).
  14.170 +;    d) If still not found, pop the entry from the top of the stack; 
  14.171 +;       if the stack is empty, the search has failed. If it's not, 
  14.172 +;       continue with the next context in c).
  14.173 +; This is a depth-first traversal, and stops with the first context 
  14.174 +; that provides a matching extension. As usual, if more than one
  14.175 +; pattern in a context will match, the 'best' match will win.
  14.176 +; Please note that that extensions found in an included context are
  14.177 +; treated as if they were in the context from which the search began.
  14.178 +; The PBX's notion of the "current context" is not changed.
  14.179 +; Please note that in a context, it does not matter where an include
  14.180 +; directive occurs. Whether at the top, or near the bottom, the effect 
  14.181 +; will be the same. The only thing that matters is that if there is 
  14.182 +; more than one include directive, they will be searched for extensions 
  14.183 +; in order, first to last.
  14.184 +; Also please note that pattern matches (like _9XX) are not treated
  14.185 +; any differently than exact matches (like 987). Also note that the
  14.186 +; order of extensions in a context have no affect on the outcome.
  14.187 +;
  14.188 +; Timing list for includes is 
  14.189 +;
  14.190 +;   <time range>|<days of week>|<days of month>|<months>
  14.191 +;
  14.192 +; Note that ranges may be specified to wrap around the ends.  Also, minutes are
  14.193 +; fine-grained only down to the closest even minute.
  14.194 +;
  14.195 +;include => daytime|9:00-17:00|mon-fri|*|*
  14.196 +;include => weekend|*|sat-sun|*|*
  14.197 +;include => weeknights|17:02-8:58|mon-fri|*|*
  14.198 +;
  14.199 +; ignorepat can be used to instruct drivers to not cancel dialtone upon
  14.200 +; receipt of a particular pattern.  The most commonly used example is
  14.201 +; of course '9' like this:
  14.202 +;
  14.203 +;ignorepat => 9
  14.204 +;
  14.205 +; so that dialtone remains even after dialing a 9.
  14.206 +;
  14.207 +
  14.208 +;
  14.209 +; Sample entries for extensions.conf
  14.210 +;
  14.211 +;
  14.212 +;[dundi-e164-canonical]
  14.213 +;
  14.214 +; List canonical entries here
  14.215 +;
  14.216 +;exten => 12564286000,1,Macro(stdexten,6000,IAX2/foo)
  14.217 +;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
  14.218 +
  14.219 +;[dundi-e164-customers]
  14.220 +;
  14.221 +; If you are an ITSP or Reseller, list your customers here.
  14.222 +;
  14.223 +;exten => _12564286000,1,Dial(SIP/customer1)
  14.224 +;exten => _12564286001,1,Dial(IAX2/customer2)
  14.225 +
  14.226 +;[dundi-e164-via-pstn]
  14.227 +;
  14.228 +; If you are freely delivering calls to the PSTN, list them here
  14.229 +;
  14.230 +;exten => _1256428XXXX,1,Dial(Zap/G2/${EXTEN:7}) ; Expose all of 256-428 
  14.231 +;exten => _1256325XXXX,1,Dial(Zap/G2/${EXTEN:7}) ; Ditto for 256-325
  14.232 +
  14.233 +;[dundi-e164-local]
  14.234 +;
  14.235 +; Context to put your dundi IAX2 or SIP user in for
  14.236 +; full access
  14.237 +;
  14.238 +;include => dundi-e164-canonical
  14.239 +;include => dundi-e164-customers
  14.240 +;include => dundi-e164-via-pstn
  14.241 +
  14.242 +;[dundi-e164-switch]
  14.243 +;
  14.244 +; Just a wrapper for the switch
  14.245 +;
  14.246 +;switch => DUNDi/e164
  14.247 +
  14.248 +;[dundi-e164-lookup]
  14.249 +;
  14.250 +; Locally to lookup, try looking for a local E.164 solution
  14.251 +; then try DUNDi if we don't have one.
  14.252 +;
  14.253 +;include => dundi-e164-local
  14.254 +;include => dundi-e164-switch
  14.255 +;
  14.256 +; DUNDi can also be implemented as a Macro instead of using 
  14.257 +; the Local channel driver. 
  14.258 +;
  14.259 +;[macro-dundi-e164]
  14.260 +;
  14.261 +; ARG1 is the extension to Dial
  14.262 +;
  14.263 +; Extension "s" is not a wildcard extension that matches "anything".
  14.264 +; In macros, it is the start extension. In most other cases, 
  14.265 +; you have to goto "s" to execute that extension.
  14.266 +;
  14.267 +; For wildcard matches, see above - all pattern matches start with
  14.268 +; an underscore.
  14.269 +;exten => s,1,Goto(${ARG1},1)
  14.270 +;include => dundi-e164-lookup
  14.271 +
  14.272 +;
  14.273 +; Here are the entries you need to participate in the IAXTEL
  14.274 +; call routing system.  Most IAXTEL numbers begin with 1-700, but
  14.275 +; there are exceptions.  For more information, and to sign
  14.276 +; up, please go to www.gnophone.com or www.iaxtel.com
  14.277 +;
  14.278 +;[iaxtel700]
  14.279 +;exten => _91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel)
  14.280 +
  14.281 +;
  14.282 +; The SWITCH statement permits a server to share the dialplan with
  14.283 +; another server. Use with care: Reciprocal switch statements are not
  14.284 +; allowed (e.g. both A -> B and B -> A), and the switched server needs
  14.285 +; to be on-line or else dialing can be severly delayed.
  14.286 +;
  14.287 +;[iaxprovider]
  14.288 +;switch => IAX2/user:[key]@myserver/mycontext
  14.289 +
  14.290 +;[trunkint]
  14.291 +;
  14.292 +; International long distance through trunk
  14.293 +;
  14.294 +;exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
  14.295 +;exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  14.296 +
  14.297 +;[trunkld]
  14.298 +;
  14.299 +; Long distance context accessed through trunk
  14.300 +;
  14.301 +;exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
  14.302 +;exten => _91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  14.303 +
  14.304 +;[trunklocal]
  14.305 +;
  14.306 +; Local seven-digit dialing accessed through trunk interface
  14.307 +;
  14.308 +;exten => _9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  14.309 +
  14.310 +;[trunktollfree]
  14.311 +;
  14.312 +; Long distance context accessed through trunk interface
  14.313 +;
  14.314 +;exten => _91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  14.315 +;exten => _91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  14.316 +;exten => _91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  14.317 +;exten => _91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
  14.318 +
  14.319 +;[international]
  14.320 +;
  14.321 +; Master context for international long distance
  14.322 +;
  14.323 +;ignorepat => 9
  14.324 +;include => longdistance
  14.325 +;include => trunkint
  14.326 +
  14.327 +;[longdistance]
  14.328 +;
  14.329 +; Master context for long distance
  14.330 +;
  14.331 +;ignorepat => 9
  14.332 +;include => local
  14.333 +;include => trunkld
  14.334 +
  14.335 +;[local]
  14.336 +;
  14.337 +; Master context for local, toll-free, and iaxtel calls only
  14.338 +;
  14.339 +;ignorepat => 9
  14.340 +;include => default
  14.341 +;include => trunklocal
  14.342 +;include => iaxtel700
  14.343 +;include => trunktollfree
  14.344 +;include => iaxprovider
  14.345 +
  14.346 +;Include parkedcalls (or the context you define in features conf)
  14.347 +;to enable call parking.
  14.348 +;include => parkedcalls
  14.349 +;
  14.350 +; You can use an alternative switch type as well, to resolve
  14.351 +; extensions that are not known here, for example with remote 
  14.352 +; IAX switching you transparently get access to the remote
  14.353 +; Asterisk PBX
  14.354 +; 
  14.355 +; switch => IAX2/user:password@bigserver/local
  14.356 +;
  14.357 +; An "lswitch" is like a switch but is literal, in that
  14.358 +; variable substitution is not performed at load time
  14.359 +; but is passed to the switch directly (presumably to
  14.360 +; be substituted in the switch routine itself)
  14.361 +;
  14.362 +; lswitch => Loopback/12${EXTEN}@othercontext
  14.363 +;
  14.364 +; An "eswitch" is like a switch but the evaluation of
  14.365 +; variable substitution is performed at runtime before
  14.366 +; being passed to the switch routine.
  14.367 +;
  14.368 +; eswitch => IAX2/context@${CURSERVER}
  14.369 +
  14.370 +;[macro-trunkdial]
  14.371 +;
  14.372 +; Standard trunk dial macro (hangs up on a dialstatus that should 
  14.373 +; terminate call)
  14.374 +;   ${ARG1} - What to dial
  14.375 +;
  14.376 +;exten => s,1,Dial(${ARG1})
  14.377 +;exten => s,n,Goto(s-${DIALSTATUS},1)
  14.378 +;exten => s-NOANSWER,1,Hangup
  14.379 +;exten => s-BUSY,1,Hangup
  14.380 +;exten => _s-.,1,NoOp
  14.381 +
  14.382 +;[macro-stdexten];
  14.383 +;
  14.384 +; Standard extension macro:
  14.385 +;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
  14.386 +;   ${ARG2} - Device(s) to ring
  14.387 +;
  14.388 +;exten => s,1,Dial(${ARG2},20)			; Ring the interface, 20 seconds maximum
  14.389 +;exten => s,2,Goto(s-${DIALSTATUS},1)		; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
  14.390 +
  14.391 +;exten => s-NOANSWER,1,Voicemail(${ARG1},u)	; If unavailable, send to voicemail w/ unavail announce
  14.392 +;exten => s-NOANSWER,2,Goto(default,s,1)		; If they press #, return to start
  14.393 +
  14.394 +;exten => s-BUSY,1,Voicemail(${ARG1},b)		; If busy, send to voicemail w/ busy announce
  14.395 +;exten => s-BUSY,2,Goto(default,s,1)		; If they press #, return to start
  14.396 +
  14.397 +;exten => _s-.,1,Goto(s-NOANSWER,1)		; Treat anything else as no answer
  14.398 +
  14.399 +;exten => a,1,VoicemailMain(${ARG1})		; If they press *, send the user into VoicemailMain
  14.400 +
  14.401 +;[macro-stdPrivacyexten];
  14.402 +;
  14.403 +; Standard extension macro:
  14.404 +;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
  14.405 +;   ${ARG2} - Device(s) to ring
  14.406 +;   ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority)
  14.407 +;   ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)`
  14.408 +;
  14.409 +;exten => s,1,Dial(${ARG2},20|p)			; Ring the interface, 20 seconds maximum, call screening 
  14.410 +						; option (or use P for databased call screening)
  14.411 +;exten => s,2,Goto(s-${DIALSTATUS},1)		; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
  14.412 +
  14.413 +;exten => s-NOANSWER,1,Voicemail(${ARG1},u)	; If unavailable, send to voicemail w/ unavail announce
  14.414 +;exten => s-NOANSWER,2,Goto(default,s,1)		; If they press #, return to start
  14.415 +
  14.416 +;exten => s-BUSY,1,Voicemail(${ARG1},b)		; If busy, send to voicemail w/ busy announce
  14.417 +;exten => s-BUSY,2,Goto(default,s,1)		; If they press #, return to start
  14.418 +
  14.419 +;exten => s-DONTCALL,1,Goto(${ARG3},s,1)		; Callee chose to send this call to a polite "Don't call again" script.
  14.420 +
  14.421 +;exten => s-TORTURE,1,Goto(${ARG4},s,1)		; Callee chose to send this call to a telemarketer torture script.
  14.422 +
  14.423 +;exten => _s-.,1,Goto(s-NOANSWER,1)		; Treat anything else as no answer
  14.424 +
  14.425 +;exten => a,1,VoicemailMain(${ARG1})		; If they press *, send the user into VoicemailMain
  14.426 +
  14.427 +;[macro-page];
  14.428 +;
  14.429 +; Paging macro:
  14.430 +;
  14.431 +;       Check to see if SIP device is in use and DO NOT PAGE if they are
  14.432 +;
  14.433 +;   ${ARG1} - Device to page
  14.434 +
  14.435 +;exten => s,1,ChanIsAvail(${ARG1}|js)			; j is for Jump and s is for ANY call
  14.436 +;exten => s,n,GoToIf([${AVAILSTATUS} = "1"]?autoanswer:fail)
  14.437 +;exten => s,n(autoanswer),Set(_ALERT_INFO="RA")			; This is for the PolyComs
  14.438 +;exten => s,n,SIPAddHeader(Call-Info: Answer-After=0)	; This is for the Grandstream, Snoms, and Others
  14.439 +;exten => s,n,NoOp()					; Add others here and Post on the Wiki!!!!
  14.440 +;exten => s,n,Dial(${ARG1}||)
  14.441 +;exten => s,n(fail),Hangup
  14.442 +
  14.443 +
  14.444 +;[demo]
  14.445 +;
  14.446 +; We start with what to do when a call first comes in.
  14.447 +;
  14.448 +;exten => s,1,Wait(1)			; Wait a second, just for fun
  14.449 +;exten => s,n,Answer			; Answer the line
  14.450 +;exten => s,n,Set(TIMEOUT(digit)=5)	; Set Digit Timeout to 5 seconds
  14.451 +;exten => s,n,Set(TIMEOUT(response)=10)	; Set Response Timeout to 10 seconds
  14.452 +;exten => s,n(restart),BackGround(demo-congrats)	; Play a congratulatory message
  14.453 +;exten => s,n(instruct),BackGround(demo-instruct)	; Play some instructions
  14.454 +;exten => s,n,WaitExten			; Wait for an extension to be dialed.
  14.455 +
  14.456 +;exten => 2,1,BackGround(demo-moreinfo)	; Give some more information.
  14.457 +;exten => 2,n,Goto(s,instruct)
  14.458 +
  14.459 +;exten => 3,1,Set(LANGUAGE()=fr)		; Set language to french
  14.460 +;exten => 3,n,Goto(s,restart)		; Start with the congratulations
  14.461 +
  14.462 +;exten => 1000,1,Goto(default,s,1)
  14.463 +;
  14.464 +; We also create an example user, 1234, who is on the console and has
  14.465 +; voicemail, etc.
  14.466 +;
  14.467 +;exten => 1234,1,Playback(transfer,skip)		; "Please hold while..." 
  14.468 +					; (but skip if channel is not up)
  14.469 +;exten => 1234,n,Macro(stdexten,1234,${GLOBAL(CONSOLE)})
  14.470 +
  14.471 +;exten => 1235,1,Voicemail(1234,u)		; Right to voicemail
  14.472 +
  14.473 +;exten => 1236,1,Dial(Console/dsp)		; Ring forever
  14.474 +;exten => 1236,n,Voicemail(1234,b)		; Unless busy
  14.475 +
  14.476 +;
  14.477 +; # for when they're done with the demo
  14.478 +;
  14.479 +;exten => #,1,Playback(demo-thanks)	; "Thanks for trying the demo"
  14.480 +;exten => #,n,Hangup			; Hang them up.
  14.481 +
  14.482 +;
  14.483 +; A timeout and "invalid extension rule"
  14.484 +;
  14.485 +;exten => t,1,Goto(#,1)			; If they take too long, give up
  14.486 +;exten => i,1,Playback(invalid)		; "That's not valid, try again"
  14.487 +
  14.488 +;
  14.489 +; Create an extension, 500, for dialing the
  14.490 +; Asterisk demo.
  14.491 +;
  14.492 +;exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
  14.493 +;exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default)	; Call the Asterisk demo
  14.494 +;exten => 500,n,Playback(demo-nogo)	; Couldn't connect to the demo site
  14.495 +;exten => 500,n,Goto(s,6)		; Return to the start over message.
  14.496 +
  14.497 +;
  14.498 +; Create an extension, 600, for evaluating echo latency.
  14.499 +;
  14.500 +;exten => 600,1,Playback(demo-echotest)	; Let them know what's going on
  14.501 +;exten => 600,n,Echo			; Do the echo test
  14.502 +;exten => 600,n,Playback(demo-echodone)	; Let them know it's over
  14.503 +;exten => 600,n,Goto(s,6)		; Start over
  14.504 +
  14.505 +;
  14.506 +;	You can use the Macro Page to intercom a individual user
  14.507 +;exten => 76245,1,Macro(page,SIP/Grandstream1)
  14.508 +; or if your peernames are the same as extensions
  14.509 +;exten => _7XXX,1,Macro(page,SIP/${EXTEN})
  14.510 +;
  14.511 +;
  14.512 +; System Wide Page at extension 7999
  14.513 +;
  14.514 +;exten => 7999,1,Set(TIMEOUT(absolute)=60)
  14.515 +;exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n|d)
  14.516 +
  14.517 +; Give voicemail at extension 8500
  14.518 +;
  14.519 +;exten => 8500,1,VoicemailMain
  14.520 +;exten => 8500,n,Goto(s,6)
  14.521 +;
  14.522 +; Here's what a phone entry would look like (IXJ for example)
  14.523 +;
  14.524 +;exten => 1265,1,Dial(Phone/phone0,15)
  14.525 +;exten => 1265,n,Goto(s,5)
  14.526 +
  14.527 +;
  14.528 +;	The page context calls up the page macro that sets variables needed for auto-answer
  14.529 +;	It is in is own context to make calling it from the Page() application as simple as 
  14.530 +;	Local/{peername}@page
  14.531 +;
  14.532 +;[page]
  14.533 +;exten => _X.,1,Macro(page,SIP/${EXTEN})
  14.534 +
  14.535 +;[mainmenu]
  14.536 +;
  14.537 +; Example "main menu" context with submenu
  14.538 +;
  14.539 +;exten => s,1,Answer
  14.540 +;exten => s,n,Background(thanks)		; "Thanks for calling press 1 for sales, 2 for support, ..."
  14.541 +;exten => s,n,WaitExten
  14.542 +;exten => 1,1,Goto(submenu,s,1)
  14.543 +;exten => 2,1,Hangup
  14.544 +;include => default
  14.545 +;
  14.546 +;[submenu]
  14.547 +;exten => s,1,Ringing					; Make them comfortable with 2 seconds of ringback
  14.548 +;exten => s,n,Wait,2
  14.549 +;exten => s,n,Background(submenuopts)	; "Thanks for calling the sales department.  Press 1 for steve, 2 for..."
  14.550 +;exten => s,n,WaitExten
  14.551 +;exten => 1,1,Goto(default,steve,1)
  14.552 +;exten => 2,1,Goto(default,mark,2)
  14.553 +
  14.554 +;[default]
  14.555 +;
  14.556 +; By default we include the demo.  In a production system, you 
  14.557 +; probably don't want to have the demo there.
  14.558 +;
  14.559 +;include => demo
  14.560 +
  14.561 +;
  14.562 +; An extension like the one below can be used for FWD, Nikotel, sipgate etc.
  14.563 +; Note that you must have a [sipprovider] section in sip.conf
  14.564 +;
  14.565 +;exten => _41X.,1,Dial(SIP/${EXTEN:2}@sipprovider,,r)
  14.566 +
  14.567 +; Real extensions would go here. Generally you want real extensions to be
  14.568 +; 4 or 5 digits long (although there is no such requirement) and start with a
  14.569 +; single digit that is fairly large (like 6 or 7) so that you have plenty of
  14.570 +; room to overlap extensions and menu options without conflict.  You can alias
  14.571 +; them with names, too, and use global variables
  14.572 +
  14.573 +;exten => 6245,hint,SIP/Grandstream1&SIP/Xlite1,Joe Schmoe ; Channel hints for presence
  14.574 +;exten => 6245,1,Dial(SIP/Grandstream1,20,rt)	; permit transfer
  14.575 +;exten => 6245,n(dial),Dial(${HINT},20,rtT)	; Use hint as listed
  14.576 +;exten => 6245,n,Voicemail(6245,u)		; Voicemail (unavailable)
  14.577 +;exten => 6245,s+1,Hangup			; s+1, same as n
  14.578 +;exten => 6245,dial+101,Voicemail(6245,b)	; Voicemail (busy)
  14.579 +;exten => 6361,1,Dial(IAX2/JaneDoe,,rm)		; ring without time limit
  14.580 +;exten => 6389,1,Dial(MGCP/aaln/1@192.168.0.14)
  14.581 +;exten => 6390,1,Dial(JINGLE/caller/callee) ; Dial via jingle using labels
  14.582 +;exten => 6391,1,Dial(JINGLE/asterisk@digium.com/mogorman@astjab.org) ;Dial via jingle using asterisk as the transport and calling mogorman.
  14.583 +;exten => 6394,1,Dial(Local/6275/n)		; this will dial ${MARK}
  14.584 +
  14.585 +;exten => 6275,1,Macro(stdexten,6275,${MARK})	; assuming ${MARK} is something like Zap/2
  14.586 +;exten => mark,1,Goto(6275|1)			; alias mark to 6275
  14.587 +;exten => 6536,1,Macro(stdexten,6236,${WIL})	; Ditto for wil
  14.588 +;exten => wil,1,Goto(6236|1)
  14.589 +
  14.590 +;If you want to subscribe to the status of a parking space, this is
  14.591 +;how you do it. Subscribe to extension 6600 in sip, and you will see
  14.592 +;the status of the first parking lot with this extensions' help
  14.593 +;exten => 6600,hint,park:701@parkedcalls
  14.594 +;exten => 6600,1,noop
  14.595 +;
  14.596 +; Some other handy things are an extension for checking voicemail via
  14.597 +; voicemailmain
  14.598 +;
  14.599 +;exten => 8500,1,VoicemailMain
  14.600 +;exten => 8500,n,Hangup
  14.601 +;
  14.602 +; Or a conference room (you'll need to edit meetme.conf to enable this room)
  14.603 +;
  14.604 +;exten => 8600,1,Meetme(1234)
  14.605 +;
  14.606 +; Or playing an announcement to the called party, as soon it answers
  14.607 +;
  14.608 +;exten = 8700,1,Dial(${MARK},30,A(/path/to/my/announcemsg))
  14.609 +;
  14.610 +; For more information on applications, just type "core show applications" at your
  14.611 +; friendly Asterisk CLI prompt.
  14.612 +;
  14.613 +; "core show application <command>" will show details of how you
  14.614 +; use that particular application in this file, the dial plan. 
  14.615 +; "core show functions" will list all dialplan functions
  14.616 +; "core show function <COMMAND>" will show you more information about
  14.617 +; one function. Remember that function names are UPPER CASE.
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/asterisk/features.conf	Mon Apr 27 12:19:05 2009 +0200
    15.3 @@ -0,0 +1,95 @@
    15.4 +;
    15.5 +; Sample Call Features (parking, transfer, etc) configuration
    15.6 +;
    15.7 +
    15.8 +;[general]
    15.9 +;parkext => 700			; What extension to dial to park
   15.10 +;parkpos => 701-720		; What extensions to park calls on. These needs to be
   15.11 +				; numeric, as Asterisk starts from the start position
   15.12 +				; and increments with one for the next parked call.
   15.13 +;context => parkedcalls		; Which context parked calls are in
   15.14 +;parkingtime => 45		; Number of seconds a call can be parked for 
   15.15 +				; (default is 45 seconds)
   15.16 +;courtesytone = beep		; Sound file to play to the parked caller 
   15.17 +				; when someone dials a parked call
   15.18 +				; or the Touch Monitor is activated/deactivated.
   15.19 +;parkedplay = caller		; Who to play the courtesy tone to when picking up a parked call
   15.20 +				; one of: parked, caller, both  (default is caller)
   15.21 +;adsipark = yes			; if you want ADSI parking announcements
   15.22 +;findslot => next		; Continue to the 'next' free parking space. 
   15.23 +				; Defaults to 'first' available
   15.24 +;parkedmusicclass=default	; This is the MOH class to use for the parked channel
   15.25 +				; as long as the class is not set on the channel directly
   15.26 +				; using Set(CHANNEL(musicclass)=whatever) in the dialplan
   15.27 +
   15.28 +;transferdigittimeout => 3	; Number of seconds to wait between digits when transferring a call
   15.29 +				; (default is 3 seconds)
   15.30 +;xfersound = beep		; to indicate an attended transfer is complete
   15.31 +;xferfailsound = beeperr	; to indicate a failed transfer
   15.32 +;pickupexten = *8		; Configure the pickup extension. (default is *8)
   15.33 +;featuredigittimeout = 500	; Max time (ms) between digits for 
   15.34 +				; feature activation  (default is 500 ms)
   15.35 +;atxfernoanswertimeout = 15	; Timeout for answer on attended transfer default is 15 seconds.
   15.36 +
   15.37 +; Note that the DTMF features listed below only work when two channels have answered and are bridged together.
   15.38 +; They can not be used while the remote party is ringing or in progress. If you require this feature you can use
   15.39 +; chan_local in combination with Answer to accomplish it.
   15.40 +
   15.41 +;[featuremap]
   15.42 +;blindxfer => #1		; Blind transfer  (default is #)
   15.43 +;disconnect => *0		; Disconnect  (default is *)
   15.44 +;automon => *1			; One Touch Record a.k.a. Touch Monitor
   15.45 +;atxfer => *2			; Attended transfer
   15.46 +;parkcall => #72                ; Park call (one step parking)
   15.47 +
   15.48 +;[applicationmap]
   15.49 +; Note that the DYNAMIC_FEATURES channel variable must be set to use the features
   15.50 +; defined here.  The value of DYNAMIC_FEATURES should be the names of the features
   15.51 +; to allow the channel to use separated by '#'.  For example:
   15.52 +;
   15.53 +;    Set(DYNAMIC_FEATURES=myfeature1#myfeature2#myfeature3)
   15.54 +;
   15.55 +;
   15.56 +; The syntax for declaring a dynamic feature is the following:
   15.57 +;
   15.58 +;<FeatureName> => <DTMF_sequence>,<ActivateOn>[/<ActivatedBy>],<Application>[,<AppArguments>[,MOH_Class]]
   15.59 +;
   15.60 +;  FeatureName   -> This is the name of the feature used in when setting the
   15.61 +;                   DYNAMIC_FEATURES variable to enable usage of this feature.
   15.62 +;  DTMF_sequence -> This is the key sequence used to activate this feature.
   15.63 +;  ActivateOn    -> This is the channel of the call that the application will be executed
   15.64 +;                   on. Valid values are "self" and "peer". "self" means run the
   15.65 +;                   application on the same channel that activated the feature. "peer"
   15.66 +;                   means run the application on the opposite channel from the one that
   15.67 +;                   has activated the feature.
   15.68 +;  ActivatedBy   -> This is which channel is allowed to activate this feature. Valid
   15.69 +;                   values are "caller", "callee", and "both". "both" is the default.
   15.70 +;                   The "caller" is the channel that executed the Dial application, while
   15.71 +;                   the "callee" is the channel called by the Dial application.
   15.72 +;  Application   -> This is the application to execute.
   15.73 +;  AppArguments  -> These are the arguments to be passed into the application.
   15.74 +;  MOH_Class     -> This is the music on hold class to play while the idle
   15.75 +;                   channel waits for the feature to complete. If left blank,
   15.76 +;                   no music will be played.
   15.77 +;
   15.78 +;
   15.79 +; IMPORTANT NOTE: The applicationmap is not intended to be used for all Asterisk
   15.80 +;   applications. When applications are used in extensions.conf, they are executed
   15.81 +;   by the PBX core. In this case, these applications are executed outside of the
   15.82 +;   PBX core, so it does *not* make sense to use any application which has any
   15.83 +;   concept of dialplan flow. Examples of this would be things like Macro, Goto,
   15.84 +;   Background, WaitExten, and many more.
   15.85 +;
   15.86 +; Enabling these features means that the PBX needs to stay in the media flow and
   15.87 +; media will not be re-directed if DTMF is sent in the media stream.
   15.88 +;
   15.89 +; Example Usage:
   15.90 +;
   15.91 +;testfeature => #9,peer,Playback,tt-monkeys  ;Allow both the caller and callee to play
   15.92 +;                                            ;tt-monkeys to the opposite channel
   15.93 +;
   15.94 +;pauseMonitor   => #1,self/callee,Pausemonitor     ;Allow the callee to pause monitoring
   15.95 +;                                                  ;on their channel
   15.96 +;unpauseMonitor => #3,self/callee,UnPauseMonitor   ;Allow the callee to unpause monitoring
   15.97 +;                                                  ;on their channel
   15.98 +;
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/asterisk/festival.conf	Mon Apr 27 12:19:05 2009 +0200
    16.3 @@ -0,0 +1,35 @@
    16.4 +;
    16.5 +; Festival Configuration
    16.6 +;
    16.7 +;[general]
    16.8 +;
    16.9 +; Host which runs the festival server (default : localhost);
   16.10 +;
   16.11 +;host=localhost
   16.12 +;
   16.13 +; Port on host where the festival server runs (default : 1314)
   16.14 +;
   16.15 +;port=1314
   16.16 +;
   16.17 +; Use cache (yes, no - defaults to no)
   16.18 +;
   16.19 +;usecache=yes
   16.20 +;
   16.21 +; If usecache=yes, a directory to store waveform cache files. 
   16.22 +; The cache is never cleared (yet), so you must take care of cleaning it
   16.23 +; yourself (just delete any or all files from the cache). 
   16.24 +; THIS DIRECTORY *MUST* EXIST and must be writable from the asterisk process.
   16.25 +; Defaults to /tmp/
   16.26 +;
   16.27 +;cachedir=/var/lib/asterisk/festivalcache/
   16.28 +;
   16.29 +; Festival command to send to the server.
   16.30 +; Defaults to: (tts_textasterisk "%s" 'file)(quit)\n
   16.31 +; %s is replaced by the desired text to say. The command MUST end with a 
   16.32 +; (quit) directive, or the cache handling mechanism will hang. Do not 
   16.33 +; forget the \n at the end. 
   16.34 +; 
   16.35 +;festivalcommand=(tts_textasterisk "%s" 'file)(quit)\n
   16.36 +;
   16.37 +;
   16.38 +
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/asterisk/followme.conf	Mon Apr 27 12:19:05 2009 +0200
    17.3 @@ -0,0 +1,86 @@
    17.4 +; Find-Me / Follow-Me Configuration File
    17.5 +;[general]
    17.6 +;
    17.7 +;featuredigittimeout=>5000
    17.8 +; The number of ms to wait for a digit input for the callee on whether to take the call or
    17.9 +; not before we consider them "done" entering digits.
   17.10 +;
   17.11 +;takecall=>1
   17.12 +; The global default keypress for the callee to take taking the current call. This can be
   17.13 +; a single digit or multiple digits. Default is "1".
   17.14 +;
   17.15 +;declinecall=>2
   17.16 +; The global default keypress for the callee to decline taking the current call. This can
   17.17 +; be a single digit or multiple digits. Default is "2".
   17.18 +;
   17.19 +;call-from-prompt=>followme/call-from
   17.20 +; The global default for the 'Incoming call from' message.
   17.21 +;
   17.22 +;norecording-prompt=>followme/no-recording
   17.23 +; The global default for the 'You have an incoming call' message when the caller elects
   17.24 +; not to leave their name or the option isn't set for them to do so.
   17.25 +;
   17.26 +;options-prompt=>followme/options
   17.27 +; The global default for the 'Press 1 to accept this call or press 2 to decline it' message.
   17.28 +;
   17.29 +;pls-hold-prompt=>followme/pls-hold-while-try
   17.30 +; The global default for 'Please hold while we try and connect your call' message.
   17.31 +;
   17.32 +;status-prompt=>followme/status
   17.33 +; The global default for 'The party you're calling isn't at their desk' message.
   17.34 +;
   17.35 +;sorry-prompt=>followme/sorry  
   17.36 +; The global default for 'I'm sorry, but we were unable to locate your party' message.
   17.37 +;
   17.38 +;
   17.39 +;[default]
   17.40 +;musicclass=>default
   17.41 +; The moh class that should be used for the caller while they are waiting to be connected.
   17.42 +;context=>default
   17.43 +; The context to dial the numbers from
   17.44 +;number=>01233456,25
   17.45 +; The a follow-me number to call. The format is:
   17.46 +; number=> <number to call[&2nd #[&3rd #]]> [, <timeout value in seconds> [, <order in follow-me>] ]
   17.47 +; You can specify as many of these numbers as you like. They will be dialed in the 
   17.48 +; order that you specify them in the config file OR as specified with the order field
   17.49 +; on the number prompt. As you can see from the example, forked dialing of multiple 
   17.50 +; numbers in the same step is supported with this application if you'd like to dial
   17.51 +; multiple numbers in the same followme step.
   17.52 +; It's also important to note that the timeout value is not the same
   17.53 +; as the timeout value you would use in app_dial. This timeout value is the amount of
   17.54 +; time allowed between the time the dialing step starts and the callee makes a choice
   17.55 +; on whether to take the call or not. That being the case, you may want to account for
   17.56 +; this time, and make this timeout longer than a timeout you might specify in app_dial.
   17.57 +;takecall=>1
   17.58 +; The keypress for the callee to take taking the current call. This can be
   17.59 +; a single digit or multiple digits. Default is the global default.
   17.60 +;
   17.61 +;declinecall=>2
   17.62 +; The keypress for the callee to decline taking the current call. This can
   17.63 +; be a single digit or multiple digits. Default is the global default.
   17.64 +;
   17.65 +;call-from-prompt=>followme/call-from
   17.66 +; The 'Incoming call from' message prompt. Default is the global default.
   17.67 +;
   17.68 +;followme-norecording-prompt=>followme/no-recording
   17.69 +; The 'You have an incoming call' message prompt when the caller elects
   17.70 +; not to leave their name or the option isn't set for them to do so. Default
   17.71 +; is the global default.
   17.72 +;
   17.73 +;followme-options-prompt=>followme/options
   17.74 +; The 'Press 1 to accept this call or press 2 to decline it' message prompt.
   17.75 +; Default is the global default.
   17.76 +;
   17.77 +;followme-pls-hold-prompt=>followme/pls-hold-while-try
   17.78 +; The 'Please hold while we try and connect your call' message prompt.
   17.79 +; Default is the global default.
   17.80 +;
   17.81 +;followme-status-prompt=>followme/status
   17.82 +; The 'The party you're calling isn't at their desk' message prompt.
   17.83 +; Default is the global default.
   17.84 +;
   17.85 +;followme-sorry-prompt=>followme/sorry  
   17.86 +; The 'I'm sorry, but we were unable to locate your party' message prompt. Default
   17.87 +; is the global default.
   17.88 +
   17.89 +
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/asterisk/indications.conf	Mon Apr 27 12:19:05 2009 +0200
    18.3 @@ -0,0 +1,733 @@
    18.4 +; indications.conf
    18.5 +; Configuration file for location specific tone indications
    18.6 +; used by the pbx_indications module.
    18.7 +;
    18.8 +; NOTE:
    18.9 +;    When adding countries to this file, please keep them in alphabetical
   18.10 +;    order according to the 2-character country codes!
   18.11 +;
   18.12 +; The [general] category is for certain global variables.
   18.13 +; All other categories are interpreted as location specific indications
   18.14 +;
   18.15 +;
   18.16 +;[general]
   18.17 +;country=us		; default location
   18.18 +
   18.19 +
   18.20 +; [example]
   18.21 +; description = string
   18.22 +;      The full name of your country, in English.
   18.23 +; alias = iso[,iso]*
   18.24 +;      List of other countries 2-letter iso codes, which have the same
   18.25 +;      tone indications.
   18.26 +; ringcadence = num[,num]*
   18.27 +;      List of durations the physical bell rings.
   18.28 +; dial = tonelist
   18.29 +;      Set of tones to be played when one picks up the hook.
   18.30 +; busy = tonelist
   18.31 +;      Set of tones played when the receiving end is busy.
   18.32 +; congestion = tonelist
   18.33 +;      Set of tones played when there is some congestion (on the network?)
   18.34 +; callwaiting = tonelist
   18.35 +;      Set of tones played when there is a call waiting in the background.
   18.36 +; dialrecall = tonelist
   18.37 +;      Not well defined; many phone systems play a recall dial tone after hook
   18.38 +;      flash.
   18.39 +; record = tonelist
   18.40 +;      Set of tones played when call recording is in progress.
   18.41 +; info = tonelist
   18.42 +;      Set of tones played with special information messages (e.g., "number is
   18.43 +;      out of service")
   18.44 +; 'name' = tonelist
   18.45 +;      Every other variable will be available as a shortcut for the "PlayList" command
   18.46 +;      but will not be used automatically by Asterisk.
   18.47 +;
   18.48 +;
   18.49 +; The tonelist itself is defined by a comma-separated sequence of elements.
   18.50 +; Each element consist of a frequency (f) with an optional duration (in ms)
   18.51 +; attached to it (f/duration). The frequency component may be a mixture of two
   18.52 +; frequencies (f1+f2) or a frequency modulated by another frequency (f1*f2).
   18.53 +; The implicit modulation depth is fixed at 90%, though.
   18.54 +; If the list element starts with a !, that element is NOT repeated,
   18.55 +; therefore, only if all elements start with !, the tonelist is time-limited,
   18.56 +; all others will repeat indefinitely.
   18.57 +;
   18.58 +; concisely:
   18.59 +;   element = [!]freq[+|*freq2][/duration]
   18.60 +;   tonelist = element[,element]*
   18.61 +;
   18.62 +; Please note that SPACES ARE NOT ALLOWED in tone lists!
   18.63 +;
   18.64 +
   18.65 +;[at]
   18.66 +;description = Austria
   18.67 +;ringcadence = 1000,5000
   18.68 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
   18.69 +;dial = 420
   18.70 +;busy = 420/400,0/400
   18.71 +;ring = 420/1000,0/5000
   18.72 +;congestion = 420/200,0/200
   18.73 +;callwaiting = 420/40,0/1960
   18.74 +;dialrecall = 420
   18.75 +; RECORDTONE - not specified
   18.76 +;record = 1400/80,0/14920
   18.77 +;info = 950/330,1450/330,1850/330,0/1000
   18.78 +;stutter = 380+420
   18.79 +
   18.80 +;[au]
   18.81 +;description = Australia
   18.82 +; Reference http://www.acif.org.au/__data/page/3303/S002_2001.pdf
   18.83 +; Normal Ring
   18.84 +;ringcadence = 400,200,400,2000
   18.85 +; Distinctive Ring 1 - Forwarded Calls
   18.86 +; 400,400,200,200,400,1400
   18.87 +; Distinctive Ring 2 - Selective Ring 2 + Operator + Recall
   18.88 +; 400,400,200,2000
   18.89 +; Distinctive Ring 3 - Multiple Subscriber Number 1
   18.90 +; 200,200,400,2200
   18.91 +; Distinctive Ring 4 - Selective Ring 1 + Centrex
   18.92 +; 400,2600
   18.93 +; Distinctive Ring 5 - Selective Ring 3
   18.94 +; 400,400,200,400,200,1400
   18.95 +; Distinctive Ring 6 - Multiple Subscriber Number 2
   18.96 +; 200,400,200,200,400,1600
   18.97 +; Distinctive Ring 7 - Multiple Subscriber Number 3 + Data Privacy
   18.98 +; 200,400,200,400,200,1600
   18.99 +; Tones
  18.100 +;dial = 413+438
  18.101 +;busy = 425/375,0/375
  18.102 +;ring = 413+438/400,0/200,413+438/400,0/2000
  18.103 +; XXX Congestion: Should reduce by 10 db every other cadence XXX
  18.104 +;congestion = 425/375,0/375,420/375,0/375
  18.105 +;callwaiting = 425/200,0/200,425/200,0/4400
  18.106 +;dialrecall = 413+438
  18.107 +; Record tone used for Call Intrusion/Recording or Conference
  18.108 +;record = !425/1000,!0/15000,425/360,0/15000
  18.109 +;info = 425/2500,0/500
  18.110 +; Other Australian Tones
  18.111 +; The STD "pips" indicate the call is not an untimed local call
  18.112 +;std = !525/100,!0/100,!525/100,!0/100,!525/100,!0/100,!525/100,!0/100,!525/100
  18.113 +; Facility confirmation tone (eg. Call Forward Activated)
  18.114 +;facility = 425
  18.115 +; Message Waiting "stutter" dialtone
  18.116 +;stutter = 413+438/100,0/40
  18.117 +; Ringtone for calls to Telstra mobiles
  18.118 +;ringmobile = 400+450/400,0/200,400+450/400,0/2000
  18.119 +
  18.120 +;[bg]
  18.121 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.122 +;description = Bulgaria
  18.123 +;ringdance = 1000,4000
  18.124 +;
  18.125 +;dial = 425
  18.126 +;busy = 425/500,0/500
  18.127 +;ring = 425/1000,0/4000
  18.128 +;congestion = 425/250,0/250
  18.129 +;callwaiting = 425/150,0/150,425/150,0/4000
  18.130 +;dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.131 +;record = 1400/425,0/15000
  18.132 +;info = 950/330,1400/330,1800/330,0/1000
  18.133 +;stutter = 425/1500,0/100
  18.134 +
  18.135 +;[br]
  18.136 +;description = Brazil
  18.137 +;ringcadence = 1000,4000
  18.138 +;dial = 425
  18.139 +;busy = 425/250,0/250
  18.140 +;ring = 425/1000,0/4000
  18.141 +;congestion = 425/250,0/250,425/750,0/250
  18.142 +;callwaiting = 425/50,0/1000
  18.143 +; Dialrecall not used in Brazil standard (using UK standard)
  18.144 +;dialrecall = 350+440
  18.145 +; Record tone is not used in Brazil, use busy tone
  18.146 +;record = 425/250,0/250
  18.147 +; Info not used in Brazil standard (using UK standard)
  18.148 +;info = 950/330,1400/330,1800/330
  18.149 +;stutter = 350+440
  18.150 +
  18.151 +;[be]
  18.152 +;description = Belgium
  18.153 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.154 +;ringcadence = 1000,3000
  18.155 +;dial = 425
  18.156 +;busy = 425/500,0/500
  18.157 +;ring = 425/1000,0/3000
  18.158 +;congestion = 425/167,0/167
  18.159 +;callwaiting = 1400/175,0/175,1400/175,0/3500
  18.160 +; DIALRECALL - not specified
  18.161 +;dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440"
  18.162 +; RECORDTONE - not specified
  18.163 +;record = 1400/500,0/15000
  18.164 +;info = 900/330,1400/330,1800/330,0/1000
  18.165 +;stutter = 425/1000,0/250
  18.166 +
  18.167 +;[ch]
  18.168 +;description = Switzerland
  18.169 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.170 +;ringcadence = 1000,4000
  18.171 +;dial = 425
  18.172 +;busy = 425/500,0/500
  18.173 +;ring = 425/1000,0/4000
  18.174 +;congestion = 425/200,0/200
  18.175 +;callwaiting = 425/200,0/200,425/200,0/4000
  18.176 +; DIALRECALL - not specified
  18.177 +;dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.178 +; RECORDTONE - not specified
  18.179 +;record = 1400/80,0/15000
  18.180 +;info = 950/330,1400/330,1800/330,0/1000
  18.181 +;stutter = 425+340/1100,0/1100
  18.182 +
  18.183 +;[cl]
  18.184 +;description = Chile
  18.185 +; According to specs from Telefonica CTC Chile
  18.186 +;ringcadence = 1000,3000
  18.187 +;dial = 400
  18.188 +;busy = 400/500,0/500
  18.189 +;ring = 400/1000,0/3000
  18.190 +;congestion = 400/200,0/200
  18.191 +;callwaiting = 400/250,0/8750
  18.192 +;dialrecall = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
  18.193 +;record = 1400/500,0/15000
  18.194 +;info = 950/333,1400/333,1800/333,0/1000
  18.195 +;stutter = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
  18.196 +
  18.197 +;[cn]
  18.198 +;description = China
  18.199 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.200 +;ringcadence = 1000,4000
  18.201 +;dial = 450
  18.202 +;busy = 450/350,0/350
  18.203 +;ring = 450/1000,0/4000
  18.204 +;congestion = 450/700,0/700
  18.205 +;callwaiting = 450/400,0/4000
  18.206 +;dialrecall = 450
  18.207 +;record = 950/400,0/10000
  18.208 +;info = 450/100,0/100,450/100,0/100,450/100,0/100,450/400,0/400
  18.209 +; STUTTER - not specified
  18.210 +;stutter = 450+425
  18.211 +
  18.212 +;[cz]
  18.213 +;description = Czech Republic
  18.214 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.215 +;ringcadence = 1000,4000
  18.216 +;dial = 425/330,0/330,425/660,0/660
  18.217 +;busy = 425/330,0/330
  18.218 +;ring = 425/1000,0/4000
  18.219 +;congestion = 425/165,0/165
  18.220 +;callwaiting = 425/330,0/9000
  18.221 +; DIALRECALL - not specified
  18.222 +;dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425/330,0/330,425/660,0/660
  18.223 +; RECORDTONE - not specified
  18.224 +;record = 1400/500,0/14000
  18.225 +;info = 950/330,0/30,1400/330,0/30,1800/330,0/1000
  18.226 +; STUTTER - not specified
  18.227 +;stutter = 425/450,0/50
  18.228 +
  18.229 +;[de]
  18.230 +;description = Germany
  18.231 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.232 +;ringcadence = 1000,4000
  18.233 +;dial = 425
  18.234 +;busy = 425/480,0/480
  18.235 +;ring = 425/1000,0/4000
  18.236 +;congestion = 425/240,0/240
  18.237 +;callwaiting = !425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0
  18.238 +; DIALRECALL - not specified
  18.239 +;dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.240 +; RECORDTONE - not specified
  18.241 +;record = 1400/80,0/15000
  18.242 +;info = 950/330,1400/330,1800/330,0/1000
  18.243 +;stutter = 425+400
  18.244 +
  18.245 +;[dk]
  18.246 +;description = Denmark
  18.247 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.248 +;ringcadence = 1000,4000
  18.249 +;dial = 425
  18.250 +;busy = 425/500,0/500
  18.251 +;ring = 425/1000,0/4000
  18.252 +;congestion = 425/200,0/200
  18.253 +;callwaiting = !425/200,!0/600,!425/200,!0/3000,!425/200,!0/200,!425/200,0
  18.254 +; DIALRECALL - not specified
  18.255 +;dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.256 +; RECORDTONE - not specified
  18.257 +;record = 1400/80,0/15000
  18.258 +;info = 950/330,1400/330,1800/330,0/1000
  18.259 +; STUTTER - not specified
  18.260 +;stutter = 425/450,0/50
  18.261 +
  18.262 +;[ee]
  18.263 +;description = Estonia
  18.264 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.265 +;ringcadence = 1000,4000
  18.266 +;dial = 425
  18.267 +;busy = 425/300,0/300
  18.268 +;ring = 425/1000,0/4000
  18.269 +;congestion = 425/200,0/200
  18.270 +; CALLWAIT not in accordance to ITU
  18.271 +;callwaiting = 950/650,0/325,950/325,0/30,1400/1300,0/2600
  18.272 +; DIALRECALL - not specified
  18.273 +;dialrecall = 425/650,0/25
  18.274 +; RECORDTONE - not specified
  18.275 +;record = 1400/500,0/15000
  18.276 +; INFO not in accordance to ITU
  18.277 +;info = 950/650,0/325,950/325,0/30,1400/1300,0/2600
  18.278 +; STUTTER not specified
  18.279 +;stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.280 +
  18.281 +;[es]
  18.282 +;description = Spain
  18.283 +;ringcadence = 1500,3000
  18.284 +;dial = 425
  18.285 +;busy = 425/200,0/200
  18.286 +;ring = 425/1500,0/3000
  18.287 +;congestion = 425/200,0/200,425/200,0/200,425/200,0/600
  18.288 +;callwaiting = 425/175,0/175,425/175,0/3500
  18.289 +;dialrecall = !425/200,!0/200,!425/200,!0/200,!425/200,!0/200,425
  18.290 +;record = 1400/500,0/15000
  18.291 +;info = 950/330,0/1000
  18.292 +;dialout = 500
  18.293 +
  18.294 +
  18.295 +;[fi]
  18.296 +;description = Finland
  18.297 +;ringcadence = 1000,4000
  18.298 +;dial = 425
  18.299 +;busy = 425/300,0/300
  18.300 +;ring = 425/1000,0/4000
  18.301 +;congestion = 425/200,0/200
  18.302 +;callwaiting = 425/150,0/150,425/150,0/8000
  18.303 +;dialrecall = 425/650,0/25
  18.304 +;record = 1400/500,0/15000
  18.305 +;info = 950/650,0/325,950/325,0/30,1400/1300,0/2600
  18.306 +;stutter = 425/650,0/25
  18.307 +
  18.308 +;[fr]
  18.309 +;description = France
  18.310 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.311 +;ringcadence = 1500,3500
  18.312 +; Dialtone can also be 440+330
  18.313 +;dial = 440
  18.314 +;busy = 440/500,0/500
  18.315 +;ring = 440/1500,0/3500
  18.316 +; CONGESTION - not specified
  18.317 +;congestion = 440/250,0/250
  18.318 +;callwait = 440/300,0/10000
  18.319 +; DIALRECALL - not specified
  18.320 +;dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.321 +; RECORDTONE - not specified
  18.322 +;record = 1400/500,0/15000
  18.323 +;info = !950/330,!1400/330,!1800/330
  18.324 +;stutter = !440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,440
  18.325 +
  18.326 +;[gr]
  18.327 +;description = Greece
  18.328 +;ringcadence = 1000,4000
  18.329 +;dial = 425/200,0/300,425/700,0/800
  18.330 +;busy = 425/300,0/300
  18.331 +;ring = 425/1000,0/4000
  18.332 +;congestion = 425/200,0/200
  18.333 +;callwaiting = 425/150,0/150,425/150,0/8000
  18.334 +;dialrecall = 425/650,0/25
  18.335 +;record = 1400/400,0/15000
  18.336 +;info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
  18.337 +;stutter = 425/650,0/25
  18.338 +
  18.339 +;[hu]
  18.340 +;description = Hungary
  18.341 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.342 +;ringcadence = 1250,3750
  18.343 +;dial = 425
  18.344 +;busy = 425/300,0/300
  18.345 +;ring = 425/1250,0/3750
  18.346 +;congestion = 425/300,0/300
  18.347 +;callwaiting = 425/40,0/1960
  18.348 +;dialrecall = 425+450
  18.349 +; RECORDTONE - not specified
  18.350 +;record = 1400/400,0/15000
  18.351 +;info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
  18.352 +;stutter = 350+375+400
  18.353 +
  18.354 +;[il]
  18.355 +;description = Israel
  18.356 +;ringcadence = 1000,3000
  18.357 +;dial = 414
  18.358 +;busy = 414/500,0/500
  18.359 +;ring = 414/1000,0/3000
  18.360 +;congestion = 414/250,0/250
  18.361 +;callwaiting = 414/100,0/100,414/100,0/100,414/600,0/3000
  18.362 +;dialrecall = !414/100,!0/100,!414/100,!0/100,!414/100,!0/100,414
  18.363 +;record = 1400/500,0/15000
  18.364 +;info = 1000/330,1400/330,1800/330,0/1000
  18.365 +;stutter = !414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,414
  18.366 +
  18.367 +
  18.368 +;[in]
  18.369 +;description = India
  18.370 +;ringcadence = 400,200,400,2000
  18.371 +;dial = 400*25
  18.372 +;busy = 400/750,0/750
  18.373 +;ring = 400*25/400,0/200,400*25/400,0/2000
  18.374 +;congestion = 400/250,0/250
  18.375 +;callwaiting = 400/200,0/100,400/200,0/7500
  18.376 +;dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.377 +;record = 1400/500,0/15000
  18.378 +;info = !950/330,!1400/330,!1800/330,0/1000
  18.379 +;stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.380 +
  18.381 +;[it]
  18.382 +;description = Italy
  18.383 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.384 +;ringcadence = 1000,4000
  18.385 +;dial = 425/200,0/200,425/600,0/1000
  18.386 +;busy = 425/500,0/500
  18.387 +;ring = 425/1000,0/4000
  18.388 +;congestion = 425/200,0/200
  18.389 +;callwaiting = 425/400,0/100,425/250,0/100,425/150,0/14000
  18.390 +;dialrecall = 470/400,425/400
  18.391 +;record = 1400/400,0/15000
  18.392 +;info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
  18.393 +;stutter = 470/400,425/400
  18.394 +
  18.395 +;[lt]
  18.396 +;description = Lithuania
  18.397 +;ringcadence = 1000,4000
  18.398 +;dial = 425
  18.399 +;busy = 425/350,0/350
  18.400 +;ring = 425/1000,0/4000
  18.401 +;congestion = 425/200,0/200
  18.402 +;callwaiting = 425/150,0/150,425/150,0/4000
  18.403 +; DIALRECALL - not specified
  18.404 +;dialrecall = 425/500,0/50
  18.405 +; RECORDTONE - not specified
  18.406 +;record = 1400/500,0/15000
  18.407 +;info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
  18.408 +; STUTTER - not specified
  18.409 +;stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.410 +
  18.411 +;[jp]
  18.412 +;description = Japan
  18.413 +;ringcadence = 1000,2000
  18.414 +;dial = 400
  18.415 +;busy = 400/500,0/500
  18.416 +;ring = 400+15/1000,0/2000
  18.417 +;congestion = 400/500,0/500
  18.418 +;callwaiting = 400+16/500,0/8000
  18.419 +;dialrecall = !400/200,!0/200,!400/200,!0/200,!400/200,!0/200,400
  18.420 +;record = 1400/500,0/15000
  18.421 +;info = !950/330,!1400/330,!1800/330,0
  18.422 +;stutter = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
  18.423 +
  18.424 +;[mx]
  18.425 +;description = Mexico
  18.426 +;ringcadence = 2000,4000
  18.427 +;dial = 425
  18.428 +;busy = 425/250,0/250
  18.429 +;ring = 425/1000,0/4000
  18.430 +;congestion = 425/250,0/250
  18.431 +;callwaiting = 425/200,0/600,425/200,0/10000
  18.432 +;dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.433 +;record = 1400/500,0/15000
  18.434 +;info = 950/330,0/30,1400/330,0/30,1800/330,0/1000
  18.435 +;stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.436 +
  18.437 +;[my]
  18.438 +;description = Malaysia
  18.439 +;ringcadence = 2000,4000
  18.440 +;dial = 425
  18.441 +;busy = 425/500,0/500
  18.442 +;ring = 425/400,0/200
  18.443 +;congestion = 425/500,0/500
  18.444 +
  18.445 +;[nl]
  18.446 +;description = Netherlands
  18.447 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.448 +;ringcadence = 1000,4000
  18.449 +; Most of these 425's can also be 450's
  18.450 +;dial = 425
  18.451 +;busy = 425/500,0/500
  18.452 +;ring = 425/1000,0/4000
  18.453 +;congestion = 425/250,0/250
  18.454 +;callwaiting = 425/500,0/9500
  18.455 +; DIALRECALL - not specified
  18.456 +;dialrecall = 425/500,0/50
  18.457 +; RECORDTONE - not specified
  18.458 +;record = 1400/500,0/15000
  18.459 +;info = 950/330,1400/330,1800/330,0/1000
  18.460 +;stutter = 425/500,0/50
  18.461 +
  18.462 +;[no]
  18.463 +;description = Norway
  18.464 +;ringcadence = 1000,4000
  18.465 +;dial = 425
  18.466 +;busy = 425/500,0/500
  18.467 +;ring = 425/1000,0/4000
  18.468 +;congestion = 425/200,0/200
  18.469 +;callwaiting = 425/200,0/600,425/200,0/10000
  18.470 +;dialrecall = 470/400,425/400
  18.471 +;record = 1400/400,0/15000
  18.472 +;info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0
  18.473 +;stutter = 470/400,425/400
  18.474 +
  18.475 +;[nz]
  18.476 +;description = New Zealand
  18.477 +;NOTE - the ITU has different tonesets for NZ, but according to some residents there,
  18.478 +;      this is, indeed, the correct way to do it.
  18.479 +;ringcadence = 400,200,400,2000
  18.480 +;dial = 400
  18.481 +;busy = 400/250,0/250
  18.482 +;ring = 400+450/400,0/200,400+450/400,0/2000
  18.483 +;congestion = 400/375,0/375
  18.484 +;callwaiting = !400/200,!0/3000,!400/200,!0/3000,!400/200,!0/3000,!400/200
  18.485 +;dialrecall = !400/100!0/100,!400/100,!0/100,!400/100,!0/100,400
  18.486 +;record = 1400/425,0/15000
  18.487 +;info = 400/750,0/100,400/750,0/100,400/750,0/100,400/750,0/400
  18.488 +;stutter = !400/100!0/100,!400/100,!0/100,!400/100,!0/100,!400/100!0/100,!400/100,!0/100,!400/100,!0/100,400
  18.489 +;unobtainable = 400/75,0/100,400/75,0/100,400/75,0/100,400/75,0/400
  18.490 +
  18.491 +;[ph]
  18.492 +
  18.493 +; reference http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.494 +
  18.495 +;description = Philippines
  18.496 +;ringcadence = 1000,4000
  18.497 +;dial = 425
  18.498 +;busy = 480+620/500,0/500
  18.499 +;ring = 425+480/1000,0/4000
  18.500 +;congestion = 480+620/250,0/250
  18.501 +;callwaiting = 440/300,0/10000
  18.502 +; DIALRECALL - not specified
  18.503 +;dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.504 +; RECORDTONE - not specified
  18.505 +;record = 1400/500,0/15000
  18.506 +; INFO - not specified
  18.507 +;info = !950/330,!1400/330,!1800/330,0
  18.508 +; STUTTER - not specified
  18.509 +;stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.510 +
  18.511 +
  18.512 +;[pl]
  18.513 +;description = Poland
  18.514 +;ringcadence = 1000,4000
  18.515 +;dial = 425
  18.516 +;busy = 425/500,0/500
  18.517 +;ring = 425/1000,0/4000
  18.518 +;congestion = 425/500,0/500
  18.519 +;callwaiting = 425/150,0/150,425/150,0/4000
  18.520 +; DIALRECALL - not specified
  18.521 +;dialrecall = 425/500,0/50
  18.522 +; RECORDTONE - not specified
  18.523 +;record = 1400/500,0/15000
  18.524 +; 950/1400/1800 3x0.33 on 1.0 off  repeated 3 times 
  18.525 +;info = !950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000
  18.526 +; STUTTER - not specified
  18.527 +;stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.528 +
  18.529 +;[pt]
  18.530 +;description = Portugal
  18.531 +;ringcadence = 1000,5000
  18.532 +;dial = 425
  18.533 +;busy = 425/500,0/500
  18.534 +;ring = 425/1000,0/5000
  18.535 +;congestion = 425/200,0/200
  18.536 +;callwaiting = 440/300,0/10000
  18.537 +;dialrecall = 425/1000,0/200
  18.538 +;record = 1400/500,0/15000
  18.539 +;info = 950/330,1400/330,1800/330,0/1000
  18.540 +;stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.541 +
  18.542 +;[ru]
  18.543 +; References:
  18.544 +;	http://www.minsvyaz.ru/site.shtml?id=1806
  18.545 +;	http://www.aboutphone.info/lib/gost/45-223-2001.html
  18.546 +;description = Russian Federation / ex Soviet Union
  18.547 +;ringcadence = 1000,4000
  18.548 +;dial = 425
  18.549 +;busy = 425/350,0/350
  18.550 +;ring = 425/1000,0/4000
  18.551 +;congestion = 425/175,0/175
  18.552 +;callwaiting = 425/200,0/5000
  18.553 +;record = 1400/400,0/15000
  18.554 +;info = 950/330,1400/330,1800/330,0/1000
  18.555 +;dialrecall = 425/400,0/40
  18.556 +;stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.557 +
  18.558 +;[se]
  18.559 +;description = Sweden
  18.560 +;ringcadence = 1000,5000
  18.561 +;dial = 425
  18.562 +;busy = 425/250,0/250
  18.563 +;ring = 425/1000,0/5000
  18.564 +;congestion = 425/250,0/750
  18.565 +;callwaiting = 425/200,0/500,425/200,0/9100
  18.566 +;dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.567 +;record = 1400/500,0/15000
  18.568 +;info = !950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,0
  18.569 +;stutter = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
  18.570 +; stutter = 425/320,0/20        ; Real swedish standard, not used for now
  18.571 +
  18.572 +;[sg]
  18.573 +;description = Singapore
  18.574 +; Singapore
  18.575 +; Reference: http://www.ida.gov.sg/idaweb/doc/download/I397/ida_ts_pstn1_i4r2.pdf 
  18.576 +; Frequency specs are:   425 Hz +/- 20Hz; 24 Hz +/- 2Hz; modulation depth 100%; SIT +/- 50Hz
  18.577 +;ringcadence = 400,200,400,2000
  18.578 +;dial        = 425
  18.579 +;ring        = 425*24/400,0/200,425*24/400,0/2000     ; modulation should be 100%, not 90%
  18.580 +;busy        = 425/750,0/750
  18.581 +;congestion  = 425/250,0/250
  18.582 +;callwaiting = 425*24/300,0/200,425*24/300,0/3200
  18.583 +;stutter     = !425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,425
  18.584 +;info        = 950/330,1400/330,1800/330,0/1000       ; not currently in use acc. to reference
  18.585 +;dialrecall  = 425*24/500,0/500,425/500,0/2500        ; unspecified in IDA reference, use repeating Holding Tone A,B
  18.586 +;record      = 1400/500,0/15000                       ; unspecified in IDA reference, use 0.5s tone every 15s
  18.587 +; additionally defined in reference
  18.588 +;nutone      = 425/2500,0/500
  18.589 +;intrusion   = 425/250,0/2000
  18.590 +;warning     = 425/624,0/4376                         ; end of period tone, warning
  18.591 +;acceptance  = 425/125,0/125
  18.592 +;holdinga    = !425*24/500,!0/500                     ; followed by holdingb
  18.593 +;holdingb    = !425/500,!0/2500
  18.594 +
  18.595 +;[th]
  18.596 +;description = Thailand
  18.597 +;ringcadence = 1000,4000
  18.598 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.599 +;dial = 400*50
  18.600 +;busy = 400/500,0/500
  18.601 +;ring = 420/1000,0/5000
  18.602 +;congestion = 400/300,0/300
  18.603 +;callwaiting = 1000/400,10000/400,1000/400
  18.604 +; DIALRECALL - not specified - use special dial tone instead.
  18.605 +;dialrecall = 400*50/400,0/100,400*50/400,0/100
  18.606 +; RECORDTONE - not specified
  18.607 +;record = 1400/500,0/15000
  18.608 +; INFO - specified as an announcement - use special information tones instead
  18.609 +;info = 950/330,1400/330,1800/330
  18.610 +; STUTTER - not specified
  18.611 +;stutter = !400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,400
  18.612 +
  18.613 +;[uk]
  18.614 +;description = United Kingdom
  18.615 +;ringcadence = 400,200,400,2000
  18.616 +; These are the official tones taken from BT SIN350. The actual tones
  18.617 +; used by BT include some volume differences so sound slightly different
  18.618 +; from Asterisk-generated ones.
  18.619 +;dial = 350+440
  18.620 +; Special dial is the intermittent dial tone heard when, for example,
  18.621 +; you have a divert active on the line
  18.622 +;specialdial = 350+440/750,440/750
  18.623 +; Busy is also called "Engaged"
  18.624 +;busy = 400/375,0/375
  18.625 +; "Congestion" is the Beep-bip engaged tone
  18.626 +;congestion = 400/400,0/350,400/225,0/525
  18.627 +; "Special Congestion" is not used by BT very often if at all
  18.628 +;specialcongestion = 400/200,1004/300
  18.629 +;unobtainable = 400
  18.630 +;ring = 400+450/400,0/200,400+450/400,0/2000
  18.631 +;callwaiting = 400/100,0/4000
  18.632 +; BT seem to use "Special Call Waiting" rather than just "Call Waiting" tones
  18.633 +;specialcallwaiting = 400/250,0/250,400/250,0/250,400/250,0/5000
  18.634 +; "Pips" used by BT on payphones. (Sounds wrong, but this is what BT claim it
  18.635 +; is and I've not used a payphone for years)
  18.636 +;creditexpired = 400/125,0/125
  18.637 +; These two are used to confirm/reject service requests on exchanges that
  18.638 +; don't do voice announcements.
  18.639 +;confirm = 1400
  18.640 +;switching = 400/200,0/400,400/2000,0/400
  18.641 +; This is the three rising tones Doo-dah-dee "Special Information Tone",
  18.642 +; usually followed by the BT woman saying an appropriate message.
  18.643 +;info = 950/330,0/15,1400/330,0/15,1800/330,0/1000
  18.644 +; Not listed in SIN350
  18.645 +;record = 1400/500,0/60000
  18.646 +;stutter = 350+440/750,440/750
  18.647 +
  18.648 +;[us]
  18.649 +;description = United States / North America
  18.650 +;ringcadence = 2000,4000
  18.651 +;dial = 350+440
  18.652 +;busy = 480+620/500,0/500
  18.653 +;ring = 440+480/2000,0/4000
  18.654 +;congestion = 480+620/250,0/250
  18.655 +;callwaiting = 440/300,0/10000
  18.656 +;dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.657 +;record = 1400/500,0/15000
  18.658 +;info = !950/330,!1400/330,!1800/330,0
  18.659 +;stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.660 +
  18.661 +;[us-old]
  18.662 +;description = United States Circa 1950/ North America
  18.663 +;ringcadence = 2000,4000
  18.664 +;dial = 600*120
  18.665 +;busy = 500*100/500,0/500
  18.666 +;ring = 420*40/2000,0/4000
  18.667 +;congestion = 500*100/250,0/250
  18.668 +;callwaiting = 440/300,0/10000
  18.669 +;dialrecall = !600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120
  18.670 +;record = 1400/500,0/15000
  18.671 +;info = !950/330,!1400/330,!1800/330,0
  18.672 +;stutter = !600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120
  18.673 +
  18.674 +;[tw]
  18.675 +;description = Taiwan
  18.676 +; http://nemesis.lonestar.org/reference/telecom/signaling/dialtone.html
  18.677 +; http://nemesis.lonestar.org/reference/telecom/signaling/busy.html
  18.678 +; http://www.iproducts.com.tw/ee/kylink/06ky-1000a.htm
  18.679 +; http://www.pbx-manufacturer.com/ky120dx.htm
  18.680 +; http://www.nettwerked.net/tones.txt
  18.681 +; http://www.cisco.com/univercd/cc/td/doc/product/tel_pswt/vco_prod/taiw_sup/taiw2.htm
  18.682 +;
  18.683 +; busy tone 480+620Hz 0.5 sec. on ,0.5 sec. off
  18.684 +; reorder tone 480+620Hz 0.25 sec. on,0.25 sec. off
  18.685 +; ringing tone 440+480Hz 1 sec. on ,2 sec. off
  18.686 +;
  18.687 +;ringcadence = 1000,4000
  18.688 +;dial = 350+440
  18.689 +;busy = 480+620/500,0/500
  18.690 +;ring = 440+480/1000,0/2000
  18.691 +;congestion = 480+620/250,0/250
  18.692 +;callwaiting = 350+440/250,0/250,350+440/250,0/3250
  18.693 +;dialrecall = 300/1500,0/500
  18.694 +;record = 1400/500,0/15000
  18.695 +;info = !950/330,!1400/330,!1800/330,0
  18.696 +;stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
  18.697 +
  18.698 +;[ve]
  18.699 +; Tone definition source for ve found on 
  18.700 +; Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf
  18.701 +;description = Venezuela / South America
  18.702 +;ringcadence = 1000,4000
  18.703 +;dial = 425
  18.704 +;busy = 425/500,0/500
  18.705 +;ring = 425/1000,0/4000
  18.706 +;congestion = 425/250,0/250
  18.707 +;callwaiting = 400+450/300,0/6000
  18.708 +;dialrecall = 425
  18.709 +;record = 1400/500,0/15000
  18.710 +;info = !950/330,!1440/330,!1800/330,0/1000
  18.711 +
  18.712 +
  18.713 +;[za]
  18.714 +;description = South Africa
  18.715 +; http://www.cisco.com/univercd/cc/td/doc/product/tel_pswt/vco_prod/safr_sup/saf02.htm
  18.716 +; (definitions for other countries can also be found there)
  18.717 +; Note, though, that South Africa uses two switch types in their network --
  18.718 +; Alcatel switches -- mainly in the Western Cape, and Siemens elsewhere.
  18.719 +; The former use 383+417 in dial, ringback etc.  The latter use 400*33
  18.720 +; I've provided both, uncomment the ones you prefer
  18.721 +;ringcadence = 400,200,400,2000
  18.722 +; dial/ring/callwaiting for the Siemens switches:
  18.723 +;dial = 400*33
  18.724 +;ring = 400*33/400,0/200,400*33/400,0/2000
  18.725 +;callwaiting = 400*33/250,0/250,400*33/250,0/250,400*33/250,0/250,400*33/250,0/250
  18.726 +; dial/ring/callwaiting for the Alcatel switches:
  18.727 +; dial = 383+417
  18.728 +; ring = 383+417/400,0/200,383+417/400,0/2000
  18.729 +; callwaiting = 383+417/250,0/250,383+417/250,0/250,383+417/250,0/250,383+417/250,0/250
  18.730 +;congestion = 400/250,0/250
  18.731 +;busy = 400/500,0/500
  18.732 +;dialrecall = 350+440
  18.733 +; XXX Not sure about the RECORDTONE
  18.734 +;record = 1400/500,0/10000
  18.735 +;info = 950/330,1400/330,1800/330,0/330
  18.736 +;stutter = !400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,400*33
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/asterisk/logger.conf	Mon Apr 27 12:19:05 2009 +0200
    19.3 @@ -0,0 +1,69 @@
    19.4 +;
    19.5 +; Logging Configuration
    19.6 +;
    19.7 +; In this file, you configure logging to files or to
    19.8 +; the syslog system.
    19.9 +;
   19.10 +; "logger reload" at the CLI will reload configuration
   19.11 +; of the logging system.
   19.12 +
   19.13 +;[general]
   19.14 +; Customize the display of debug message time stamps
   19.15 +; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
   19.16 +; see strftime(3) Linux manual for format specifiers
   19.17 +;dateformat=%F %T
   19.18 +;
   19.19 +; This appends the hostname to the name of the log files.
   19.20 +;appendhostname = yes
   19.21 +;
   19.22 +; This determines whether or not we log queue events to a file
   19.23 +; (defaults to yes).
   19.24 +;queue_log = no
   19.25 +;
   19.26 +; This determines whether or not we log generic events to a file
   19.27 +; (defaults to yes).
   19.28 +;event_log = no
   19.29 +;
   19.30 +;
   19.31 +; For each file, specify what to log.
   19.32 +;
   19.33 +; For console logging, you set options at start of
   19.34 +; Asterisk with -v for verbose and -d for debug
   19.35 +; See 'asterisk -h' for more information.
   19.36 +;
   19.37 +; Directory for log files is configures in asterisk.conf
   19.38 +; option astlogdir
   19.39 +;
   19.40 +;[logfiles]
   19.41 +;
   19.42 +; Format is "filename" and then "levels" of debugging to be included:
   19.43 +;    debug
   19.44 +;    notice
   19.45 +;    warning
   19.46 +;    error
   19.47 +;    verbose
   19.48 +;    dtmf
   19.49 +;
   19.50 +; Special filename "console" represents the system console
   19.51 +;
   19.52 +; We highly recommend that you DO NOT turn on debug mode if you are simply
   19.53 +; running a production system.  Debug mode turns on a LOT of extra messages,
   19.54 +; most of which you are unlikely to understand without an understanding of
   19.55 +; the underlying code.  Do NOT report debug messages as code issues, unless
   19.56 +; you have a specific issue that you are attempting to debug.  They are
   19.57 +; messages for just that -- debugging -- and do not rise to the level of
   19.58 +; something that merit your attention as an Asterisk administrator.  Debug
   19.59 +; messages are also very verbose and can and do fill up logfiles quickly;
   19.60 +; this is another reason not to have debug mode on a production system unless
   19.61 +; you are in the process of debugging a specific issue.
   19.62 +;
   19.63 +;debug => debug
   19.64 +;console => notice,warning,error
   19.65 +;console => notice,warning,error,debug
   19.66 +;messages => notice,warning,error
   19.67 +;full => notice,warning,error,debug,verbose
   19.68 +
   19.69 +;syslog keyword : This special keyword logs to syslog facility 
   19.70 +;
   19.71 +;syslog.local0 => notice,warning,error
   19.72 +;
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/asterisk/manager.conf	Mon Apr 27 12:19:05 2009 +0200
    20.3 @@ -0,0 +1,56 @@
    20.4 +;
    20.5 +; AMI - The Asterisk Manager Interface
    20.6 +; 
    20.7 +; Third party application call management support and PBX event supervision
    20.8 +;
    20.9 +; This configuration file is read every time someone logs in
   20.10 +;
   20.11 +; Use the "manager list commands" at the CLI to list available manager commands
   20.12 +; and their authorization levels.
   20.13 +;
   20.14 +; "manager show command <command>" will show a help text.
   20.15 +;
   20.16 +; ---------------------------- SECURITY NOTE -------------------------------
   20.17 +; Note that you should not enable the AMI on a public IP address. If needed,
   20.18 +; block this TCP port with iptables (or another FW software) and reach it
   20.19 +; with IPsec, SSH, or SSL vpn tunnel.  You can also make the manager 
   20.20 +; interface available over http if Asterisk's http server is enabled in
   20.21 +; http.conf and if both "enabled" and "webenabled" are set to yes in
   20.22 +; this file.  Both default to no.  httptimeout provides the maximum 
   20.23 +; timeout in seconds before a web based session is discarded.  The 
   20.24 +; default is 60 seconds.
   20.25 +;
   20.26 +;[general]
   20.27 +;displaysystemname = yes
   20.28 +;enabled = no
   20.29 +;webenabled = yes
   20.30 +;port = 5038
   20.31 +
   20.32 +;httptimeout = 60
   20.33 +; a) httptimeout sets the Max-Age of the http cookie
   20.34 +; b) httptimeout is the amount of time the webserver waits 
   20.35 +;    on a action=waitevent request (actually its httptimeout-10)
   20.36 +; c) httptimeout is also the amount of time the webserver keeps 
   20.37 +;    a http session alive after completing a successful action
   20.38 +
   20.39 +;bindaddr = 0.0.0.0
   20.40 +;displayconnects = yes
   20.41 +;
   20.42 +; Add a Unix epoch timestamp to events (not action responses)
   20.43 +;
   20.44 +;timestampevents = yes
   20.45 +
   20.46 +;[mark]
   20.47 +;secret = mysecret
   20.48 +;deny=0.0.0.0/0.0.0.0
   20.49 +;permit=209.16.236.73/255.255.255.0
   20.50 +;
   20.51 +; If the device connected via this user accepts input slowly,
   20.52 +; the timeout for writes to it can be increased to keep it
   20.53 +; from being disconnected (value is in milliseconds)
   20.54 +;
   20.55 +; writetimeout = 100
   20.56 +;
   20.57 +; Authorization for various classes 
   20.58 +;read = system,call,log,verbose,command,agent,user,config
   20.59 +;write = system,call,log,verbose,command,agent,user,config
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/asterisk/meetme.conf	Mon Apr 27 12:19:05 2009 +0200
    21.3 @@ -0,0 +1,26 @@
    21.4 +;
    21.5 +; Configuration file for MeetMe simple conference rooms for Asterisk of course.
    21.6 +;
    21.7 +; This configuration file is read every time you call app meetme()
    21.8 +
    21.9 +;[general]
   21.10 +;audiobuffers=32	; The number of 20ms audio buffers to be used
   21.11 +			; when feeding audio frames from non-Zap channels
   21.12 +			; into the conference; larger numbers will allow
   21.13 +			; for the conference to 'de-jitter' audio that arrives
   21.14 +			; at different timing than the conference's timing
   21.15 +			; source, but can also allow for latency in hearing
   21.16 +			; the audio from the speaker. Minimum value is 2,
   21.17 +			; maximum value is 32.
   21.18 +;
   21.19 +;[rooms]
   21.20 +;
   21.21 +; Usage is conf => confno[,pin][,adminpin]	
   21.22 +;
   21.23 +; Note that once a participant has called the conference, a change to the pin
   21.24 +; number done in this file will not take effect until there are no more users
   21.25 +; in the conference and it goes away.  When it is created again, it will have
   21.26 +; the new pin number.
   21.27 +;
   21.28 +;conf => 1234 
   21.29 +;conf => 2345,9938
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/asterisk/misdn.conf	Mon Apr 27 12:19:05 2009 +0200
    22.3 @@ -0,0 +1,429 @@
    22.4 +;
    22.5 +; chan_misdn sample config
    22.6 +;
    22.7 +
    22.8 +; general section:
    22.9 +;
   22.10 +; for debugging and general setup, things that are not bound to port groups
   22.11 +;
   22.12 +
   22.13 +;[general] 
   22.14 +;
   22.15 +; Sets the Path to the misdn-init.conf (for nt_ptp mode checking)
   22.16 +;
   22.17 +;misdn_init=/etc/misdn-init.conf
   22.18 +
   22.19 +; set debugging flag: 
   22.20 +;   0 - No Debug
   22.21 +;   1 - mISDN Messages and * - Messages, and * - State changes
   22.22 +;   2 - Messages + Message specific Informations (e.g. bearer capability)
   22.23 +;   3 - very Verbose, the above + lots of Driver specific infos
   22.24 +;   4 - even more Verbose than 3
   22.25 +;
   22.26 +; default value: 0
   22.27 +;
   22.28 +;debug=0
   22.29 +
   22.30 +
   22.31 +
   22.32 +; set debugging file and flags for mISDNuser (NT-Stack) 
   22.33 +; 
   22.34 +; flags can be or'ed with the following values:
   22.35 +;
   22.36 +; DBGM_NET        0x00000001
   22.37 +; DBGM_MSG        0x00000002
   22.38 +; DBGM_FSM        0x00000004
   22.39 +; DBGM_TEI        0x00000010
   22.40 +; DBGM_L2         0x00000020
   22.41 +; DBGM_L3         0x00000040
   22.42 +; DBGM_L3DATA     0x00000080
   22.43 +; DBGM_BC         0x00000100
   22.44 +; DBGM_TONE       0x00000200
   22.45 +; DBGM_BCDATA     0x00000400
   22.46 +; DBGM_MAN        0x00001000
   22.47 +; DBGM_APPL       0x00002000
   22.48 +; DBGM_ISDN       0x00004000
   22.49 +; DBGM_SOCK       0x00010000
   22.50 +; DBGM_CONN       0x00020000
   22.51 +; DBGM_CDATA      0x00040000
   22.52 +; DBGM_DDATA      0x00080000
   22.53 +; DBGM_SOUND      0x00100000
   22.54 +; DBGM_SDATA      0x00200000
   22.55 +; DBGM_TOPLEVEL   0x40000000
   22.56 +; DBGM_ALL        0xffffffff
   22.57 +;
   22.58 +
   22.59 +;ntdebugflags=0
   22.60 +;ntdebugfile=/var/log/misdn-nt.log
   22.61 +
   22.62 +
   22.63 +; some pbx systems do cut the L1 for some milliseconds, to avoid 
   22.64 +; dropping running calls, we can set this flag to yes and tell
   22.65 +; mISDNuser not to drop the calls on L2_RELEASE
   22.66 +;ntkeepcalls=no
   22.67 +
   22.68 +; the big trace
   22.69 +;
   22.70 +; default value: [not set]
   22.71 +;
   22.72 +;tracefile=/var/log/asterisk/misdn.log
   22.73 +
   22.74 +
   22.75 +; set to yes if you want mISDN_dsp to bridge the calls in HW
   22.76 +;
   22.77 +; default value: yes
   22.78 +;
   22.79 +;bridging=no
   22.80 +
   22.81 +
   22.82 +;
   22.83 +; watches the L1s of every port. If one l1 is down it tries to 
   22.84 +; get it up. The timeout is given in seconds. with 0 as value it
   22.85 +; does not watch the l1 at all
   22.86 +; 
   22.87 +; default value: 0
   22.88 +;
   22.89 +; this option is only read at loading time of chan_misdn, 
   22.90 +; which means you need to unload and load chan_misdn to change the 
   22.91 +; value, an asterisk restart should do the trick
   22.92 +; 
   22.93 +;l1watcher_timeout=0
   22.94 +
   22.95 +; stops dialtone after getting first digit on nt Port
   22.96 +;
   22.97 +; default value: yes
   22.98 +;
   22.99 +;stop_tone_after_first_digit=yes
  22.100 +
  22.101 +; whether to append overlapdialed Digits to Extension or not 
  22.102 +;
  22.103 +; default value: yes
  22.104 +;
  22.105 +;append_digits2exten=yes
  22.106 +
  22.107 +;;; CRYPTION STUFF
  22.108 +
  22.109 +; Whether to look for dynamic crypting attempt
  22.110 +;
  22.111 +; default value: no
  22.112 +;
  22.113 +;dynamic_crypt=no
  22.114 +
  22.115 +; crypt_prefix, what is used for crypting Protocol
  22.116 +;
  22.117 +; default value: [not set]
  22.118 +;
  22.119 +;crypt_prefix=**
  22.120 +
  22.121 +; Keys for cryption, you reference them in the dialplan
  22.122 +; later also in dynamic encr.
  22.123 +;
  22.124 +; default value: [not set]
  22.125 +;
  22.126 +;crypt_keys=test,muh
  22.127 +
  22.128 +; users sections:
  22.129 +; 
  22.130 +; name your sections as you which but not "general" ! 
  22.131 +; the sections are Groups, you can dial out in extensions.conf
  22.132 +; with Dial(mISDN/g:extern/101) where extern is a section name, 
  22.133 +; chan_misdn tries every port in this section to find a 
  22.134 +; new free channel
  22.135 +; 
  22.136 +
  22.137 +; The default section is not a group section, it just contains config elements
  22.138 +; which are inherited by group sections.
  22.139 +;
  22.140 +
  22.141 +;[default]
  22.142 +
  22.143 +; define your default context here
  22.144 +;
  22.145 +; default value: default
  22.146 +;
  22.147 +;context=misdn
  22.148 +
  22.149 +; language
  22.150 +;
  22.151 +; default value: en
  22.152 +;
  22.153 +;language=en
  22.154 +
  22.155 +;
  22.156 +; sets the musiconhold class
  22.157 +;
  22.158 +;musicclass=default
  22.159 +
  22.160 +;
  22.161 +; Either if we should produce DTMF Tones ourselves
  22.162 +; 
  22.163 +;senddtmf=yes
  22.164 +
  22.165 +;
  22.166 +; If we should generate Ringing for chan_sip and others
  22.167 +;
  22.168 +;far_alerting=no
  22.169 +
  22.170 +
  22.171 +;
  22.172 +; here you can define which bearers should be allowed
  22.173 +;
  22.174 +;allowed_bearers=all
  22.175 +
  22.176 +; Prefixes for national and international, those are put before the 
  22.177 +; oad if an according dialplan is set by the other end. 
  22.178 +;
  22.179 +; default values: nationalprefix      : 0
  22.180 +;                 internationalprefix : 00
  22.181 +;
  22.182 +;nationalprefix=0
  22.183 +;internationalprefix=00
  22.184 +
  22.185 +; set rx/tx gains between -8 and 8 to change the RX/TX Gain
  22.186 +;
  22.187 +; default values: rxgain: 0
  22.188 +;                 txgain: 0
  22.189 +;
  22.190 +;rxgain=0
  22.191 +;txgain=0
  22.192 +
  22.193 +; some telcos especially in NL seem to need this set to yes, also in 
  22.194 +; switzerland this seems to be important
  22.195 +;
  22.196 +; default value: no
  22.197 +;
  22.198 +;te_choose_channel=no
  22.199 +
  22.200 +
  22.201 +
  22.202 +;
  22.203 +; This option defines, if chan_misdn should check the L1 on  a PMP 
  22.204 +; before making a group call on it. The L1 may go down for PMP Ports
  22.205 +; so we might need this.
  22.206 +; But be aware! a broken or plugged off cable might be used for a group call
  22.207 +; as well, since chan_misdn has no chance to distinguish if the L1 is down
  22.208 +; because of a lost Link or because the Provider shut it down...
  22.209 +;
  22.210 +; default: no
  22.211 +;
  22.212 +;pmp_l1_check=no
  22.213 +
  22.214 +
  22.215 +;
  22.216 +; in PMP this option defines which cause should be sent out to 
  22.217 +; the 3. caller. chan_misdn does not support callwaiting on TE
  22.218 +; PMP side. This allows to modify the RELEASE_COMPLETE cause 
  22.219 +; at least.
  22.220 +;
  22.221 +;reject_cause=16
  22.222 +
  22.223 +
  22.224 +;
  22.225 +; Send Setup_Acknowledge on incoming calls anyway (instead of PROCEEDING), 
  22.226 +; this requests additional Infos, so we can waitfordigits 
  22.227 +; without much issues. This works only for PTP Ports
  22.228 +; 
  22.229 +; default value: no
  22.230 +;
  22.231 +;need_more_infos=no
  22.232 +
  22.233 +
  22.234 +;
  22.235 +; set this to yes if you want to disconnect calls when a timeout occurs
  22.236 +; for example during the overlapdial phase
  22.237 +;
  22.238 +;nttimeout=no
  22.239 +
  22.240 +; set the method to use for channel selection:
  22.241 +;   standard    - always choose the first free channel with the lowest number
  22.242 +;   round_robin - use the round robin algorithm to select a channel. use this
  22.243 +;                 if you want to balance your load.
  22.244 +;
  22.245 +; default value: standard
  22.246 +;
  22.247 +;method=standard
  22.248 +
  22.249 +
  22.250 +; specify if chan_misdn should collect digits before going into the 
  22.251 +; dialplan, you can choose yes=4 Seconds, no, or specify the amount
  22.252 +; of seconds you need;
  22.253 +; 
  22.254 +;overlapdial=yes
  22.255 +
  22.256 +;
  22.257 +; dialplan means Type Of Number in ISDN Terms (for outgoing calls)
  22.258 +;
  22.259 +; there are different types of the dialplan:
  22.260 +;
  22.261 +; dialplan -> outgoing Number
  22.262 +; localdialplan -> callerid
  22.263 +; cpndialplan -> connected party number
  22.264 +;
  22.265 +; dialplan options: 
  22.266 +;
  22.267 +; 0 - unknown
  22.268 +; 1 - International
  22.269 +; 2 - National
  22.270 +; 4 - Subscriber
  22.271 +;
  22.272 +; This setting is used for outgoing calls
  22.273 +;
  22.274 +; default value: 0
  22.275 +;
  22.276 +;dialplan=0
  22.277 +;localdialplan=0
  22.278 +;cpndialplan=0
  22.279 +
  22.280 +
  22.281 +
  22.282 +;
  22.283 +; turn this to no if you don't mind correct handling of Progress Indicators  
  22.284 +;
  22.285 +;early_bconnect=yes
  22.286 +
  22.287 +
  22.288 +;
  22.289 +; turn this on if you like to send Tone Indications to a Incoming
  22.290 +; isdn channel on a TE Port. Rarely used, only if the Telco allows
  22.291 +; you to send indications by yourself, normally the Telco sends the 
  22.292 +; indications to the remote party.
  22.293 +; 
  22.294 +; default: no
  22.295 +;
  22.296 +;incoming_early_audio=no
  22.297 +
  22.298 +; uncomment the following to get into s extension at extension conf
  22.299 +; there you can use DigitTimeout if you can't or don't want to use
  22.300 +; isdn overlap dial. 
  22.301 +; note: This will jump into the s exten for every exten!
  22.302 +;
  22.303 +; default value: no
  22.304 +;
  22.305 +;always_immediate=no
  22.306 +
  22.307 +;
  22.308 +; set this to yes if you want to generate your own dialtone 
  22.309 +; with always_immediate=yes, else chan_misdn generates the dialtone
  22.310 +;
  22.311 +; default value: no
  22.312 +;
  22.313 +;nodialtone=no
  22.314 +
  22.315 +
  22.316 +; uncomment the following if you want callers which called exactly the 
  22.317 +; base number (so no extension is set) jump to the s extension.
  22.318 +; if the user dials something more it jumps to the correct extension 
  22.319 +; instead
  22.320 +;
  22.321 +; default value: no
  22.322 +;
  22.323 +;immediate=no
  22.324 +
  22.325 +; uncomment the following to have hold and retrieve support
  22.326 +;
  22.327 +; default value: no
  22.328 +;
  22.329 +;hold_allowed=yes
  22.330 +
  22.331 +; Pickup and Callgroup
  22.332 +;
  22.333 +; default values: not set = 0
  22.334 +; range: 0-63
  22.335 +;
  22.336 +;callgroup=1
  22.337 +;pickupgroup=1
  22.338 +
  22.339 +
  22.340 +;
  22.341 +; these are the exact isdn screening and presentation indicators
  22.342 +; if -1 is given for both values the presentation indicators are used
  22.343 +; from asterisks SetCallerPres application.
  22.344 +; s=0, p=0 -> callerid presented not screened
  22.345 +; s=1, p=1 -> callerid presented but screened (the remote end does not see it!)
  22.346 +; 
  22.347 +; default values s=-1, p=-1
  22.348 +;presentation=-1
  22.349 +;screen=-1
  22.350 +
  22.351 +; this enables echocancellation, with the given number of taps
  22.352 +; be aware, move this setting only to outgoing portgroups!
  22.353 +; A value of zero turns echocancellation off.
  22.354 +;
  22.355 +; possible values are: 0,32,64,128,256,yes(=128),no(=0)
  22.356 +;
  22.357 +; default value: no
  22.358 +;
  22.359 +;echocancel=no
  22.360 +
  22.361 +; Set this to no to disable echotraining. You can enter a number > 10
  22.362 +; the value is a multiple of 0.125 ms. 
  22.363 +;
  22.364 +; default value: no 
  22.365 +; yes = 2000
  22.366 +; no = 0
  22.367 +;
  22.368 +;echotraining=no
  22.369 +
  22.370 +;
  22.371 +; chan_misdns jitterbuffer, default 4000
  22.372 +; 
  22.373 +;jitterbuffer=4000
  22.374 +
  22.375 +;
  22.376 +; change this threshold to enable dejitter functionality
  22.377 +;
  22.378 +;jitterbuffer_upper_threshold=0
  22.379 +
  22.380 +
  22.381 +;
  22.382 +; change this to yes, if you want to bridge a mISDN data channel to 
  22.383 +; another channel type or to an application.
  22.384 +;
  22.385 +;hdlc=no
  22.386 +
  22.387 +
  22.388 +;
  22.389 +; defines the maximum amount of incoming calls per port for
  22.390 +; this group. Calls which exceed the maximum will be marked with 
  22.391 +; the channel variable MAX_OVERFLOW. It will contain the amount of 
  22.392 +; overflowed calls
  22.393 +;
  22.394 +;max_incoming=-1
  22.395 +
  22.396 +;
  22.397 +; defines the maximum amount of outgoing calls per port for this group
  22.398 +; exceeding calls will be rejected
  22.399 +;
  22.400 +;max_outgoing=-1
  22.401 +
  22.402 +;[intern]
  22.403 +; define your ports, e.g. 1,2 (depends on mISDN-driver loading order) 
  22.404 +;ports=1,2
  22.405 +; context where to go to when incoming Call on one of the above ports
  22.406 +;context=Intern
  22.407 +
  22.408 +;[internPP]
  22.409 +;
  22.410 +; adding the postfix 'ptp' to a port number is obsolete now, chan_misdn
  22.411 +; parses /etc/misdn-init.conf and sets the ptp mode to the corresponding
  22.412 +; configs. For backwards compatibility you can still set ptp here.
  22.413 +;
  22.414 +;ports=3
  22.415 +	
  22.416 +;[first_extern]
  22.417 +; again port defs
  22.418 +;ports=4
  22.419 +; again a context for incoming calls
  22.420 +;context=Extern1
  22.421 +; msns for te ports, listen on those numbers on the above ports, and 
  22.422 +; indicate the incoming calls to asterisk
  22.423 +; here you can give a comma separated list or simply an '*' for 
  22.424 +; any msn. 
  22.425 +;msns=*
  22.426 +
  22.427 +; here an example with given msns
  22.428 +;[second_extern]
  22.429 +;ports=5
  22.430 +;context=Extern2
  22.431 +;callerid=15
  22.432 +;msns=102,144,101,104
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/asterisk/modules.conf	Mon Apr 27 12:19:05 2009 +0200
    23.3 @@ -0,0 +1,35 @@
    23.4 +;
    23.5 +; Asterisk configuration file
    23.6 +;
    23.7 +; Module Loader configuration file
    23.8 +;
    23.9 +
   23.10 +;[modules]
   23.11 +;autoload=yes
   23.12 +;
   23.13 +; Any modules that need to be loaded before the Asterisk core has been
   23.14 +; initialized (just after the logger has been initialized) can be loaded
   23.15 +; using 'preload'. This will frequently be needed if you wish to map all
   23.16 +; module configuration files into Realtime storage, since the Realtime
   23.17 +; driver will need to be loaded before the modules using those configuration
   23.18 +; files are initialized.
   23.19 +;
   23.20 +; An example of loading ODBC support would be:
   23.21 +;preload => res_odbc.so
   23.22 +;preload => res_config_odbc.so
   23.23 +;
   23.24 +; Uncomment the following if you wish to use the Speech Recognition API
   23.25 +;preload => res_speech.so
   23.26 +;
   23.27 +; If you want, load the GTK console right away.  
   23.28 +;
   23.29 +;noload => pbx_gtkconsole.so
   23.30 +;load => pbx_gtkconsole.so
   23.31 +;
   23.32 +;load => res_musiconhold.so
   23.33 +;
   23.34 +; Load either OSS or ALSA, not both
   23.35 +; By default, load OSS only (automatically) and do not load ALSA
   23.36 +;
   23.37 +;noload => chan_alsa.so
   23.38 +;noload => chan_oss.so
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/asterisk/musiconhold.conf	Mon Apr 27 12:19:05 2009 +0200
    24.3 @@ -0,0 +1,66 @@
    24.4 +;
    24.5 +; Music on Hold -- Sample Configuration
    24.6 +;
    24.7 +
    24.8 +; valid mode options:
    24.9 +; files		-- read files from a directory in any Asterisk supported 
   24.10 +;		   media format
   24.11 +; quietmp3 	-- default 
   24.12 +; mp3 		-- loud
   24.13 +; mp3nb		-- unbuffered
   24.14 +; quietmp3nb	-- quiet unbuffered
   24.15 +; custom	-- run a custom application (See examples below)
   24.16 +
   24.17 +; =========
   24.18 +; File-based (native) music on hold
   24.19 +; =========
   24.20 +;
   24.21 +; This plays files directly from the specified directory, no external
   24.22 +; processes are required. Files are played in normal sorting order
   24.23 +; (same as a sorted directory listing), and no volume or other
   24.24 +; sound adjustments are available. If the file is available in
   24.25 +; the same format as the channel's codec, then it will be played
   24.26 +; without transcoding (same as Playback would do in the dialplan).
   24.27 +; Files can be present in as many formats as you wish, and the
   24.28 +; 'best' format will be chosen at playback time.
   24.29 +;
   24.30 +; NOTE:
   24.31 +; If you are not using "autoload" in modules.conf, then you
   24.32 +; must ensure that the format modules for any formats you wish
   24.33 +; to use are loaded _before_ res_musiconhold. If you do not do
   24.34 +; this, res_musiconhold will skip the files it is not able to
   24.35 +; understand when it loads.
   24.36 +;
   24.37 +
   24.38 +;[default]
   24.39 +;mode=files
   24.40 +;directory=/var/lib/asterisk/moh
   24.41 +;
   24.42 +;[native-random]
   24.43 +;mode=files
   24.44 +;directory=/var/lib/asterisk/moh
   24.45 +;random=yes 	; Play the files in a random order
   24.46 +
   24.47 +
   24.48 +; =========
   24.49 +; Other (non-native) playback methods
   24.50 +; =========
   24.51 +
   24.52 +;[manual]
   24.53 +;mode=custom
   24.54 +; Note that with mode=custom, a directory is not required, such as when reading
   24.55 +; from a stream.
   24.56 +;directory=/var/lib/asterisk/mohmp3
   24.57 +;application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s
   24.58 +
   24.59 +;[ulawstream]
   24.60 +;mode=custom
   24.61 +;application=/usr/bin/streamplayer 192.168.100.52 888
   24.62 +;format=ulaw
   24.63 +
   24.64 +; mpg123 on Solaris does not always exit properly; madplay may be a better
   24.65 +; choice
   24.66 +;[solaris]
   24.67 +;mode=custom
   24.68 +;directory=/var/lib/asterisk/mohmp3
   24.69 +;application=/site/sw/bin/madplay -Q -o raw:- --mono -R 8000 -a -12
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/asterisk/privacy.conf	Mon Apr 27 12:19:05 2009 +0200
    25.3 @@ -0,0 +1,3 @@
    25.4 +;[general]
    25.5 +
    25.6 +;maxretries = 2	;How many chances the caller has to enter their number
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/asterisk/rc.asterisk	Mon Apr 27 12:19:05 2009 +0200
    26.3 @@ -0,0 +1,56 @@
    26.4 +#!@l_prefix@/bin/openpkg rc
    26.5 +##
    26.6 +##  rc.asterisk -- Run-Commands
    26.7 +##
    26.8 +
    26.9 +%config
   26.10 +    asterisk_enable="$openpkg_rc_def"
   26.11 +    asterisk_flags=""
   26.12 +    asterisk_log_prolog="true"
   26.13 +    asterisk_log_epilog="true"
   26.14 +    asterisk_log_numfiles="10"
   26.15 +    asterisk_log_minsize="1M"
   26.16 +    asterisk_log_complevel="9"
   26.17 +
   26.18 +%status -u @l_susr@ -o
   26.19 +    asterisk_usable="unknown"
   26.20 +    asterisk_active="no"
   26.21 +    rcService asterisk enable yes && \
   26.22 +        @l_prefix@/sbin/asterisk -rx "show version" >/dev/null 2>&1 && \
   26.23 +        asterisk_active="yes"
   26.24 +    echo "asterisk_enable=\"$asterisk_enable\""
   26.25 +    echo "asterisk_usable=\"$asterisk_usable\""
   26.26 +    echo "asterisk_active=\"$asterisk_active\""
   26.27 +
   26.28 +%start -u @l_susr@
   26.29 +    rcService asterisk enable yes || exit 0
   26.30 +    rcService asterisk active yes && exit 0
   26.31 +    @l_prefix@/sbin/asterisk ${asterisk_flags}
   26.32 +
   26.33 +%stop -u @l_susr@
   26.34 +    rcService asterisk enable yes || exit 0
   26.35 +    rcService asterisk active no  && exit 0
   26.36 +    ( @l_prefix@/sbin/asterisk -rx "stop gracefully" &
   26.37 +      sleep 2
   26.38 +      @l_prefix@/sbin/asterisk -rx "stop now" &
   26.39 +    ) >/dev/null 2>&1 || true
   26.40 +
   26.41 +%restart -u @l_susr@
   26.42 +    rcService asterisk enable yes || exit 0
   26.43 +    rcService asterisk active no  && exit 0
   26.44 +    rc asterisk stop start
   26.45 +
   26.46 +%reload -u @l_susr@
   26.47 +    rcService asterisk enable yes || exit 0
   26.48 +    rcService asterisk active no  && exit 0
   26.49 +    @l_prefix@/sbin/asterisk -rx "reload"
   26.50 +
   26.51 +%daily -u @l_susr@
   26.52 +    rcService asterisk enable yes || exit 0
   26.53 +    shtool rotate -f \
   26.54 +        -n ${asterisk_log_numfiles} -s ${asterisk_log_minsize} -d \
   26.55 +        -z ${asterisk_log_complevel} -m 664 -o @l_rusr@ -g @l_rgrp@ \
   26.56 +        -P "${asterisk_log_prolog}" \
   26.57 +        -E "${asterisk_log_epilog}; rc asterisk reload" \
   26.58 +        @l_prefix@/var/asterisk/log/asterisk.log
   26.59 +
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/asterisk/rpt.conf	Mon Apr 27 12:19:05 2009 +0200
    27.3 @@ -0,0 +1,193 @@
    27.4 +; Radio Repeater / Remote Base configuration file (for use with app_rpt)
    27.5 +; As of app_rpt version 0.39, 12/20/2005
    27.6 +;
    27.7 +
    27.8 +;[000]					; Node ID of first repeater
    27.9 +
   27.10 +;rxchannel = Zap/1			; Rx audio/signalling channel
   27.11 +; Note: if you use a unified interface (tx/rx on one channel), only
   27.12 +; specify the rxchannel and the txchannel will be assumed from the rxchannel
   27.13 +;txchannel = Zap/2			; Tx audio/signalling channel
   27.14 +;duplex = 2				; (Optional) set duplex operating mode
   27.15 +;; 0 = half duplex (telemetry and courtesy tones do not transmit)
   27.16 +;; 1 = semi-half duplex (telemetry and courtesy tones transmit, but not
   27.17 +;;    repeated audio
   27.18 +;; 2 = normal full-duplex mode (Default)
   27.19 +;; 3 = full-duplex mode, without repeated audio from main input source
   27.20 +;functions = functions-repeater		; DTMF function list
   27.21 +;; specify this for a different function list then local when on link
   27.22 +;;link_functions = functions-different	; DTMF function list for link
   27.23 +;;phone_functions = functions-phone	; (optional) different functions for 'P' mode
   27.24 +;;dphone_functions = functions-dphone	; (optional) different functions for 'D' mode
   27.25 +;;nodes = nodes-different		; (optional) different node list
   27.26 +;tonezone = us				; use US tones (default)
   27.27 +;context = default			; dialing context for phone
   27.28 +;callerid = "WB6NIL Repeater" <(213) 555-0123>  ; Callerid for phone calls
   27.29 +;idrecording = wb6nil			; id recording
   27.30 +;accountcode=RADIO			; account code (optional)
   27.31 +;funcchar = *				; function lead-in character (defaults to '*')
   27.32 +;endchar = #				; command mode end character (defaults to '#')
   27.33 +;;nobusyout=yes				; (optional) Do not busy-out reverse-patch when
   27.34 +					; normal patch in use
   27.35 +;hangtime=1000				; squelch tail hang time (in ms) (optional)
   27.36 +;totime=100000				; transmit time-out time (in ms) (optional)
   27.37 +;idtime=30000				; id interval time (in ms) (optional)
   27.38 +;politeid=30000				; time in milliseconds before ID timer
   27.39 +					; expires to try and ID in the tail.
   27.40 +					; (optional, default is 30000).
   27.41 +;idtalkover=|iwb6nil/rpt		; Talkover ID (optional) default is none
   27.42 +;unlinkedct=ct2				; unlinked courtesy tone (optional) default is none
   27.43 +
   27.44 +;; The tailmessagetime,tailsquashedtime, and tailmessages need to be set
   27.45 +;; to support tail messages. They can be omitted otherwise.
   27.46 +;tailmessagetime=300000			; Play a tail message every 5 mins
   27.47 +;tailsquashedtime=30000			; If squashed by another user,
   27.48 +;;					  try again after 30 seconds
   27.49 +;tailmessages=msg1,msg2,msg3		;list of messages to be played for tail message
   27.50 +
   27.51 +; The default values for hangtime, time-out time, and id interval time are
   27.52 +; 5 seconds (5000 ms),  3 minutes (180000 ms), and 5 minutes (300000 ms)
   27.53 +; respectively
   27.54 +
   27.55 +;[001]					; Node ID of first repeater
   27.56 +
   27.57 +;rxchannel = Zap/3			; Rx audio/signalling channel
   27.58 +; Note: if you use a unified interface (tx/rx on one channel), only
   27.59 +; specify the rxchannel and the txchannel will be assumed from the rxchannel
   27.60 +;txchannel = Zap/4			; Tx audio/signalling channel
   27.61 +;functions = functions-repeater		; DTMF function list
   27.62 +;; specify this for a different function list then local when on link
   27.63 +;;link_functions = functions-different	; DTMF function list for link
   27.64 +;;phone_functions = functions-phone	; (optional) different functions for 'P' mode
   27.65 +;;dphone_functions = functions-dphone	; (optional) different functions for 'D' mode
   27.66 +;;nodes = nodes-different		; (optional) different node list
   27.67 +;tonezone = us				; use US tones (default)
   27.68 +;context = default			; dialing context for phone
   27.69 +;callerid = "WB6NIL Repeater" <(213) 555-0123>  ; Callerid for phone calls
   27.70 +;idrecording = wb6nil			; id recording
   27.71 +;accountcode=RADIO			; account code (optional)
   27.72 +;funcchar = *				; function lead-in character (defaults to '*')
   27.73 +;endchar = #				; command mode end character (defaults to '#')
   27.74 +;;nobusyout=yes				; (optional) Do not busy-out reverse-patch when
   27.75 +					; normal patch in use
   27.76 +;hangtime=1000				; squelch tail hang time (in ms) (optional)
   27.77 +;totime=100000				; transmit time-out time (in ms) (optional)
   27.78 +;idtime=30000				; id interval time (in ms) (optional)
   27.79 +;politeid=30000				; time in milliseconds before ID timer
   27.80 +					; expires to try and ID in the tail.
   27.81 +					; (optional, default is 30000).
   27.82 +;idtalkover=|iwb6nil/rpt		; Talkover ID (optional) default is none
   27.83 +;unlinkedct=ct2				; unlinked courtesy tone (optional) default is none
   27.84 +
   27.85 +;[002]					; Node ID of remote base
   27.86 +
   27.87 +;rxchannel = Zap/5			; Rx audio/signalling channel
   27.88 +; Note: if you use a unified interface (tx/rx on one channel), only
   27.89 +; specify the rxchannel and the txchannel will be assumed from the rxchannel
   27.90 +;txchannel = Zap/6			; Tx audio/signalling channel
   27.91 +;functions = functions-remote
   27.92 +;remote = ft897				; Set remote=y for dumb remote or 
   27.93 +					; remote=ft897 for Yaesu FT-897 or
   27.94 +					; remote=rbi for Doug Hall RBI1
   27.95 +;iobase = 0x378				; Specify IO port for parallel port (optional)
   27.96 +
   27.97 +;[functions-repeater]
   27.98 +;1=ilink,1				; Specific link disconnect
   27.99 +;2=ilink,2				; Specific Link connect -  monitor only
  27.100 +;3=ilink,3				; Specific Link connect - transceive
  27.101 +;4=ilink,4				; Enter command mode on a specific link
  27.102 +;7=ilink,5				; Link status
  27.103 +;;XX=ilink,6				; Disconnect all links (not used here)
  27.104 +
  27.105 +;80=status,1				; System info
  27.106 +;81=status,2				; Time
  27.107 +;82=status,3				; app_rpt.c Version
  27.108 +
  27.109 +;6=autopatchup				; Autopatch up
  27.110 +;0=autopatchdn				; Autopatch down
  27.111 +
  27.112 +;90=cop,1				; System warm boot 
  27.113 +;91=cop,2				; System enable
  27.114 +;92=cop,3				; System disable
  27.115 +
  27.116 +;[functions-remote]
  27.117 +
  27.118 +;0=remote,1				; Retrieve Memory
  27.119 +;1=remote,2				; Set freq.
  27.120 +;2=remote,3				; Set Rx PL tone.
  27.121 +;40=remote,100				; Rx PL off
  27.122 +;41=remote,101				; Rx PL on
  27.123 +;42=remote,102				; Tx PL off
  27.124 +;43=remote,103				; Tx PL on
  27.125 +;44=remote,104				; Low Pwr
  27.126 +;45=remote,105				; Med Pwr
  27.127 +;46=remote,106				; Hi Pwr
  27.128 +;5=remote,5				; Status
  27.129 +
  27.130 +;[telemetry]
  27.131 +
  27.132 +; Telemetry entries are shared across all repeaters
  27.133 +; Can be a tone sequence, morse string, or a file
  27.134 +;
  27.135 +; |t - Tone escape sequence
  27.136 +;
  27.137 +; Tone sequences consist of 1 or more 4-tuple entries (freq1, freq2, duration, amplitude)
  27.138 +; Single frequencies are created by setting freq1 or freq2 to zero.
  27.139 +;
  27.140 +; |m - Morse escape sequence
  27.141 +; 
  27.142 +; Sends Morse code at the telemetry amplitude and telemetry frequency as defined in the
  27.143 +; [morse] section.
  27.144 +;
  27.145 +; Follow with an alphanumeric string
  27.146 +;
  27.147 +; |i - Morse ID escape sequence
  27.148 +;
  27.149 +; Sends Morse code at the ID amplitude and ID frequency as defined in the
  27.150 +; [morse] section.
  27.151 +;
  27.152 +; Follow with an alphanumeric string
  27.153 +
  27.154 +
  27.155 +;ct1=|t(350,0,100,2048)(500,0,100,2048)(660,0,100,2048)
  27.156 +;ct2=|t(660,880,150,2048)  
  27.157 +;ct3=|t(440,0,150,2048) 
  27.158 +;ct4=|t(550,0,150,2048)
  27.159 +;ct5=|t(660,0,150,2048)
  27.160 +;ct6=|t(880,0,150,2048)
  27.161 +;ct7=|t(660,440,150,2048)
  27.162 +;ct8=|t(700,1100,150,2048)
  27.163 +;remotetx=|t(2000,0,75,2048)(0,0,75,0)(1600,0,75,2048); 
  27.164 +;remotemon=|t(1600,0,75,2048) 
  27.165 +;cmdmode=|t(900,903,200,2048)
  27.166 +;functcomplete=|t(1000,0,100,2048)(0,0,100,0)(1000,0,100,2048)
  27.167 +
  27.168 +
  27.169 +;[morse]
  27.170 +
  27.171 +;speed=20		; Approximate speed in WPM
  27.172 +;frequency=800		; Morse Telemetry Frequency
  27.173 +;amplitude=4096		; Morse Telemetry Amplitude
  27.174 +;idfrequency=330		; Morse ID Frequency	
  27.175 +;idamplitude=2048	; Morse ID Amplitude
  27.176 +
  27.177 +;[nodes]
  27.178 +
  27.179 +;000 = context_A@foo.bar.com/1234,foo.bar.com
  27.180 +;001 = context_B@baz.waldo.com/4321,baz.waldo.com
  27.181 +;002 = context_C@pepper.salt.com/5678,pepper.salt.com,y  ; this is a remote
  27.182 +
  27.183 +;of course, you can also specify these with domain names, but why rely
  27.184 +;on DNS working unnecessarily?
  27.185 +
  27.186 +;[memory]
  27.187 +
  27.188 +;; this example gives you 146.460, simplex, 100.0 HZ PL, hi-power, transmit PL
  27.189 +;00 = 146.460,100.0,sht
  27.190 +;; this example gives you 146.940, minus offset, 100.0 HZ PL, low-power, no PL
  27.191 +;01 = 146.940,100.0,-l
  27.192 +
  27.193 +; The format for these entries is:  Receive-Freq,Receive-PL,Attrbutes
  27.194 +;     Attributes: l=low power, m=medium power, h=high power, -=minus offset,
  27.195 +;	s=simplex, +=plus offset, t=tx PL enable, r=rx PL enable
  27.196 +
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/asterisk/rtp.conf	Mon Apr 27 12:19:05 2009 +0200
    28.3 @@ -0,0 +1,22 @@
    28.4 +;
    28.5 +; RTP Configuration
    28.6 +;
    28.7 +;[general]
    28.8 +;
    28.9 +; RTP start and RTP end configure start and end addresses
   28.10 +;
   28.11 +; Defaults are rtpstart=5000 and rtpend=31000
   28.12 +;
   28.13 +;rtpstart=10000
   28.14 +;rtpend=20000
   28.15 +;
   28.16 +; Whether to enable or disable UDP checksums on RTP traffic
   28.17 +;
   28.18 +;rtpchecksums=no
   28.19 +;
   28.20 +; The amount of time a DTMF digit with no 'end' marker should be
   28.21 +; allowed to continue (in 'samples', 1/8000 of a second)
   28.22 +;
   28.23 +;dtmftimeout=3000
   28.24 +; rtcpinterval = 5000 	; Milliseconds between rtcp reports 
   28.25 +			;(min 500, max 60000, default 5000)
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/asterisk/say.conf	Mon Apr 27 12:19:05 2009 +0200
    29.3 @@ -0,0 +1,171 @@
    29.4 +; say.conf
    29.5 +; 
    29.6 +; language configuration
    29.7 +;
    29.8 +; The new language routines produce strings of the form
    29.9 +;	prefix:[format:]data
   29.10 +; that are matched against the rules in this file to produce
   29.11 +; an output.
   29.12 +;
   29.13 +; The data is generally the string to be spelled (either a number,
   29.14 +; an ascii string or a date/time in the format specified below).
   29.15 +; It is available, in the right hand side of a rule, as variable ${SAY}.
   29.16 +;
   29.17 +; The format is optional and normally used only for date/time.
   29.18 +; The prefix is used to select the pronunciation - standard
   29.19 +; prefixes are
   29.20 +;	num		used for numbers
   29.21 +;	enum		used for enumerations
   29.22 +;	date 		for dates
   29.23 +;	time 		for times
   29.24 +;	datetime	for dates and times
   29.25 +;	char		for character strings
   29.26 +;	phonetic	for phonetic strings
   29.27 +;	digit		for digit strings
   29.28 +;
   29.29 +; but others can be used at will.
   29.30 +;
   29.31 +; Processing occurs as follows:
   29.32 +; If the format is empty, or there is no format, the entire
   29.33 +; string is matched against one of the pattern on the left hand side.
   29.34 +; On the first match, the various comma-separated components on the right
   29.35 +; hand side are pronounced, as follows:
   29.36 +; + a component starting with a prefix: (i.e. with a ':' in it)
   29.37 +;   is re-processed according to these rules;
   29.38 +; + a component without a ':' in it is considered a filename and
   29.39 +;   the corresponding file is played.
   29.40 +;
   29.41 +; If the format is non-empty, the format is split into its components
   29.42 +; (individual characters, or filenames in single quotes), and then
   29.43 +; filenames are played, whereas single characters are used to
   29.44 +; generate a new string format:pat:data to be processed.
   29.45 +;
   29.46 +; DATES/AND TIMES assume that the date info is available in
   29.47 +; the form	 YYYYMMDDHHmm.ss-dow-doy
   29.48 +; with 4 digits for the year, 2 for month, day, hour, minutes, seconds,
   29.49 +; one digit for the day-of-week, and 3 digits for the day-of-year.
   29.50 +;
   29.51 +; Example:
   29.52 +;     datetime::200604172030.00-4-102
   29.53 +; (typical format for a date) is first matched against the line
   29.54 +;	datetime::. => date:AdBY 'digits/at' IMp:${SAY}
   29.55 +; which is normally present with the default format for dates.
   29.56 +; In turn, the format string "AdBY 'digits/at' IMp" results in
   29.57 +; the sequence
   29.58 +;	date:A:200604172030.00-4-102
   29.59 +;	date:d:200604172030.00-4-102
   29.60 +;	date:B:200604172030.00-4-102
   29.61 +;	date:Y:200604172030.00-4-102
   29.62 +;	digits/at
   29.63 +;	date:I:200604172030.00-4-102
   29.64 +;	date:M:200604172030.00-4-102
   29.65 +;	date:p:200604172030.00-4-102
   29.66 +;
   29.67 +; 
   29.68 +; Remember, normally X Z N are special, and the search is
   29.69 +; case insensitive, so you must use [X] [N] [Z] .. if you
   29.70 +; want exact match.
   29.71 +
   29.72 +; We start with the basic rules that might be more-or-less
   29.73 +; language-independent
   29.74 +
   29.75 +[digit-base](!)		; base rule for digit strings
   29.76 +			; XXX incomplete yet
   29.77 +    _digit:[0-9] => digits/${SAY}
   29.78 +    _digit:[-] => letters/dash
   29.79 +    _digit:[*] => letters/star
   29.80 +    _digit:[@] => letters/at
   29.81 +    _digit:[0-9]. => digit:${SAY:0:1}, digit:${SAY:1}
   29.82 +
   29.83 +[date-base](!)		; base rules for dates and times
   29.84 +    ; the 'SAY' variable contains YYYYMMDDHHmm.ss-dow-doy
   29.85 +    ; these rule map the strftime attributes.
   29.86 +    _date:Y:. => num:${SAY:0:4}	; year, 19xx
   29.87 +    _date:[Bb]:. => digits/mon-$[${SAY:4:2}-1]	; month name, 0..11
   29.88 +    _date:[Aa]:. => digits/day-${SAY:16:1}	; day of week
   29.89 +    _date:[de]:. => num:${SAY:6:2}		; day of month
   29.90 +    _date:[hH]:. => num:${SAY:8:2}		; hour
   29.91 +    _date:[I]:. => num:$[${SAY:8:2} % 12]	; hour 0-12
   29.92 +    _date:[M]:. => num:${SAY:10:2}		; minute
   29.93 +    ; XXX too bad the '?' function does not remove the quotes
   29.94 +    ; _date:[pP]:. => digits/$[ ${SAY:10:2} > 12 ? "p-m" :: "a-m"]	; am pm
   29.95 +    _date:[pP]:. => digits/p-m	; am pm
   29.96 +    _date:[S]:. => num:${SAY:13:2}		; seconds
   29.97 +
   29.98 +[en-base](!)
   29.99 +    _[n]um:0. => num:${SAY:1}
  29.100 +    _[n]um:X => digits/${SAY}
  29.101 +    _[n]um:1X => digits/${SAY}
  29.102 +    _[n]um:[2-9]0 =>  digits/${SAY}
  29.103 +    _[n]um:[2-9][1-9] =>  digits/${SAY:0:1}0, num:${SAY:1}
  29.104 +    _[n]um:XXX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
  29.105 +
  29.106 +    _[n]um:XXXX => num:${SAY:0:1}, digits/thousand, num:${SAY:1}
  29.107 +    _[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
  29.108 +    _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3}
  29.109 +
  29.110 +    _[n]um:XXXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
  29.111 +    _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/million, num:${SAY:2}
  29.112 +    _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/million, num:${SAY:3}
  29.113 +
  29.114 +    _[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1}
  29.115 +    _[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2}
  29.116 +    _[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3}
  29.117 +
  29.118 +    ; enumeration
  29.119 +    _e[n]um:X => digits/h-${SAY}
  29.120 +    _e[n]um:1X => digits/h-${SAY}
  29.121 +    _e[n]um:[2-9]0 => digits/h-${SAY}
  29.122 +    _e[n]um:[2-9][1-9] => num:${SAY:0:1}0, digits/h-${SAY:1}
  29.123 +    _e[n]um:[1-9]XX => num:${SAY:0:1}, digits/hundred, enum:${SAY:1}
  29.124 +
  29.125 +[it](digit-base,date-base)
  29.126 +    _[n]um:0. => num:${SAY:1}
  29.127 +    _[n]um:X => digits/${SAY}
  29.128 +    _[n]um:1X => digits/${SAY}
  29.129 +    _[n]um:[2-9]0 =>  digits/${SAY}
  29.130 +    _[n]um:[2-9][1-9] =>  digits/${SAY:0:1}0, num:${SAY:1}
  29.131 +    _[n]um:1XX => digits/hundred, num:${SAY:1}
  29.132 +    _[n]um:[2-9]XX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
  29.133 +
  29.134 +    _[n]um:1XXX => digits/thousand, num:${SAY:1}
  29.135 +    _[n]um:[2-9]XXX => num:${SAY:0:1}, digits/thousands, num:${SAY:1}
  29.136 +    _[n]um:XXXXX => num:${SAY:0:2}, digits/thousands, num:${SAY:2}
  29.137 +    _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousands, num:${SAY:3}
  29.138 +
  29.139 +    _[n]um:1XXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
  29.140 +    _[n]um:[2-9]XXXXXX => num:${SAY:0:1}, digits/millions, num:${SAY:1}
  29.141 +    _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2}
  29.142 +    _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3}
  29.143 +
  29.144 +    _datetime::. => date:AdBY 'digits/at' IMp:${SAY}
  29.145 +    _date::. => date:AdBY:${SAY}
  29.146 +    _time::. => date:IMp:${SAY}
  29.147 +
  29.148 +[en](en-base,date-base,digit-base)
  29.149 +    _datetime::. => date:AdBY 'digits/at' IMp:${SAY}
  29.150 +    _date::. => date:AdBY:${SAY}
  29.151 +    _time::. => date:IMp:${SAY}
  29.152 +
  29.153 +[de](date-base,digit-base)
  29.154 +    _[n]um:0. => num:${SAY:1}
  29.155 +    _[n]um:X => digits/${SAY}
  29.156 +    _[n]um:1X => digits/${SAY}
  29.157 +    _[n]um:[2-9]0 => digits/${SAY}
  29.158 +    _[n]um:[2-9][1-9] => digits/${SAY:1}-and, digits/${SAY:0:1}0
  29.159 +    _[n]um:1XX => digits/ein, digits/hundred, num:${SAY:1}
  29.160 +    _[n]um:[2-9]XX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1}
  29.161 +    _[n]um:1XXX => digits/ein, digits/thousand, num:${SAY:1}
  29.162 +    _[n]um:[2-9]XXX => digits/${SAY:0:1}, digits/thousand, num:${SAY:1}
  29.163 +    _[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
  29.164 +    _[n]um:X00XXX => digits/${SAY:0:1}, digits/hundred, digits/thousand, num:${SAY:3}
  29.165 +    _[n]um:XXXXXX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1}
  29.166 +    _[n]um:1XXXXXX => digits/eine, digits/million, num:${SAY:1}
  29.167 +    _[n]um:[2-9]XXXXXX => digits/${SAY:0:1}, digits/millions, num:${SAY:1}
  29.168 +    _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2}
  29.169 +    _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3}
  29.170 +
  29.171 +    _datetime::. => date:AdBY 'digits/at' IMp:${SAY}
  29.172 +    _date::. => date:AdBY:${SAY}
  29.173 +    _time::. => date:IMp:${SAY}
  29.174 +
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/asterisk/sip.conf	Mon Apr 27 12:19:05 2009 +0200
    30.3 @@ -0,0 +1,664 @@
    30.4 +;
    30.5 +; SIP Configuration example for Asterisk
    30.6 +;
    30.7 +; Syntax for specifying a SIP device in extensions.conf is
    30.8 +; SIP/devicename where devicename is defined in a section below.
    30.9 +;
   30.10 +; You may also use 
   30.11 +; SIP/username@domain to call any SIP user on the Internet
   30.12 +; (Don't forget to enable DNS SRV records if you want to use this)
   30.13 +; 
   30.14 +; If you define a SIP proxy as a peer below, you may call
   30.15 +; SIP/proxyhostname/user or SIP/user@proxyhostname 
   30.16 +; where the proxyhostname is defined in a section below 
   30.17 +; 
   30.18 +; Useful CLI commands to check peers/users:
   30.19 +;   sip show peers		Show all SIP peers (including friends)
   30.20 +;   sip show users		Show all SIP users (including friends)
   30.21 +;   sip show registry		Show status of hosts we register with
   30.22 +;
   30.23 +;   sip debug			Show all SIP messages
   30.24 +;
   30.25 +;   reload chan_sip.so		Reload configuration file
   30.26 +;				Active SIP peers will not be reconfigured
   30.27 +;
   30.28 +
   30.29 +;[general]
   30.30 +;context=default			; Default context for incoming calls
   30.31 +;allowguest=no			; Allow or reject guest calls (default is yes)
   30.32 +;allowoverlap=no			; Disable overlap dialing support. (Default is yes)
   30.33 +;allowtransfer=no		; Disable all transfers (unless enabled in peers or users)
   30.34 +				; Default is enabled
   30.35 +;realm=mydomain.tld		; Realm for digest authentication
   30.36 +				; defaults to "asterisk". If you set a system name in
   30.37 +				; asterisk.conf, it defaults to that system name
   30.38 +				; Realms MUST be globally unique according to RFC 3261
   30.39 +				; Set this to your host name or domain name
   30.40 +;bindport=5060			; UDP Port to bind to (SIP standard port is 5060)
   30.41 +				; bindport is the local UDP port that Asterisk will listen on
   30.42 +;bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
   30.43 +;srvlookup=yes			; Enable DNS SRV lookups on outbound calls
   30.44 +				; Note: Asterisk only uses the first host 
   30.45 +				; in SRV records
   30.46 +				; Disabling DNS SRV lookups disables the 
   30.47 +				; ability to place SIP calls based on domain 
   30.48 +				; names to some other SIP users on the Internet
   30.49 +				
   30.50 +;domain=mydomain.tld		; Set default domain for this host
   30.51 +				; If configured, Asterisk will only allow
   30.52 +				; INVITE and REFER to non-local domains
   30.53 +				; Use "sip show domains" to list local domains
   30.54 +;pedantic=yes			; Enable checking of tags in headers, 
   30.55 +				; international character conversions in URIs
   30.56 +				; and multiline formatted headers for strict
   30.57 +				; SIP compatibility (defaults to "no")
   30.58 +
   30.59 +; See doc/README.tos for a description of these parameters.
   30.60 +;tos_sip=cs3                    ; Sets TOS for SIP packets.
   30.61 +;tos_audio=ef                   ; Sets TOS for RTP audio packets.
   30.62 +;tos_video=af41                 ; Sets TOS for RTP video packets.
   30.63 +
   30.64 +;maxexpiry=3600			; Maximum allowed time of incoming registrations
   30.65 +				; and subscriptions (seconds)
   30.66 +;minexpiry=60			; Minimum length of registrations/subscriptions (default 60)
   30.67 +;defaultexpiry=120		; Default length of incoming/outgoing registration
   30.68 +;t1min=100			; Minimum roundtrip time for messages to monitored hosts
   30.69 +				; Defaults to 100 ms
   30.70 +;notifymimetype=text/plain	; Allow overriding of mime type in MWI NOTIFY
   30.71 +;checkmwi=10			; Default time between mailbox checks for peers
   30.72 +;buggymwi=no			; Cisco SIP firmware doesn't support the MWI RFC
   30.73 +				; fully. Enable this option to not get error messages
   30.74 +				; when sending MWI to phones with this bug.
   30.75 +;vmexten=voicemail		; dialplan extension to reach mailbox sets the 
   30.76 +				; Message-Account in the MWI notify message 
   30.77 +				; defaults to "asterisk"
   30.78 +;disallow=all			; First disallow all codecs
   30.79 +;allow=ulaw			; Allow codecs in order of preference
   30.80 +;allow=ilbc			; see doc/rtp-packetization for framing options
   30.81 +;
   30.82 +; This option specifies a preference for which music on hold class this channel
   30.83 +; should listen to when put on hold if the music class has not been set on the
   30.84 +; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
   30.85 +; channel putting this one on hold did not suggest a music class.
   30.86 +;
   30.87 +; This option may be specified globally, or on a per-user or per-peer basis.
   30.88 +;
   30.89 +;mohinterpret=default
   30.90 +;
   30.91 +; This option specifies which music on hold class to suggest to the peer channel
   30.92 +; when this channel places the peer on hold. It may be specified globally or on
   30.93 +; a per-user or per-peer basis.
   30.94 +;
   30.95 +;mohsuggest=default
   30.96 +;
   30.97 +;language=en			; Default language setting for all users/peers
   30.98 +				; This may also be set for individual users/peers
   30.99 +;relaxdtmf=yes			; Relax dtmf handling
  30.100 +;trustrpid = no			; If Remote-Party-ID should be trusted
  30.101 +;sendrpid = yes			; If Remote-Party-ID should be sent
  30.102 +;progressinband=never		; If we should generate in-band ringing always
  30.103 +				; use 'never' to never use in-band signalling, even in cases
  30.104 +				; where some buggy devices might not render it
  30.105 +				; Valid values: yes, no, never Default: never
  30.106 +;useragent=Asterisk PBX		; Allows you to change the user agent string
  30.107 +;promiscredir = no      	; If yes, allows 302 or REDIR to non-local SIP address
  30.108 +	                       	; Note that promiscredir when redirects are made to the
  30.109 +       	                	; local system will cause loops since Asterisk is incapable
  30.110 +       	                	; of performing a "hairpin" call.
  30.111 +;usereqphone = no		; If yes, ";user=phone" is added to uri that contains
  30.112 +				; a valid phone number
  30.113 +;dtmfmode = rfc2833		; Set default dtmfmode for sending DTMF. Default: rfc2833
  30.114 +				; Other options: 
  30.115 +				; info : SIP INFO messages
  30.116 +				; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
  30.117 +				; auto : Use rfc2833 if offered, inband otherwise
  30.118 +
  30.119 +;compactheaders = yes		; send compact sip headers.
  30.120 +;
  30.121 +;videosupport=yes		; Turn on support for SIP video. You need to turn this on
  30.122 +				; in the this section to get any video support at all.
  30.123 +				; You can turn it off on a per peer basis if the general
  30.124 +				; video support is enabled, but you can't enable it for
  30.125 +				; one peer only without enabling in the general section.
  30.126 +;maxcallbitrate=384		; Maximum bitrate for video calls (default 384 kb/s)
  30.127 +				; Videosupport and maxcallbitrate is settable
  30.128 +				; for peers and users as well
  30.129 +;callevents=no			; generate manager events when sip ua 
  30.130 +				; performs events (e.g. hold)
  30.131 +;alwaysauthreject = yes		; When an incoming INVITE or REGISTER is to be rejected,
  30.132 + 		    		; for any reason, always reject with '401 Unauthorized'
  30.133 + 				; instead of letting the requester know whether there was
  30.134 + 				; a matching user or peer for their request
  30.135 +
  30.136 +;g726nonstandard = yes		; If the peer negotiates G726-32 audio, use AAL2 packing
  30.137 +				; order instead of RFC3551 packing order (this is required
  30.138 +				; for Sipura and Grandstream ATAs, among others). This is
  30.139 +				; contrary to the RFC3551 specification, the peer _should_
  30.140 +				; be negotiating AAL2-G726-32 instead :-(
  30.141 +
  30.142 +;matchexterniplocally = yes     ; Only substitute the externip or externhost setting if it matches
  30.143 +                                ; your localnet setting. Unless you have some sort of strange network
  30.144 +                                ; setup you will not need to enable this.
  30.145 +
  30.146 +;
  30.147 +; If regcontext is specified, Asterisk will dynamically create and destroy a
  30.148 +; NoOp priority 1 extension for a given peer who registers or unregisters with
  30.149 +; us and have a "regexten=" configuration item.  
  30.150 +; Multiple contexts may be specified by separating them with '&'. The 
  30.151 +; actual extension is the 'regexten' parameter of the registering peer or its
  30.152 +; name if 'regexten' is not provided.  If more than one context is provided,
  30.153 +; the context must be specified within regexten by appending the desired
  30.154 +; context after '@'.  More than one regexten may be supplied if they are 
  30.155 +; separated by '&'.  Patterns may be used in regexten.
  30.156 +;
  30.157 +;regcontext=sipregistrations
  30.158 +;
  30.159 +;--------------------------- RTP timers ----------------------------------------------------
  30.160 +; These timers are currently used for both audio and video streams. The RTP timeouts
  30.161 +; are only applied to the audio channel.
  30.162 +; The settings are settable in the global section as well as per device
  30.163 +;
  30.164 +;rtptimeout=60			; Terminate call if 60 seconds of no RTP or RTCP activity
  30.165 +				; on the audio channel
  30.166 +				; when we're not on hold. This is to be able to hangup
  30.167 +				; a call in the case of a phone disappearing from the net,
  30.168 +				; like a powerloss or grandma tripping over a cable.
  30.169 +;rtpholdtimeout=300		; Terminate call if 300 seconds of no RTP or RTCP activity
  30.170 +				; on the audio channel
  30.171 +				; when we're on hold (must be > rtptimeout)
  30.172 +;rtpkeepalive=<secs>		; Send keepalives in the RTP stream to keep NAT open
  30.173 +				; (default is off - zero)
  30.174 +;--------------------------- SIP DEBUGGING ---------------------------------------------------
  30.175 +;sipdebug = yes			; Turn on SIP debugging by default, from
  30.176 +				; the moment the channel loads this configuration
  30.177 +;recordhistory=yes		; Record SIP history by default 
  30.178 +				; (see sip history / sip no history)
  30.179 +;dumphistory=yes		; Dump SIP history at end of SIP dialogue
  30.180 +				; SIP history is output to the DEBUG logging channel
  30.181 +
  30.182 +
  30.183 +;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
  30.184 +; You can subscribe to the status of extensions with a "hint" priority
  30.185 +; (See extensions.conf.sample for examples)
  30.186 +; chan_sip support two major formats for notifications: dialog-info and SIMPLE 
  30.187 +;
  30.188 +; You will get more detailed reports (busy etc) if you have a call limit set
  30.189 +; for a device. When the call limit is filled, we will indicate busy. Note that
  30.190 +; you need at least 2 in order to be able to do attended transfers.
  30.191 +;
  30.192 +; For queues, you will need this level of detail in status reporting, regardless
  30.193 +; if you use SIP subscriptions. Queues and manager use the same internal interface
  30.194 +; for reading status information.
  30.195 +;
  30.196 +; Note: Subscriptions does not work if you have a realtime dialplan and use the
  30.197 +; realtime switch.
  30.198 +;
  30.199 +;allowsubscribe=no		; Disable support for subscriptions. (Default is yes)
  30.200 +;subscribecontext = default	; Set a specific context for SUBSCRIBE requests
  30.201 +				; Useful to limit subscriptions to local extensions
  30.202 +				; Settable per peer/user also
  30.203 +;notifyringing = yes		; Notify subscriptions on RINGING state (default: no)
  30.204 +;notifyhold = yes		; Notify subscriptions on HOLD state (default: no)
  30.205 +				; Turning on notifyringing and notifyhold will add a lot
  30.206 +				; more database transactions if you are using realtime.
  30.207 +;limitonpeers = yes		; Apply call limits on peers only. This will improve 
  30.208 +				; status notification when you are using type=friend
  30.209 +				; Inbound calls, that really apply to the user part
  30.210 +				; of a friend will now be added to and compared with
  30.211 +				; the peer limit instead of applying two call limits,
  30.212 +				; one for the peer and one for the user.
  30.213 +				; "sip show inuse" will only show active calls on 
  30.214 +				; the peer side of a "type=friend" object if this
  30.215 +				; setting is turned on.
  30.216 +
  30.217 +;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
  30.218 +;
  30.219 +; This setting is available in the [general] section as well as in device configurations.
  30.220 +; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
  30.221 +; both parties have T38 support enabled in their Asterisk configuration 
  30.222 +; This has to be enabled in the general section for all devices to work. You can then
  30.223 +; disable it on a per device basis. 
  30.224 +;
  30.225 +; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
  30.226 +;
  30.227 +; t38pt_udptl = yes            ; Default false
  30.228 +;
  30.229 +;----------------------------------------- OUTBOUND SIP REGISTRATIONS  ------------------------
  30.230 +; Asterisk can register as a SIP user agent to a SIP proxy (provider)
  30.231 +; Format for the register statement is:
  30.232 +;       register => user[:secret[:authuser]]@host[:port][/extension]
  30.233 +;
  30.234 +; If no extension is given, the 's' extension is used. The extension needs to
  30.235 +; be defined in extensions.conf to be able to accept calls from this SIP proxy
  30.236 +; (provider).
  30.237 +;
  30.238 +; host is either a host name defined in DNS or the name of a section defined
  30.239 +; below.
  30.240 +;
  30.241 +; Examples:
  30.242 +;
  30.243 +;register => 1234:password@mysipprovider.com	
  30.244 +;
  30.245 +;     This will pass incoming calls to the 's' extension
  30.246 +;
  30.247 +;
  30.248 +;register => 2345:password@sip_proxy/1234
  30.249 +;
  30.250 +;    Register 2345 at sip provider 'sip_proxy'.  Calls from this provider
  30.251 +;    connect to local extension 1234 in extensions.conf, default context,
  30.252 +;    unless you configure a [sip_proxy] section below, and configure a
  30.253 +;    context.
  30.254 +;    Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
  30.255 +;    Tip 2: Use separate type=peer and type=user sections for SIP providers
  30.256 +;           (instead of type=friend) if you have calls in both directions
  30.257 +  
  30.258 +;registertimeout=20		; retry registration calls every 20 seconds (default)
  30.259 +;registerattempts=10		; Number of registration attempts before we give up
  30.260 +				; 0 = continue forever, hammering the other server
  30.261 +				; until it accepts the registration
  30.262 +				; Default is 0 tries, continue forever
  30.263 +
  30.264 +;----------------------------------------- NAT SUPPORT ------------------------
  30.265 +; The externip, externhost and localnet settings are used if you use Asterisk
  30.266 +; behind a NAT device to communicate with services on the outside.
  30.267 +
  30.268 +;externip = 200.201.202.203	; Address that we're going to put in outbound SIP
  30.269 +				; messages if we're behind a NAT
  30.270 +
  30.271 +				; The externip and localnet is used
  30.272 +				; when registering and communicating with other proxies
  30.273 +				; that we're registered with
  30.274 +;externhost=foo.dyndns.net	; Alternatively you can specify an 
  30.275 +				; external host, and Asterisk will 
  30.276 +				; perform DNS queries periodically.  Not
  30.277 +				; recommended for production 
  30.278 +				; environments!  Use externip instead
  30.279 +;externrefresh=10		; How often to refresh externhost if 
  30.280 +				; used
  30.281 +				; You may add multiple local networks.  A reasonable 
  30.282 +				; set of defaults are:
  30.283 +;localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
  30.284 +;localnet=10.0.0.0/255.0.0.0	; Also RFC1918
  30.285 +;localnet=172.16.0.0/12		; Another RFC1918 with CIDR notation
  30.286 +;localnet=169.254.0.0/255.255.0.0 ;Zero conf local network
  30.287 +
  30.288 +; The nat= setting is used when Asterisk is on a public IP, communicating with
  30.289 +; devices hidden behind a NAT device (broadband router).  If you have one-way
  30.290 +; audio problems, you usually have problems with your NAT configuration or your
  30.291 +; firewall's support of SIP+RTP ports.  You configure Asterisk choice of RTP
  30.292 +; ports for incoming audio in rtp.conf
  30.293 +;
  30.294 +;nat=no				; Global NAT settings  (Affects all peers and users)
  30.295 +                                ; yes = Always ignore info and assume NAT
  30.296 +                                ; no = Use NAT mode only according to RFC3581 (;rport)
  30.297 +                                ; never = Never attempt NAT mode or RFC3581 support
  30.298 +				; route = Assume NAT, don't send rport 
  30.299 +				; (work around more UNIDEN bugs)
  30.300 +
  30.301 +;----------------------------------- MEDIA HANDLING --------------------------------
  30.302 +; By default, Asterisk tries to re-invite the audio to an optimal path. If there's
  30.303 +; no reason for Asterisk to stay in the media path, the media will be redirected.
  30.304 +; This does not really work with in the case where Asterisk is outside and have
  30.305 +; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat
  30.306 +;
  30.307 +;canreinvite=yes		; Asterisk by default tries to redirect the
  30.308 +				; RTP media stream (audio) to go directly from
  30.309 +				; the caller to the callee.  Some devices do not
  30.310 +				; support this (especially if one of them is behind a NAT).
  30.311 +				; The default setting is YES. If you have all clients
  30.312 +				; behind a NAT, or for some other reason wants Asterisk to
  30.313 +				; stay in the audio path, you may want to turn this off.
  30.314 +
  30.315 +				; In Asterisk 1.4 this setting also affect direct RTP
  30.316 +				; at call setup (a new feature in 1.4 - setting up the
  30.317 +				; call directly between the endpoints instead of sending
  30.318 +				; a re-INVITE).
  30.319 +
  30.320 +;directrtpsetup=yes		; Enable the new experimental direct RTP setup. This sets up
  30.321 +				; the call directly with media peer-2-peer without re-invites.
  30.322 +				; Will not work for video and cases where the callee sends 
  30.323 +				; RTP payloads and fmtp headers in the 200 OK that does not match the
  30.324 +				; callers INVITE. This will also fail if canreinvite is enabled when
  30.325 +				; the device is actually behind NAT.
  30.326 +
  30.327 +;canreinvite=nonat		; An additional option is to allow media path redirection
  30.328 +				; (reinvite) but only when the peer where the media is being
  30.329 +				; sent is known to not be behind a NAT (as the RTP core can
  30.330 +				; determine it based on the apparent IP address the media
  30.331 +				; arrives from).
  30.332 +
  30.333 +;canreinvite=update		; Yet a third option... use UPDATE for media path redirection,
  30.334 +				; instead of INVITE. This can be combined with 'nonat', as
  30.335 +				; 'canreinvite=update,nonat'. It implies 'yes'.
  30.336 +
  30.337 +;----------------------------------------- REALTIME SUPPORT ------------------------
  30.338 +; For additional information on ARA, the Asterisk Realtime Architecture,
  30.339 +; please read realtime.txt and extconfig.txt in the /doc directory of the
  30.340 +; source code.
  30.341 +;
  30.342 +;rtcachefriends=yes		; Cache realtime friends by adding them to the internal list
  30.343 +				; just like friends added from the config file only on a
  30.344 +				; as-needed basis? (yes|no)
  30.345 +
  30.346 +;rtsavesysname=yes		; Save systemname in realtime database at registration
  30.347 +				; Default= no
  30.348 +
  30.349 +;rtupdate=yes			; Send registry updates to database using realtime? (yes|no)
  30.350 +				; If set to yes, when a SIP UA registers successfully, the ip address,
  30.351 +				; the origination port, the registration period, and the username of
  30.352 +				; the UA will be set to database via realtime. 
  30.353 +				; If not present, defaults to 'yes'.
  30.354 +;rtautoclear=yes		; Auto-Expire friends created on the fly on the same schedule
  30.355 +				; as if it had just registered? (yes|no|<seconds>)
  30.356 +				; If set to yes, when the registration expires, the friend will
  30.357 +				; vanish from the configuration until requested again. If set
  30.358 +				; to an integer, friends expire within this number of seconds
  30.359 +				; instead of the registration interval.
  30.360 +
  30.361 +;ignoreregexpire=yes		; Enabling this setting has two functions:
  30.362 +				;
  30.363 +				; For non-realtime peers, when their registration expires, the
  30.364 +				; information will _not_ be removed from memory or the Asterisk database
  30.365 +				; if you attempt to place a call to the peer, the existing information
  30.366 +				; will be used in spite of it having expired
  30.367 +				;
  30.368 +				; For realtime peers, when the peer is retrieved from realtime storage,
  30.369 +				; the registration information will be used regardless of whether
  30.370 +				; it has expired or not; if it expires while the realtime peer 
  30.371 +				; is still in memory (due to caching or other reasons), the 
  30.372 +				; information will not be removed from realtime storage
  30.373 +
  30.374 +;----------------------------------------- SIP DOMAIN SUPPORT ------------------------
  30.375 +; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
  30.376 +; domains, each of which can direct the call to a specific context if desired.
  30.377 +; By default, all domains are accepted and sent to the default context or the
  30.378 +; context associated with the user/peer placing the call.
  30.379 +; Domains can be specified using:
  30.380 +; domain=<domain>[,<context>]
  30.381 +; Examples:
  30.382 +; domain=myasterisk.dom
  30.383 +; domain=customer.com,customer-context
  30.384 +;
  30.385 +; In addition, all the 'default' domains associated with a server should be
  30.386 +; added if incoming request filtering is desired.
  30.387 +; autodomain=yes
  30.388 +;
  30.389 +; To disallow requests for domains not serviced by this server:
  30.390 +; allowexternaldomains=no
  30.391 +
  30.392 +;domain=mydomain.tld,mydomain-incoming
  30.393 +				; Add domain and configure incoming context
  30.394 +				; for external calls to this domain
  30.395 +;domain=1.2.3.4			; Add IP address as local domain
  30.396 +				; You can have several "domain" settings
  30.397 +;allowexternaldomains=no	; Disable INVITE and REFER to non-local domains
  30.398 +				; Default is yes
  30.399 +;autodomain=yes			; Turn this on to have Asterisk add local host
  30.400 +				; name and local IP to domain list.
  30.401 +
  30.402 +; fromdomain=mydomain.tld 	; When making outbound SIP INVITEs to
  30.403 +                          	; non-peers, use your primary domain "identity"
  30.404 +                          	; for From: headers instead of just your IP
  30.405 +                          	; address. This is to be polite and
  30.406 +                          	; it may be a mandatory requirement for some
  30.407 +                          	; destinations which do not have a prior
  30.408 +                          	; account relationship with your server. 
  30.409 +
  30.410 +;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
  30.411 +; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
  30.412 +                              ; SIP channel. Defaults to "no". An enabled jitterbuffer will
  30.413 +                              ; be used only if the sending side can create and the receiving
  30.414 +                              ; side can not accept jitter. The SIP channel can accept jitter,
  30.415 +                              ; thus a jitterbuffer on the receive SIP side will be used only
  30.416 +                              ; if it is forced and enabled.
  30.417 +
  30.418 +; jbforce = no                ; Forces the use of a jitterbuffer on the receive side of a SIP
  30.419 +                              ; channel. Defaults to "no".
  30.420 +
  30.421 +; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
  30.422 +
  30.423 +; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
  30.424 +                              ; resynchronized. Useful to improve the quality of the voice, with
  30.425 +                              ; big jumps in/broken timestamps, usually sent from exotic devices
  30.426 +                              ; and programs. Defaults to 1000.
  30.427 +
  30.428 +; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a SIP
  30.429 +                              ; channel. Two implementations are currently available - "fixed"
  30.430 +                              ; (with size always equals to jbmaxsize) and "adaptive" (with
  30.431 +                              ; variable size, actually the new jb of IAX2). Defaults to fixed.
  30.432 +
  30.433 +; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
  30.434 +;-----------------------------------------------------------------------------------
  30.435 +
  30.436 +;[authentication]
  30.437 +; Global credentials for outbound calls, i.e. when a proxy challenges your
  30.438 +; Asterisk server for authentication. These credentials override
  30.439 +; any credentials in peer/register definition if realm is matched.
  30.440 +;
  30.441 +; This way, Asterisk can authenticate for outbound calls to other
  30.442 +; realms. We match realm on the proxy challenge and pick an set of 
  30.443 +; credentials from this list
  30.444 +; Syntax:
  30.445 +;	auth = <user>:<secret>@<realm>
  30.446 +;	auth = <user>#<md5secret>@<realm>
  30.447 +; Example:
  30.448 +;auth=mark:topsecret@digium.com
  30.449 +; 
  30.450 +; You may also add auth= statements to [peer] definitions 
  30.451 +; Peer auth= override all other authentication settings if we match on realm
  30.452 +
  30.453 +;------------------------------------------------------------------------------
  30.454 +; Users and peers have different settings available. Friends have all settings,
  30.455 +; since a friend is both a peer and a user
  30.456 +;
  30.457 +; User config options:        Peer configuration:
  30.458 +; --------------------        -------------------
  30.459 +; context                     context
  30.460 +; callingpres		      callingpres
  30.461 +; permit                      permit
  30.462 +; deny                        deny
  30.463 +; secret                      secret
  30.464 +; md5secret                   md5secret
  30.465 +; dtmfmode                    dtmfmode
  30.466 +; canreinvite                 canreinvite
  30.467 +; nat                         nat
  30.468 +; callgroup                   callgroup
  30.469 +; pickupgroup                 pickupgroup
  30.470 +; language                    language
  30.471 +; allow                       allow
  30.472 +; disallow                    disallow
  30.473 +; insecure                    insecure
  30.474 +; trustrpid                   trustrpid
  30.475 +; progressinband              progressinband
  30.476 +; promiscredir                promiscredir
  30.477 +; useclientcode               useclientcode
  30.478 +; accountcode                 accountcode
  30.479 +; setvar                      setvar
  30.480 +; callerid		      callerid
  30.481 +; amaflags		      amaflags
  30.482 +; call-limit		      call-limit
  30.483 +; allowoverlap		      allowoverlap
  30.484 +; allowsubscribe	      allowsubscribe
  30.485 +; allowtransfer	      	      allowtransfer
  30.486 +; subscribecontext	      subscribecontext
  30.487 +; videosupport		      videosupport
  30.488 +; maxcallbitrate	      maxcallbitrate
  30.489 +; rfc2833compensate           mailbox
  30.490 +;                             username
  30.491 +;                             template
  30.492 +;                             fromdomain
  30.493 +;                             regexten
  30.494 +;                             fromuser
  30.495 +;                             host
  30.496 +;                             port
  30.497 +;                             qualify
  30.498 +;                             defaultip
  30.499 +;                             rtptimeout
  30.500 +;                             rtpholdtimeout
  30.501 +;                             sendrpid
  30.502 +;                             outboundproxy
  30.503 +;                             rfc2833compensate
  30.504 +
  30.505 +;[sip_proxy]
  30.506 +; For incoming calls only. Example: FWD (Free World Dialup)
  30.507 +; We match on IP address of the proxy for incoming calls 
  30.508 +; since we can not match on username (caller id)
  30.509 +;type=peer
  30.510 +;context=from-fwd
  30.511 +;host=fwd.pulver.com
  30.512 +
  30.513 +;[sip_proxy-out]
  30.514 +;type=peer          			; we only want to call out, not be called
  30.515 +;secret=guessit
  30.516 +;username=yourusername			; Authentication user for outbound proxies
  30.517 +;fromuser=yourusername			; Many SIP providers require this!
  30.518 +;fromdomain=provider.sip.domain	
  30.519 +;host=box.provider.com
  30.520 +;usereqphone=yes			; This provider requires ";user=phone" on URI
  30.521 +;call-limit=5				; permit only 5 simultaneous outgoing calls to this peer
  30.522 +;outboundproxy=proxy.provider.domain	; send outbound signaling to this proxy, not directly to the peer
  30.523 +					; Call-limits will not be enforced on real-time peers,
  30.524 +					; since they are not stored in-memory
  30.525 +;port=80				; The port number we want to connect to on the remote side
  30.526 +					; Also used as "defaultport" in combination with "defaultip" settings
  30.527 +
  30.528 +;------------------------------------------------------------------------------
  30.529 +; Definitions of locally connected SIP devices
  30.530 +;
  30.531 +; type = user	a device that authenticates to us by "from" field to place calls
  30.532 +; type = peer	a device we place calls to or that calls us and we match by host
  30.533 +; type = friend two configurations (peer+user) in one
  30.534 +;
  30.535 +; For device names, we recommend using only a-z, numerics (0-9) and underscore
  30.536 +; 
  30.537 +; For local phones, type=friend works most of the time
  30.538 +;
  30.539 +; If you have one-way audio, you probably have NAT problems. 
  30.540 +; If Asterisk is on a public IP, and the phone is inside of a NAT device
  30.541 +; you will need to configure nat option for those phones.
  30.542 +; Also, turn on qualify=yes to keep the nat session open
  30.543 +
  30.544 +;[grandstream1]
  30.545 +;type=friend 			
  30.546 +;context=from-sip		; Where to start in the dialplan when this phone calls
  30.547 +;callerid=John Doe <1234>	; Full caller ID, to override the phones config
  30.548 +				; on incoming calls to Asterisk
  30.549 +;host=192.168.0.23		; we have a static but private IP address
  30.550 +				; No registration allowed
  30.551 +;nat=no				; there is not NAT between phone and Asterisk
  30.552 +;canreinvite=yes		; allow RTP voice traffic to bypass Asterisk
  30.553 +;dtmfmode=info			; either RFC2833 or INFO for the BudgeTone
  30.554 +;call-limit=1			; permit only 1 outgoing call and 1 incoming call at a time
  30.555 +				; from the phone to asterisk
  30.556 +				; 1 for the explicit peer, 1 for the explicit user,
  30.557 +				; remember that a friend equals 1 peer and 1 user in
  30.558 +				; memory
  30.559 +				; This will affect your subscriptions as well.
  30.560 +				; There is no combined call counter for a "friend"
  30.561 +				; so there's currently no way in sip.conf to limit
  30.562 +				; to one inbound or outbound call per phone. Use
  30.563 +				; the group counters in the dial plan for that.
  30.564 +				;
  30.565 +;mailbox=1234@default		; mailbox 1234 in voicemail context "default"
  30.566 +;disallow=all			; need to disallow=all before we can use allow=
  30.567 +;allow=ulaw			; Note: In user sections the order of codecs
  30.568 +				; listed with allow= does NOT matter!
  30.569 +;allow=alaw
  30.570 +;allow=g723.1			; Asterisk only supports g723.1 pass-thru!
  30.571 +;allow=g729			; Pass-thru only unless g729 license obtained
  30.572 +;callingpres=allowed_passed_screen	; Set caller ID presentation
  30.573 +				; See README.callingpres for more information
  30.574 +
  30.575 +
  30.576 +;[xlite1]
  30.577 +; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
  30.578 +; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
  30.579 +;type=friend
  30.580 +;regexten=1234			; When they register, create extension 1234
  30.581 +;callerid="Jane Smith" <5678>
  30.582 +;host=dynamic			; This device needs to register
  30.583 +;nat=yes			; X-Lite is behind a NAT router
  30.584 +;canreinvite=no			; Typically set to NO if behind NAT
  30.585 +;disallow=all
  30.586 +;allow=gsm			; GSM consumes far less bandwidth than ulaw
  30.587 +;allow=ulaw
  30.588 +;allow=alaw
  30.589 +;mailbox=1234@default,1233@default	; Subscribe to status of multiple mailboxes
  30.590 +
  30.591 +
  30.592 +;[snom]
  30.593 +;type=friend			; Friends place calls and receive calls
  30.594 +;context=from-sip		; Context for incoming calls from this user
  30.595 +;secret=blah
  30.596 +;subscribecontext=localextensions	; Only allow SUBSCRIBE for local extensions
  30.597 +;language=de			; Use German prompts for this user 
  30.598 +;host=dynamic			; This peer register with us
  30.599 +;dtmfmode=inband		; Choices are inband, rfc2833, or info
  30.600 +;defaultip=192.168.0.59		; IP used until peer registers
  30.601 +;mailbox=1234@context,2345      ; Mailbox(-es) for message waiting indicator
  30.602 +;subscribemwi=yes		; Only send notifications if this phone 
  30.603 +				; subscribes for mailbox notification
  30.604 +;vmexten=voicemail		; dialplan extension to reach mailbox 
  30.605 +				; sets the Message-Account in the MWI notify message
  30.606 +				; defaults to global vmexten which defaults to "asterisk"
  30.607 +;disallow=all
  30.608 +;allow=ulaw			; dtmfmode=inband only works with ulaw or alaw!
  30.609 +
  30.610 +
  30.611 +;[polycom]
  30.612 +;type=friend			; Friends place calls and receive calls
  30.613 +;context=from-sip		; Context for incoming calls from this user
  30.614 +;secret=blahpoly
  30.615 +;host=dynamic			; This peer register with us
  30.616 +;dtmfmode=rfc2833		; Choices are inband, rfc2833, or info
  30.617 +;username=polly			; Username to use in INVITE until peer registers
  30.618 +				; Normally you do NOT need to set this parameter
  30.619 +;disallow=all
  30.620 +;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
  30.621 +;progressinband=no		; Polycom phones don't work properly with "never"
  30.622 +
  30.623 +
  30.624 +;[pingtel]
  30.625 +;type=friend
  30.626 +;secret=blah
  30.627 +;host=dynamic
  30.628 +;insecure=port			; Allow matching of peer by IP address without 
  30.629 +				; matching port number
  30.630 +;insecure=invite		; Do not require authentication of incoming INVITEs
  30.631 +;insecure=port,invite		; (both)
  30.632 +;qualify=1000			; Consider it down if it's 1 second to reply
  30.633 +				; Helps with NAT session
  30.634 +				; qualify=yes uses default value
  30.635 +;
  30.636 +; Call group and Pickup group should be in the range from 0 to 63
  30.637 +;
  30.638 +;callgroup=1,3-4		; We are in caller groups 1,3,4
  30.639 +;pickupgroup=1,3-5		; We can do call pick-p for call group 1,3,4,5
  30.640 +;defaultip=192.168.0.60		; IP address to use if peer has not registered
  30.641 +;deny=0.0.0.0/0.0.0.0		; ACL: Control access to this account based on IP address
  30.642 +;permit=192.168.0.60/255.255.255.0
  30.643 +
  30.644 +;[cisco1]
  30.645 +;type=friend
  30.646 +;secret=blah
  30.647 +;qualify=200			; Qualify peer is no more than 200ms away
  30.648 +;nat=yes			; This phone may be natted
  30.649 +				; Send SIP and RTP to the IP address that packet is 
  30.650 +				; received from instead of trusting SIP headers 
  30.651 +;host=dynamic			; This device registers with us
  30.652 +;canreinvite=no			; Asterisk by default tries to redirect the
  30.653 +				; RTP media stream (audio) to go directly from
  30.654 +				; the caller to the callee.  Some devices do not
  30.655 +				; support this (especially if one of them is 
  30.656 +				; behind a NAT).
  30.657 +;defaultip=192.168.0.4		; IP address to use until registration
  30.658 +;username=goran			; Username to use when calling this device before registration
  30.659 +				; Normally you do NOT need to set this parameter
  30.660 +;setvar=CUSTID=5678		; Channel variable to be set for all calls from this device
  30.661 +
  30.662 +;[pre14-asterisk]
  30.663 +;type=friend
  30.664 +;secret=digium
  30.665 +;host=dynamic
  30.666 +;rfc2833compensate=yes		; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
  30.667 +				; You must have this turned on or DTMF reception will work improperly.
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/asterisk/sip_notify.conf	Mon Apr 27 12:19:05 2009 +0200
    31.3 @@ -0,0 +1,22 @@
    31.4 +;[polycom-check-cfg]
    31.5 +;Event=>check-sync
    31.6 +;Content-Length=>0
    31.7 +
    31.8 +; Untested
    31.9 +;[sipura-check-cfg]
   31.10 +;Event=>resync
   31.11 +;Content-Length=>0
   31.12 +
   31.13 +; Untested
   31.14 +;[grandstream-check-cfg]
   31.15 +;Event=>sys-control
   31.16 +
   31.17 +; Untested
   31.18 +;[cisco-check-cfg]
   31.19 +;Event=>check-sync
   31.20 +;Content-Length=>0
   31.21 +
   31.22 +; Tested
   31.23 +;[snom-check-cfg]
   31.24 +;Event=>check-sync\;reboot=false
   31.25 +;Content-Length=>0
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/asterisk/sla.conf	Mon Apr 27 12:19:05 2009 +0200
    32.3 @@ -0,0 +1,140 @@
    32.4 +;
    32.5 +; Configuration for Shared Line Appearances (SLA).
    32.6 +;
    32.7 +; See doc/sla.pdf for more information.
    32.8 +;
    32.9 +
   32.10 +; ---- General Options ----------------
   32.11 +;[general]
   32.12 +
   32.13 +;attemptcallerid=no         ; Attempt CallerID handling.  The default value for this
   32.14 +                            ; is "no" because CallerID handling with an SLA setup is
   32.15 +                            ; known to not work properly in some situations.  However,
   32.16 +                            ; feel free to enable it if you would like.  If you do, and
   32.17 +                            ; you find problems, please do not report them.
   32.18 +; -------------------------------------
   32.19 +
   32.20 +
   32.21 +; ---- Trunk Declarations -------------
   32.22 +;
   32.23 +;[line1]                    ; Provide a name for this trunk.
   32.24 +
   32.25 +;type=trunk                 ; This line is what marks this entry as a trunk.
   32.26 +
   32.27 +;device=Zap/3               ; Map this trunk declaration to a specific device.
   32.28 +                            ; NOTE: You can not just put any type of channel here.
   32.29 +                            ;       Zap channels can be directly used.  IP trunks
   32.30 +                            ;       require some indirect configuration which is
   32.31 +                            ;       described in doc/sla.pdf.
   32.32 +
   32.33 +;autocontext=line1          ; This supports automatic generation of the dialplan entries 
   32.34 +                            ; if the autocontext option is used.  Each trunk should have 
   32.35 +                            ; a unique context name.  Then, in zapata.conf, this device 
   32.36 +                            ; should be configured to have incoming calls go to this context.
   32.37 +
   32.38 +;ringtimeout=30             ; Set how long to allow this trunk to ring on an inbound call before hanging 
   32.39 +                            ; it up as an unanswered call.  The value is in seconds.
   32.40 +
   32.41 +;barge=no                   ; If this option is set to "no", then no station will be
   32.42 +                            ; allowed to join a call that is in progress.  The default
   32.43 +                            ; value is "yes".
   32.44 +
   32.45 +;hold=private               ; This option configure hold permissions for this trunk.
   32.46 +                            ;   "open"    - This means that any station can put this trunk
   32.47 +                            ;               on hold, and any station can retrieve it from
   32.48 +                            ;               hold.  This is the default.
   32.49 +                            ;   "private" - This means that once a station puts the
   32.50 +                            ;               trunk on hold, no other station will be
   32.51 +                            ;               allowed to retrieve the call from hold.
   32.52 +
   32.53 +;[line2]
   32.54 +;type=trunk
   32.55 +;device=Zap/4
   32.56 +;autocontext=line2
   32.57 +
   32.58 +;[line3]
   32.59 +;type=trunk
   32.60 +;device=Zap/3
   32.61 +;autocontext=line3
   32.62 +
   32.63 +;[line4]
   32.64 +;type=trunk
   32.65 +;device=Local/disa@line4_outbound ; A Local channel in combination with the Disa
   32.66 +                                  ; application can be used to support IP trunks.
   32.67 +                                  ; See doc/sla.pdf on more information on how
   32.68 +                                  ; IP trunks work.
   32.69 +;autocontext=line4
   32.70 +; --------------------------------------
   32.71 +
   32.72 +
   32.73 +; ---- Station Declarations ------------
   32.74 +
   32.75 +;[station1]                 ; Define a name for this station.
   32.76 +
   32.77 +;type=station               ; This line indicates that this entry is a station.
   32.78 +
   32.79 +;device=SIP/station1        ; Each station must be mapped to a device.
   32.80 +
   32.81 +;autocontext=sla_stations   ; This supports automatic generation of the dialplan entries if 
   32.82 +                            ; the autocontext option is used.  All stations can use the same 
   32.83 +                            ; context without conflict.  The device for this station should 
   32.84 +                            ; have its context configured to the same one listed here.
   32.85 +
   32.86 +;ringtimeout=10             ; Set a timeout for how long to allow the station to ring for an 
   32.87 +                            ; incoming call, in seconds.
   32.88 +
   32.89 +;ringdelay=10               ; Set a time for how long to wait before beginning to ring this station
   32.90 +                            ; once there is an incoming call, in seconds.
   32.91 +
   32.92 +;hold=private               ; This option configure hold permissions for this station.  Note
   32.93 +                            ; that if private hold is set in the trunk entry, that will override
   32.94 +                            ; anything here.  However, if a trunk has open hold access, but this
   32.95 +                            ; station is set to private hold, then the private hold will be in
   32.96 +                            ; effect.
   32.97 +                            ;   "open"    - This means that once this station puts a call
   32.98 +                            ;               on hold, any other station is allowed to retrieve
   32.99 +                            ;               it.  This is the default.
  32.100 +                            ;   "private" - This means that once this station puts a
  32.101 +                            ;               call on hold, no other station will be
  32.102 +                            ;               allowed to retrieve the call from hold.
  32.103 +      
  32.104 +
  32.105 +;trunk=line1                ; Individually list all of the trunks that will appear on this station.  This
  32.106 +                            ; order is significant.  It should be the same order as they appear on the
  32.107 +                            ; phone.  The order here defines the order of preference that the trunks will
  32.108 +                            ; be used.
  32.109 +;trunk=line2
  32.110 +;trunk=line3,ringdelay=5    ; A ring delay for the station can also be specified for a specific trunk.
  32.111 +                            ; If a ring delay is specified both for the whole station and for a specific
  32.112 +                            ; trunk on a station, the setting for the specific trunk will take priority.
  32.113 +                            ; This value is in seconds.
  32.114 +
  32.115 +;trunk=line4,ringtimeout=5  ; A ring timeout for the station can also be specified for a specific trunk.
  32.116 +                            ; If a ring timeout is specified both for the whole station and for a specific
  32.117 +                            ; trunk on a station, the setting for the specific trunk will take priority.
  32.118 +                            ; This value is in seconds.
  32.119 +
  32.120 +
  32.121 +;[station](!)               ; When there are a lot of stations that are configured the same way,
  32.122 +                            ; it is convenient to use a configuration template like this so that
  32.123 +                            ; the common settings stay in one place.
  32.124 +;type=station
  32.125 +;autocontext=sla_stations
  32.126 +;trunk=line1
  32.127 +;trunk=line2 
  32.128 +;trunk=line3
  32.129 +;trunk=line4 
  32.130 +
  32.131 +;[station2](station)        ; Define a station that uses the configuration from the template "station".
  32.132 +;device=SIP/station2
  32.133 +;
  32.134 +;[station3](station)
  32.135 +;device=SIP/station3
  32.136 +;
  32.137 +;[station4](station)
  32.138 +;device=SIP/station4
  32.139 +;
  32.140 +;[station5](station)
  32.141 +;device=SIP/station5
  32.142 +; --------------------------------------
  32.143 +
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/asterisk/voicemail.conf	Mon Apr 27 12:19:05 2009 +0200
    33.3 @@ -0,0 +1,248 @@
    33.4 +;
    33.5 +; Voicemail Configuration
    33.6 +;
    33.7 +
    33.8 +;
    33.9 +; NOTE: Asterisk has to edit this file to change a user's password.  This does
   33.10 +; not currently work with the "#include <file>" directive for Asterisk
   33.11 +; configuration files, nor when using realtime static configuration.
   33.12 +; Do not use them with this configuration file.
   33.13 +;
   33.14 +
   33.15 +;[general]
   33.16 +; Formats for writing Voicemail.  Note that when using IMAP storage for
   33.17 +; voicemail, only the first format specified will be used.
   33.18 +;format=g723sf|wav49|wav
   33.19 +;format=wav49|gsm|wav
   33.20 +;
   33.21 +; WARNING:
   33.22 +; If you change the list of formats that you record voicemail in
   33.23 +; when you have mailboxes that contain messages, you _MUST_ absolutely
   33.24 +; manually go through those mailboxes and convert/delete/add the
   33.25 +; the message files so that they appear to have been stored using
   33.26 +; your new format list. If you don't do this, very unpleasant
   33.27 +; things may happen to your users while they are retrieving and
   33.28 +; manipulating their voicemail.
   33.29 +;
   33.30 +; In other words: don't change the format list on a production system
   33.31 +; unless you are _VERY_  sure that you know what you are doing and are
   33.32 +; prepared for the consequences.
   33.33 +;
   33.34 +; Who the e-mail notification should appear to come from
   33.35 +;serveremail=asterisk
   33.36 +;serveremail=asterisk@linux-support.net
   33.37 +; Should the email contain the voicemail as an attachment
   33.38 +;attach=yes
   33.39 +; Maximum number of messages per folder.  If not specified, a default value
   33.40 +; (100) is used.  Maximum value for this option is 9999.
   33.41 +;maxmsg=100
   33.42 +; Maximum length of a voicemail message in seconds
   33.43 +;maxmessage=180
   33.44 +; Minimum length of a voicemail message in seconds for the message to be kept
   33.45 +; The default is no minimum.
   33.46 +;minmessage=3
   33.47 +; Maximum length of greetings in seconds
   33.48 +;maxgreet=60
   33.49 +; How many milliseconds to skip forward/back when rew/ff in message playback
   33.50 +;skipms=3000
   33.51 +; How many seconds of silence before we end the recording
   33.52 +;maxsilence=10
   33.53 +; Silence threshold (what we consider silence: the lower, the more sensitive)
   33.54 +;silencethreshold=128
   33.55 +; Max number of failed login attempts
   33.56 +;maxlogins=3
   33.57 +;
   33.58 +; User context is where entries from users.conf are registered.  The
   33.59 +; default value is 'default'
   33.60 +;
   33.61 +;userscontext=default
   33.62 +;
   33.63 +; If you need to have an external program, i.e. /usr/bin/myapp
   33.64 +; called when a voicemail is left, delivered, or your voicemailbox 
   33.65 +; is checked, uncomment this.  It can also be set to 'smdi' to use
   33.66 +; smdi for external notification.  If it is 'smdi', smdiport should
   33.67 +; be set to a valid port as specified in smdi.conf.
   33.68 +
   33.69 +;externnotify=/usr/bin/myapp
   33.70 +;smdiport=/dev/ttyS0
   33.71 +
   33.72 +; If you need to have an external program, i.e. /usr/bin/myapp
   33.73 +; called when a voicemail password is changed, uncomment this:
   33.74 +;externpass=/usr/bin/myapp
   33.75 +; For the directory, you can override the intro file if you want
   33.76 +;directoryintro=dir-intro
   33.77 +; The character set for voicemail messages can be specified here
   33.78 +;charset=ISO-8859-1
   33.79 +; The ADSI feature descriptor number to download to 
   33.80 +;adsifdn=0000000F
   33.81 +; The ADSI security lock code
   33.82 +;adsisec=9BDBF7AC
   33.83 +; The ADSI voicemail application version number.
   33.84 +;adsiver=1
   33.85 +; Skip the "[PBX]:" string from the message title
   33.86 +;pbxskip=yes
   33.87 +; Change the From: string
   33.88 +;fromstring=The Asterisk PBX
   33.89 +; Permit finding entries for forward/compose from the directory
   33.90 +;usedirectory=yes
   33.91 +; Voicemail can be stored in a database using the ODBC driver.
   33.92 +; The value of odbcstorage is the database connection configured
   33.93 +; in res_odbc.conf.
   33.94 +;odbcstorage=asterisk
   33.95 +; The default table for ODBC voicemail storage is voicemessages.
   33.96 +;odbctable=voicemessages
   33.97 +;
   33.98 +; Change the from, body and/or subject, variables:
   33.99 +;     VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_CIDNUM,
  33.100 +;     VM_CIDNAME, VM_DATE
  33.101 +;
  33.102 +; Note: The emailbody config row can only be up to 512 characters due to a
  33.103 +;       limitation in the Asterisk configuration subsystem.
  33.104 +;emailsubject=[PBX]: New message ${VM_MSGNUM} in mailbox ${VM_MAILBOX}
  33.105 +; The following definition is very close to the default, but the default shows
  33.106 +; just the CIDNAME, if it is not null, otherwise just the CIDNUM, or "an unknown
  33.107 +; caller", if they are both null.
  33.108 +;emailbody=Dear ${VM_NAME}:\n\n\tjust wanted to let you know you were just left a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE}, so you might\nwant to check it when you get a chance.  Thanks!\n\n\t\t\t\t--Asterisk\n
  33.109 +;
  33.110 +; You can also change the Pager From: string, the pager body and/or subject.
  33.111 +; The above defined variables also can be used here
  33.112 +;pagerfromstring=The Asterisk PBX
  33.113 +;pagersubject=New VM
  33.114 +;pagerbody=New ${VM_DUR} long msg in box ${VM_MAILBOX}\nfrom ${VM_CALLERID}, on ${VM_DATE}
  33.115 +;
  33.116 +; Set the date format on outgoing mails. Valid arguments can be found on the
  33.117 +; strftime(3) man page
  33.118 +;
  33.119 +; Default
  33.120 +;emaildateformat=%A, %B %d, %Y at %r
  33.121 +; 24h date format
  33.122 +;emaildateformat=%A, %d %B %Y at %H:%M:%S
  33.123 +;
  33.124 +; You can override the default program to send e-mail if you wish, too
  33.125 +;
  33.126 +;mailcmd=/usr/sbin/sendmail -t
  33.127 +; 
  33.128 +; Users may be located in different timezones, or may have different 
  33.129 +; message announcements for their introductory message when they enter 
  33.130 +; the voicemail system. Set the message and the timezone each user 
  33.131 +; hears here. Set the user into one of these zones with the tz= attribute 
  33.132 +; in the options field of the mailbox. Of course, language substitution 
  33.133 +; still applies here so you may have several directory trees that have 
  33.134 +; alternate language choices. 
  33.135 +; 
  33.136 +; Look in /usr/share/zoneinfo/ for names of timezones. 
  33.137 +; Look at the manual page for strftime for a quick tutorial on how the 
  33.138 +; variable substitution is done on the values below. 
  33.139 +; 
  33.140 +; Supported values: 
  33.141 +; 'filename'    filename of a soundfile (single ticks around the filename
  33.142 +;               required)
  33.143 +; ${VAR}        variable substitution 
  33.144 +; A or a        Day of week (Saturday, Sunday, ...) 
  33.145 +; B or b or h   Month name (January, February, ...) 
  33.146 +; d or e        numeric day of month (first, second, ..., thirty-first) 
  33.147 +; Y             Year 
  33.148 +; I or l        Hour, 12 hour clock 
  33.149 +; H             Hour, 24 hour clock (single digit hours preceded by "oh") 
  33.150 +; k             Hour, 24 hour clock (single digit hours NOT preceded by "oh") 
  33.151 +; M             Minute, with 00 pronounced as "o'clock" 
  33.152 +; N             Minute, with 00 pronounced as "hundred" (US military time)
  33.153 +; P or p        AM or PM 
  33.154 +; Q             "today", "yesterday" or ABdY
  33.155 +;               (*note: not standard strftime value) 
  33.156 +; q             "" (for today), "yesterday", weekday, or ABdY
  33.157 +;               (*note: not standard strftime value) 
  33.158 +; R             24 hour time, including minute 
  33.159 +; 
  33.160 +; 
  33.161 +;
  33.162 +; Each mailbox is listed in the form <mailbox>=<password>,<name>,<email>,<pager_email>,<options>
  33.163 +; if the e-mail is specified, a message will be sent when a message is
  33.164 +; received, to the given mailbox. If pager is specified, a message will be
  33.165 +; sent there as well. If the password is prefixed by '-', then it is
  33.166 +; considered to be unchangeable.
  33.167 +;
  33.168 +; Advanced options example is extension 4069
  33.169 +; NOTE: All options can be expressed globally in the general section, and
  33.170 +; overridden in the per-mailbox settings, unless listed otherwise.
  33.171 +; 
  33.172 +; tz=central 		; Timezone from zonemessages below. Irrelevant if envelope=no.
  33.173 +; attach=yes 		; Attach the voicemail to the notification email *NOT* the pager email
  33.174 +; attachfmt=wav49	; Which format to attach to the email.  Normally this is the
  33.175 +			; first format specified in the format parameter above, but this
  33.176 +			; option lets you customize the format sent to particular mailboxes.
  33.177 +			; Useful if Windows users want wav49, but Linux users want gsm.
  33.178 +			; [per-mailbox only]
  33.179 +; saycid=yes 		; Say the caller id information before the message. If not described, 
  33.180 +			;     or set to no, it will be in the envelope
  33.181 +; cidinternalcontexts=intern	; Internal Context for Name Playback instead of 
  33.182 +			; extension digits when saying caller id.
  33.183 +; sayduration=no 	; Turn on/off the duration information before the message. [ON by default]
  33.184 +; saydurationm=2        ; Specify the minimum duration to say. Default is 2 minutes
  33.185 +; dialout=fromvm ; Context to dial out from [option 4 from mailbox's advanced menu]. 
  33.186 +                 ; If not specified, option 4 will not be listed and dialing out 
  33.187 +                 ; from within VoiceMailMain() will not be permitted.
  33.188 +;sendvoicemail=yes ; Allow the user to compose and send a voicemail while inside 
  33.189 +                  ; VoiceMailMain() [option 5 from mailbox's advanced menu].
  33.190 +                  ; If set to 'no', option 5 will not be listed.
  33.191 +; searchcontexts=yes	; Current default behavior is to search only the default context
  33.192 +			; if one is not specified.  The older behavior was to search all contexts.
  33.193 +			; This option restores the old behavior [DEFAULT=no]
  33.194 +; callback=fromvm 	; Context to call back from  
  33.195 +			;     if not listed, calling the sender back will not be permitted
  33.196 +; review=yes 		; Allow sender to review/rerecord their message before saving it [OFF by default
  33.197 +; operator=yes 		; Allow sender to hit 0 before/after/during  leaving a voicemail to 
  33.198 +			;     reach an operator  [OFF by default]
  33.199 +; envelope=no 		; Turn on/off envelope playback before message playback. [ON by default] 
  33.200 +			;     This does NOT affect option 3,3 from the advanced options menu
  33.201 +; delete=yes		; After notification, the voicemail is deleted from the server. [per-mailbox only]
  33.202 +			;     This is intended for use with users who wish to receive their 
  33.203 +			;     voicemail ONLY by email. Note:  "deletevoicemail" is provided as an
  33.204 +			;     equivalent option for Realtime configuration.
  33.205 +; volgain=0.0		; Emails bearing the voicemail may arrive in a volume too
  33.206 +			;     quiet to be heard.  This parameter allows you to specify how
  33.207 +			;     much gain to add to the message when sending a voicemail.
  33.208 +			;     NOTE: sox must be installed for this option to work.
  33.209 +; nextaftercmd=yes	; Skips to the next message after hitting 7 or 9 to delete/save current message.
  33.210 +			;     [global option only at this time] 
  33.211 +; forcename=yes		; Forces a new user to record their name.  A new user is
  33.212 +			;     determined by the password being the same as
  33.213 +			;     the mailbox number.  The default is "no".
  33.214 +; forcegreetings=no	; This is the same as forcename, except for recording
  33.215 +			;     greetings.  The default is "no".
  33.216 +; hidefromdir=yes	; Hide this mailbox from the directory produced by app_directory
  33.217 +			;     The default is "no".
  33.218 +;tempgreetwarn=yes	; Remind the user that their temporary greeting is set
  33.219 +
  33.220 +;[zonemessages]
  33.221 +;eastern=America/New_York|'vm-received' Q 'digits/at' IMp
  33.222 +;central=America/Chicago|'vm-received' Q 'digits/at' IMp
  33.223 +;central24=America/Chicago|'vm-received' q 'digits/at' H N 'hours'
  33.224 +;military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
  33.225 +;european=Europe/Copenhagen|'vm-received' a d b 'digits/at' HM
  33.226 +
  33.227 +
  33.228 +
  33.229 +;[default]
  33.230 +; Define maximum number of messages per folder for a particular context.
  33.231 +;maxmsg=50
  33.232 +
  33.233 +;1234 => 4242,Example Mailbox,root@localhost
  33.234 +;4200 => 9855,Mark Spencer,markster@linux-support.net,mypager@digium.com,attach=no|serveremail=myaddy@digium.com|tz=central|maxmsg=10
  33.235 +;4300 => 3456,Ben Rigas,ben@american-computer.net
  33.236 +;4310 => -5432,Sales,sales@marko.net
  33.237 +;4069 => 6522,Matt Brooks,matt@marko.net,,|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes|envelope=yes|sayduration=yes|saydurationm=1
  33.238 +;4073 => 1099,Bianca Paige,bianca@biancapaige.com,,delete=1
  33.239 +;4110 => 3443,Rob Flynn,rflynn@blueridge.net
  33.240 +;4235 => 1234,Jim Holmes,jim@astricon.ips,,Tz=european
  33.241 +
  33.242 +
  33.243 +;
  33.244 +; Mailboxes may be organized into multiple contexts for
  33.245 +; voicemail virtualhosting
  33.246 +;
  33.247 +
  33.248 +;[other]
  33.249 +;The intro can be customized on a per-context basis
  33.250 +;directoryintro=dir-company2
  33.251 +;1234 => 5678,Company2 User,root@localhost
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/asterisk/wakeup.agi	Mon Apr 27 12:19:05 2009 +0200
    34.3 @@ -0,0 +1,733 @@
    34.4 +#! @l_prefix@/bin/perl
    34.5 +#
    34.6 +# wakeup.agi 1.1
    34.7 +#
    34.8 +# A wakeup agi script for Asterisk
    34.9 +#
   34.10 +# Copyright (C) 2007
   34.11 +#
   34.12 +# Jonas Arndt <jonas_arndt@comcast.net>
   34.13 +#
   34.14 +# This program is free software, distributed under the terms of the
   34.15 +# GNU General Public License v2.
   34.16 +#
   34.17 +#
   34.18 +# This program is free software: you can redistribute it and/or modify
   34.19 +# it under the terms of the GNU General Public License as published by
   34.20 +# the Free Software Foundation, either version 3 of the License, or
   34.21 +# (at your option) any later version.
   34.22 +#
   34.23 +# This program is distributed in the hope that it will be useful,
   34.24 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
   34.25 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   34.26 +# GNU General Public License for more details.
   34.27 +#
   34.28 +# You should have received a copy of the GNU General Public License
   34.29 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
   34.30 +#
   34.31 +
   34.32 +use strict;
   34.33 +use Time::Local;
   34.34 +$|=1;
   34.35 +# Setup some variables
   34.36 +my %AGI; my $DEBUG=0;
   34.37 +# Some constants
   34.38 +my $OUTDIR="@l_prefix@/var/asterisk/spool/outgoing";
   34.39 +my $WAKEDIR="@l_prefix@/var/asterisk/spool/tmp";
   34.40 +my $debugfile="@l_prefix@/var/asterisk/spool/tmp/wakeup.log";
   34.41 +my $DEBUGOUT = "filehandle";
   34.42 +my $CALL = "filehandle";
   34.43 +my $TOUCH = "/usr/bin/touch";
   34.44 +
   34.45 +############ check_result ##########
   34.46 +# Use this to check the result of  #
   34.47 +# a sent command                   #
   34.48 +# I pretty much stole this from    #
   34.49 +# the regular agi-test.agi         #
   34.50 +####################################
   34.51 +sub checkresult {
   34.52 +    my ($res) = @_;
   34.53 +    my $retval;
   34.54 +    chomp $res;
   34.55 +    if ($res =~ /^200/) {
   34.56 +        $res =~ /result=(-?\d+)/;
   34.57 +        if (!length($1)) {
   34.58 +            print DEBUGOUT "FAIL ($res)\n";
   34.59 +            exit(1);
   34.60 +        } elsif ($DEBUG=1) {
   34.61 +            print DEBUGOUT "PASS ($1)\n";
   34.62 +        }
   34.63 +    } else {
   34.64 +        print STDERR "FAIL (unexpected result '$res')\n";
   34.65 +        exit(1);
   34.66 +    }
   34.67 +}
   34.68 +
   34.69 +
   34.70 +############ send_file #############
   34.71 +# Use this to send a wave file on  #
   34.72 +# the channel                      #
   34.73 +#                                  #
   34.74 +####################################
   34.75 +sub send_file {
   34.76 +    my ($myfile) = @_;
   34.77 +    chomp($myfile);
   34.78 +    if ($DEBUG == 1 ) {
   34.79 +        print DEBUGOUT "Sending stream $myfile \n";
   34.80 +    }
   34.81 +    print "STREAM FILE $myfile \"0123456789\"\n";
   34.82 +    my $result = <STDIN>;
   34.83 +    &checkresult($result);
   34.84 +    $result =~ /result=(-?\d+)/;
   34.85 +    return $1;
   34.86 +}
   34.87 +
   34.88 +############ hangup  ###############
   34.89 +# Use this to hand up a channel    #
   34.90 +# the channel                      #
   34.91 +#                                  #
   34.92 +####################################
   34.93 +sub hangup {
   34.94 +    if ($DEBUG == 1 ) {
   34.95 +        print DEBUGOUT "Hanging up \n";
   34.96 +    }
   34.97 +    print "HANGUP \"\" \n";
   34.98 +    my $result = <STDIN>;
   34.99 +    &checkresult($result);
  34.100 +}
  34.101 +
  34.102 +############ say_number ############
  34.103 +# Use this to say a number         #
  34.104 +# over the channel                 #
  34.105 +#                                  #
  34.106 +####################################
  34.107 +sub say_number {
  34.108 +    my ($mynumber) = @_;
  34.109 +    chomp($mynumber);
  34.110 +    if ($DEBUG == 1 ) {
  34.111 +        print DEBUGOUT "Saying number $mynumber \n";
  34.112 +    }
  34.113 +    print "SAY NUMBER $mynumber \"0123456789\"\n";
  34.114 +    my $result = <STDIN>;
  34.115 +    &checkresult($result);
  34.116 +    $result =~ /result=(-?\d+)/;
  34.117 +    return $1;
  34.118 +}
  34.119 +
  34.120 +############ say_digits ############
  34.121 +# Use this to say a digits         #
  34.122 +# over the channel                 #
  34.123 +#                                  #
  34.124 +####################################
  34.125 +sub say_digits {
  34.126 +    my ($mynumber) = @_;
  34.127 +    chomp($mynumber);
  34.128 +    if ($DEBUG == 1 ) {
  34.129 +        print DEBUGOUT "Saying digits $mynumber \n";
  34.130 +    }
  34.131 +    print "SAY DIGITS $mynumber \"0123456789\"\n";
  34.132 +    my $result = <STDIN>;
  34.133 +    &checkresult($result);
  34.134 +}
  34.135 +
  34.136 +############ get_choice ############
  34.137 +# Use this to receive a DTMF       #
  34.138 +# choice from the channel          #
  34.139 +#                                  #
  34.140 +####################################
  34.141 +sub get_choice {
  34.142 +    if ($DEBUG == 1 ) {
  34.143 +        print DEBUGOUT "Getting choice \n";
  34.144 +    }
  34.145 +    print "WAIT FOR DIGIT 15000\n";
  34.146 +    my $result = <STDIN>;
  34.147 +    &checkresult($result);
  34.148 +    $result =~ /result=(-?\d+)/;
  34.149 +    return $1;
  34.150 +}
  34.151 +
  34.152 +############ answer  ###############
  34.153 +# Anser the channel                #
  34.154 +#                                  #
  34.155 +####################################
  34.156 +sub answer {
  34.157 +    if ($DEBUG == 1 ) {
  34.158 +        print DEBUGOUT "Answering the channel \n";
  34.159 +    }
  34.160 +    print "ANSWER\n";
  34.161 +    my $result = <STDIN>;
  34.162 +    &checkresult($result);
  34.163 +    $result =~ /result=(-?\d+)/;
  34.164 +    return $1;
  34.165 +}
  34.166 +
  34.167 +######## get_data ##################
  34.168 +# Feed with (file, maxnumbers)     #
  34.169 +# where file is the sound file     #
  34.170 +# to be played and maxnumbers is   #
  34.171 +# the maximum amount of digits to  #
  34.172 +# allow in the answer              #
  34.173 +####################################
  34.174 +sub get_data {
  34.175 +    my @mydata = @_;
  34.176 +    my $myfile = $mydata[0];
  34.177 +    my $mymax = $mydata[1];
  34.178 +    if ($DEBUG == 1 ) {
  34.179 +        print DEBUGOUT "Getting data \n";
  34.180 +    }
  34.181 +    print "GET DATA $myfile 15000 $mymax \n";
  34.182 +    my $result = <STDIN>;
  34.183 +    &checkresult($result);
  34.184 +    $result =~ /result=(-?\d+)/;
  34.185 +    return $1;
  34.186 +}
  34.187 +
  34.188 +###### check_outstanding_calls #####
  34.189 +# Are there any outstanding wakeup #
  34.190 +# calls for this extensions?       #
  34.191 +# Pass the extension to the        #
  34.192 +# function. The function returns   #
  34.193 +# a list of files                  #
  34.194 +####################################
  34.195 +sub check_outstanding_calls {
  34.196 +    my $myext = @_;
  34.197 +    #opendir DIR, $WAKEDIR;
  34.198 +    opendir DIR, $OUTDIR;
  34.199 +    my @files = grep {/$myext/} readdir(DIR);
  34.200 +    closedir DIR;
  34.201 +    return @files;
  34.202 +}
  34.203 +
  34.204 +######## get_extension #############
  34.205 +# Receive the AIG variable and     #
  34.206 +# return the extension             #
  34.207 +####################################
  34.208 +sub get_extension {
  34.209 +    my (@aig) = @_;
  34.210 +        if ($aig[11] == '') {
  34.211 +        print STDERR "No extension found in function get_exension \n";
  34.212 +        return "FAIL";
  34.213 +    }
  34.214 +    my $myext = $aig[11];
  34.215 +    return $myext;
  34.216 +}
  34.217 +
  34.218 +######## get_context ###############
  34.219 +# Receive the AIG variable and     #
  34.220 +# return the context               #
  34.221 +####################################
  34.222 +sub get_context {
  34.223 +    my (@aig) = @_;
  34.224 +        if ($aig[8] == '') {
  34.225 +        print STDERR "No extension found in function get_exension \n";
  34.226 +        return "FAIL";
  34.227 +    }
  34.228 +    my $mycont = $aig[8];
  34.229 +    return $mycont;
  34.230 +}
  34.231 +
  34.232 +########### get_clid ###############
  34.233 +# Receive the AIG variable and     #
  34.234 +# return the clid                  #
  34.235 +####################################
  34.236 +sub get_clid {
  34.237 +    my (@aig) = @_;
  34.238 +        if ($aig[1] == '') {
  34.239 +        print STDERR "No clid found in function get_clid \n";
  34.240 +        return "FAIL";
  34.241 +    }
  34.242 +    my $myext = $aig[1];
  34.243 +    return $myext;
  34.244 +}
  34.245 +########### init_agi ###############
  34.246 +# Use this to initialize the AGI   #
  34.247 +# variable                         #
  34.248 +#                                  #
  34.249 +####################################
  34.250 +sub init_agi {
  34.251 +    while(<STDIN>) {
  34.252 +        chomp;
  34.253 +        last unless length($_);
  34.254 +        if (/^agi_(\w+)\:\s+(.*)$/) {
  34.255 +            $AGI{$1} = $2;
  34.256 +        }
  34.257 +    }
  34.258 +}
  34.259 +
  34.260 +############ ascii2num #############
  34.261 +# Removes 48 to get a number out   #
  34.262 +# of the asciss return             #
  34.263 +####################################
  34.264 +sub ascii2num {
  34.265 +    my ($asc) = @_;
  34.266 +    my $ret;
  34.267 +    $ret = $asc - 48;
  34.268 +    return $ret;
  34.269 +}
  34.270 +
  34.271 +
  34.272 +########### Welcome  ###############
  34.273 +# This is the welcome menu         #
  34.274 +#                                  #
  34.275 +####################################
  34.276 +sub welcome {
  34.277 +    my $ret = 0;
  34.278 +    $ret = &send_file("welcome");
  34.279 +    if ($ret == 0) {
  34.280 +        $ret = &send_file("for-wakeup-call");
  34.281 +    }
  34.282 +    if ($ret == 0) {
  34.283 +        $ret = &send_file("press-1");
  34.284 +    }
  34.285 +    if ($ret == 0) {
  34.286 +        $ret = &send_file("for-a-list-of");
  34.287 +    }
  34.288 +    if ($ret == 0) {
  34.289 +        $ret = &send_file("or");
  34.290 +    }
  34.291 +    if ($ret == 0) {
  34.292 +        $ret = &send_file("to-cancel-wakeup");
  34.293 +    }
  34.294 +    if ($ret != 0) {
  34.295 +        $ret = &ascii2num($ret);
  34.296 +    }
  34.297 +    if ($ret == 0) {
  34.298 +        $ret = &get_data("press-2",1);
  34.299 +    }
  34.300 +    if ($ret == 1) {
  34.301 +        $ret = &schedule_new();
  34.302 +    } elsif ($ret == 2) {
  34.303 +        &manage_calls();
  34.304 +    } else {
  34.305 +        $ret = &send_file("goodbye");
  34.306 +    }
  34.307 +}
  34.308 +
  34.309 +######### manage_calls #############
  34.310 +# This is what is called if you    #
  34.311 +# want to manage already scheduled #
  34.312 +# wakeup calls                     #
  34.313 +####################################
  34.314 +
  34.315 +sub manage_calls {
  34.316 +    my $checker = "false";
  34.317 +    my @calls;
  34.318 +    my $del;
  34.319 +    #my $ret;
  34.320 +    my $hours;
  34.321 +    my $minutes;
  34.322 +    # Send out a welcome message and ask for return
  34.323 +    @calls = &check_outstanding_calls($AGI{callerid});
  34.324 +    if ($#calls + 1 == 0) {
  34.325 +        $del = &send_file("not-rqsted-wakeup");
  34.326 +        $del = &send_file("goodbye");
  34.327 +    } else {
  34.328 +        foreach (@calls) {
  34.329 +            $del = 0;
  34.330 +            my $wakefile = $_;
  34.331 +            my @wakeup = split /\./, $_;
  34.332 +            my $time = $wakeup[0];
  34.333 +            $_ = $time;
  34.334 +            /(^[0-9][0-9])/;
  34.335 +            my $hours = $1;
  34.336 +            /^[0-9][0-9]([0-9][0-9])/;
  34.337 +            my $minutes = $1;
  34.338 +            $del = &send_file("rqsted-wakeup-for");
  34.339 +            if ($del == 0) {
  34.340 +                $del = &say_number($hours);
  34.341 +            }
  34.342 +            if ($del == 0) {
  34.343 +                if ($minutes >= 10 ) {
  34.344 +                    $del = &say_number($minutes);
  34.345 +                } elsif ($minutes > 0 && $minutes < 10) {
  34.346 +                    $del = &send_file("digits/oh");
  34.347 +                    $del = &say_number($minutes);
  34.348 +                }
  34.349 +            }
  34.350 +            if ($del == 0) {
  34.351 +                $del = &send_file("digits/oclock");
  34.352 +            }
  34.353 +            if ($del == 0) {
  34.354 +                $del = &send_file("to-cancel-wakeup");
  34.355 +            }
  34.356 +            if ($del == 0) {
  34.357 +                $del = &send_file("press-1");
  34.358 +            }
  34.359 +            if ($del == 0) {
  34.360 +                $del = &send_file("otherwise-press");
  34.361 +            }
  34.362 +            if ($del != 0) {
  34.363 +                $del = &ascii2num($del);
  34.364 +            }
  34.365 +            if ($del == 0) {
  34.366 +                $del = &get_data("digits/2",1);
  34.367 +            }
  34.368 +            if ($del == 1) {
  34.369 +                my @sysargs = ("rm", "-f", "$WAKEDIR/$wakefile", "$OUTDIR/$wakefile");
  34.370 +                system(@sysargs) == 0
  34.371 +                or die "system @sysargs failed: $?";
  34.372 +                $del = &send_file("cancelled");
  34.373 +            }
  34.374 +        }
  34.375 +        $del = &send_file("goodbye");
  34.376 +    }
  34.377 +
  34.378 +}
  34.379 +
  34.380 +######## schedule_new ##############
  34.381 +# This is the menu to schedule a   #
  34.382 +# a new wakeup call                #
  34.383 +####################################
  34.384 +sub schedule_new {
  34.385 +    my $checker = "false";
  34.386 +    my $ret_var;
  34.387 +    my $ret_dummy = 0;
  34.388 +    my $time;
  34.389 +    my $perm;
  34.390 +    my $file;
  34.391 +    my $calltype;
  34.392 +    my $extension;
  34.393 +    my $context;
  34.394 +    my $hours;
  34.395 +    my $minutes;
  34.396 +    if ($DEBUG == 1 ) {
  34.397 +        print DEBUGOUT "From schedule_new\n";
  34.398 +    }
  34.399 +    while ( $checker eq "false" ) {
  34.400 +        $ret_var = &send_file("to-rqst-wakeup-call");
  34.401 +        if ($ret_var != 0) {
  34.402 +            my $tmp = &get_data("silence/1",3);
  34.403 +            $ret_var = &ascii2num($ret_var);
  34.404 +            $ret_var = $ret_var . $tmp;
  34.405 +        } else {
  34.406 +            $ret_var = &get_data("enter-a-time",4);
  34.407 +        }
  34.408 +#        if ($ret_var < 1300 && $ret_var >= 0100) {
  34.409 +#            my $pm = &get_data("1-for-am-2-for-pm",1);
  34.410 +#            if ($pm == 2 && $ret_var <= 1159) {
  34.411 +#                $ret_var = $ret_var + 1200;
  34.412 +#                $checker = "true";
  34.413 +#            } elsif ($pm == 1 && $ret_var > 1159) {
  34.414 +#                $ret_var = $ret_var - 1200;
  34.415 +#                # Fix the zero
  34.416 +#                $ret_var = "00" . $ret_var;
  34.417 +#                $checker = "true";
  34.418 +#            } else {
  34.419 +#                $checker = "true";
  34.420 +#            }
  34.421 +#        } elsif ($ret_var > 2359) {
  34.422 +#            $ret_dummy = &send_file("please-try-again");
  34.423 +#        } else {
  34.424 +#            $checker = "true";
  34.425 +#        }
  34.426 +        if ($ret_var > 2359) {
  34.427 +            $ret_dummy = &send_file("please-try-again");
  34.428 +        } else {
  34.429 +            $checker = "true";
  34.430 +        }
  34.431 +    }
  34.432 +    $perm = 0;
  34.433 +    $perm = &send_file("wakeup-for-one-time");
  34.434 +    if ($perm == 0) {
  34.435 +        $perm = &send_file("press-1");
  34.436 +    }
  34.437 +    if ($perm == 0) {
  34.438 +        $perm = &send_file("for-a-daily-wakeup-call");
  34.439 +    }
  34.440 +    if ($perm != 0) {
  34.441 +        $perm = &ascii2num($perm);
  34.442 +    }
  34.443 +    if ($perm == 0) {
  34.444 +        $perm = $perm = &get_data("press-2",1);
  34.445 +    }
  34.446 +    # Open the file and populate it with data
  34.447 +    $extension = $AGI{callerid};
  34.448 +    $context = $AGI{context};
  34.449 +    if ($perm == 2) {
  34.450 +        $file = "$WAKEDIR/$ret_var.perm.1.$extension.call";
  34.451 +        $calltype = "perm";
  34.452 +        open (CALL, '>', $file) or die "Cannot open call file for write :$!";
  34.453 +    } else {
  34.454 +        $file = "$WAKEDIR/$ret_var.temp.1.$extension.call";
  34.455 +        $calltype = "temp";
  34.456 +        open (CALL, '>', $file) or die "Cannot open call file for write :$!";
  34.457 +    }
  34.458 +    my $myprint = "channel: Local" . "/" . $extension . "@" . $context . "\n";
  34.459 +    print CALL $myprint;
  34.460 +    print CALL "maxretries: 3\n";
  34.461 +    print CALL "retrytime: 60\n";
  34.462 +    print CALL "waittime: 60\n";
  34.463 +    print CALL "callerid: \"AsterPBX Weckruf\" <$AGI{extension}>\n";
  34.464 +    print CALL "application: AGI\n";
  34.465 +    print CALL "data: wakeup|$ret_var.$calltype.1.$extension.call\n";
  34.466 +    close ($CALL);
  34.467 +    # Now touch the file
  34.468 +    # Get the time variable
  34.469 +    $time = get_time_string($ret_var);
  34.470 +    my @command = ("$TOUCH", "-t", "$time", "${file}");
  34.471 +    system(@command) == 0
  34.472 +        or die "system @command failed: $?";
  34.473 +    # Move it to the OUT directory
  34.474 +    my @command = ("mv", "${file}", "${OUTDIR}/");
  34.475 +    system(@command) == 0
  34.476 +        or die "system @command failed: $?";
  34.477 +
  34.478 +    # Stream out the wakeup
  34.479 +    $_ = $ret_var;
  34.480 +    /(^[0-9][0-9])/;
  34.481 +    my $hours = $1;
  34.482 +    /^[0-9][0-9]([0-9][0-9])/;
  34.483 +    my $minutes = $1;
  34.484 +    $ret_dummy = &send_file("rqsted-wakeup-for");
  34.485 +    $ret_dummy = &say_number($hours);
  34.486 +    if ($minutes >= 10 ) {
  34.487 +        &say_number($minutes);
  34.488 +    } elsif ($minutes > 0 && $minutes < 10) {
  34.489 +        &send_file("digits/oh");
  34.490 +        &say_number($minutes);
  34.491 +    }
  34.492 +    $ret_dummy = &send_file("digits/oclock");
  34.493 +    $ret_dummy = &send_file("goodbye");
  34.494 +    return $ret_var;
  34.495 +}
  34.496 +
  34.497 +######## get_time_string ###########
  34.498 +# This will return the time string #
  34.499 +# when inputing a string like      #
  34.500 +# hhmi                             #
  34.501 +####################################
  34.502 +sub get_time_string {
  34.503 +    my ($intime) = @_;
  34.504 +    my $minutes = substr($intime, 2, 4);
  34.505 +    my $hours = substr($intime, 0, 2);
  34.506 +    my $tmpepoch;
  34.507 +    my $day;
  34.508 +    my $month;
  34.509 +    my $ret_val;
  34.510 +    my $epoch = time();
  34.511 +    my @timedata = localtime($epoch);
  34.512 +    # Insert the minutes and hours from input
  34.513 +    $timedata[1] = $minutes;
  34.514 +    $timedata[2] = $hours;
  34.515 +    # Get tmpepoch
  34.516 +    $tmpepoch = timelocal(@timedata);
  34.517 +    #Now compare them
  34.518 +    if ($tmpepoch < $epoch) { # Means it is tomorrow
  34.519 +        $tmpepoch += 86400; # Add 24 hours
  34.520 +    }
  34.521 +    # Now get the new timedata
  34.522 +    my @timedata = localtime($tmpepoch);
  34.523 +    $minutes = $timedata[1];
  34.524 +    $hours = $timedata[2];
  34.525 +    $day = $timedata[3];
  34.526 +    $month = $timedata[4] + 1;
  34.527 +    #Correct the "First hour after midnight" problem
  34.528 +    if ($minutes < 10) {
  34.529 +        $minutes = "0" . $minutes;
  34.530 +    }
  34.531 +    if ($hours < 10) {
  34.532 +        $hours = "0" . $hours;
  34.533 +    }
  34.534 +    if ($day < 10) {
  34.535 +        $day = "0" . $day;
  34.536 +    }
  34.537 +    if ($month < 10) {
  34.538 +        $month = "0" . $month;
  34.539 +    }
  34.540 +    $ret_val = $month . $day . $hours . $minutes;
  34.541 +    return $ret_val;
  34.542 +}
  34.543 +
  34.544 +############ new_time ##############
  34.545 +# This will return the time string #
  34.546 +# with a time set 10 minute into   #
  34.547 +# the future                       #
  34.548 +# The string is                    #
  34.549 +# MMDDhhmi                         #
  34.550 +####################################
  34.551 +sub new_time {
  34.552 +    my ($input) = @_;
  34.553 +    my @timedata;
  34.554 +    my $minutes;
  34.555 +    my $hours;
  34.556 +    my $day;
  34.557 +    my $month;
  34.558 +    my $ret_val;
  34.559 +    my $epoc = time();
  34.560 +    if ($input eq "10m") {
  34.561 +        # add 10 minutes
  34.562 +        $epoc += 600;
  34.563 +        #$epoc += 120; #just for debugs
  34.564 +    } else {
  34.565 +        # add 24 hours
  34.566 +        $epoc += 86400;
  34.567 +    }
  34.568 +    @timedata = localtime($epoc);
  34.569 +    $minutes = $timedata[1];
  34.570 +    $hours = $timedata[2];
  34.571 +    $day = $timedata[3];
  34.572 +    $month = $timedata[4] + 1;
  34.573 +    #Correct the "First hour after midnight" problem
  34.574 +    if ($minutes < 10) {
  34.575 +        $minutes = "0" . $minutes;
  34.576 +    }
  34.577 +    if ($hours < 10) {
  34.578 +        $hours = "0" . $hours;
  34.579 +    }
  34.580 +    if ($day < 10) {
  34.581 +        $day = "0" . $day;
  34.582 +    }
  34.583 +    if ($month < 10) {
  34.584 +        $month = "0" . $month;
  34.585 +    }
  34.586 +    $ret_val = $month . $day . $hours . $minutes;
  34.587 +    return $ret_val;
  34.588 +}
  34.589 +
  34.590 +########### snooze  ################
  34.591 +# This is the menu to snooze the   #
  34.592 +# wakeup call                      #
  34.593 +####################################
  34.594 +sub snooze {
  34.595 +    my ($oldfile) = @_;
  34.596 +    my $newfile;
  34.597 +    my $extension;
  34.598 +    my $context;
  34.599 +    my @filestore = split (/\./, $oldfile);
  34.600 +    my @permstore = split (/\./, $oldfile);
  34.601 +    my $time;
  34.602 +    my $ret_var = 0;
  34.603 +    my $ret_dummy;
  34.604 +    my $myprint;
  34.605 +    # Answer the channel
  34.606 +    &answer();
  34.607 +    # Is this a reoccuring call, then add 24h
  34.608 +    if ($permstore[1] eq "perm") {
  34.609 +        $permstore[2] += 1; #Just to get a new file name
  34.610 +        $newfile = join(".",@permstore);
  34.611 +        $extension = $AGI{extension};
  34.612 +        $context = $AGI{context};
  34.613 +        # Open the file
  34.614 +        open (CALL, '>', "${WAKEDIR}/${newfile}") or die "Cannot open call file for write :$!";
  34.615 +        $myprint = "channel: Local" . "/" . $extension . "@" . $context . "\n";
  34.616 +            print CALL $myprint;
  34.617 +            print CALL "maxretries: 3\n";
  34.618 +                print CALL "retrytime: 60\n";
  34.619 +        print CALL "waittime: 60\n";
  34.620 +                print CALL "callerid: \"AsterPBX Weckruf\" <$AGI{callerid}>\n";
  34.621 +            print CALL "application: AGI\n";
  34.622 +            print CALL "data: wakeup|$newfile\n";
  34.623 +            close ($CALL);
  34.624 +        # Get a time 24h from now
  34.625 +        $time = &new_time("24h");
  34.626 +        # Touch the file with the new time
  34.627 +        my @command = ("$TOUCH", "-t", "$time", "${WAKEDIR}/${newfile}");
  34.628 +        system(@command) == 0
  34.629 +            or die "system @command failed: $?";
  34.630 +        # Now move it
  34.631 +        my @command = ("mv", "${WAKEDIR}/${newfile}", "${OUTDIR}/${newfile}");
  34.632 +        system(@command) == 0
  34.633 +            or die "system @command failed: $?";
  34.634 +    }
  34.635 +    #Replace the file name time with snooze
  34.636 +    $filestore[1] = "snooze";
  34.637 +    # Also add 10 minutes to the name
  34.638 +    $time = new_time("10m");
  34.639 +    $filestore[0] = substr($time, 4, 8);
  34.640 +    # Get the new file name
  34.641 +    $newfile = join(".",@filestore);
  34.642 +    $ret_var = &send_file("this-is-yr-wakeup-call");
  34.643 +    if ($ret_var == 0 ) {
  34.644 +        $ret_var = &send_file("to-confirm-wakeup");
  34.645 +    }
  34.646 +    if ($ret_var == 0 ) {
  34.647 +        $ret_var = &send_file("press-1");
  34.648 +    }
  34.649 +    if ($ret_var == 0 ) {
  34.650 +        $ret_var = &send_file("to-snooze-for");
  34.651 +    }
  34.652 +    if ($ret_var == 0 ) {
  34.653 +        $ret_var = &send_file("digits/10");
  34.654 +    }
  34.655 +    if ($ret_var == 0 ) {
  34.656 +        $ret_var = &send_file("minutes");
  34.657 +    }
  34.658 +    if ($ret_var != 0 ) {
  34.659 +        $ret_var = &ascii2num($ret_var);
  34.660 +    }
  34.661 +    if ($ret_var == 0 ) {
  34.662 +        $ret_var = &get_data("press-2",1);
  34.663 +    }
  34.664 +    if ($ret_var == 2 ) {
  34.665 +        # Populate some variables
  34.666 +        $time = &new_time("10m");
  34.667 +        $extension = $AGI{extension};
  34.668 +        $context = $AGI{context};
  34.669 +        # Open the file
  34.670 +        open (CALL, '>', "${WAKEDIR}/${newfile}") or die "Cannot open call file for write :$!";
  34.671 +        $myprint = "channel: Local" . "/" . $extension . "@" . $context . "\n";
  34.672 +            print CALL $myprint;
  34.673 +            print CALL "maxretries: 3\n";
  34.674 +                print CALL "retrytime: 60\n";
  34.675 +        print CALL "waittime: 60\n";
  34.676 +                print CALL "callerid: \"AsterPBX Weckruf\" <$AGI{callerid}>\n";
  34.677 +            print CALL "application: AGI\n";
  34.678 +            print CALL "data: wakeup|$newfile\n";
  34.679 +            close ($CALL);
  34.680 +        # Touch the file with the new time
  34.681 +        my @command = ("$TOUCH", "-t", "$time", "${WAKEDIR}/${newfile}");
  34.682 +        system(@command) == 0
  34.683 +            or die "system @command failed: $?";
  34.684 +        # Now move it
  34.685 +        my @command = ("mv", "${WAKEDIR}/${newfile}", "${OUTDIR}/${newfile}");
  34.686 +        system(@command) == 0
  34.687 +            or die "system @command failed: $?";
  34.688 +        $ret_dummy = &send_file("goodbye");
  34.689 +
  34.690 +    } elsif ($ret_var == 1) {
  34.691 +        $ret_dummy = &send_file("goodbye");
  34.692 +    } else {
  34.693 +        $ret_dummy = &send_file("goodbye");
  34.694 +    }
  34.695 +
  34.696 +    # Stream out the wakeup
  34.697 +    return 0;
  34.698 +}
  34.699 +
  34.700 +########### main program ###########
  34.701 +# Here goes the main program       #
  34.702 +#                                  #
  34.703 +####################################
  34.704 +
  34.705 +my $numargs = $#ARGV + 1;
  34.706 +if ($DEBUG == 1) {
  34.707 +    open (DEBUGOUT, '>', $debugfile) or die "Cannot open $debugfile for write :$!";
  34.708 +}
  34.709 +
  34.710 +# Start by reading in the stuff Asterisk is sending
  34.711 +&init_agi(); # Comment out in case of debug outside Asterisk
  34.712 +
  34.713 +# If DEBUG is set, dump the AGI variable
  34.714 +if ($DEBUG == 1) {
  34.715 +    foreach my $i (sort keys %AGI) {
  34.716 +        print DEBUGOUT " -- $i = $AGI{$i}\n";
  34.717 +    }
  34.718 +}
  34.719 +
  34.720 +if ( $numargs == 0 ) {
  34.721 +    &welcome();
  34.722 +    &hangup();
  34.723 +    exit(0);
  34.724 +} elsif ( $ARGV[0] eq "move" ) {
  34.725 +    &move();
  34.726 +    &hangup();
  34.727 +    exit(0);
  34.728 +} else {
  34.729 +    &snooze($ARGV[0]);
  34.730 +    &hangup();
  34.731 +    exit(0);
  34.732 +}
  34.733 +
  34.734 +if ($DEBUG ==1) {
  34.735 +    close $DEBUGOUT;
  34.736 +}
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/asterisk/zapata.conf	Mon Apr 27 12:19:05 2009 +0200
    35.3 @@ -0,0 +1,663 @@
    35.4 +;
    35.5 +; Zapata telephony interface
    35.6 +;
    35.7 +; Configuration file
    35.8 +;
    35.9 +; You need to restart Asterisk to re-configure the Zap channel
   35.10 +; CLI> reload chan_zap.so 
   35.11 +;		will reload the configuration file,
   35.12 +;		but not all configuration options are 
   35.13 +; 		re-configured during a reload.
   35.14 +
   35.15 +
   35.16 +
   35.17 +;[trunkgroups]
   35.18 +;
   35.19 +; Trunk groups are used for NFAS or GR-303 connections.
   35.20 +;
   35.21 +; Group: Defines a trunk group.  
   35.22 +;        trunkgroup => <trunkgroup>,<dchannel>[,<backup1>...]
   35.23 +;
   35.24 +;        trunkgroup  is the numerical trunk group to create
   35.25 +;        dchannel    is the zap channel which will have the 
   35.26 +;                    d-channel for the trunk.
   35.27 +;        backup1     is an optional list of backup d-channels.
   35.28 +;
   35.29 +;trunkgroup => 1,24,48
   35.30 +;trunkgroup => 1,24
   35.31 +;
   35.32 +; Spanmap: Associates a span with a trunk group
   35.33 +;        spanmap => <zapspan>,<trunkgroup>[,<logicalspan>]
   35.34 +;
   35.35 +;        zapspan     is the zap span number to associate
   35.36 +;        trunkgroup  is the trunkgroup (specified above) for the mapping
   35.37 +;        logicalspan is the logical span number within the trunk group to use.
   35.38 +;                    if unspecified, no logical span number is used.
   35.39 +;
   35.40 +;spanmap => 1,1,1
   35.41 +;spanmap => 2,1,2
   35.42 +;spanmap => 3,1,3
   35.43 +;spanmap => 4,1,4
   35.44 +
   35.45 +;[channels]
   35.46 +;
   35.47 +; Default language
   35.48 +;
   35.49 +;language=en
   35.50 +;
   35.51 +; Default context
   35.52 +;
   35.53 +;context=default
   35.54 +;
   35.55 +; Switchtype:  Only used for PRI.
   35.56 +;
   35.57 +; national:	  National ISDN 2 (default)
   35.58 +; dms100:	  Nortel DMS100
   35.59 +; 4ess:           AT&T 4ESS
   35.60 +; 5ess:	          Lucent 5ESS
   35.61 +; euroisdn:       EuroISDN
   35.62 +; ni1:            Old National ISDN 1
   35.63 +; qsig:           Q.SIG
   35.64 +;
   35.65 +;switchtype=national
   35.66 +;
   35.67 +; Some switches (AT&T especially) require network specific facility IE
   35.68 +; supported values are currently 'none', 'sdn', 'megacom', 'tollfreemegacom', 'accunet'
   35.69 +;
   35.70 +;nsf=none
   35.71 +;
   35.72 +; PRI Dialplan:  Only RARELY used for PRI.
   35.73 +;
   35.74 +; unknown:        Unknown
   35.75 +; private:        Private ISDN
   35.76 +; local:          Local ISDN
   35.77 +; national:	  National ISDN
   35.78 +; international:  International ISDN
   35.79 +; dynamic:	  Dynamically selects the appropriate dialplan
   35.80 +;
   35.81 +;pridialplan=national
   35.82 +;
   35.83 +; PRI Local Dialplan:  Only RARELY used for PRI (sets the calling number's numbering plan)
   35.84 +;
   35.85 +; unknown:        Unknown
   35.86 +; private:        Private ISDN
   35.87 +; local:          Local ISDN
   35.88 +; national:	  National ISDN
   35.89 +; international:  International ISDN
   35.90 +; dynamic:	  Dynamically selects the appropriate dialplan
   35.91 +;
   35.92 +;prilocaldialplan=national
   35.93 +;
   35.94 +; PRI callerid prefixes based on the given TON/NPI (dialplan)
   35.95 +; This is especially needed for euroisdn E1-PRIs
   35.96 +; 
   35.97 +; sample 1 for Germany 
   35.98 +;internationalprefix = 00
   35.99 +;nationalprefix = 0
  35.100 +;localprefix = 0711
  35.101 +;privateprefix = 07115678
  35.102 +;unknownprefix = 
  35.103 +;
  35.104 +; sample 2 for Germany 
  35.105 +;internationalprefix = +
  35.106 +;nationalprefix = +49
  35.107 +;localprefix = +49711
  35.108 +;privateprefix = +497115678
  35.109 +;unknownprefix = 
  35.110 +;
  35.111 +; PRI resetinterval: sets the time in seconds between restart of unused
  35.112 +; channels, defaults to 3600; minimum 60 seconds.  Some PBXs don't like
  35.113 +; channel restarts. so set the interval to a very long interval e.g. 100000000
  35.114 +; or 'never' to disable *entirely*.
  35.115 +;
  35.116 +;resetinterval = 3600 
  35.117 +;
  35.118 +; Overlap dialing mode (sending overlap digits)
  35.119 +;
  35.120 +;overlapdial=yes
  35.121 +;
  35.122 +; PRI Out of band indications.
  35.123 +; Enable this to report Busy and Congestion on a PRI using out-of-band
  35.124 +; notification. Inband indication, as used by Asterisk doesn't seem to work
  35.125 +; with all telcos.
  35.126 +; 
  35.127 +; outofband:      Signal Busy/Congestion out of band with RELEASE/DISCONNECT
  35.128 +; inband:         Signal Busy/Congestion using in-band tones
  35.129 +;
  35.130 +; priindication = outofband
  35.131 +;
  35.132 +; If you need to override the existing channels selection routine and force all
  35.133 +; PRI channels to be marked as exclusively selected, set this to yes.
  35.134 +; priexclusive = yes
  35.135 +;
  35.136 +; ISDN Timers
  35.137 +; All of the ISDN timers and counters that are used are configurable.  Specify
  35.138 +; the timer name, and its value (in ms for timers).
  35.139 +; K:    Layer 2 max number of outstanding unacknowledged I frames (default 7)
  35.140 +; N200: Layer 2 max number of retransmissions of a frame (default 3)
  35.141 +; T200: Layer 2 max time before retransmission of a frame (default 1000 ms)
  35.142 +; T203: Layer 2 max time without frames being exchanged (default 10000 ms)
  35.143 +; T305: Wait for DISCONNECT acknowledge (default 30000 ms)
  35.144 +; T308: Wait for RELEASE acknowledge (default 4000 ms)
  35.145 +; T309: Maintain active calls on Layer 2 disconnection (default -1, Asterisk clears calls)
  35.146 +;       EuroISDN: 6000 to 12000 ms, according to (N200 + 1) x T200 + 2s
  35.147 +;       May vary in other ISDN standards (Q.931 1993 : 90000 ms)
  35.148 +; T313: Wait for CONNECT acknowledge, CPE side only (default 3000 ms)
  35.149 +;
  35.150 +; pritimer => t200,1000
  35.151 +; pritimer => t313,4000
  35.152 +;
  35.153 +; To enable transmission of facility-based ISDN supplementary services (such
  35.154 +; as caller name from CPE over facility), enable this option.
  35.155 +; facilityenable = yes
  35.156 +;
  35.157 +;
  35.158 +; Signalling method (default is fxs).  Valid values:
  35.159 +; em:             E & M
  35.160 +; em_w:           E & M Wink
  35.161 +; featd:          Feature Group D (The fake, Adtran style, DTMF)
  35.162 +; featdmf:        Feature Group D (The real thing, MF (domestic, US))
  35.163 +; featdmf_ta:     Feature Group D (The real thing, MF (domestic, US)) through
  35.164 +;                 a Tandem Access point
  35.165 +; featb:          Feature Group B (MF (domestic, US))
  35.166 +; fgccama	  Feature Group C-CAMA (DP DNIS, MF ANI)
  35.167 +; fgccamamf	  Feature Group C-CAMA MF (MF DNIS, MF ANI)
  35.168 +; fxs_ls:         FXS (Loop Start)
  35.169 +; fxs_gs:         FXS (Ground Start)
  35.170 +; fxs_ks:         FXS (Kewl Start)
  35.171 +; fxo_ls:         FXO (Loop Start)
  35.172 +; fxo_gs:         FXO (Ground Start)
  35.173 +; fxo_ks:         FXO (Kewl Start)
  35.174 +; pri_cpe:        PRI signalling, CPE side
  35.175 +; pri_net:        PRI signalling, Network side
  35.176 +; gr303fxoks_net: GR-303 Signalling, FXO Loopstart, Network side
  35.177 +; gr303fxsks_cpe: GR-303 Signalling, FXS Loopstart, CPE side
  35.178 +; sf:	          SF (Inband Tone) Signalling
  35.179 +; sf_w:	          SF Wink
  35.180 +; sf_featd:       SF Feature Group D (The fake, Adtran style, DTMF)
  35.181 +; sf_featdmf:     SF Feature Group D (The real thing, MF (domestic, US))
  35.182 +; sf_featb:       SF Feature Group B (MF (domestic, US))
  35.183 +; e911:           E911 (MF) style signalling
  35.184 +;
  35.185 +; The following are used for Radio interfaces:
  35.186 +; fxs_rx:         Receive audio/COR on an FXS kewlstart interface (FXO at the
  35.187 +;                 channel bank)
  35.188 +; fxs_tx:         Transmit audio/PTT on an FXS loopstart interface (FXO at the
  35.189 +;                 channel bank)
  35.190 +; fxo_rx:         Receive audio/COR on an FXO loopstart interface (FXS at the
  35.191 +;                 channel bank)
  35.192 +; fxo_tx:         Transmit audio/PTT on an FXO groundstart interface (FXS at
  35.193 +;                 the channel bank)
  35.194 +; em_rx:          Receive audio/COR on an E&M interface (1-way)
  35.195 +; em_tx:          Transmit audio/PTT on an E&M interface (1-way)
  35.196 +; em_txrx:        Receive audio/COR AND Transmit audio/PTT on an E&M interface
  35.197 +;                 (2-way)
  35.198 +; em_rxtx:        Same as em_txrx (for our dyslexic friends)
  35.199 +; sf_rx:          Receive audio/COR on an SF interface (1-way)
  35.200 +; sf_tx:          Transmit audio/PTT on an SF interface (1-way)
  35.201 +; sf_txrx:        Receive audio/COR AND Transmit audio/PTT on an SF interface
  35.202 +;                 (2-way)
  35.203 +; sf_rxtx:        Same as sf_txrx (for our dyslexic friends)
  35.204 +;
  35.205 +;signalling=fxo_ls
  35.206 +;
  35.207 +; If you have an outbound signalling format that is different from format
  35.208 +; specified above (but compatible), you can specify outbound signalling format,
  35.209 +; (see below). The 'signalling' format specified will be the inbound signalling
  35.210 +; format. If you only specify 'signalling', then it will be the format for
  35.211 +; both inbound and outbound.
  35.212 +; 
  35.213 +; signalling=featdmf
  35.214 +; outsignalling=featb
  35.215 +;
  35.216 +; For Feature Group D Tandem access, to set the default CIC and OZZ use these
  35.217 +; parameters:
  35.218 +;defaultozz=0000
  35.219 +;defaultcic=303
  35.220 +;
  35.221 +; A variety of timing parameters can be specified as well
  35.222 +; Including:
  35.223 +;    prewink:     Pre-wink time (default 50ms)
  35.224 +;    preflash:    Pre-flash time (default 50ms)
  35.225 +;    wink:        Wink time (default 150ms)
  35.226 +;    flash:       Flash time (default 750ms)
  35.227 +;    start:       Start time (default 1500ms)
  35.228 +;    rxwink:      Receiver wink time (default 300ms)
  35.229 +;    rxflash:     Receiver flashtime (default 1250ms)
  35.230 +;    debounce:    Debounce timing (default 600ms)
  35.231 +;
  35.232 +;rxwink=300		; Atlas seems to use long (250ms) winks
  35.233 +;
  35.234 +; How long generated tones (DTMF and MF) will be played on the channel
  35.235 +; (in milliseconds)
  35.236 +;toneduration=100
  35.237 +;
  35.238 +; Whether or not to do distinctive ring detection on FXO lines
  35.239 +;
  35.240 +;usedistinctiveringdetection=yes
  35.241 +;distinctiveringaftercid=yes	; enable dring detection after callerid for those countries like Australia
  35.242 +				; where the ring cadence is changed *after* the callerid spill.
  35.243 +;
  35.244 +; Whether or not to use caller ID
  35.245 +;
  35.246 +;usecallerid=yes
  35.247 +;
  35.248 +; Type of caller ID signalling in use
  35.249 +;     bell     = bell202 as used in US
  35.250 +;     v23      = v23 as used in the UK
  35.251 +;     v23_jp   = v23 as used in Japan
  35.252 +;     dtmf     = DTMF as used in Denmark, Sweden and Netherlands
  35.253 +;     smdi     = Use SMDI for callerid.  Requires SMDI to be enabled (usesmdi).
  35.254 +;
  35.255 +;cidsignalling=bell
  35.256 +;
  35.257 +; What signals the start of caller ID
  35.258 +;     ring     = a ring signals the start
  35.259 +;     polarity = polarity reversal signals the start
  35.260 +;
  35.261 +;cidstart=ring
  35.262 +;
  35.263 +; Whether or not to hide outgoing caller ID (Override with *67 or *82)
  35.264 +;
  35.265 +;hidecallerid=no
  35.266 +;
  35.267 +; Whether or not to enable call waiting on internal extensions
  35.268 +; With this set to 'yes', busy extensions will hear the call-waiting
  35.269 +; tone, and can use hook-flash to switch between callers. The Dial()
  35.270 +; app will not return the "BUSY" result for extensions.
  35.271 +;
  35.272 +;callwaiting=yes
  35.273 +;
  35.274 +; Whether or not restrict outgoing caller ID (will be sent as ANI only, not
  35.275 +; available for the user)
  35.276 +; Mostly use with FXS ports
  35.277 +;
  35.278 +;restrictcid=no
  35.279 +;
  35.280 +; Whether or not use the caller ID presentation for the outgoing call that the
  35.281 +; calling switch is sending.
  35.282 +; See README.callingpres
  35.283 +;
  35.284 +;usecallingpres=yes
  35.285 +;
  35.286 +; Some countries (UK) have ring tones with different ring tones (ring-ring),
  35.287 +; which means the callerid needs to be set later on, and not just after
  35.288 +; the first ring, as per the default. 
  35.289 +;
  35.290 +;sendcalleridafter=1
  35.291 +;
  35.292 +;
  35.293 +; Support Caller*ID on Call Waiting
  35.294 +;
  35.295 +;callwaitingcallerid=yes
  35.296 +;
  35.297 +; Support three-way calling
  35.298 +;
  35.299 +;threewaycalling=yes
  35.300 +;
  35.301 +; Support flash-hook call transfer (requires three way calling)
  35.302 +; Also enables call parking (overrides the 'canpark' parameter)
  35.303 +;
  35.304 +;transfer=yes
  35.305 +;
  35.306 +; Allow call parking
  35.307 +; ('canpark=no' is overridden by 'transfer=yes')
  35.308 +;
  35.309 +;canpark=yes
  35.310 +;
  35.311 +; Support call forward variable
  35.312 +;
  35.313 +;cancallforward=yes
  35.314 +;
  35.315 +; Whether or not to support Call Return (*69)
  35.316 +;
  35.317 +;callreturn=yes
  35.318 +;
  35.319 +; Stutter dialtone support: If a mailbox is specified without a voicemail 
  35.320 +; context, then when voicemail is received in a mailbox in the default 
  35.321 +; voicemail context in voicemail.conf, taking the phone off hook will cause a
  35.322 +; stutter dialtone instead of a normal one. 
  35.323 +;
  35.324 +; If a mailbox is specified *with* a voicemail context, the same will result
  35.325 +; if voicemail received in mailbox in the specified voicemail context.
  35.326 +;
  35.327 +; for default voicemail context, the example below is fine:
  35.328 +;
  35.329 +;mailbox=1234
  35.330 +;
  35.331 +; for any other voicemail context, the following will produce the stutter tone:
  35.332 +;
  35.333 +;mailbox=1234@context 
  35.334 +;
  35.335 +; Enable echo cancellation 
  35.336 +; Use either "yes", "no", or a power of two from 32 to 256 if you wish to
  35.337 +; actually set the number of taps of cancellation.
  35.338 +;
  35.339 +; Note that when setting the number of taps, the number 256 does not translate
  35.340 +; to 256 ms of echo cancellation.  echocancel=256 means 256 / 8 = 32 ms.
  35.341 +;
  35.342 +; Note that if any of your Zaptel cards have hardware echo cancellers,
  35.343 +; then this setting only turns them on and off; numeric settings will
  35.344 +; be treated as "yes". There are no special settings required for
  35.345 +; hardware echo cancellers; when present and enabled in their kernel
  35.346 +; modules, they take precedence over the software echo canceller compiled
  35.347 +; into Zaptel automatically.
  35.348 +;
  35.349 +;echocancel=yes
  35.350 +;
  35.351 +; Generally, it is not necessary (and in fact undesirable) to echo cancel when
  35.352 +; the circuit path is entirely TDM.  You may, however, change this behavior
  35.353 +; by enabling the echo cancel during pure TDM bridging below.
  35.354 +;
  35.355 +;echocancelwhenbridged=yes
  35.356 +;
  35.357 +; In some cases, the echo canceller doesn't train quickly enough and there
  35.358 +; is echo at the beginning of the call.  Enabling echo training will cause
  35.359 +; asterisk to briefly mute the channel, send an impulse, and use the impulse
  35.360 +; response to pre-train the echo canceller so it can start out with a much
  35.361 +; closer idea of the actual echo.  Value may be "yes", "no", or a number of
  35.362 +; milliseconds to delay before training (default = 400)
  35.363 +;
  35.364 +; WARNING:  In some cases this option can make echo worse!  If you are
  35.365 +; trying to debug an echo problem, it is worth checking to see if your echo
  35.366 +; is better with the option set to yes or no.  Use whatever setting gives
  35.367 +; the best results.
  35.368 +;
  35.369 +; Note that these parameters do not apply to hardware echo cancellers.
  35.370 +;
  35.371 +;echotraining=yes
  35.372 +;echotraining=800
  35.373 +;
  35.374 +; If you are having trouble with DTMF detection, you can relax the DTMF
  35.375 +; detection parameters.  Relaxing them may make the DTMF detector more likely
  35.376 +; to have "talkoff" where DTMF is detected when it shouldn't be.
  35.377 +;
  35.378 +;relaxdtmf=yes
  35.379 +;
  35.380 +; You may also set the default receive and transmit gains (in dB)
  35.381 +;
  35.382 +;rxgain=0.0
  35.383 +;txgain=0.0
  35.384 +;
  35.385 +; Logical groups can be assigned to allow outgoing rollover.  Groups range
  35.386 +; from 0 to 63, and multiple groups can be specified.
  35.387 +;
  35.388 +;group=1
  35.389 +;
  35.390 +; Ring groups (a.k.a. call groups) and pickup groups.  If a phone is ringing
  35.391 +; and it is a member of a group which is one of your pickup groups, then
  35.392 +; you can answer it by picking up and dialling *8#.  For simple offices, just
  35.393 +; make these both the same.  Groups range from 0 to 63.
  35.394 +;
  35.395 +;callgroup=1
  35.396 +;pickupgroup=1
  35.397 +
  35.398 +;
  35.399 +; Specify whether the channel should be answered immediately or if the simple
  35.400 +; switch should provide dialtone, read digits, etc.
  35.401 +; Note: If immediate=yes the dialplan execution will always start at extension
  35.402 +; 's' priority 1 regardless of the dialed number!
  35.403 +;
  35.404 +;immediate=no
  35.405 +;
  35.406 +; Specify whether flash-hook transfers to 'busy' channels should complete or
  35.407 +; return to the caller performing the transfer (default is yes).
  35.408 +;
  35.409 +;transfertobusy=no
  35.410 +;
  35.411 +; CallerID can be set to "asreceived" or a specific number if you want to
  35.412 +; override it.  Note that "asreceived" only applies to trunk interfaces.
  35.413 +;
  35.414 +;callerid=2564286000
  35.415 +;
  35.416 +; AMA flags affects the recording of Call Detail Records.  If specified
  35.417 +; it may be 'default', 'omit', 'billing', or 'documentation'.
  35.418 +;
  35.419 +;amaflags=default
  35.420 +;
  35.421 +; Channels may be associated with an account code to ease
  35.422 +; billing
  35.423 +;
  35.424 +;accountcode=lss0101
  35.425 +;
  35.426 +; ADSI (Analog Display Services Interface) can be enabled on a per-channel
  35.427 +; basis if you have (or may have) ADSI compatible CPE equipment
  35.428 +;
  35.429 +;adsi=yes
  35.430 +;
  35.431 +; SMDI (Simplified Message Desk Interface) can be enabled on a per-channel
  35.432 +; basis if you would like that channel to behave like an SMDI message desk.
  35.433 +; The SMDI port specified should have already been defined in smdi.conf.  The
  35.434 +; default port is /dev/ttyS0.
  35.435 +;
  35.436 +;usesmdi=yes
  35.437 +;smdiport=/dev/ttyS0
  35.438 +;
  35.439 +; On trunk interfaces (FXS) and E&M interfaces (E&M, Wink, Feature Group D
  35.440 +; etc, it can be useful to perform busy detection either in an effort to 
  35.441 +; detect hangup or for detecting busies.  This enables listening for
  35.442 +; the beep-beep busy pattern.
  35.443 +;
  35.444 +;busydetect=yes
  35.445 +;
  35.446 +; If busydetect is enabled, it is also possible to specify how many busy tones
  35.447 +; to wait for before hanging up.  The default is 4, but better results can be
  35.448 +; achieved if set to 6 or even 8.  Mind that the higher the number, the more
  35.449 +; time that will be needed to hangup a channel, but lowers the probability
  35.450 +; that you will get random hangups.
  35.451 +;
  35.452 +;busycount=4
  35.453 +;
  35.454 +; If busydetect is enabled, it is also possible to specify the cadence of your
  35.455 +; busy signal.  In many countries, it is 500msec on, 500msec off.  Without
  35.456 +; busypattern specified, we'll accept any regular sound-silence pattern that
  35.457 +; repeats <busycount> times as a busy signal.  If you specify busypattern,
  35.458 +; then we'll further check the length of the sound (tone) and silence, which
  35.459 +; will further reduce the chance of a false positive.
  35.460 +;
  35.461 +;busypattern=500,500
  35.462 +;
  35.463 +; NOTE: In the Asterisk Makefile you'll find further options to tweak the busy
  35.464 +; detector.  If your country has a busy tone with the same length tone and
  35.465 +; silence (as many countries do), consider defining the
  35.466 +; -DBUSYDETECT_COMPARE_TONE_AND_SILENCE option.
  35.467 +;
  35.468 +; Use a polarity reversal to mark when a outgoing call is answered by the
  35.469 +; remote party.
  35.470 +;
  35.471 +;answeronpolarityswitch=yes
  35.472 +;
  35.473 +; In some countries, a polarity reversal is used to signal the disconnect of a
  35.474 +; phone line.  If the hanguponpolarityswitch option is selected, the call will
  35.475 +; be considered "hung up" on a polarity reversal.
  35.476 +;
  35.477 +;hanguponpolarityswitch=yes
  35.478 +;
  35.479 +; On trunk interfaces (FXS) it can be useful to attempt to follow the progress
  35.480 +; of a call through RINGING, BUSY, and ANSWERING.   If turned on, call
  35.481 +; progress attempts to determine answer, busy, and ringing on phone lines.
  35.482 +; This feature is HIGHLY EXPERIMENTAL and can easily detect false answers,
  35.483 +; so don't count on it being very accurate.
  35.484 +;
  35.485 +; Few zones are supported at the time of this writing, but may be selected
  35.486 +; with "progzone"
  35.487 +;
  35.488 +; This feature can also easily detect false hangups. The symptoms of this is
  35.489 +; being disconnected in the middle of a call for no reason.
  35.490 +;
  35.491 +;callprogress=yes
  35.492 +;progzone=us
  35.493 +;
  35.494 +; FXO (FXS signalled) devices must have a timeout to determine if there was a
  35.495 +; hangup before the line was answered.  This value can be tweaked to shorten
  35.496 +; how long it takes before Zap considers a non-ringing line to have hungup.
  35.497 +;
  35.498 +;ringtimeout=8000
  35.499 +;
  35.500 +; For FXO (FXS signalled) devices, whether to use pulse dial instead of DTMF
  35.501 +;
  35.502 +;pulsedial=yes
  35.503 +;
  35.504 +; For fax detection, uncomment one of the following lines.  The default is *OFF*
  35.505 +;
  35.506 +;faxdetect=both
  35.507 +;faxdetect=incoming
  35.508 +;faxdetect=outgoing
  35.509 +;faxdetect=no
  35.510 +;
  35.511 +; This option specifies a preference for which music on hold class this channel
  35.512 +; should listen to when put on hold if the music class has not been set on the
  35.513 +; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
  35.514 +; channel putting this one on hold did not suggest a music class.
  35.515 +;
  35.516 +; If this option is set to "passthrough", then the hold message will always be
  35.517 +; passed through as signalling instead of generating hold music locally. This
  35.518 +; setting is only valid when used on a channel that uses digital signalling.
  35.519 +;
  35.520 +; This option may be specified globally, or on a per-user or per-peer basis.
  35.521 +;
  35.522 +;mohinterpret=default
  35.523 +;
  35.524 +; This option specifies which music on hold class to suggest to the peer channel
  35.525 +; when this channel places the peer on hold. It may be specified globally or on
  35.526 +; a per-user or per-peer basis.
  35.527 +;
  35.528 +;mohsuggest=default
  35.529 +;
  35.530 +; PRI channels can have an idle extension and a minunused number.  So long as
  35.531 +; at least "minunused" channels are idle, chan_zap will try to call "idledial"
  35.532 +; on them, and then dump them into the PBX in the "idleext" extension (which
  35.533 +; is of the form exten@context).  When channels are needed the "idle" calls
  35.534 +; are disconnected (so long as there are at least "minidle" calls still
  35.535 +; running, of course) to make more channels available.  The primary use of
  35.536 +; this is to create a dynamic service, where idle channels are bundled through
  35.537 +; multilink PPP, thus more efficiently utilizing combined voice/data services
  35.538 +; than conventional fixed mappings/muxings.
  35.539 +;
  35.540 +;idledial=6999
  35.541 +;idleext=6999@dialout
  35.542 +;minunused=2
  35.543 +;minidle=1
  35.544 +;
  35.545 +; Configure jitter buffers in zapata (each one is 20ms, default is 4)
  35.546 +;
  35.547 +;jitterbuffers=4
  35.548 +;
  35.549 +;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
  35.550 +; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
  35.551 +                              ; ZAP channel. Defaults to "no". An enabled jitterbuffer will
  35.552 +                              ; be used only if the sending side can create and the receiving
  35.553 +                              ; side can not accept jitter. The ZAP channel can't accept jitter,
  35.554 +                              ; thus an enabled jitterbuffer on the receive ZAP side will always
  35.555 +                              ; be used if the sending side can create jitter.
  35.556 +
  35.557 +; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
  35.558 +
  35.559 +; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
  35.560 +                              ; resynchronized. Useful to improve the quality of the voice, with
  35.561 +                              ; big jumps in/broken timestamps, usually sent from exotic devices
  35.562 +                              ; and programs. Defaults to 1000.
  35.563 +
  35.564 +; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a ZAP
  35.565 +                              ; channel. Two implementations are currently available - "fixed"
  35.566 +                              ; (with size always equals to jbmax-size) and "adaptive" (with
  35.567 +                              ; variable size, actually the new jb of IAX2). Defaults to fixed.
  35.568 +
  35.569 +; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
  35.570 +;-----------------------------------------------------------------------------------
  35.571 +;
  35.572 +; You can define your own custom ring cadences here.  You can define up to 8
  35.573 +; pairs.  If the silence is negative, it indicates where the callerid spill is
  35.574 +; to be placed.  Also, if you define any custom cadences, the default cadences
  35.575 +; will be turned off.
  35.576 +;
  35.577 +; Syntax is:  cadence=ring,silence[,ring,silence[...]]
  35.578 +;
  35.579 +; These are the default cadences:
  35.580 +;
  35.581 +;cadence=125,125,2000,-4000
  35.582 +;cadence=250,250,500,1000,250,250,500,-4000
  35.583 +;cadence=125,125,125,125,125,-4000
  35.584 +;cadence=1000,500,2500,-5000
  35.585 +;
  35.586 +; Each channel consists of the channel number or range.  It inherits the
  35.587 +; parameters that were specified above its declaration.
  35.588 +;
  35.589 +; For GR-303, CRV's are created like channels except they must start with the
  35.590 +; trunk group followed by a colon, e.g.: 
  35.591 +;
  35.592 +; crv => 1:1
  35.593 +; crv => 2:1-2,5-8
  35.594 +;
  35.595 +;
  35.596 +;callerid="Green Phone"<(256) 428-6121>
  35.597 +;channel => 1
  35.598 +;callerid="Black Phone"<(256) 428-6122>
  35.599 +;channel => 2
  35.600 +;callerid="CallerID Phone" <(256) 428-6123>
  35.601 +;callerid="CallerID Phone" <(630) 372-1564>
  35.602 +;callerid="CallerID Phone" <(256) 704-4666>
  35.603 +;channel => 3
  35.604 +;callerid="Pac Tel Phone" <(256) 428-6124>
  35.605 +;channel => 4
  35.606 +;callerid="Uniden Dead" <(256) 428-6125>
  35.607 +;channel => 5
  35.608 +;callerid="Cortelco 2500" <(256) 428-6126>
  35.609 +;channel => 6
  35.610 +;callerid="Main TA 750" <(256) 428-6127>
  35.611 +;channel => 44
  35.612 +;
  35.613 +; For example, maybe we have some other channels which start out in a
  35.614 +; different context and use E & M signalling instead.
  35.615 +;
  35.616 +;context=remote
  35.617 +;sigalling=em
  35.618 +;channel => 15
  35.619 +;channel => 16
  35.620 +
  35.621 +;signalling=em_w
  35.622 +;
  35.623 +; All those in group 0 I'll use for outgoing calls
  35.624 +;
  35.625 +; Strip most significant digit (9) before sending
  35.626 +;
  35.627 +;stripmsd=1
  35.628 +;callerid=asreceived
  35.629 +;group=0
  35.630 +;signalling=fxs_ls
  35.631 +;channel => 45
  35.632 +
  35.633 +;signalling=fxo_ls
  35.634 +;group=1
  35.635 +;callerid="Joe Schmoe" <(256) 428-6131>
  35.636 +;channel => 25
  35.637 +;callerid="Megan May" <(256) 428-6132>
  35.638 +;channel => 26
  35.639 +;callerid="Suzy Queue" <(256) 428-6233>
  35.640 +;channel => 27
  35.641 +;callerid="Larry Moe" <(256) 428-6234>
  35.642 +;channel => 28
  35.643 +;
  35.644 +; Sample PRI (CPE) config:  Specify the switchtype, the signalling as either
  35.645 +; pri_cpe or pri_net for CPE or Network termination, and generally you will
  35.646 +; want to create a single "group" for all channels of the PRI.
  35.647 +;
  35.648 +; switchtype = national
  35.649 +; signalling = pri_cpe
  35.650 +; group = 2
  35.651 +; channel => 1-23
  35.652 +
  35.653 +;
  35.654 +
  35.655 +;  Used for distinctive ring support for x100p.
  35.656 +;  You can see the dringX patterns is to set any one of the dringXcontext fields
  35.657 +;  and they will be printed on the console when an inbound call comes in.
  35.658 +;
  35.659 +;dring1=95,0,0 
  35.660 +;dring1context=internal1 
  35.661 +;dring2=325,95,0 
  35.662 +;dring2context=internal2 
  35.663 +; If no pattern is matched here is where we go.
  35.664 +;context=default
  35.665 +;channel => 1 
  35.666 +

mercurial