[svn-commits] murf: branch murf/config_comments r40387 - in /team/murf/config_comments: ./ ...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Aug 18 08:51:15 MST 2006


Author: murf
Date: Fri Aug 18 10:51:14 2006
New Revision: 40387

URL: http://svn.digium.com/view/asterisk?rev=40387&view=rev
Log:
Bringing this up to date against bustling changes...


Added:
    team/murf/config_comments/doc/queues-with-callback-members.txt   (props changed)
      - copied unchanged from r40360, trunk/doc/queues-with-callback-members.txt
Modified:
    team/murf/config_comments/   (props changed)
    team/murf/config_comments/UPGRADE.txt
    team/murf/config_comments/acinclude.m4
    team/murf/config_comments/apps/app_macro.c
    team/murf/config_comments/apps/app_voicemail.c
    team/murf/config_comments/channel.c
    team/murf/config_comments/channels/Makefile
    team/murf/config_comments/channels/chan_alsa.c
    team/murf/config_comments/channels/chan_h323.c
    team/murf/config_comments/channels/chan_jingle.c
    team/murf/config_comments/channels/chan_mgcp.c
    team/murf/config_comments/channels/chan_misdn.c
    team/murf/config_comments/channels/chan_oss.c
    team/murf/config_comments/channels/chan_sip.c
    team/murf/config_comments/channels/chan_skinny.c
    team/murf/config_comments/channels/misdn/Makefile
    team/murf/config_comments/channels/misdn/isdn_lib.c
    team/murf/config_comments/channels/misdn/isdn_lib.h
    team/murf/config_comments/channels/misdn/isdn_msg_parser.c
    team/murf/config_comments/configure
    team/murf/config_comments/configure.ac
    team/murf/config_comments/contrib/utils/zones2indications.c
    team/murf/config_comments/doc/imapstorage.txt
    team/murf/config_comments/doc/odbcstorage.txt
    team/murf/config_comments/frame.c
    team/murf/config_comments/funcs/func_cdr.c
    team/murf/config_comments/http.c
    team/murf/config_comments/include/asterisk/autoconfig.h.in
    team/murf/config_comments/include/asterisk/lock.h
    team/murf/config_comments/res/res_agi.c
    team/murf/config_comments/translate.c

Propchange: team/murf/config_comments/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/murf/config_comments/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/murf/config_comments/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Aug 18 10:51:14 2006
@@ -1,1 +1,1 @@
-/trunk:1-39814
+/trunk:1-40386

Modified: team/murf/config_comments/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/UPGRADE.txt?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/UPGRADE.txt (original)
+++ team/murf/config_comments/UPGRADE.txt Fri Aug 18 10:51:14 2006
@@ -197,6 +197,10 @@
   exit code, the AGISTATUS variable will be set to "FAILURE" as opposed to
   "SUCCESS".
 
+* app_voicemail: The ODBC_STORAGE capability now requires the extended table format
+  previously used only by EXTENDED_ODBC_STORAGE. This means that you will need to update
+  your table format using the schema provided in doc/odbcstorage.txt
+
 Manager:
 
 * After executing the 'status' manager action, the "Status" manager events

Modified: team/murf/config_comments/acinclude.m4
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/acinclude.m4?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/acinclude.m4 (original)
+++ team/murf/config_comments/acinclude.m4 Fri Aug 18 10:51:14 2006
@@ -84,10 +84,14 @@
 AC_DEFUN(
 [AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
    GNU_MAKE='Not Found' ;
+   GNU_MAKE_VERSION_MAJOR=0 ;
+   GNU_MAKE_VERSION_MINOR=0 ;
    for a in make gmake gnumake ; do
       if test -z "$a" ; then continue ; fi ;
       if ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
          GNU_MAKE=$a ;
+         GNU_MAKE_VERSION_MAJOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
+         GNU_MAKE_VERSION_MINOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
          break;
       fi
    done ;

Modified: team/murf/config_comments/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/apps/app_macro.c?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/apps/app_macro.c (original)
+++ team/murf/config_comments/apps/app_macro.c Fri Aug 18 10:51:14 2006
@@ -112,7 +112,7 @@
 	int oldpriority;
 	char pc[80], depthc[12];
 	char oldcontext[AST_MAX_CONTEXT] = "";
-	int offset, depth = 0;
+	int offset, depth = 0, maxdepth = 7;
 	int setmacrocontext=0;
 	int autoloopflag, dead = 0;
   
@@ -129,11 +129,16 @@
 
 	LOCAL_USER_ADD(u);
 
+	/* does the user want a deeper rabbit hole? */
+	s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION");
+	if (s)
+		sscanf(s, "%d", &maxdepth);
+
 	/* Count how many levels deep the rabbit hole goes */
 	s = pbx_builtin_getvar_helper(chan, "MACRO_DEPTH");
 	if (s)
 		sscanf(s, "%d", &depth);
-	if (depth >= 7) {
+	if (depth >= maxdepth) {
 		ast_log(LOG_ERROR, "Macro():  possible infinite loop detected.  Returning early.\n");
 		LOCAL_USER_REMOVE(u);
 		return 0;
@@ -254,9 +259,9 @@
 			break;
 		}
 		/* don't stop executing extensions when we're in "h" */
-		if (chan->_softhangup && strcasecmp(oldexten,"h")) {
-			ast_log(LOG_DEBUG, "Extension %s, priority %d returned normally even though call was hung up\n",
-				chan->exten, chan->priority);
+		if (chan->_softhangup && strcasecmp(chan->macroexten,"h")) {
+			ast_log(LOG_DEBUG, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n",
+				chan->exten, chan->macroexten, chan->priority);
 			goto out;
 		}
 		chan->priority++;

Modified: team/murf/config_comments/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/apps/app_voicemail.c?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/apps/app_voicemail.c (original)
+++ team/murf/config_comments/apps/app_voicemail.c Fri Aug 18 10:51:14 2006
@@ -31,10 +31,6 @@
 /*** MAKEOPTS
 <category name="MENUSELECT_OPTS_app_voicemail" displayname="Voicemail Build Options" positive_output="yes" remove_on_change="apps/app_voicemail.o">
 	<member name="ODBC_STORAGE" displayname="Storage of Voicemail using ODBC">
-		<depend>unixodbc</depend>
-		<defaultenabled>no</defaultenabled>
-	</member>
-	<member name="EXTENDED_ODBC_STORAGE" displayname="Storage of Voicemail using ODBC (extended)">
 		<depend>unixodbc</depend>
 		<defaultenabled>no</defaultenabled>
 	</member>
@@ -1330,11 +1326,7 @@
 			odbc_release_obj(obj);
 			goto yuck;
 		}
-#ifdef EXTENDED_ODBC_STORAGE
 		snprintf(sql, sizeof(sql), "INSERT INTO %s (dir, msgnum, context, macrocontext, callerid, origtime, duration, recording, mailboxuser, mailboxcontext) SELECT ?,?,context,macrocontext,callerid,origtime,duration,recording,?,? FROM %s WHERE dir=? AND msgnum=?",odbc_table,odbc_table); 
-#else
-		snprintf(sql, sizeof(sql), "INSERT INTO %s (dir, msgnum, context, macrocontext, callerid, origtime, duration, recording) SELECT ?,?,context,macrocontext,callerid,origtime,duration,recording FROM %s WHERE dir=? AND msgnum=?",odbc_table,odbc_table); 
-#endif
 		res = SQLPrepare(stmt, sql, SQL_NTS);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -1344,15 +1336,10 @@
 		}
 		SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(ddir), 0, (void *)ddir, 0, NULL);
 		SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnumd), 0, (void *)msgnumd, 0, NULL);
-#ifdef EXTENDED_ODBC_STORAGE
 		SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(dmailboxuser), 0, (void *)dmailboxuser, 0, NULL);
 		SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(dmailboxcontext), 0, (void *)dmailboxcontext, 0, NULL);
 		SQLBindParameter(stmt, 5, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(sdir), 0, (void *)sdir, 0, NULL);
 		SQLBindParameter(stmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
-#else
-		SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(sdir), 0, (void *)sdir, 0, NULL);
-		SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
-#endif
 		res = odbc_smart_execute(obj, stmt);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Execute error!\n[%s] (You probably don't have MySQL 4.1 or later installed)\n\n", sql);
@@ -1441,17 +1428,9 @@
 			goto yuck;
 		}
 		if (!ast_strlen_zero(category)) 
-#ifdef EXTENDED_ODBC_STORAGE
 			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext,category) VALUES (?,?,?,?,?,?,?,?,?,?,?)",odbc_table); 
-#else
-			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,category) VALUES (?,?,?,?,?,?,?,?,?)",odbc_table);
-#endif
 		else
-#ifdef EXTENDED_ODBC_STORAGE
 			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext) VALUES (?,?,?,?,?,?,?,?,?,?)",odbc_table);
-#else
-			snprintf(sql, sizeof(sql), "INSERT INTO %s (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration) VALUES (?,?,?,?,?,?,?,?)",odbc_table);
-#endif
 		res = SQLPrepare(stmt, sql, SQL_NTS);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -1468,15 +1447,10 @@
 		SQLBindParameter(stmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(callerid), 0, (void *)callerid, 0, NULL);
 		SQLBindParameter(stmt, 7, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(origtime), 0, (void *)origtime, 0, NULL);
 		SQLBindParameter(stmt, 8, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(duration), 0, (void *)duration, 0, NULL);
-#ifdef EXTENDED_ODBC_STORAGE
 		SQLBindParameter(stmt, 9, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(mailboxuser), 0, (void *)mailboxuser, 0, NULL);
 		SQLBindParameter(stmt, 10, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(mailboxcontext), 0, (void *)mailboxcontext, 0, NULL);
 		if (!ast_strlen_zero(category))
 			SQLBindParameter(stmt, 11, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(category), 0, (void *)category, 0, NULL);
-#else
-		if (!ast_strlen_zero(category))
-			SQLBindParameter(stmt, 9, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(category), 0, (void *)category, 0, NULL);
-#endif
 		res = odbc_smart_execute(obj, stmt);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
@@ -1518,11 +1492,7 @@
 			odbc_release_obj(obj);
 			goto yuck;
 		}
-#ifdef EXTENDED_ODBC_STORAGE
 		snprintf(sql, sizeof(sql), "UPDATE %s SET dir=?, msgnum=?, mailboxuser=?, mailboxcontext=? WHERE dir=? AND msgnum=?",odbc_table);
-#else
-		snprintf(sql, sizeof(sql), "UPDATE %s SET dir=?, msgnum=? WHERE dir=? AND msgnum=?",odbc_table);
-#endif
 		res = SQLPrepare(stmt, sql, SQL_NTS);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -1532,15 +1502,10 @@
 		}
 		SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(ddir), 0, (void *)ddir, 0, NULL);
 		SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnumd), 0, (void *)msgnumd, 0, NULL);
-#ifdef EXTENDED_ODBC_STORAGE
 		SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(mailboxuser), 0, (void *)mailboxuser, 0, NULL);
 		SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(mailboxcontext), 0, (void *)mailboxcontext, 0, NULL);
 		SQLBindParameter(stmt, 5, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(sdir), 0, (void *)sdir, 0, NULL);
 		SQLBindParameter(stmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
-#else
-		SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(sdir), 0, (void *)sdir, 0, NULL);
-		SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
-#endif
 		res = odbc_smart_execute(obj, stmt);
 		if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
 			ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
@@ -2390,7 +2355,7 @@
 
 #else
 #ifdef IMAP_STORAGE
-static int messagecount(const char *mailbox, int *newmsgs, int *oldmsgs)
+static int count_messages_imap(const char *mailbox, int *newmsgs, int *oldmsgs)
 {
    	SEARCHPGM *pgm;
    	SEARCHHEADER *hdr;
@@ -2418,7 +2383,7 @@
  		ret = 0;
  		while((cur = strsep(&mb, ", "))) {
  			if (!ast_strlen_zero(cur)) {
- 				if (messagecount(cur, newmsgs ? &tmpnew : NULL, oldmsgs ? &tmpold : NULL))
+ 				if (count_messages_imap(cur, newmsgs ? &tmpnew : NULL, oldmsgs ? &tmpold : NULL))
  					return -1;
  				else {
  					if (newmsgs)
@@ -2542,13 +2507,6 @@
  	}
  	return 0;
  }
-#else
-
-static int messagecount(const char *context, const char *mailbox, const char *folder)
-{
-	return __has_voicemail(context, mailbox, folder, 0);
-}
-
 #endif
 #endif
 
@@ -2588,6 +2546,13 @@
 }
 
 #ifndef ODBC_STORAGE
+
+static int messagecount(const char *context, const char *mailbox, const char *folder)
+{
+	return __has_voicemail(context, mailbox, folder, 0);
+}
+
+
 static int __has_voicemail(const char *context, const char *mailbox, const char *folder, int shortcircuit)
 {
 	DIR *dir;
@@ -2914,7 +2879,7 @@
 			oldmsgs = vms->oldmessages;
 		} else {
 			ast_log(LOG_DEBUG, "About to call messagecount.\n");
-			res = messagecount(ext, &newmsgs, &oldmsgs);
+			res = count_messages_imap(ext, &newmsgs, &oldmsgs);
 			if(res < 0) {
 				ast_log(LOG_NOTICE,"Can not leave voicemail, unable to count messages\n");
 				return -1;
@@ -6505,10 +6470,13 @@
 	/* expunge message - use UID Expunge if supported on IMAP server*/
 	ast_log(LOG_DEBUG, "*** Checking if we can expunge, deleted set to %d, expungeonhangup set to %d\n",deleted,expungeonhangup);
 	if (vmu && deleted == 1 && expungeonhangup == 1)  {
+#ifdef HAVE_IMAP_TK2006
 	      	if (LEVELUIDPLUS (vms.mailstream)) {
 			ast_log(LOG_DEBUG, "*** About to expunge messages using UID\n");
 			mail_expunge_full(vms.mailstream,NIL,EX_UID);
-		} else {
+		} else 
+#endif
+		{
 			ast_log(LOG_DEBUG, "*** About to expunge messages\n");
 			mail_expunge(vms.mailstream);
 		}
@@ -7406,13 +7374,6 @@
 	snprintf(VM_SPOOL_DIR, sizeof(VM_SPOOL_DIR), "%s/voicemail/", ast_config_AST_SPOOL_DIR);
 
 	ast_install_vm_functions(has_voicemail, inboxcount, messagecount);
-
-#if defined(ODBC_STORAGE) && !defined(EXTENDED_ODBC_STORAGE)
-	ast_log(LOG_WARNING, "The current ODBC storage table format will be changed soon."
-				"Please update your tables as per the README and edit the apps/Makefile "
-				"and uncomment the line containing EXTENDED_ODBC_STORAGE to enable the "
-				"new table format.\n");
-#endif
 
 	return res;
 }
@@ -8555,7 +8516,7 @@
 	for (x = 0; x<256; x++) {
 		if (vms->msgArray[x]!=0) {
   			ast_log (LOG_DEBUG, "Item %d set to %ld\n",x,vms->msgArray[x]);
-		};
+		}
 	}
   	ast_log (LOG_DEBUG, "Check complete.\n");
 }

Modified: team/murf/config_comments/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/channel.c?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/channel.c (original)
+++ team/murf/config_comments/channel.c Fri Aug 18 10:51:14 2006
@@ -3349,7 +3349,8 @@
 
 	chan->_state = state;
 	ast_device_state_changed_literal(chan->name);
-	manager_event(EVENT_FLAG_CALL, "Newstate",
+	manager_event(EVENT_FLAG_CALL,
+		      (oldstate == AST_STATE_DOWN) ? "Newchannel" : "Newstate",
 		      "Channel: %s\r\n"
 		      "State: %s\r\n"
 		      "CallerID: %s\r\n"
@@ -3807,12 +3808,18 @@
 };
 
 struct tonepair_state {
-	float freq1;
-	float freq2;
-	float vol;
+	int fac1;
+	int fac2;
+	int v1_1;
+	int v2_1;
+	int v3_1;
+	int v1_2;
+	int v2_2;
+	int v3_2;
+	int origwfmt;
+	int pos;
 	int duration;
-	int pos;
-	int origwfmt;
+	int modulate;
 	struct ast_frame f;
 	unsigned char offset[AST_FRIENDLY_OFFSET];
 	short data[4000];
@@ -3840,10 +3847,16 @@
 		tonepair_release(NULL, ts);
 		ts = NULL;
 	} else {
-		ts->freq1 = td->freq1;
-		ts->freq2 = td->freq2;
+		ts->fac1 = 2.0 * cos(2.0 * M_PI * (td->freq1 / 8000.0)) * 32768.0;
+		ts->v1_1 = 0;
+		ts->v2_1 = sin(-4.0 * M_PI * (td->freq1 / 8000.0)) * td->vol;
+		ts->v3_1 = sin(-2.0 * M_PI * (td->freq1 / 8000.0)) * td->vol;
+		ts->v2_1 = 0;
+		ts->fac2 = 2.0 * cos(2.0 * M_PI * (td->freq2 / 8000.0)) * 32768.0;
+		ts->v2_2 = sin(-4.0 * M_PI * (td->freq2 / 8000.0)) * td->vol;
+		ts->v3_2 = sin(-2.0 * M_PI * (td->freq2 / 8000.0)) * td->vol;
 		ts->duration = td->duration;
-		ts->vol = td->vol;
+		ts->modulate = 0;
 	}
 	/* Let interrupts interrupt :) */
 	ast_set_flag(chan, AST_FLAG_WRITE_INT);
@@ -3865,12 +3878,23 @@
 		return -1;
 	}
 	memset(&ts->f, 0, sizeof(ts->f));
-	for (x = 0; x < (len / 2); x++) {
-		ts->data[x] = ts->vol * (
-				sin((ts->freq1 * 2.0 * M_PI / 8000.0) * (ts->pos + x)) +
-				sin((ts->freq2 * 2.0 * M_PI / 8000.0) * (ts->pos + x))
-			);
-	}
+ 	for (x=0;x<len/2;x++) {
+ 		ts->v1_1 = ts->v2_1;
+ 		ts->v2_1 = ts->v3_1;
+ 		ts->v3_1 = (ts->fac1 * ts->v2_1 >> 15) - ts->v1_1;
+ 		
+ 		ts->v1_2 = ts->v2_2;
+ 		ts->v2_2 = ts->v3_2;
+ 		ts->v3_2 = (ts->fac2 * ts->v2_2 >> 15) - ts->v1_2;
+ 		if (ts->modulate) {
+ 			int p;
+ 			p = ts->v3_2 - 32768;
+ 			if (p < 0) p = -p;
+ 			p = ((p * 9) / 10) + 1;
+ 			ts->data[x] = (ts->v3_1 * p) >> 15;
+ 		} else
+ 			ts->data[x] = ts->v3_1 + ts->v3_2; 
+ 	}
 	ts->f.frametype = AST_FRAME_VOICE;
 	ts->f.subclass = AST_FORMAT_SLINEAR;
 	ts->f.datalen = len;

Modified: team/murf/config_comments/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/channels/Makefile?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/channels/Makefile (original)
+++ team/murf/config_comments/channels/Makefile Fri Aug 18 10:51:14 2006
@@ -47,11 +47,6 @@
   C_MODS:=$(filter-out chan_misdn,$(C_MODS))
 endif
 
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libbnec.so),)
-  EC_CFLAGS=-DWITH_BEROEC
-  EC_LIBS=-lbnec
-endif
-
 ifndef OPENH323DIR
   OPENH323DIR=$(HOME)/openh323
 endif
@@ -99,9 +94,9 @@
 misdn/chan_misdn_lib.a:
 	make -C misdn
 
-chan_misdn.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\" $(EC_CFLAGS)
+chan_misdn.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\" 
 
-misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\" $(EC_CFLAGS)
+misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\" 
 
 chan_misdn.so: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a
-chan_misdn.so: LIBS+=-lisdnnet -lmISDN -lsuppserv $(EC_LIBS)
+chan_misdn.so: LIBS+=-lisdnnet -lmISDN -lsuppserv 

Modified: team/murf/config_comments/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/channels/chan_alsa.c?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/channels/chan_alsa.c (original)
+++ team/murf/config_comments/channels/chan_alsa.c Fri Aug 18 10:51:14 2006
@@ -829,6 +829,7 @@
 		usecnt++;
 		ast_mutex_unlock(&usecnt_lock);
 		ast_update_use_count();
+		ast_jb_configure(tmp, &global_jbconf);
 		if (state != AST_STATE_DOWN) {
 			if (ast_pbx_start(tmp)) {
 				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@@ -836,8 +837,6 @@
 				tmp = NULL;
 			}
 		}
-		if (tmp)
-			ast_jb_configure(tmp, &global_jbconf);
 	}
 	return tmp;
 }

Modified: team/murf/config_comments/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/channels/chan_h323.c?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/channels/chan_h323.c (original)
+++ team/murf/config_comments/channels/chan_h323.c Fri Aug 18 10:51:14 2006
@@ -278,10 +278,13 @@
 		pvt->newcontrol = -1;
 	}
 	if (pvt->newdigit >= 0) {
-		struct ast_frame f = {AST_FRAME_DTMF, pvt->newdigit, };
-
-		f.samples = 800;
-		f.src = "UPDATE_INFO";
+		struct ast_frame f = {
+			.frametype = AST_FRAME_DTMF,
+			.subclass = pvt->newdigit,
+			.samples = 800,
+			.src = "UPDATE_INFO",
+		};
+
 		ast_queue_frame(c, &f);
 		pvt->newdigit = -1;
 	}
@@ -823,6 +826,8 @@
 			ch->cid.cid_dnid = strdup(pvt->exten);
 		}
 		ast_setstate(ch, state);
+		if (pvt->rtp)
+			ast_jb_configure(ch, &global_jbconf);
 		if (state != AST_STATE_DOWN) {
 			if (ast_pbx_start(ch)) {
 				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ch->name);
@@ -830,10 +835,6 @@
 				ch = NULL;
 			}
 		}
-
-		/* Configure the new channel jb */
-		if (ch && pvt && pvt->rtp)
-			ast_jb_configure(ch, &global_jbconf);
 	} else  {
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 	}
@@ -1158,9 +1159,13 @@
 		return -1;
 	}
 	if (pvt->owner && !ast_mutex_trylock(&pvt->owner->lock)) {
-		struct ast_frame f = {AST_FRAME_DTMF, digit, };
-		f.samples = 800;
-		f.src = "SEND_DIGIT";
+		struct ast_frame f = {
+			.frametype = AST_FRAME_DTMF,
+			.subclass = digit,
+			.samples = 800,
+			.src = "SEND_DIGIT",
+		};
+
 		res = ast_queue_frame(pvt->owner, &f);
 		ast_mutex_unlock(&pvt->owner->lock);
 	} else {

Modified: team/murf/config_comments/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/channels/chan_jingle.c?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/channels/chan_jingle.c (original)
+++ team/murf/config_comments/channels/chan_jingle.c Fri Aug 18 10:51:14 2006
@@ -813,16 +813,14 @@
 		tmp->cid.cid_dnid = ast_strdup(i->exten);
 	tmp->priority = 1;
 	ast_setstate(tmp, state);
+	if (i->rtp)
+		ast_jb_configure(tmp, &global_jbconf);
 	if (state != AST_STATE_DOWN && ast_pbx_start(tmp)) {
 		ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
 		tmp->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
 		ast_hangup(tmp);
 		tmp = NULL;
 	}
-
-	/* Configure the new channel jb */
-	if (tmp && i && i->rtp)
-		ast_jb_configure(tmp, &global_jbconf);
 
 	return tmp;
 }

Modified: team/murf/config_comments/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/channels/chan_mgcp.c?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/channels/chan_mgcp.c (original)
+++ team/murf/config_comments/channels/chan_mgcp.c Fri Aug 18 10:51:14 2006
@@ -1425,6 +1425,8 @@
 		if (!i->adsi)
 			tmp->adsicpe = AST_ADSI_UNAVAILABLE;
 		tmp->priority = 1;
+		if (sub->rtp)
+			ast_jb_configure(tmp, &global_jbconf);
 		if (state != AST_STATE_DOWN) {
 			if (ast_pbx_start(tmp)) {
 				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
@@ -1437,10 +1439,6 @@
 			ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_new(%s) created in state: %s\n",
 				tmp->name, ast_state2str(state));
 		}
-
-		/* Configure the new channel jb */
-		if (tmp && sub && sub->rtp)
-			ast_jb_configure(tmp, &global_jbconf);
 	} else {
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 	}
@@ -2462,12 +2460,14 @@
 						if (strncasecmp(v, p->sub->cxident, len) &&
 						    strncasecmp(v, p->sub->next->cxident, len)) {
 							/* connection id not found. delete it */
-							char cxident[80];
-							memcpy(cxident, v, len);
-							cxident[len] = '\0';
+							char cxident[80] = "";
+
+							if (len > (sizeof(cxident) - 1))
+								len = sizeof(cxident) - 1;
+							ast_copy_string(cxident, v, len);
 							if (option_verbose > 2) {
 								ast_verbose(VERBOSE_PREFIX_3 "Non existing connection id %s on %s@%s \n", 
-									cxident, p->name, gw->name);
+									    cxident, p->name, gw->name);
 							}
 							transmit_connection_del_w_params(p, NULL, cxident);
 						}

Modified: team/murf/config_comments/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/murf/config_comments/channels/chan_misdn.c?rev=40387&r1=40386&r2=40387&view=diff
==============================================================================
--- team/murf/config_comments/channels/chan_misdn.c (original)
+++ team/murf/config_comments/channels/chan_misdn.c Fri Aug 18 10:51:14 2006
@@ -260,6 +260,8 @@
 static struct sched_context *misdn_tasks = NULL;
 static pthread_t misdn_tasks_thread;
 
+static int *misdn_ports;
+
 static void chan_misdn_log(int level, int port, char *tmpl, ...);
 
 static struct ast_channel *misdn_new(struct chan_list *cl, int state,  char *exten, char *callerid, int format, int port, int c);
@@ -413,12 +415,38 @@
 }
 
 
-static void print_facility(struct FacReqParm *fac, struct misdn_bchannel *bc)
+static void print_facility(struct FacParm *fac, struct misdn_bchannel *bc)
 {
 	switch (fac->Function) {
-	case FacReq_CD:
+	case Fac_CD:
 		chan_misdn_log(0,bc->port," --> calldeflect to: %s, screened: %s\n", fac->u.CDeflection.DeflectedToNumber,
 					   fac->u.CDeflection.PresentationAllowed ? "yes" : "no");
+		break;
+	case Fac_AOCDCurrency:
+		if (fac->u.AOCDcur.chargeNotAvailable)
+			chan_misdn_log(0,bc->port," --> AOCD currency: charge not available\n");
+		else if (fac->u.AOCDcur.freeOfCharge)
+			chan_misdn_log(0,bc->port," --> AOCD currency: free of charge\n");
+		else if (fac->u.AOCDchu.billingId >= 0)
+			chan_misdn_log(0,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%d billingId:%d\n",
+						   fac->u.AOCDcur.currency, fac->u.AOCDcur.currencyAmount, fac->u.AOCDcur.multiplier,
+						   (fac->u.AOCDcur.typeOfChargingInfo == 0) ? "subTotal" : "total", fac->u.AOCDcur.billingId);
+		else
+			chan_misdn_log(0,bc->port," --> AOCD currency: currency:%s amount:%d multiplier:%d typeOfChargingInfo:%d\n",
+						   fac->u.AOCDcur.currency, fac->u.AOCDcur.currencyAmount, fac->u.AOCDcur.multiplier,
+						   (fac->u.AOCDcur.typeOfChargingInfo == 0) ? "subTotal" : "total");
+		break;
+	case Fac_AOCDChargingUnit:
+		if (fac->u.AOCDchu.chargeNotAvailable)
+			chan_misdn_log(0,bc->port," --> AOCD charging unit: charge not available\n");
+		else if (fac->u.AOCDchu.freeOfCharge)
+			chan_misdn_log(0,bc->port," --> AOCD charging unit: free of charge\n");
+		else if (fac->u.AOCDchu.billingId >= 0)
+			chan_misdn_log(0,bc->port," --> AOCD charging unit: recordedUnits:%d typeOfChargingInfo:%s billingId:%d\n",
+						   fac->u.AOCDchu.recordedUnits, (fac->u.AOCDchu.typeOfChargingInfo == 0) ? "subTotal" : "total", fac->u.AOCDchu.billingId);
+		else
+			chan_misdn_log(0,bc->port," --> AOCD charging unit: recordedUnits:%d typeOfChargingInfo:%s\n",
+						   fac->u.AOCDchu.recordedUnits, (fac->u.AOCDchu.typeOfChargingInfo == 0) ? "subTotal" : "total");
 		break;
 	default:
 		chan_misdn_log(0,bc->port," --> unknown\n");
@@ -534,8 +562,8 @@
 
 static int misdn_l1_task (void *data)
 {
-	misdn_lib_isdn_l1watcher((int)data);
-	chan_misdn_log(5, (int)data, "L1watcher timeout\n");
+	misdn_lib_isdn_l1watcher(*(int *)data);
+	chan_misdn_log(5, *(int *)data, "L1watcher timeout\n");
 	return 1;
 }
 
@@ -957,13 +985,6 @@
 			"  --> state: %s\n"
 			"  --> capability: %s\n"
 			"  --> echo_cancel: %d\n"
-#ifdef WITH_BEROEC
-			"  --> bnec_tail: %d\n"
-			"  --> bnec_nlp: %d\n"
-			"  --> bnec_ah: %d\n"
-			"  --> bnec_td: %d\n"
-			"  --> bnec_zerocoeff: %d\n"
-#endif
 			"  --> notone : rx %d tx:%d\n"
 			"  --> bc_hold: %d holded_bc :%d\n",
 			help->ast->name,
@@ -978,13 +999,6 @@
 			bearer2str(bc->capability),
 			bc->ec_enable,
 
-#ifdef WITH_BEROEC
-			bc->bnec_tail,
-			bc->bnec_nlp,
-			bc->bnec_ah,
-			bc->bnec_td,
-			bc->bnec_zero,
-#endif
 			help->norxtone,help->notxtone,
 			bc->holded, help->holded_bc?1:0
 			);
@@ -1128,7 +1142,7 @@
 				ast_cli(fd, "Sending CD with nr %s to %s failed: Number too long (up to 15 digits are allowed).\n",nr, channame);
 				return 0; 
 			}
-			tmp->bc->fac_out.Function = FacReq_CD;
+			tmp->bc->fac_out.Function = Fac_CD;
 			strncpy((char *)tmp->bc->fac_out.u.CDeflection.DeflectedToNumber, nr, sizeof(tmp->bc->fac_out.u.CDeflection.DeflectedToNumber));
 			misdn_lib_send_event(tmp->bc, EVENT_FACILITY);
 		}
@@ -1329,155 +1343,51 @@
 	return NULL;
 }
 
-static struct ast_cli_entry cli_send_cd =
-{ {"misdn","send","calldeflect", NULL},
-  misdn_send_cd,
-  "Sends CallDeflection to mISDN Channel", 
-  "Usage: misdn send calldeflect <channel> \"<nr>\" \n",
-  complete_ch
+static struct ast_cli_entry chan_misdn_clis[] = {
+	{ {"misdn","send","calldeflect", NULL}, misdn_send_cd, "Sends CallDeflection to mISDN Channel",
+		"Usage: misdn send calldeflect <channel> \"<nr>\" \n", complete_ch },
+	{ {"misdn","send","digit", NULL}, misdn_send_digit,	"Sends DTMF Digit to mISDN Channel",
+		"Usage: misdn send digit <channel> \"<msg>\" \n"
+		"       Send <digit> to <channel> as DTMF Tone\n"
+		"       when channel is a mISDN channel\n", complete_ch },
+	{ {"misdn","toggle","echocancel", NULL}, misdn_toggle_echocancel, "Toggles EchoCancel on mISDN Channel",
+		"Usage: misdn toggle echocancel <channel>\n", complete_ch },
+	{ {"misdn","send","display", NULL}, misdn_send_display, "Sends Text to mISDN Channel", 
+		"Usage: misdn send display <channel> \"<msg>\" \n"
+		"       Send <msg> to <channel> as Display Message\n"
+		"       when channel is a mISDN channel\n", complete_ch },
+	{ {"misdn","show","config", NULL}, misdn_show_config, "Shows internal mISDN config, read from cfg-file",
+		"Usage: misdn show config [<port> | description <config element> | descriptions [general|ports]]\n"
+		"       Use 0 for <port> to only print the general config.\n", complete_show_config },
+	{ {"misdn","reload", NULL}, misdn_reload, "Reloads internal mISDN config, read from cfg-file",
+		"Usage: misdn reload\n" },
+	{ {"misdn","set","tics", NULL}, misdn_set_tics, "", 
+		"\n" },
+	{ {"misdn","show","channels", NULL}, misdn_show_cls, "Shows internal mISDN chan_list",
+		"Usage: misdn show channels\n" },
+	{ {"misdn","show","channel", NULL}, misdn_show_cl, "Shows internal mISDN chan_list",
+		"Usage: misdn show channels\n", complete_ch },
+	{ {"misdn","port","block", NULL}, misdn_port_block, "Blocks the given port",
+		"Usage: misdn port block\n" },
+	{ {"misdn","port","unblock", NULL}, misdn_port_unblock, "Unblocks the given port",
+		"Usage: misdn port unblock\n" },
+	{ {"misdn","restart","port", NULL}, misdn_restart_port, "Restarts the given port",
+		"Usage: misdn restart port\n" },
+	{ {"misdn","port","up", NULL}, misdn_port_up, "Tries to establish L1 on the given port",
+		"Usage: misdn port up <port>\n" },
+	{ {"misdn","port","down", NULL}, misdn_port_down, "Tries to deacivate the L1 on the given port",
+		"Usage: misdn port down <port>\n" },
+	{ {"misdn","show","stacks", NULL}, misdn_show_stacks, "Shows internal mISDN stack_list",
+		"Usage: misdn show stacks\n" },
+	{ {"misdn","show","ports","stats", NULL}, misdn_show_ports_stats, "Shows chan_misdns call statistics per port",
+		"Usage: misdn show port stats\n" },
+	{ {"misdn","show","port", NULL}, misdn_show_port, "Shows detailed information for given port",
+		"Usage: misdn show port <port>\n" },
+	{ {"misdn","set","debug", NULL}, misdn_set_debug, "Sets Debuglevel of chan_misdn",
+		"Usage: misdn set debug <level> [only] | [port <port> [only]]\n", complete_debug_port },
+	{ {"misdn","set","crypt","debug", NULL}, misdn_set_crypt_debug, "Sets CryptDebuglevel of chan_misdn, at the moment, level={1,2}",
+		"Usage: misdn set crypt debug <level>\n" }
 };
-
-static struct ast_cli_entry cli_send_digit =
-{ {"misdn","send","digit", NULL},
-  misdn_send_digit,
-  "Sends DTMF Digit to mISDN Channel", 
-  "Usage: misdn send digit <channel> \"<msg>\" \n"
-  "       Send <digit> to <channel> as DTMF Tone\n"
-  "       when channel is a mISDN channel\n",
-  complete_ch
-};
-
-static struct ast_cli_entry cli_toggle_echocancel =
-{ {"misdn","toggle","echocancel", NULL},
-  misdn_toggle_echocancel,
-  "Toggles EchoCancel on mISDN Channel", 
-  "Usage: misdn toggle echocancel <channel>\n", 
-  complete_ch
-};
-
-static struct ast_cli_entry cli_send_display =
-{ {"misdn","send","display", NULL},
-  misdn_send_display,
-  "Sends Text to mISDN Channel", 
-  "Usage: misdn send display <channel> \"<msg>\" \n"
-  "       Send <msg> to <channel> as Display Message\n"
-  "       when channel is a mISDN channel\n",
-  complete_ch
-};
-
-static struct ast_cli_entry cli_show_config =
-{ {"misdn","show","config", NULL},
-  misdn_show_config,
-  "Shows internal mISDN config, read from cfg-file", 
-  "Usage: misdn show config [<port> | description <config element> | descriptions [general|ports]]\n"
-  "       Use 0 for <port> to only print the general config.\n",
-  complete_show_config
-};
- 
-static struct ast_cli_entry cli_reload =
-{ {"misdn","reload", NULL},
-  misdn_reload,
-  "Reloads internal mISDN config, read from cfg-file", 
-  "Usage: misdn reload\n"
-};
-
-static struct ast_cli_entry cli_set_tics =
-{ {"misdn","set","tics", NULL},
-  misdn_set_tics,
-  "", 
-  "\n"
-};
-
-static struct ast_cli_entry cli_show_cls =
-{ {"misdn","show","channels", NULL},
-  misdn_show_cls,
-  "Shows internal mISDN chan_list", 
-  "Usage: misdn show channels\n"
-};
-
-static struct ast_cli_entry cli_show_cl =
-{ {"misdn","show","channel", NULL},
-  misdn_show_cl,
-  "Shows internal mISDN chan_list", 
-  "Usage: misdn show channels\n",
-  complete_ch
-};
-
-static struct ast_cli_entry cli_port_block=
-{ {"misdn","port","block", NULL},
-  misdn_port_block,
-  "Blocks the given port", 
-  "Usage: misdn port block\n"
-};
-
-static struct ast_cli_entry cli_port_unblock=
-{ {"misdn","port","unblock", NULL},
-  misdn_port_unblock,
-  "Unblocks the given port", 
-  "Usage: misdn port unblock\n"
-};
-
-
-static struct ast_cli_entry cli_restart_port =
-{ {"misdn","restart","port", NULL},
-  misdn_restart_port,
-  "Restarts the given port", 
-  "Usage: misdn restart port\n"
-};
-
-static struct ast_cli_entry cli_port_up =
-{ {"misdn","port","up", NULL},
-  misdn_port_up,
-  "Tries to establish L1 on the given port", 
-  "Usage: misdn port up <port>\n"
-};
-
-static struct ast_cli_entry cli_port_down =
-{ {"misdn","port","down", NULL},
-  misdn_port_down,
-  "Tries to deacivate the L1 on the given port", 
-  "Usage: misdn port down <port>\n"
-};
-
-
-
-static struct ast_cli_entry cli_show_stacks =
-{ {"misdn","show","stacks", NULL},
-  misdn_show_stacks,
-  "Shows internal mISDN stack_list", 
-  "Usage: misdn show stacks\n"
-};
-
-static struct ast_cli_entry cli_show_ports_stats =
-{ {"misdn","show","ports","stats", NULL},
-  misdn_show_ports_stats,
-  "Shows chan_misdns call statistics per port", 
-  "Usage: misdn show port stats\n"
-};
-
-
-static struct ast_cli_entry cli_show_port =
-{ {"misdn","show","port", NULL},
-  misdn_show_port,
-  "Shows detailed information for given port", 
-  "Usage: misdn show port <port>\n"
-};
-
-static struct ast_cli_entry cli_set_debug =
-{ {"misdn","set","debug", NULL},
-  misdn_set_debug,
-  "Sets Debuglevel of chan_misdn",
-  "Usage: misdn set debug <level> [only] | [port <port> [only]]\n",
-  complete_debug_port
-};
-
-static struct ast_cli_entry cli_set_crypt_debug =
-{ {"misdn","set","crypt","debug", NULL},
-  misdn_set_crypt_debug,
-  "Sets CryptDebuglevel of chan_misdn, at the moment, level={1,2}", 
-  "Usage: misdn set crypt debug <level>\n"
-};
-/*** CLI END ***/
 
 
 static int update_config (struct chan_list *ch, int orig) 
@@ -1663,19 +1573,6 @@
 	}
 #endif
 
-#ifdef WITH_BEROEC
-	misdn_cfg_get(port, MISDN_CFG_BNECHOCANCEL,&bc->bnec_tail, sizeof(int));
-	misdn_cfg_get(port, MISDN_CFG_BNEC_ANTIHOWL, &bc->bnec_ah, sizeof(int));
-	misdn_cfg_get(port, MISDN_CFG_BNEC_NLP, &bc->bnec_nlp, sizeof(int));
-	misdn_cfg_get(port, MISDN_CFG_BNEC_TD, &bc->bnec_td, sizeof(int));
-	misdn_cfg_get(port, MISDN_CFG_BNEC_ADAPT, &bc->bnec_adapt, sizeof(int));
-	misdn_cfg_get(port, MISDN_CFG_BNEC_ZEROCOEFF, &bc->bnec_zero, sizeof(int));
-
-	if (bc->bnec_tail && bc->ec_enable) {
-		ast_log(LOG_WARNING,"Are you sure you wan't to mix BNEC with Zapec ? This might cause bad audio quality!\n");
-		bc->ec_enable=0;
-	}
-#endif
 	return 0;
 }
 
@@ -1895,6 +1792,9 @@
 		if (!ch->trans)
 			ch->trans=ast_translator_build_path(AST_FORMAT_SLINEAR, AST_FORMAT_ALAW);
 	}
+
+	/* AOCD initialization */
+	bc->AOCDtype = Fac_None;
 
 	return 0;
 }
@@ -4480,29 +4380,34 @@
 		print_facility(&(bc->fac_in), bc);
 		
 		switch (bc->fac_in.Function) {
-		case FacReq_CD:
-		{
-			struct ast_channel *bridged=AST_BRIDGED_P(ch->ast);
-			struct chan_list *ch_br;
-			
-			if (bridged && MISDN_ASTERISK_TECH_PVT(bridged)) {
-				ch_br=MISDN_ASTERISK_TECH_PVT(bridged);
-				/*ch->state=MISDN_FACILITY_DEFLECTED;*/
-				if (ch_br->bc) {
-					if (ast_exists_extension(bridged, ch->context, (char *)bc->fac_in.u.CDeflection.DeflectedToNumber, 1, bc->oad)) {
-						ch_br->state=MISDN_DIALING;
-						if (pbx_start_chan(ch_br) < 0) {
-							chan_misdn_log(-1, ch_br->bc->port, "ast_pbx_start returned < 0 in misdn_overlap_dial_task\n");
+		case Fac_CD:
+			{
+				struct ast_channel *bridged=AST_BRIDGED_P(ch->ast);
+				struct chan_list *ch_br;
+				if (bridged && MISDN_ASTERISK_TECH_PVT(bridged)) {
+					ch_br=MISDN_ASTERISK_TECH_PVT(bridged);
+					/*ch->state=MISDN_FACILITY_DEFLECTED;*/
+					if (ch_br->bc) {
+						if (ast_exists_extension(bridged, ch->context, (char *)bc->fac_in.u.CDeflection.DeflectedToNumber, 1, bc->oad)) {
+							ch_br->state=MISDN_DIALING;
+							if (pbx_start_chan(ch_br) < 0) {
+								chan_misdn_log(-1, ch_br->bc->port, "ast_pbx_start returned < 0 in misdn_overlap_dial_task\n");
+							}
 						}
 					}
+
 				}
-				
-			}
-			
-			misdn_lib_send_event(bc, EVENT_DISCONNECT);
-		} 
-		
-		break;
+				misdn_lib_send_event(bc, EVENT_DISCONNECT);
+			} 
+			break;
+		case Fac_AOCDCurrency:
+			bc->AOCDtype = Fac_AOCDCurrency;
+			memcpy(&(bc->AOCD.currency), &(bc->fac_in.u.AOCDcur), sizeof(struct FacAOCDCurrency));
+			break;
+		case Fac_AOCDChargingUnit:
+			bc->AOCDtype = Fac_AOCDChargingUnit;
+			memcpy(&(bc->AOCD.chargingUnit), &(bc->fac_in.u.AOCDchu), sizeof(struct FacAOCDChargingUnit));
+			break;
 		default:
 			chan_misdn_log(0, bc->port," --> not yet handled: facility type:%p\n", bc->fac_in.Function);
 		}
@@ -4545,28 +4450,8 @@
 	
 	if (!g_config_initialized) return 0;
 	
-	ast_cli_unregister(&cli_send_display);
-	
-	ast_cli_unregister(&cli_send_cd);
-	
-	ast_cli_unregister(&cli_send_digit);
-	ast_cli_unregister(&cli_toggle_echocancel);
-	ast_cli_unregister(&cli_set_tics);
-  
-	ast_cli_unregister(&cli_show_cls);
-	ast_cli_unregister(&cli_show_cl);
-	ast_cli_unregister(&cli_show_config);
-	ast_cli_unregister(&cli_show_port);
-	ast_cli_unregister(&cli_show_ports_stats);
-	ast_cli_unregister(&cli_show_stacks);
-	ast_cli_unregister(&cli_port_block);
-	ast_cli_unregister(&cli_port_unblock);
-	ast_cli_unregister(&cli_restart_port);
-	ast_cli_unregister(&cli_port_up);
-	ast_cli_unregister(&cli_port_down);
-	ast_cli_unregister(&cli_set_debug);
-	ast_cli_unregister(&cli_set_crypt_debug);
-	ast_cli_unregister(&cli_reload);
+	ast_cli_unregister_multiple(chan_misdn_clis, sizeof(chan_misdn_clis) / sizeof(chan_misdn_clis[0]));
+	
 	/* ast_unregister_application("misdn_crypt"); */

[... 1297 lines stripped ...]


More information about the svn-commits mailing list