88{
89 char *path =
NULL, filein[256], *filename =
"";
90 char *parse;
94 );
95 char dftbase[256];
96 char *base;
100 int ffactor = 320 * 80,
101 res = 0,
103 lastop = 0,
105 speed = 1,
108 maxlen = 0,
109 mode = 0;
111
116 } else
118
121 } else {
122 base = dftbase;
123 }
124 if (
args.argc > 1 &&
args.filename) {
125 filename =
args.filename;
126 }
131 return -1;
132 }
133
136 }
138 for (res = 0; !res;) {
140 if (
ast_app_getdata(chan,
"dictate/enter_filename", filein,
sizeof(filein), 0) ||
142 res = -1;
143 break;
144 }
145 } else {
147 filename = "";
148 }
150 len = strlen(base) + strlen(filein) + 2;
151 if (!path ||
len > maxlen) {
154 memset(path, 0,
len);
156 } else {
157 memset(path, 0, maxlen);
158 }
159
160 snprintf(path,
len,
"%s/%s", base, filein);
163 memset(&flags, 0, sizeof(flags));
167 speed = 1;
168 res = 0;
169 lastop = 0;
170 samples = 0;
176 }
178 int got = 1;
179 switch(mode) {
182 case '1':
185 break;
186 case '2':
187 speed++;
188 if (speed > 4) {
189 speed = 1;
190 }
192 break;
193 case '7':
197 }
199 break;
200 case '8':
203 break;
204
205 default:
206 got = 0;
207 }
208 break;
211 case '1':
214 break;
215 case '8':
217 lastop = 0;
218 break;
219 default:
220 got = 0;
221 }
222 break;
223 default:
224 got = 0;
225 }
226 if (!got) {
228 case '#':
230 continue;
231 break;
232 case '*':
236 } else {
238 }
239 break;
240 case '0':
243 switch(mode) {
246 break;
249 break;
250 }
253 }
else if (
digit < 0) {
255 break;
256 }
257 break;
258 }
259 }
260
262 switch(mode) {
264 int x;
271 }
else if (
digit < 0) {
272 break;
273 }
274 }
279 break;
282 }
284 }
285
287 for (x = 0; x < speed; x++) {
293 } else {
296 }
297 }
298 }
299 break;
302 int oflags = O_CREAT | O_WRONLY;
307 }
else if (
digit < 0) {
308 break;
309 }
310 }
314 oflags |= O_TRUNC;
316 } else {
317 oflags |= O_APPEND;
318 }
323 } else {
325 }
326 }
329 }
330 break;
331 }
332
333 }
334
336 }
337 }
339 if (oldr) {
342 }
343 return 0;
344}
static int play_and_wait(struct ast_channel *chan, char *file, char *digits)
#define ast_toggle_flag(it, flag)
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
void ast_channel_stream_set(struct ast_channel *chan, struct ast_filestream *value)
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to a channel's frame queue.
int ast_write(struct ast_channel *chan, struct ast_frame *frame)
Write a frame to a channel This function writes the given frame to the indicated channel.
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
const char * ast_channel_language(const struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
int ast_safe_sleep(struct ast_channel *chan, int ms)
Wait for a specified amount of time, looking for hangups.
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
ast_channel_state
ast_channel states
struct ast_filestream * ast_openstream(struct ast_channel *chan, const char *filename, const char *preflang)
Opens stream for use in seeking, playing.
struct ast_frame * ast_readframe(struct ast_filestream *s)
Read a frame from a filestream.
int ast_writestream(struct ast_filestream *fs, struct ast_frame *f)
Writes a frame to a stream.
int ast_seekstream(struct ast_filestream *fs, off_t sample_offset, int whence)
Seeks into stream.
struct ast_filestream * ast_writefile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode)
Starts writing a file.
int ast_closestream(struct ast_filestream *f)
Closes a stream.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
#define AST_APP_ARG(name)
Define an application argument.
enum ast_getdata_result ast_app_getdata(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout)
Plays a stream and gets DTMF data from a channel.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
const char * ast_config_AST_SPOOL_DIR
int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options)
says a number
static force_inline int attribute_pure ast_strlen_zero(const char *s)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
Structure used to handle boolean flags.
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
enum ast_frame_type frametype
#define ast_test_flag(p, flag)
#define ast_clear_flag(p, flag)
int ast_mkdir(const char *path, int mode)
Recursively create directory path.
#define ast_set_flag(p, flag)