[asterisk-commits] tilghman: branch group/codec_bits r108890 - in /team/group/codec_bits: apps/ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 14 20:02:02 CDT 2008


Author: tilghman
Date: Fri Mar 14 20:02:02 2008
New Revision: 108890

URL: http://svn.digium.com/view/asterisk?view=rev&rev=108890
Log:
A few more changes

Modified:
    team/group/codec_bits/apps/app_alarmreceiver.c
    team/group/codec_bits/apps/app_amd.c
    team/group/codec_bits/apps/app_chanspy.c
    team/group/codec_bits/apps/app_dictate.c
    team/group/codec_bits/apps/app_echo.c
    team/group/codec_bits/apps/app_festival.c
    team/group/codec_bits/apps/app_ices.c
    team/group/codec_bits/apps/app_meetme.c
    team/group/codec_bits/apps/app_milliwatt.c
    team/group/codec_bits/apps/app_mixmonitor.c
    team/group/codec_bits/apps/app_mp3.c
    team/group/codec_bits/apps/app_nbscat.c
    team/group/codec_bits/include/asterisk/audiohook.h
    team/group/codec_bits/include/asterisk/pbx.h
    team/group/codec_bits/pbx/pbx_spool.c

Modified: team/group/codec_bits/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_alarmreceiver.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_alarmreceiver.c (original)
+++ team/group/codec_bits/apps/app_alarmreceiver.c Fri Mar 14 20:02:02 2008
@@ -182,7 +182,8 @@
 
 		if (f->frametype == AST_FRAME_VOICE) {
 			wf.frametype = AST_FRAME_VOICE;
-			wf.subclass = AST_FORMAT_ULAW;
+			wf.subclass = 0;
+			wf.codec = AST_FMT_ULAW;
 			wf.offset = AST_FRIENDLY_OFFSET;
 			wf.mallocd = 0;
 			wf.data = tone_block.buf;
@@ -562,12 +563,12 @@
 	/* Set write and read formats to ULAW */
 	ast_verb(4, "AlarmReceiver: Setting read and write formats to ULAW\n");
 
-	if (ast_set_write_format(chan,AST_FORMAT_ULAW)) {
+	if (ast_set_write_format(chan,AST_FMT_ULAW)) {
 		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name);
 		return -1;
 	}
 
-	if (ast_set_read_format(chan,AST_FORMAT_ULAW)) {
+	if (ast_set_read_format(chan,AST_FMT_ULAW)) {
 		ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",chan->name);
 		return -1;
 	}

Modified: team/group/codec_bits/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_amd.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_amd.c (original)
+++ team/group/codec_bits/apps/app_amd.c Fri Mar 14 20:02:02 2008
@@ -101,7 +101,8 @@
 	int res = 0;
 	struct ast_frame *f = NULL;
 	struct ast_dsp *silenceDetector = NULL;
-	int dspsilence = 0, readFormat, framelength = 0;
+	int dspsilence = 0, framelength = 0;
+	struct ast_extended_codec readFormat;
 	int inInitialSilence = 1;
 	int inGreeting = 0;
 	int voiceDuration = 0;
@@ -113,6 +114,7 @@
 	int consecutiveVoiceDuration = 0;
 	char amdCause[256] = "", amdStatus[256] = "";
 	char *parse = ast_strdupa(data);
+	struct ast_str *str = ast_str_alloca(128);
 
 	/* Lets set the initial values of the variables that will control the algorithm.
 	   The initial values are the default ones. If they are passed as arguments
@@ -141,7 +143,7 @@
 		AST_APP_ARG(argMaximumWordLength);
 	);
 
-	ast_verb(3, "AMD: %s %s %s (Fmt: %d)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, chan->readformat);
+	ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", chan->name ,chan->cid.cid_ani, chan->cid.cid_rdnis, ast_codec2bitstring(chan->readformat, &str));
 
 	/* Lets parse the arguments. */
 	if (!ast_strlen_zero(parse)) {
@@ -191,7 +193,7 @@
 
 	/* Set read format to signed linear so we get signed linear frames in */
 	readFormat = chan->readformat;
-	if (ast_set_read_format(chan, AST_FORMAT_SLINEAR) < 0 ) {
+	if (ast_set_read_format(chan, AST_FMT_SLINEAR) < 0 ) {
 		ast_log(LOG_WARNING, "AMD: Channel [%s]. Unable to set to linear mode, giving up\n", chan->name );
 		pbx_builtin_setvar_helper(chan , "AMDSTATUS", "");
 		pbx_builtin_setvar_helper(chan , "AMDCAUSE", "");
@@ -347,7 +349,7 @@
 	pbx_builtin_setvar_helper(chan , "AMDCAUSE" , amdCause);
 
 	/* Restore channel read format */
-	if (readFormat && ast_set_read_format(chan, readFormat))
+	if (FMT_NZ(readFormat) && ast_set_read_format(chan, readFormat))
 		ast_log(LOG_WARNING, "AMD: Unable to restore read format on '%s'\n", chan->name);
 
 	/* Free the DSP used to detect silence */

Modified: team/group/codec_bits/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_chanspy.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_chanspy.c (original)
+++ team/group/codec_bits/apps/app_chanspy.c Fri Mar 14 20:02:02 2008
@@ -198,7 +198,7 @@
 		return -1;
 	}
 
-	f = ast_audiohook_read_frame(&csth->spy_audiohook, samples, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR);
+	f = ast_audiohook_read_frame(&csth->spy_audiohook, samples, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FMT_SLINEAR);
 
 	ast_audiohook_unlock(&csth->spy_audiohook);
 
@@ -777,7 +777,7 @@
 	char *recbase = NULL;
 	int fd = 0;
 	struct ast_flags flags;
-	int oldwf = 0;
+	struct ast_extended_codec oldwf = AST_FMT_NULL_MASK;
 	int volfactor = 0;
 	int res;
 	AST_DECLARE_APP_ARGS(args,
@@ -820,7 +820,7 @@
 		ast_clear_flag(&flags, AST_FLAGS_ALL);
 
 	oldwf = chan->writeformat;
-	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
+	if (ast_set_write_format(chan, AST_FMT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 		return -1;
 	}
@@ -840,7 +840,7 @@
 	if (fd)
 		close(fd);
 
-	if (oldwf && ast_set_write_format(chan, oldwf) < 0)
+	if (FMT_NZ(oldwf) && ast_set_write_format(chan, oldwf) < 0)
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 
 	return res;
@@ -853,7 +853,7 @@
 	char *recbase = NULL;
 	int fd = 0;
 	struct ast_flags flags;
-	int oldwf = 0;
+	struct ast_extended_codec oldwf = AST_FMT_NULL_MASK;
 	int volfactor = 0;
 	int res;
 	AST_DECLARE_APP_ARGS(args,
@@ -899,7 +899,7 @@
 		ast_clear_flag(&flags, AST_FLAGS_ALL);
 
 	oldwf = chan->writeformat;
-	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
+	if (ast_set_write_format(chan, AST_FMT_SLINEAR) < 0) {
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 		return -1;
 	}
@@ -920,7 +920,7 @@
 	if (fd)
 		close(fd);
 
-	if (oldwf && ast_set_write_format(chan, oldwf) < 0)
+	if (FMT_NZ(oldwf) && ast_set_write_format(chan, oldwf) < 0)
 		ast_log(LOG_ERROR, "Could Not Set Write Format.\n");
 
 	return res;

Modified: team/group/codec_bits/apps/app_dictate.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_dictate.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_dictate.c (original)
+++ team/group/codec_bits/apps/app_dictate.c Fri Mar 14 20:02:02 2008
@@ -86,7 +86,6 @@
 	int ffactor = 320 * 80,
 		res = 0,
 		done = 0,
-		oldr = 0,
 		lastop = 0,
 		samples = 0,
 		speed = 1,
@@ -94,6 +93,7 @@
 		len = 0,
 		maxlen = 0,
 		mode = 0;
+	struct ast_extended_codec oldr;
 
 	snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR);
 	if (!ast_strlen_zero(data)) {
@@ -111,7 +111,7 @@
 		filename = args.filename;
 	}
 	oldr = chan->readformat;
-	if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR)) < 0) {
+	if ((res = ast_set_read_format(chan, AST_FMT_SLINEAR)) < 0) {
 		ast_log(LOG_WARNING, "Unable to set to linear mode.\n");
 		return -1;
 	}
@@ -317,7 +317,7 @@
 			ast_frfree(f);
 		}
 	}
-	if (oldr) {
+	if (FMT_NZ(oldr)) {
 		ast_set_read_format(chan, oldr);
 	}
 	return 0;

Modified: team/group/codec_bits/apps/app_echo.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_echo.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_echo.c (original)
+++ team/group/codec_bits/apps/app_echo.c Fri Mar 14 20:02:02 2008
@@ -46,7 +46,7 @@
 static int echo_exec(struct ast_channel *chan, void *data)
 {
 	int res = -1;
-	int format;
+	struct ast_extended_codec format;
 
 	format = ast_best_codec(chan->nativeformats);
 	ast_set_write_format(chan, format);

Modified: team/group/codec_bits/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_festival.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_festival.c (original)
+++ team/group/codec_bits/apps/app_festival.c Fri Mar 14 20:02:02 2008
@@ -159,7 +159,7 @@
 	int fds[2];
 	int pid = -1;
 	int needed = 0;
-	int owriteformat;
+	struct ast_extended_codec owriteformat;
 	struct ast_frame *f;
 	struct myframe {
 		struct ast_frame f;
@@ -181,7 +181,7 @@
 	ast_indicate(chan, -1);
 	
 	owriteformat = chan->writeformat;
-	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
+	res = ast_set_write_format(chan, AST_FMT_SLINEAR);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");
 		return -1;
@@ -223,7 +223,8 @@
 				res = read(fds[0], myf.frdata, needed);
 				if (res > 0) {
 					myf.f.frametype = AST_FRAME_VOICE;
-					myf.f.subclass = AST_FORMAT_SLINEAR;
+					myf.f.subclass = 0;
+					myf.f.codec = AST_FMT_SLINEAR;
 					myf.f.datalen = res;
 					myf.f.samples = res / 2;
 					myf.f.offset = AST_FRIENDLY_OFFSET;
@@ -255,7 +256,7 @@
 	if (pid > -1)
 		kill(pid, SIGKILL);
 #endif
-	if (!res && owriteformat)
+	if (!res && FMT_NZ(owriteformat))
 		ast_set_write_format(chan, owriteformat);
 	return res;
 }

Modified: team/group/codec_bits/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_ices.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_ices.c (original)
+++ team/group/codec_bits/apps/app_ices.c Fri Mar 14 20:02:02 2008
@@ -102,7 +102,7 @@
 	int ms = -1;
 	int pid = -1;
 	int flags;
-	int oreadformat;
+	struct ast_extended_codec oreadformat;
 	struct timeval last;
 	struct ast_frame *f;
 	char filename[256]="";
@@ -135,7 +135,7 @@
 	}
 
 	oreadformat = chan->readformat;
-	res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
+	res = ast_set_read_format(chan, AST_FMT_SLINEAR);
 	if (res < 0) {
 		close(fds[0]);
 		close(fds[1]);
@@ -186,7 +186,7 @@
 	
 	if (pid > -1)
 		kill(pid, SIGKILL);
-	if (!res && oreadformat)
+	if (!res && FMT_NZ(oreadformat))
 		ast_set_read_format(chan, oreadformat);
 
 	return res;

Modified: team/group/codec_bits/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_meetme.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_meetme.c (original)
+++ team/group/codec_bits/apps/app_meetme.c Fri Mar 14 20:02:02 2008
@@ -844,10 +844,10 @@
 	cnf->zapconf = ztc.confno;
 
 	/* Setup a new channel for playback of audio files */
-	cnf->chan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
+	cnf->chan = ast_request("zap", AST_FMT_SLINEAR, "pseudo", NULL);
 	if (cnf->chan) {
-		ast_set_read_format(cnf->chan, AST_FORMAT_SLINEAR);
-		ast_set_write_format(cnf->chan, AST_FORMAT_SLINEAR);
+		ast_set_read_format(cnf->chan, AST_FMT_SLINEAR);
+		ast_set_write_format(cnf->chan, AST_FMT_SLINEAR);
 		ztc.chan = 0;
 		ztc.confno = cnf->zapconf;
 		ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
@@ -1625,9 +1625,9 @@
 	}
 
 	ast_mutex_lock(&conf->recordthreadlock);
-	if ((conf->recordthread == AST_PTHREADT_NULL) && (confflags & CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL)))) {
-		ast_set_read_format(conf->lchan, AST_FORMAT_SLINEAR);
-		ast_set_write_format(conf->lchan, AST_FORMAT_SLINEAR);
+	if ((conf->recordthread == AST_PTHREADT_NULL) && (confflags & CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("zap", AST_FMT_SLINEAR, "pseudo", NULL)))) {
+		ast_set_read_format(conf->lchan, AST_FMT_SLINEAR);
+		ast_set_write_format(conf->lchan, AST_FMT_SLINEAR);
 		ztc.chan = 0;
 		ztc.confno = conf->zapconf;
 		ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
@@ -1786,12 +1786,12 @@
 
 	ast_indicate(chan, -1);
 
-	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
+	if (ast_set_write_format(chan, AST_FMT_SLINEAR) < 0) {
 		ast_log(LOG_WARNING, "Unable to set '%s' to write linear mode\n", chan->name);
 		goto outrun;
 	}
 
-	if (ast_set_read_format(chan, AST_FORMAT_SLINEAR) < 0) {
+	if (ast_set_read_format(chan, AST_FMT_SLINEAR) < 0) {
 		ast_log(LOG_WARNING, "Unable to set '%s' to read linear mode\n", chan->name);
 		goto outrun;
 	}
@@ -2259,7 +2259,7 @@
 					f = ast_read(c);
 				if (!f)
 					break;
-				if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) {
+				if ((f->frametype == AST_FRAME_VOICE) && FMT_EQ(f->codec, AST_FMT_SLINEAR)) {
 					if (user->talk.actual)
 						ast_frame_adjust_volume(f, user->talk.actual);
 
@@ -2528,7 +2528,8 @@
 				if (res > 0) {
 					memset(&fr, 0, sizeof(fr));
 					fr.frametype = AST_FRAME_VOICE;
-					fr.subclass = AST_FORMAT_SLINEAR;
+					fr.subclass = 0;
+					fr.codec = AST_FMT_SLINEAR;
 					fr.datalen = res;
 					fr.samples = res / 2;
 					fr.data = buf;
@@ -2547,7 +2548,7 @@
 						if (!conf->transframe[index]) {
 							if (conf->origframe) {
 								if (!conf->transpath[index])
-									conf->transpath[index] = ast_translator_build_path((1 << index), AST_FORMAT_SLINEAR);
+									conf->transpath[index] = ast_translator_build_path((1 << index), AST_FMT_SLINEAR);
 								if (conf->transpath[index]) {
 									conf->transframe[index] = ast_translate(conf->transpath[index], conf->origframe, 0);
 									if (!conf->transframe[index])

Modified: team/group/codec_bits/apps/app_milliwatt.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_milliwatt.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_milliwatt.c (original)
+++ team/group/codec_bits/apps/app_milliwatt.c Fri Mar 14 20:02:02 2008
@@ -59,7 +59,8 @@
 	int i, *indexp = (int *) data;
 	struct ast_frame wf = {
 		.frametype = AST_FRAME_VOICE,
-		.subclass = AST_FORMAT_ULAW,
+		.subclass = 0,
+		.codec = AST_FMT_ULAW,
 		.offset = AST_FRIENDLY_OFFSET,
 		.data = buf + AST_FRIENDLY_OFFSET,
 		.src = __FUNCTION__,
@@ -102,8 +103,8 @@
 static int milliwatt_exec(struct ast_channel *chan, void *data)
 {
 
-	ast_set_write_format(chan, AST_FORMAT_ULAW);
-	ast_set_read_format(chan, AST_FORMAT_ULAW);
+	ast_set_write_format(chan, AST_FMT_ULAW);
+	ast_set_read_format(chan, AST_FMT_ULAW);
 
 
 	if (chan->_state != AST_STATE_UP)

Modified: team/group/codec_bits/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_mixmonitor.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_mixmonitor.c (original)
+++ team/group/codec_bits/apps/app_mixmonitor.c Fri Mar 14 20:02:02 2008
@@ -153,7 +153,7 @@
 		if (mixmonitor->audiohook.status != AST_AUDIOHOOK_STATUS_RUNNING)
 			break;
 
-		if (!(fr = ast_audiohook_read_frame(&mixmonitor->audiohook, SAMPLES_PER_FRAME, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR)))
+		if (!(fr = ast_audiohook_read_frame(&mixmonitor->audiohook, SAMPLES_PER_FRAME, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FMT_SLINEAR)))
 			continue;
 
 		if (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED) || ast_bridged_channel(mixmonitor->chan)) {

Modified: team/group/codec_bits/apps/app_mp3.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_mp3.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_mp3.c (original)
+++ team/group/codec_bits/apps/app_mp3.c Fri Mar 14 20:02:02 2008
@@ -121,7 +121,7 @@
 	int fds[2];
 	int ms = -1;
 	int pid = -1;
-	int owriteformat;
+	struct ast_extended_codec owriteformat;
 	int timeout = 2000;
 	struct timeval next;
 	struct ast_frame *f;
@@ -144,7 +144,7 @@
 	ast_stopstream(chan);
 
 	owriteformat = chan->writeformat;
-	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
+	res = ast_set_write_format(chan, AST_FMT_SLINEAR);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");
 		return -1;
@@ -167,7 +167,8 @@
 				res = timed_read(fds[0], myf.frdata, sizeof(myf.frdata), timeout);
 				if (res > 0) {
 					myf.f.frametype = AST_FRAME_VOICE;
-					myf.f.subclass = AST_FORMAT_SLINEAR;
+					myf.f.subclass = 0;
+					myf.f.codec = AST_FMT_SLINEAR;
 					myf.f.datalen = res;
 					myf.f.samples = res / 2;
 					myf.f.mallocd = 0;
@@ -216,7 +217,7 @@
 	
 	if (pid > -1)
 		kill(pid, SIGKILL);
-	if (!res && owriteformat)
+	if (!res && FMT_NZ(owriteformat))
 		ast_set_write_format(chan, owriteformat);
 	
 	return res;

Modified: team/group/codec_bits/apps/app_nbscat.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/apps/app_nbscat.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/apps/app_nbscat.c (original)
+++ team/group/codec_bits/apps/app_nbscat.c Fri Mar 14 20:02:02 2008
@@ -130,7 +130,7 @@
 	ast_stopstream(chan);
 
 	owriteformat = chan->writeformat;
-	res = ast_set_write_format(chan, AST_FORMAT_SLINEAR);
+	res = ast_set_write_format(chan, AST_FMT_SLINEAR);
 	if (res < 0) {
 		ast_log(LOG_WARNING, "Unable to set write format to signed linear\n");
 		return -1;

Modified: team/group/codec_bits/include/asterisk/audiohook.h
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/include/asterisk/audiohook.h?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/include/asterisk/audiohook.h (original)
+++ team/group/codec_bits/include/asterisk/audiohook.h Fri Mar 14 20:02:02 2008
@@ -32,6 +32,7 @@
 #include "asterisk/linkedlists.h"
 
 #include "asterisk/slinfactory.h"
+#include "asterisk/frame.h"
 
 enum ast_audiohook_type {
 	AST_AUDIOHOOK_TYPE_SPY = 0,    /*!< Audiohook wants to receive audio */
@@ -89,7 +90,7 @@
 	struct ast_slinfactory write_factory;                  /*!< Factory where frames written to the channel will go through */
 	struct timeval read_time;                              /*!< Last time read factory was fed */
 	struct timeval write_time;                             /*!< Last time write factory was fed */
-	int format;                                            /*!< Format translation path is setup as */
+	struct ast_extended_codec format;                      /*!< Format translation path is setup as */
 	struct ast_trans_pvt *trans_pvt;                       /*!< Translation path for reading frames */
 	ast_audiohook_manipulate_callback manipulate_callback; /*!< Manipulation callback */
 	struct ast_audiohook_options options;                  /*!< Applicable options */
@@ -127,7 +128,7 @@
  * \param format Format of frame remote side wants back
  * \return Returns frame on success, NULL on failure
  */
-struct ast_frame *ast_audiohook_read_frame(struct ast_audiohook *audiohook, size_t samples, enum ast_audiohook_direction direction, int format);
+struct ast_frame *ast_audiohook_read_frame(struct ast_audiohook *audiohook, size_t samples, enum ast_audiohook_direction direction, struct ast_extended_codec format);
 
 /*! \brief Attach audiohook to channel
  * \param chan Channel

Modified: team/group/codec_bits/include/asterisk/pbx.h
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/include/asterisk/pbx.h?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/include/asterisk/pbx.h (original)
+++ team/group/codec_bits/include/asterisk/pbx.h Fri Mar 14 20:02:02 2008
@@ -67,6 +67,7 @@
 struct ast_include;
 struct ast_ignorepat;
 struct ast_sw;
+struct ast_extended_codec;
 
 /*! \brief Typedef for devicestate and hint callbacks */
 typedef int (*ast_state_cb_type)(char *context, char* id, enum ast_extension_states state, void *data);
@@ -732,11 +733,11 @@
 
 /*! Synchronously or asynchronously make an outbound call and send it to a
    particular extension */
-int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout, const char *context, const char *exten, int priority, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
+int ast_pbx_outgoing_exten(const char *type, struct ast_extended_codec format, void *data, int timeout, const char *context, const char *exten, int priority, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
 
 /*! Synchronously or asynchronously make an outbound call and send it to a
    particular application with given extension */
-int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout, const char *app, const char *appdata, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
+int ast_pbx_outgoing_app(const char *type, struct ast_extended_codec format, void *data, int timeout, const char *app, const char *appdata, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
 
 /*!
  * \brief Evaluate a condition

Modified: team/group/codec_bits/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/team/group/codec_bits/pbx/pbx_spool.c?view=diff&rev=108890&r1=108889&r2=108890
==============================================================================
--- team/group/codec_bits/pbx/pbx_spool.c (original)
+++ team/group/codec_bits/pbx/pbx_spool.c Fri Mar 14 20:02:02 2008
@@ -323,10 +323,10 @@
 	int res, reason;
 	if (!ast_strlen_zero(o->app)) {
 		ast_verb(3, "Attempting call on %s/%s for application %s(%s) (Retry %d)\n", o->tech, o->dest, o->app, o->data, o->retries);
-		res = ast_pbx_outgoing_app(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
+		res = ast_pbx_outgoing_app(o->tech, AST_FMT_SLINEAR, o->dest, o->waittime * 1000, o->app, o->data, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
 	} else {
 		ast_verb(3, "Attempting call on %s/%s for %s@%s:%d (Retry %d)\n", o->tech, o->dest, o->exten, o->context,o->priority, o->retries);
-		res = ast_pbx_outgoing_exten(o->tech, AST_FORMAT_SLINEAR, o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
+		res = ast_pbx_outgoing_exten(o->tech, AST_FMT_SLINEAR, o->dest, o->waittime * 1000, o->context, o->exten, o->priority, &reason, 2 /* wait to finish */, o->cid_num, o->cid_name, o->vars, o->account, NULL);
 	}
 	if (res) {
 		ast_log(LOG_NOTICE, "Call failed to go through, reason (%d) %s\n", reason, ast_channel_reason2str(reason));




More information about the asterisk-commits mailing list