mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 07:01:09 +00:00
mer feb 12 14:56:57 CET 2003
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
4
.cvsignore
Executable file
4
.cvsignore
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
asterisk
|
||||||
|
build.h
|
||||||
|
ast_expr.c
|
||||||
|
.version
|
8
CHANGES
8
CHANGES
@@ -1,3 +1,11 @@
|
|||||||
|
-- Create special variable "EXTEN-n" where it is extension stripped by n MSD
|
||||||
|
-- Fix uninitialized frame pointer in channel.c
|
||||||
|
-- Add global variables support under [globals] of extensions.conf
|
||||||
|
-- Add macro support (show application Macro)
|
||||||
|
-- Allow [123-5] etc in extensions
|
||||||
|
-- Allow format of App(arg1,arg2,...) instead of just App,arg1|arg2 in dialplan
|
||||||
|
-- Add message waiting indicator to SIP
|
||||||
|
-- Fix double free bug in channel.c
|
||||||
Asterisk 0.3.0
|
Asterisk 0.3.0
|
||||||
-- Add fastfoward, rewind, seek, and truncate functions to streams
|
-- Add fastfoward, rewind, seek, and truncate functions to streams
|
||||||
-- Support registration
|
-- Support registration
|
||||||
|
@@ -17,7 +17,7 @@ APPS=app_dial.so app_playback.so app_voicemail.so app_directory.so app_intercom.
|
|||||||
app_agi.so app_qcall.so app_adsiprog.so app_getcpeid.so app_milliwatt.so \
|
app_agi.so app_qcall.so app_adsiprog.so app_getcpeid.so app_milliwatt.so \
|
||||||
app_zapateller.so app_datetime.so app_setcallerid.so app_festival.so \
|
app_zapateller.so app_datetime.so app_setcallerid.so app_festival.so \
|
||||||
app_queue.so app_senddtmf.so app_parkandannounce.so app_striplsd.so \
|
app_queue.so app_senddtmf.so app_parkandannounce.so app_striplsd.so \
|
||||||
app_setcidname.so app_lookupcidname.so app_substring.so
|
app_setcidname.so app_lookupcidname.so app_substring.so app_macro.so
|
||||||
|
|
||||||
#APPS+=app_sql_postgres.so
|
#APPS+=app_sql_postgres.so
|
||||||
#APPS+=app_sql_odbc.so
|
#APPS+=app_sql_odbc.so
|
||||||
|
@@ -72,8 +72,6 @@ STANDARD_LOCAL_USER;
|
|||||||
|
|
||||||
LOCAL_USER_DECL;
|
LOCAL_USER_DECL;
|
||||||
|
|
||||||
extern char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name);
|
|
||||||
extern void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value);
|
|
||||||
|
|
||||||
#define TONE_BLOCK_SIZE 200
|
#define TONE_BLOCK_SIZE 200
|
||||||
|
|
||||||
|
234
apps/app_macro.c
Executable file
234
apps/app_macro.c
Executable file
@@ -0,0 +1,234 @@
|
|||||||
|
/*
|
||||||
|
* Asterisk -- A telephony toolkit for Linux.
|
||||||
|
*
|
||||||
|
* Macro Implementation
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003, Digium
|
||||||
|
*
|
||||||
|
* Mark Spencer <markster@digium.com>
|
||||||
|
*
|
||||||
|
* This program is free software, distributed under the terms of
|
||||||
|
* the GNU General Public License
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <asterisk/file.h>
|
||||||
|
#include <asterisk/logger.h>
|
||||||
|
#include <asterisk/channel.h>
|
||||||
|
#include <asterisk/pbx.h>
|
||||||
|
#include <asterisk/module.h>
|
||||||
|
#include <asterisk/options.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
#define MAX_ARGS 80
|
||||||
|
|
||||||
|
static char *tdesc = "Extension Macros";
|
||||||
|
|
||||||
|
static char *descrip =
|
||||||
|
" Macro(macroname|arg1|arg2...): Executes a macro using the context\n"
|
||||||
|
"'macro-<macroname>', jumping to the 's' extension of that context and\n"
|
||||||
|
"executing each step, then returning when the steps end. The calling\n"
|
||||||
|
"extension, context, and priority are stored in ${MACRO_EXTEN}, \n"
|
||||||
|
"${MACRO_CONTEXT} and ${MACRO_PRIORITY} respectively. Arguments become\n"
|
||||||
|
"${ARG1}, ${ARG2}, etc in the macro context. Macro returns -1 if\n"
|
||||||
|
"any step in the macro returns -1, and 0 otherwise. If you Goto out\n"
|
||||||
|
"of the Macro context, the Macro will terminate and control will be return\n"
|
||||||
|
"at the location of the Goto. Otherwise if ${MACRO_OFFSET} is set at\n"
|
||||||
|
"termination, Macro will attempt to continue at priority\n"
|
||||||
|
"MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.\n";
|
||||||
|
|
||||||
|
static char *app = "Macro";
|
||||||
|
|
||||||
|
static char *synopsis = "Macro Implementation";
|
||||||
|
|
||||||
|
STANDARD_LOCAL_USER;
|
||||||
|
|
||||||
|
LOCAL_USER_DECL;
|
||||||
|
|
||||||
|
static int macro_exec(struct ast_channel *chan, void *data)
|
||||||
|
{
|
||||||
|
char tmp[256] = "";
|
||||||
|
char *cur, *rest;
|
||||||
|
char *macro;
|
||||||
|
char fullmacro[80];
|
||||||
|
char varname[80];
|
||||||
|
char *oldargs[MAX_ARGS + 1] = { NULL, };
|
||||||
|
int argc, x;
|
||||||
|
int res;
|
||||||
|
char oldexten[256]="";
|
||||||
|
int oldpriority;
|
||||||
|
char pc[80];
|
||||||
|
char oldcontext[256] = "";
|
||||||
|
char *offsets;
|
||||||
|
int offset;
|
||||||
|
|
||||||
|
char *save_macro_exten;
|
||||||
|
char *save_macro_context;
|
||||||
|
char *save_macro_priority;
|
||||||
|
char *save_macro_offset;
|
||||||
|
|
||||||
|
if (!data || !strlen(data)) {
|
||||||
|
ast_log(LOG_WARNING, "Invalid Macro incantation\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
strncpy(tmp, data, sizeof(tmp) - 1);
|
||||||
|
rest = tmp;
|
||||||
|
macro = strsep(&rest, "|");
|
||||||
|
if (!macro || !strlen(macro)) {
|
||||||
|
ast_log(LOG_WARNING, "Invalid macro name specified\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
snprintf(fullmacro, sizeof(fullmacro), "macro-%s", macro);
|
||||||
|
if (!ast_exists_extension(chan, fullmacro, "s", 1, chan->callerid)) {
|
||||||
|
if (!ast_context_find(fullmacro))
|
||||||
|
ast_log(LOG_WARNING, "No such context '%s' for macro '%s'\n", fullmacro, macro);
|
||||||
|
else
|
||||||
|
ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/* Save old info */
|
||||||
|
oldpriority = chan->priority;
|
||||||
|
strncpy(oldexten, chan->exten, sizeof(oldexten) - 1);
|
||||||
|
strncpy(oldcontext, chan->context, sizeof(oldcontext) - 1);
|
||||||
|
argc = 1;
|
||||||
|
/* Save old macro variables */
|
||||||
|
save_macro_exten = pbx_builtin_getvar_helper(chan, "MACRO_EXTEN");
|
||||||
|
if (save_macro_exten) save_macro_exten = strdup(save_macro_exten);
|
||||||
|
pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", oldexten);
|
||||||
|
|
||||||
|
save_macro_context = pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT");
|
||||||
|
if (save_macro_context) save_macro_context = strdup(save_macro_context);
|
||||||
|
pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", oldcontext);
|
||||||
|
|
||||||
|
save_macro_priority = pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY");
|
||||||
|
if (save_macro_priority) save_macro_priority = strdup(save_macro_priority);
|
||||||
|
snprintf(pc, sizeof(pc), "%d", oldpriority);
|
||||||
|
pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", pc);
|
||||||
|
|
||||||
|
save_macro_offset = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET");
|
||||||
|
if (save_macro_offset) save_macro_offset = strdup(save_macro_offset);
|
||||||
|
pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", NULL);
|
||||||
|
|
||||||
|
/* Setup environment for new run */
|
||||||
|
strcpy(chan->exten, "s");
|
||||||
|
strncpy(chan->context, fullmacro, sizeof(chan->context));
|
||||||
|
chan->priority = 1;
|
||||||
|
|
||||||
|
while((cur = strsep(&rest, "|")) && (argc < MAX_ARGS)) {
|
||||||
|
/* Save copy of old arguments if we're overwriting some, otherwise
|
||||||
|
let them pass through to the other macro */
|
||||||
|
oldargs[argc] = pbx_builtin_getvar_helper(chan, varname);
|
||||||
|
if (oldargs[argc])
|
||||||
|
oldargs[argc] = strdup(oldargs[argc]);
|
||||||
|
snprintf(varname, sizeof(varname), "ARG%d", argc);
|
||||||
|
pbx_builtin_setvar_helper(chan, varname, cur);
|
||||||
|
argc++;
|
||||||
|
}
|
||||||
|
while(ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->callerid)) {
|
||||||
|
if ((res = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->callerid))) {
|
||||||
|
/* Something bad happened, or a hangup has been requested. */
|
||||||
|
if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F'))) {
|
||||||
|
/* Just return result as to the previous application as if it had been dialed */
|
||||||
|
ast_log(LOG_DEBUG, "Oooh, got something to jump out with ('%c')!\n", res);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch(res) {
|
||||||
|
case AST_PBX_KEEPALIVE:
|
||||||
|
if (option_debug)
|
||||||
|
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
|
||||||
|
else if (option_verbose > 1)
|
||||||
|
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
|
||||||
|
goto out;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (option_debug)
|
||||||
|
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
|
||||||
|
else if (option_verbose > 1)
|
||||||
|
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strcasecmp(chan->context, fullmacro)) {
|
||||||
|
if (option_verbose > 1)
|
||||||
|
ast_verbose(VERBOSE_PREFIX_2 "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (chan->_softhangup) {
|
||||||
|
ast_log(LOG_DEBUG, "Extension %s, priority %d returned normally even though call was hung up\n",
|
||||||
|
chan->exten, chan->priority);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
chan->priority++;
|
||||||
|
}
|
||||||
|
out:
|
||||||
|
for (x=1;x<argc;x++) {
|
||||||
|
/* Restore old arguments and delete ours */
|
||||||
|
snprintf(varname, sizeof(varname), "ARG%d", x);
|
||||||
|
if (oldargs[x]) {
|
||||||
|
pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
|
||||||
|
free(oldargs[x]);
|
||||||
|
} else {
|
||||||
|
pbx_builtin_setvar_helper(chan, varname, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Restore macro variables */
|
||||||
|
pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
|
||||||
|
if (save_macro_exten) free(save_macro_exten);
|
||||||
|
pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
|
||||||
|
if (save_macro_context) free(save_macro_context);
|
||||||
|
pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
|
||||||
|
if (save_macro_priority) free(save_macro_priority);
|
||||||
|
|
||||||
|
if (!strcasecmp(chan->context, fullmacro)) {
|
||||||
|
/* If we're leaving the macro normally, restore original information */
|
||||||
|
chan->priority = oldpriority;
|
||||||
|
strncpy(chan->exten, oldexten, sizeof(chan->exten) - 1);
|
||||||
|
strncpy(chan->context, oldcontext, sizeof(chan->context) - 1);
|
||||||
|
if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) {
|
||||||
|
/* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue
|
||||||
|
normally if there is any problem */
|
||||||
|
if (sscanf(offsets, "%d", &offset) == 1) {
|
||||||
|
if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + offset + 1, chan->callerid)) {
|
||||||
|
chan->priority += offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
|
||||||
|
if (save_macro_offset) free(save_macro_offset);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
int unload_module(void)
|
||||||
|
{
|
||||||
|
STANDARD_HANGUP_LOCALUSERS;
|
||||||
|
return ast_unregister_application(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
int load_module(void)
|
||||||
|
{
|
||||||
|
return ast_register_application(app, macro_exec, synopsis, descrip);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *description(void)
|
||||||
|
{
|
||||||
|
return tdesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
int usecount(void)
|
||||||
|
{
|
||||||
|
int res;
|
||||||
|
STANDARD_USECOUNT(res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *key()
|
||||||
|
{
|
||||||
|
return ASTERISK_GPL_KEY;
|
||||||
|
}
|
@@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
static char *tdesc = "Save substring digits in a given variable";
|
static char *tdesc = "Save substring digits in a given variable";
|
||||||
|
|
||||||
extern void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value);
|
|
||||||
|
|
||||||
static char *descrip =
|
static char *descrip =
|
||||||
" StripLSD(variable=string_of_digits|count1|count2): Assigns the substring\n"
|
" StripLSD(variable=string_of_digits|count1|count2): Assigns the substring\n"
|
||||||
"of string_of_digits to a given variable. Parameter count1 may be positive\n"
|
"of string_of_digits to a given variable. Parameter count1 may be positive\n"
|
||||||
|
1
astman/.cvsignore
Executable file
1
astman/.cvsignore
Executable file
@@ -0,0 +1 @@
|
|||||||
|
astman
|
@@ -376,6 +376,7 @@ int ast_queue_frame(struct ast_channel *chan, struct ast_frame *fin, int lock)
|
|||||||
int ast_queue_hangup(struct ast_channel *chan, int lock)
|
int ast_queue_hangup(struct ast_channel *chan, int lock)
|
||||||
{
|
{
|
||||||
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
|
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
|
||||||
|
chan->_softhangup |= AST_SOFTHANGUP_DEV;
|
||||||
return ast_queue_frame(chan, &f, lock);
|
return ast_queue_frame(chan, &f, lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1145,7 +1146,7 @@ static int do_senddigit(struct ast_channel *chan, char digit)
|
|||||||
int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
||||||
{
|
{
|
||||||
int res = -1;
|
int res = -1;
|
||||||
struct ast_frame *f;
|
struct ast_frame *f = NULL;
|
||||||
/* Stop if we're a zombie or need a soft hangup */
|
/* Stop if we're a zombie or need a soft hangup */
|
||||||
if (chan->zombie || ast_check_hangup(chan))
|
if (chan->zombie || ast_check_hangup(chan))
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1180,7 +1181,7 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
|||||||
default:
|
default:
|
||||||
if (chan->pvt->write) {
|
if (chan->pvt->write) {
|
||||||
if (chan->pvt->writetrans) {
|
if (chan->pvt->writetrans) {
|
||||||
f = ast_translate(chan->pvt->writetrans, fr, 1);
|
f = ast_translate(chan->pvt->writetrans, fr, 0);
|
||||||
} else
|
} else
|
||||||
f = fr;
|
f = fr;
|
||||||
if (f)
|
if (f)
|
||||||
@@ -1189,6 +1190,8 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
|||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (f && (f != fr))
|
||||||
|
ast_frfree(f);
|
||||||
chan->blocking = 0;
|
chan->blocking = 0;
|
||||||
/* Consider a write failure to force a soft hangup */
|
/* Consider a write failure to force a soft hangup */
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
|
3
channels/.cvsignore
Executable file
3
channels/.cvsignore
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
busy.h
|
||||||
|
gentone
|
||||||
|
ringtone.h
|
@@ -32,7 +32,7 @@ CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
|
|||||||
ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
|
ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
|
||||||
ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
|
ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
|
||||||
CHANZAP=$(shell if [ -f .oldzap ]; then echo "chan_zap_old.c"; else echo "chan_zap.c"; fi)
|
CHANZAP=$(shell if [ -f .oldzap ]; then echo "chan_zap_old.c"; else echo "chan_zap.c"; fi)
|
||||||
ZAPLIB=$(shell if ! [ -f .newzap ]; then echo "-lzap"; fi)
|
ZAPLIB=$(shell if [ -f .oldzap ]; then echo "-lzap"; fi)
|
||||||
|
|
||||||
ALSA_SRC=chan_alsa.c
|
ALSA_SRC=chan_alsa.c
|
||||||
ALSA_SRC+=$(shell [ -f alsa-monitor.h ] && echo "alsa-monitor.h")
|
ALSA_SRC+=$(shell [ -f alsa-monitor.h ] && echo "alsa-monitor.h")
|
||||||
|
@@ -4712,12 +4712,13 @@ static int cache_get_callno(char *data)
|
|||||||
for (x=0;x<AST_IAX_MAX_CALLS; x++) {
|
for (x=0;x<AST_IAX_MAX_CALLS; x++) {
|
||||||
/* Look for an *exact match* call. Once a call is negotiated, it can only
|
/* Look for an *exact match* call. Once a call is negotiated, it can only
|
||||||
look up entries for a single context */
|
look up entries for a single context */
|
||||||
ast_pthread_mutex_lock(&iaxsl[x]);
|
if (!pthread_mutex_trylock(&iaxsl[x])) {
|
||||||
if (iaxs[x] && !strcasecmp(data, iaxs[x]->dproot)) {
|
if (iaxs[x] && !strcasecmp(data, iaxs[x]->dproot)) {
|
||||||
|
ast_pthread_mutex_unlock(&iaxsl[x]);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
ast_pthread_mutex_unlock(&iaxsl[x]);
|
ast_pthread_mutex_unlock(&iaxsl[x]);
|
||||||
return x;
|
|
||||||
}
|
}
|
||||||
ast_pthread_mutex_unlock(&iaxsl[x]);
|
|
||||||
}
|
}
|
||||||
/* No match found, we need to create a new one */
|
/* No match found, we need to create a new one */
|
||||||
strncpy(st, data, sizeof(st)-1);
|
strncpy(st, data, sizeof(st)-1);
|
||||||
|
@@ -380,11 +380,34 @@ static int mgcp_answer(struct ast_channel *ast)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct ast_frame *mgcp_rtp_read(struct mgcp_endpoint *p)
|
||||||
|
{
|
||||||
|
/* Retrieve audio/etc from channel. Assumes p->lock is already held. */
|
||||||
|
struct ast_frame *f;
|
||||||
|
f = ast_rtp_read(p->rtp);
|
||||||
|
if (p->owner) {
|
||||||
|
/* We already hold the channel lock */
|
||||||
|
if (f->frametype == AST_FRAME_VOICE) {
|
||||||
|
if (f->subclass != p->owner->nativeformats) {
|
||||||
|
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
|
||||||
|
p->owner->nativeformats = f->subclass;
|
||||||
|
ast_set_read_format(p->owner, p->owner->readformat);
|
||||||
|
ast_set_write_format(p->owner, p->owner->writeformat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static struct ast_frame *mgcp_read(struct ast_channel *ast)
|
static struct ast_frame *mgcp_read(struct ast_channel *ast)
|
||||||
{
|
{
|
||||||
static struct ast_frame f = { AST_FRAME_NULL, };
|
struct ast_frame *fr;
|
||||||
ast_log(LOG_DEBUG, "I should never get called but am on %s!\n", ast->name);
|
struct mgcp_endpoint *p = ast->pvt->pvt;
|
||||||
return &f;
|
ast_pthread_mutex_lock(&p->lock);
|
||||||
|
fr = mgcp_rtp_read(p);
|
||||||
|
ast_pthread_mutex_unlock(&p->lock);
|
||||||
|
return fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mgcp_write(struct ast_channel *ast, struct ast_frame *frame)
|
static int mgcp_write(struct ast_channel *ast, struct ast_frame *frame)
|
||||||
@@ -473,6 +496,8 @@ static struct ast_channel *mgcp_new(struct mgcp_endpoint *i, int state)
|
|||||||
tmp->nativeformats = capability;
|
tmp->nativeformats = capability;
|
||||||
fmt = ast_best_codec(tmp->nativeformats);
|
fmt = ast_best_codec(tmp->nativeformats);
|
||||||
snprintf(tmp->name, sizeof(tmp->name), "MGCP/%s@%s", i->name, i->parent->name);
|
snprintf(tmp->name, sizeof(tmp->name), "MGCP/%s@%s", i->name, i->parent->name);
|
||||||
|
if (i->rtp)
|
||||||
|
tmp->fds[0] = ast_rtp_fd(i->rtp);
|
||||||
tmp->type = type;
|
tmp->type = type;
|
||||||
ast_setstate(tmp, state);
|
ast_setstate(tmp, state);
|
||||||
if (state == AST_STATE_RING)
|
if (state == AST_STATE_RING)
|
||||||
@@ -556,6 +581,7 @@ static char *get_header(struct mgcp_request *req, char *name)
|
|||||||
return __get_header(req, name, &start);
|
return __get_header(req, name, &start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int rtpready(struct ast_rtp *rtp, struct ast_frame *f, void *data)
|
static int rtpready(struct ast_rtp *rtp, struct ast_frame *f, void *data)
|
||||||
{
|
{
|
||||||
/* Just deliver the audio directly */
|
/* Just deliver the audio directly */
|
||||||
@@ -582,6 +608,7 @@ static int rtpready(struct ast_rtp *rtp, struct ast_frame *f, void *data)
|
|||||||
ast_pthread_mutex_unlock(&p->lock);
|
ast_pthread_mutex_unlock(&p->lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct mgcp_endpoint *find_endpoint(char *name, int msgid, struct sockaddr_in *sin)
|
static struct mgcp_endpoint *find_endpoint(char *name, int msgid, struct sockaddr_in *sin)
|
||||||
{
|
{
|
||||||
@@ -1081,9 +1108,13 @@ static void start_rtp(struct mgcp_endpoint *p)
|
|||||||
{
|
{
|
||||||
ast_pthread_mutex_lock(&p->lock);
|
ast_pthread_mutex_lock(&p->lock);
|
||||||
/* Allocate the RTP now */
|
/* Allocate the RTP now */
|
||||||
p->rtp = ast_rtp_new(sched, io);
|
p->rtp = ast_rtp_new(NULL, NULL);
|
||||||
|
if (p->rtp && p->owner)
|
||||||
|
p->owner->fds[0] = ast_rtp_fd(p->rtp);
|
||||||
|
#if 0
|
||||||
ast_rtp_set_callback(p->rtp, rtpready);
|
ast_rtp_set_callback(p->rtp, rtpready);
|
||||||
ast_rtp_set_data(p->rtp, p);
|
ast_rtp_set_data(p->rtp, p);
|
||||||
|
#endif
|
||||||
/* Make a call*ID */
|
/* Make a call*ID */
|
||||||
snprintf(p->callid, sizeof(p->callid), "%08x%s", rand(), p->txident);
|
snprintf(p->callid, sizeof(p->callid), "%08x%s", rand(), p->txident);
|
||||||
/* Transmit the connection create */
|
/* Transmit the connection create */
|
||||||
|
@@ -154,7 +154,6 @@ static struct sip_pvt {
|
|||||||
char callerid[256]; /* Caller*ID */
|
char callerid[256]; /* Caller*ID */
|
||||||
char via[256];
|
char via[256];
|
||||||
char accountcode[256]; /* Account code */
|
char accountcode[256]; /* Account code */
|
||||||
char mailbox[AST_MAX_EXTENSION]; /* Associated mailbox */
|
|
||||||
int amaflags; /* AMA Flags */
|
int amaflags; /* AMA Flags */
|
||||||
struct sip_request initreq; /* Initial request */
|
struct sip_request initreq; /* Initial request */
|
||||||
|
|
||||||
@@ -183,7 +182,6 @@ struct sip_user {
|
|||||||
char callerid[80];
|
char callerid[80];
|
||||||
char methods[80];
|
char methods[80];
|
||||||
char accountcode[80];
|
char accountcode[80];
|
||||||
char mailbox[AST_MAX_EXTENSION];
|
|
||||||
int hascallerid;
|
int hascallerid;
|
||||||
int amaflags;
|
int amaflags;
|
||||||
int insecure;
|
int insecure;
|
||||||
@@ -199,6 +197,8 @@ struct sip_peer {
|
|||||||
char methods[80];
|
char methods[80];
|
||||||
char username[80];
|
char username[80];
|
||||||
char mailbox[AST_MAX_EXTENSION];
|
char mailbox[AST_MAX_EXTENSION];
|
||||||
|
int lastmsgssent;
|
||||||
|
time_t lastmsgcheck;
|
||||||
int dynamic;
|
int dynamic;
|
||||||
int expire;
|
int expire;
|
||||||
int expirey;
|
int expirey;
|
||||||
@@ -274,7 +274,6 @@ static int transmit_invite(struct sip_pvt *p, char *msg, int sendsdp, char *auth
|
|||||||
static int transmit_reinvite_with_sdp(struct sip_pvt *p, struct ast_rtp *rtp);
|
static int transmit_reinvite_with_sdp(struct sip_pvt *p, struct ast_rtp *rtp);
|
||||||
static int transmit_message_with_text(struct sip_pvt *p, char *text);
|
static int transmit_message_with_text(struct sip_pvt *p, char *text);
|
||||||
static int do_proxy_auth(struct sip_pvt *p, struct sip_request *req);
|
static int do_proxy_auth(struct sip_pvt *p, struct sip_request *req);
|
||||||
static int sip_send_mwi(struct sip_pvt *p);
|
|
||||||
|
|
||||||
static int __sip_xmit(struct sip_pvt *p, char *data, int len)
|
static int __sip_xmit(struct sip_pvt *p, char *data, int len)
|
||||||
{
|
{
|
||||||
@@ -358,7 +357,6 @@ static int create_addr(struct sip_pvt *r, char *peer)
|
|||||||
r->canreinvite = p->canreinvite;
|
r->canreinvite = p->canreinvite;
|
||||||
r->maxtime = p->maxms;
|
r->maxtime = p->maxms;
|
||||||
strncpy(r->context, p->context,sizeof(r->context)-1);
|
strncpy(r->context, p->context,sizeof(r->context)-1);
|
||||||
strncpy(r->mailbox, p->mailbox,sizeof(r->mailbox)-1);
|
|
||||||
if ((p->addr.sin_addr.s_addr || p->defaddr.sin_addr.s_addr) &&
|
if ((p->addr.sin_addr.s_addr || p->defaddr.sin_addr.s_addr) &&
|
||||||
(!p->maxms || ((p->lastms > 0) && (p->lastms <= p->maxms)))) {
|
(!p->maxms || ((p->lastms > 0) && (p->lastms <= p->maxms)))) {
|
||||||
if (p->addr.sin_addr.s_addr) {
|
if (p->addr.sin_addr.s_addr) {
|
||||||
@@ -638,13 +636,6 @@ static int sip_answer(struct ast_channel *ast)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ast_frame *sip_read(struct ast_channel *ast)
|
|
||||||
{
|
|
||||||
static struct ast_frame f = { AST_FRAME_NULL, };
|
|
||||||
ast_log(LOG_DEBUG, "I should never get called but am on %s!\n", ast->name);
|
|
||||||
return &f;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
|
static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
|
||||||
{
|
{
|
||||||
struct sip_pvt *p = ast->pvt->pvt;
|
struct sip_pvt *p = ast->pvt->pvt;
|
||||||
@@ -818,6 +809,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state)
|
|||||||
fmt = ast_best_codec(tmp->nativeformats);
|
fmt = ast_best_codec(tmp->nativeformats);
|
||||||
snprintf(tmp->name, sizeof(tmp->name), "SIP/%s:%d", inet_ntoa(i->sa.sin_addr), ntohs(i->sa.sin_port));
|
snprintf(tmp->name, sizeof(tmp->name), "SIP/%s:%d", inet_ntoa(i->sa.sin_addr), ntohs(i->sa.sin_port));
|
||||||
tmp->type = type;
|
tmp->type = type;
|
||||||
|
tmp->fds[0] = ast_rtp_fd(i->rtp);
|
||||||
ast_setstate(tmp, state);
|
ast_setstate(tmp, state);
|
||||||
if (state == AST_STATE_RING)
|
if (state == AST_STATE_RING)
|
||||||
tmp->rings = 1;
|
tmp->rings = 1;
|
||||||
@@ -922,31 +914,33 @@ static char *get_header(struct sip_request *req, char *name)
|
|||||||
return __get_header(req, name, &start);
|
return __get_header(req, name, &start);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtpready(struct ast_rtp *rtp, struct ast_frame *f, void *data)
|
static struct ast_frame *sip_rtp_read(struct sip_pvt *p)
|
||||||
{
|
{
|
||||||
/* Just deliver the audio directly */
|
/* Retrieve audio/etc from channel. Assumes p->lock is already held. */
|
||||||
struct sip_pvt *p = data;
|
struct ast_frame *f;
|
||||||
ast_pthread_mutex_lock(&p->lock);
|
f = ast_rtp_read(p->rtp);
|
||||||
if (p->owner) {
|
if (p->owner) {
|
||||||
/* Generally, you lock in the order channel lock, followed by private
|
/* We already hold the channel lock */
|
||||||
lock. Since here we are doing the reverse, there is the possibility
|
if (f->frametype == AST_FRAME_VOICE) {
|
||||||
of deadlock. As a result, in the case of a deadlock, we simply fail out
|
if (f->subclass != p->owner->nativeformats) {
|
||||||
here. */
|
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
|
||||||
if (!pthread_mutex_trylock(&p->owner->lock)) {
|
p->owner->nativeformats = f->subclass;
|
||||||
if (f->frametype == AST_FRAME_VOICE) {
|
ast_set_read_format(p->owner, p->owner->readformat);
|
||||||
if (f->subclass != p->owner->nativeformats) {
|
ast_set_write_format(p->owner, p->owner->writeformat);
|
||||||
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
|
|
||||||
p->owner->nativeformats = f->subclass;
|
|
||||||
ast_set_read_format(p->owner, p->owner->readformat);
|
|
||||||
ast_set_write_format(p->owner, p->owner->writeformat);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ast_queue_frame(p->owner, f, 0);
|
|
||||||
pthread_mutex_unlock(&p->owner->lock);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct ast_frame *sip_read(struct ast_channel *ast)
|
||||||
|
{
|
||||||
|
struct ast_frame *fr;
|
||||||
|
struct sip_pvt *p = ast->pvt->pvt;
|
||||||
|
ast_pthread_mutex_lock(&p->lock);
|
||||||
|
fr = sip_rtp_read(p);
|
||||||
ast_pthread_mutex_unlock(&p->lock);
|
ast_pthread_mutex_unlock(&p->lock);
|
||||||
return 0;
|
return fr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void build_callid(char *callid, int len, struct in_addr ourip)
|
static void build_callid(char *callid, int len, struct in_addr ourip)
|
||||||
@@ -974,7 +968,7 @@ static struct sip_pvt *sip_alloc(char *callid, struct sockaddr_in *sin)
|
|||||||
/* Keep track of stuff */
|
/* Keep track of stuff */
|
||||||
memset(p, 0, sizeof(struct sip_pvt));
|
memset(p, 0, sizeof(struct sip_pvt));
|
||||||
p->initid = -1;
|
p->initid = -1;
|
||||||
p->rtp = ast_rtp_new(sched, io);
|
p->rtp = ast_rtp_new(NULL, NULL);
|
||||||
p->branch = rand();
|
p->branch = rand();
|
||||||
p->tag = rand();
|
p->tag = rand();
|
||||||
/* Start with 101 instead of 1 */
|
/* Start with 101 instead of 1 */
|
||||||
@@ -986,8 +980,10 @@ static struct sip_pvt *sip_alloc(char *callid, struct sockaddr_in *sin)
|
|||||||
}
|
}
|
||||||
ast_rtp_settos(p->rtp, tos);
|
ast_rtp_settos(p->rtp, tos);
|
||||||
ast_pthread_mutex_init(&p->lock);
|
ast_pthread_mutex_init(&p->lock);
|
||||||
|
#if 0
|
||||||
ast_rtp_set_data(p->rtp, p);
|
ast_rtp_set_data(p->rtp, p);
|
||||||
ast_rtp_set_callback(p->rtp, rtpready);
|
ast_rtp_set_callback(p->rtp, rtpready);
|
||||||
|
#endif
|
||||||
if (sin) {
|
if (sin) {
|
||||||
memcpy(&p->sa, sin, sizeof(p->sa));
|
memcpy(&p->sa, sin, sizeof(p->sa));
|
||||||
memcpy(&p->ourip, myaddrfor(&p->sa.sin_addr), sizeof(p->ourip));
|
memcpy(&p->ourip, myaddrfor(&p->sa.sin_addr), sizeof(p->ourip));
|
||||||
@@ -1238,8 +1234,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
|
|||||||
ast_log(LOG_WARNING, "No compatible codecs!\n");
|
ast_log(LOG_WARNING, "No compatible codecs!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (p->owner && (p->owner->nativeformats != p->capability)) {
|
if (p->owner && !(p->owner->nativeformats & p->capability)) {
|
||||||
ast_log(LOG_DEBUG, "Oooh, we need to change our formats since our peer supports only %d\n", p->capability);
|
ast_log(LOG_DEBUG, "Oooh, we need to change our formats since our peer supports only %d and not %d\n", p->capability, p->owner->nativeformats);
|
||||||
p->owner->nativeformats = p->capability;
|
p->owner->nativeformats = p->capability;
|
||||||
ast_set_read_format(p->owner, p->owner->readformat);
|
ast_set_read_format(p->owner, p->owner->readformat);
|
||||||
ast_set_write_format(p->owner, p->owner->writeformat);
|
ast_set_write_format(p->owner, p->owner->writeformat);
|
||||||
@@ -1630,9 +1626,8 @@ static int transmit_reinvite_with_sdp(struct sip_pvt *p, struct ast_rtp *rtp)
|
|||||||
return send_response(p, &resp);
|
return send_response(p, &resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int transmit_invite(struct sip_pvt *p, char *cmd, int sdp, char *auth, char *vxml_url)
|
static void initreqprep(struct sip_request *req, struct sip_pvt *p, char *cmd, char *vxml_url)
|
||||||
{
|
{
|
||||||
struct sip_request req;
|
|
||||||
char invite[256];
|
char invite[256];
|
||||||
char from[256];
|
char from[256];
|
||||||
char to[256];
|
char to[256];
|
||||||
@@ -1670,12 +1665,12 @@ static int transmit_invite(struct sip_pvt *p, char *cmd, int sdp, char *auth, ch
|
|||||||
{
|
{
|
||||||
snprintf(to, sizeof(to), "<%s>", invite );
|
snprintf(to, sizeof(to), "<%s>", invite );
|
||||||
}
|
}
|
||||||
memset(&req, 0, sizeof(req));
|
memset(req, 0, sizeof(struct sip_request));
|
||||||
init_req(&req, cmd, invite);
|
init_req(req, cmd, invite);
|
||||||
snprintf(tmp, sizeof(tmp), "%d %s", ++p->ocseq, cmd);
|
snprintf(tmp, sizeof(tmp), "%d %s", ++p->ocseq, cmd);
|
||||||
|
|
||||||
add_header(&req, "Via", p->via);
|
add_header(req, "Via", p->via);
|
||||||
add_header(&req, "From", from);
|
add_header(req, "From", from);
|
||||||
{
|
{
|
||||||
char contact2[256] ="", *c, contact[256];
|
char contact2[256] ="", *c, contact[256];
|
||||||
/* XXX This isn't exactly right and it's implemented
|
/* XXX This isn't exactly right and it's implemented
|
||||||
@@ -1683,12 +1678,18 @@ static int transmit_invite(struct sip_pvt *p, char *cmd, int sdp, char *auth, ch
|
|||||||
strncpy(contact2, from, sizeof(contact2)-1);
|
strncpy(contact2, from, sizeof(contact2)-1);
|
||||||
c = ditch_braces(contact2);
|
c = ditch_braces(contact2);
|
||||||
snprintf(contact, sizeof(contact), "<%s>", c);
|
snprintf(contact, sizeof(contact), "<%s>", c);
|
||||||
add_header(&req, "Contact", contact);
|
add_header(req, "Contact", contact);
|
||||||
}
|
}
|
||||||
add_header(&req, "To", to);
|
add_header(req, "To", to);
|
||||||
add_header(&req, "Call-ID", p->callid);
|
add_header(req, "Call-ID", p->callid);
|
||||||
add_header(&req, "CSeq", tmp);
|
add_header(req, "CSeq", tmp);
|
||||||
add_header(&req, "User-Agent", "Asterisk PBX");
|
add_header(req, "User-Agent", "Asterisk PBX");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int transmit_invite(struct sip_pvt *p, char *cmd, int sdp, char *auth, char *vxml_url)
|
||||||
|
{
|
||||||
|
struct sip_request req;
|
||||||
|
initreqprep(&req, p, cmd, vxml_url);
|
||||||
if (auth)
|
if (auth)
|
||||||
add_header(&req, "Proxy-Authorization", auth);
|
add_header(&req, "Proxy-Authorization", auth);
|
||||||
if (sdp) {
|
if (sdp) {
|
||||||
@@ -1706,6 +1707,30 @@ static int transmit_invite(struct sip_pvt *p, char *cmd, int sdp, char *auth, ch
|
|||||||
return send_request(p, &req);
|
return send_request(p, &req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int transmit_notify(struct sip_pvt *p, int hasmsgs)
|
||||||
|
{
|
||||||
|
struct sip_request req;
|
||||||
|
char tmp[256];
|
||||||
|
char clen[20];
|
||||||
|
initreqprep(&req, p, "NOTIFY", NULL);
|
||||||
|
add_header(&req, "Event", "message-summary");
|
||||||
|
add_header(&req, "Content-Type", "text/plain");
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof(tmp), "Message-Waiting: %s\n", hasmsgs ? "yes" : "no");
|
||||||
|
snprintf(clen, sizeof(clen), "%d", strlen(tmp));
|
||||||
|
add_header(&req, "Content-Length", clen);
|
||||||
|
add_line(&req, tmp);
|
||||||
|
|
||||||
|
if (!p->initreq.headers) {
|
||||||
|
/* Use this as the basis */
|
||||||
|
copy_request(&p->initreq, &req);
|
||||||
|
parse(&p->initreq);
|
||||||
|
}
|
||||||
|
|
||||||
|
p->lastinvite = p->ocseq;
|
||||||
|
return send_request(p, &req);
|
||||||
|
}
|
||||||
|
|
||||||
static int transmit_register(struct sip_registry *r, char *cmd, char *auth);
|
static int transmit_register(struct sip_registry *r, char *cmd, char *auth);
|
||||||
|
|
||||||
static int sip_reregister(void *data)
|
static int sip_reregister(void *data)
|
||||||
@@ -1801,10 +1826,9 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth)
|
|||||||
add_header(&req, "User-Agent", "Asterisk PBX");
|
add_header(&req, "User-Agent", "Asterisk PBX");
|
||||||
if (auth)
|
if (auth)
|
||||||
add_header(&req, "Authorization", auth);
|
add_header(&req, "Authorization", auth);
|
||||||
#define EXPIRE_TIMEOUT "Thu, 01 Dec 2003 16:00:00 GMT"
|
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof(tmp), "%d", DEFAULT_EXPIREY);
|
||||||
add_header(&req, "expires", EXPIRE_TIMEOUT);
|
add_header(&req, "Expires", tmp);
|
||||||
add_header(&req, "Event", "registration");
|
add_header(&req, "Event", "registration");
|
||||||
copy_request(&p->initreq, &req);
|
copy_request(&p->initreq, &req);
|
||||||
r->regstate=auth?REG_STATE_AUTHSENT:REG_STATE_REGSENT;
|
r->regstate=auth?REG_STATE_AUTHSENT:REG_STATE_REGSENT;
|
||||||
@@ -1904,8 +1928,6 @@ static int parse_contact(struct sip_pvt *pvt, struct sip_peer *p, struct sip_req
|
|||||||
strncpy(p->username, c, sizeof(p->username) - 1);
|
strncpy(p->username, c, sizeof(p->username) - 1);
|
||||||
else
|
else
|
||||||
strcpy(p->username, "");
|
strcpy(p->username, "");
|
||||||
if (p->mailbox)
|
|
||||||
strncpy(pvt->mailbox, p->mailbox,sizeof(pvt->mailbox)-1);
|
|
||||||
if (p->expire > -1)
|
if (p->expire > -1)
|
||||||
ast_sched_del(sched, p->expire);
|
ast_sched_del(sched, p->expire);
|
||||||
if ((expirey < 1) || (expirey > MAX_EXPIREY))
|
if ((expirey < 1) || (expirey > MAX_EXPIREY))
|
||||||
@@ -2050,7 +2072,9 @@ static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct si
|
|||||||
if (parse_contact(p, peer, req)) {
|
if (parse_contact(p, peer, req)) {
|
||||||
ast_log(LOG_WARNING, "Failed to parse contact info\n");
|
ast_log(LOG_WARNING, "Failed to parse contact info\n");
|
||||||
} else {
|
} else {
|
||||||
|
/* Say OK and ask subsystem to retransmit msg counter */
|
||||||
transmit_response(p, "200 OK", req);
|
transmit_response(p, "200 OK", req);
|
||||||
|
peer->lastmsgssent = -1;
|
||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2230,7 +2254,6 @@ static int check_user(struct sip_pvt *p, struct sip_request *req, char *cmd, cha
|
|||||||
if (!strcasecmp(user->name, of)) {
|
if (!strcasecmp(user->name, of)) {
|
||||||
if (!(res = check_auth(p, req, p->randdata, sizeof(p->randdata), user->name, user->secret, cmd, uri))) {
|
if (!(res = check_auth(p, req, p->randdata, sizeof(p->randdata), user->name, user->secret, cmd, uri))) {
|
||||||
strncpy(p->context, user->context, sizeof(p->context) - 1);
|
strncpy(p->context, user->context, sizeof(p->context) - 1);
|
||||||
strncpy(p->mailbox, user->mailbox, sizeof(p->mailbox) - 1);
|
|
||||||
if (strlen(user->callerid) && strlen(p->callerid))
|
if (strlen(user->callerid) && strlen(p->callerid))
|
||||||
strncpy(p->callerid, user->callerid, sizeof(p->callerid) - 1);
|
strncpy(p->callerid, user->callerid, sizeof(p->callerid) - 1);
|
||||||
strncpy(p->accountcode, user->accountcode, sizeof(p->accountcode) -1);
|
strncpy(p->accountcode, user->accountcode, sizeof(p->accountcode) -1);
|
||||||
@@ -2705,8 +2728,8 @@ retrylock:
|
|||||||
if (r->expire != -1)
|
if (r->expire != -1)
|
||||||
ast_sched_del(sched, r->expire);
|
ast_sched_del(sched, r->expire);
|
||||||
expires=atoi(get_header(req, "expires"));
|
expires=atoi(get_header(req, "expires"));
|
||||||
if (!expires) expires=20;
|
if (!expires) expires=DEFAULT_EXPIREY;
|
||||||
r->expire=ast_sched_add(sched, (expires-2)*1000, sip_reregister, r);
|
r->expire=ast_sched_add(sched, (expires-2)*1000, sip_reregister, r);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -2855,7 +2878,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
|
|||||||
char *cmd;
|
char *cmd;
|
||||||
char *cseq;
|
char *cseq;
|
||||||
char *e;
|
char *e;
|
||||||
struct ast_channel *c;
|
struct ast_channel *c=NULL;
|
||||||
int seqno;
|
int seqno;
|
||||||
int len;
|
int len;
|
||||||
int ignore=0;
|
int ignore=0;
|
||||||
@@ -3006,24 +3029,24 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
|
|||||||
ast_log(LOG_NOTICE, "Unable to create/find channel\n");
|
ast_log(LOG_NOTICE, "Unable to create/find channel\n");
|
||||||
transmit_response(p, "503 Unavailable", req);
|
transmit_response(p, "503 Unavailable", req);
|
||||||
sip_destroy(p);
|
sip_destroy(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (!strcasecmp(cmd, "REFER")) {
|
||||||
} else if (!strcasecmp(cmd, "REFER")) {
|
struct ast_channel *transfer_to;
|
||||||
struct ast_channel *transfer_to;
|
ast_log(LOG_DEBUG, "We found a REFER!\n");
|
||||||
ast_log(LOG_DEBUG, "We found a REFER!\n");
|
if (!strlen(p->context))
|
||||||
if (!strlen(p->context))
|
strncpy(p->context, context, sizeof(p->context) - 1);
|
||||||
strncpy(p->context, context, sizeof(p->context) - 1);
|
res = get_refer_info(p, req);
|
||||||
res = get_refer_info(p, req);
|
if (res < 0)
|
||||||
if (res < 0)
|
transmit_response_with_allow(p, "404 Not Found", req);
|
||||||
transmit_response_with_allow(p, "404 Not Found", req);
|
else if (res > 0)
|
||||||
else if (res > 0)
|
transmit_response_with_allow(p, "484 Address Incomplete", req);
|
||||||
transmit_response_with_allow(p, "484 Address Incomplete", req);
|
else
|
||||||
else
|
transmit_response(p, "202 Accepted", req);
|
||||||
transmit_response(p, "202 Accepted", req);
|
ast_log(LOG_DEBUG,"202 Accepted\n");
|
||||||
ast_log(LOG_DEBUG,"202 Accepted\n");
|
transfer_to = c->bridge;
|
||||||
transfer_to = c->bridge;
|
if (transfer_to)
|
||||||
if (transfer_to)
|
ast_async_goto(transfer_to,"", p->refer_to,1, 1);
|
||||||
ast_async_goto(transfer_to,"", p->refer_to,1, 1);
|
|
||||||
|
|
||||||
} else if (!strcasecmp(cmd, "CANCEL") || !strcasecmp(cmd, "BYE")) {
|
} else if (!strcasecmp(cmd, "CANCEL") || !strcasecmp(cmd, "BYE")) {
|
||||||
copy_request(&p->initreq, req);
|
copy_request(&p->initreq, req);
|
||||||
@@ -3055,9 +3078,9 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
|
|||||||
transmit_response(p, "100 Trying", req);
|
transmit_response(p, "100 Trying", req);
|
||||||
if ((res = register_verify(p, sin, req, e)) < 0)
|
if ((res = register_verify(p, sin, req, e)) < 0)
|
||||||
ast_log(LOG_NOTICE, "Registration from '%s' failed for '%s'\n", get_header(req, "To"), inet_ntoa(sin->sin_addr));
|
ast_log(LOG_NOTICE, "Registration from '%s' failed for '%s'\n", get_header(req, "To"), inet_ntoa(sin->sin_addr));
|
||||||
sip_send_mwi(p);
|
if (res < 1) {
|
||||||
if (res < 1)
|
|
||||||
sip_destroy(p);
|
sip_destroy(p);
|
||||||
|
}
|
||||||
} else if (!strcasecmp(cmd, "ACK")) {
|
} else if (!strcasecmp(cmd, "ACK")) {
|
||||||
/* Uhm, I haven't figured out the point of the ACK yet. Are we
|
/* Uhm, I haven't figured out the point of the ACK yet. Are we
|
||||||
supposed to retransmit responses until we get an ack?
|
supposed to retransmit responses until we get an ack?
|
||||||
@@ -3117,11 +3140,55 @@ static int sipsock_read(int *id, int fd, short events, void *ignore)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sip_send_mwi_to_peer(struct sip_peer *peer)
|
||||||
|
{
|
||||||
|
/* Called with peerl lock, but releases it */
|
||||||
|
struct sip_pvt *p;
|
||||||
|
int hasmsgs;
|
||||||
|
char name[256] = "";
|
||||||
|
/* Check for messages */
|
||||||
|
hasmsgs = ast_app_has_voicemail(peer->mailbox);
|
||||||
|
|
||||||
|
time(&peer->lastmsgcheck);
|
||||||
|
|
||||||
|
/* Return now if it's the same thing we told them last time */
|
||||||
|
if (hasmsgs == peer->lastmsgssent) {
|
||||||
|
ast_pthread_mutex_unlock(&peerl.lock);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p = sip_alloc(NULL, NULL);
|
||||||
|
if (!p) {
|
||||||
|
ast_log(LOG_WARNING, "Unable to build sip pvt data for MWI\n");
|
||||||
|
ast_pthread_mutex_unlock(&peerl.lock);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
strncpy(name, peer->name, sizeof(name) - 1);
|
||||||
|
peer->lastmsgssent = hasmsgs;
|
||||||
|
ast_pthread_mutex_unlock(&peerl.lock);
|
||||||
|
if (create_addr(p, peer->name)) {
|
||||||
|
/* Maybe they're not registered, etc. */
|
||||||
|
sip_destroy(p);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/* Recalculate our side, and recalculate Call ID */
|
||||||
|
memcpy(&p->ourip, myaddrfor(&p->sa.sin_addr), sizeof(p->ourip));
|
||||||
|
snprintf(p->via, sizeof(p->via), "SIP/2.0/UDP %s:%d;branch=%08x", inet_ntoa(p->ourip), ourport, p->branch);
|
||||||
|
build_callid(p->callid, sizeof(p->callid), p->ourip);
|
||||||
|
/* Send MWI */
|
||||||
|
transmit_notify(p, hasmsgs);
|
||||||
|
/* Destroy channel */
|
||||||
|
sip_destroy(p);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void *do_monitor(void *data)
|
static void *do_monitor(void *data)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
struct sip_pkt *p;
|
struct sip_pkt *p;
|
||||||
struct sip_pvt *sip;
|
struct sip_pvt *sip;
|
||||||
|
struct sip_peer *peer;
|
||||||
|
time_t t;
|
||||||
/* Add an I/O event to our UDP socket */
|
/* Add an I/O event to our UDP socket */
|
||||||
if (sipsock > -1)
|
if (sipsock > -1)
|
||||||
ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
|
ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
|
||||||
@@ -3165,6 +3232,19 @@ restartsearch:
|
|||||||
ast_pthread_mutex_lock(&monlock);
|
ast_pthread_mutex_lock(&monlock);
|
||||||
if (res >= 0)
|
if (res >= 0)
|
||||||
ast_sched_runq(sched);
|
ast_sched_runq(sched);
|
||||||
|
ast_pthread_mutex_lock(&peerl.lock);
|
||||||
|
peer = peerl.peers;
|
||||||
|
time(&t);
|
||||||
|
while(peer) {
|
||||||
|
if (strlen(peer->mailbox) && (t - peer->lastmsgcheck > 10)) {
|
||||||
|
sip_send_mwi_to_peer(peer);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
peer = peer->next;
|
||||||
|
}
|
||||||
|
/* Remember, sip_send_mwi_to_peer releases the lock if we've called it */
|
||||||
|
if (!peer)
|
||||||
|
ast_pthread_mutex_unlock(&peerl.lock);
|
||||||
ast_pthread_mutex_unlock(&monlock);
|
ast_pthread_mutex_unlock(&monlock);
|
||||||
}
|
}
|
||||||
/* Never reached */
|
/* Never reached */
|
||||||
@@ -3260,60 +3340,6 @@ static int sip_poke_peer(struct sip_peer *peer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int sip_send_mwi(struct sip_pvt *p)
|
|
||||||
{
|
|
||||||
struct sip_request req;
|
|
||||||
int res;
|
|
||||||
|
|
||||||
if(strlen(p->mailbox)) {
|
|
||||||
ast_log(LOG_NOTICE, "mwi: check mailbox: %s\n", p->mailbox);
|
|
||||||
res = ast_app_has_voicemail(p->mailbox);
|
|
||||||
if(res) {
|
|
||||||
ast_log(LOG_NOTICE, "mwi: mailbox has messages\n");
|
|
||||||
reqprep(&req, p, "NOTIFY", 1);
|
|
||||||
add_header(&req, "Event", "message-summary");
|
|
||||||
add_header(&req, "Content-Type", "text/plain");
|
|
||||||
add_line(&req, "Message-Waiting: yes\n");
|
|
||||||
send_request(p, &req);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
ast_log(LOG_NOTICE, "mwi: mailbox does not contain messages\n");
|
|
||||||
reqprep(&req, p, "NOTIFY", 1);
|
|
||||||
add_header(&req, "Event", "message-summary");
|
|
||||||
add_header(&req, "Content-Type", "text/plain");
|
|
||||||
add_line(&req, "Message-Waiting: no\n");
|
|
||||||
send_request(p, &req);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static int sip_send_mwi_to_peer(struct sip_peer *peer)
|
|
||||||
{
|
|
||||||
struct sip_pvt *p;
|
|
||||||
p = sip_alloc(NULL, NULL);
|
|
||||||
if (!p) {
|
|
||||||
ast_log(LOG_WARNING, "Unable to build sip pvt data for MWI\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (create_addr(p, peer->name)) {
|
|
||||||
sip_destroy(p);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/* Recalculate our side, and recalculate Call ID */
|
|
||||||
memcpy(&p->ourip, myaddrfor(&p->sa.sin_addr), sizeof(p->ourip));
|
|
||||||
snprintf(p->via, sizeof(p->via), "SIP/2.0/UDP %s:%d;branch=%08x", inet_ntoa(p->ourip), ourport, p->branch);
|
|
||||||
build_callid(p->callid, sizeof(p->callid), p->ourip);
|
|
||||||
/* Send MWI */
|
|
||||||
sip_send_mwi(p);
|
|
||||||
/* Destroy channel */
|
|
||||||
sip_destroy(p);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct ast_channel *sip_request(char *type, int format, void *data)
|
static struct ast_channel *sip_request(char *type, int format, void *data)
|
||||||
{
|
{
|
||||||
int oldformat;
|
int oldformat;
|
||||||
@@ -3326,7 +3352,7 @@ static struct ast_channel *sip_request(char *type, int format, void *data)
|
|||||||
oldformat = format;
|
oldformat = format;
|
||||||
format &= capability;
|
format &= capability;
|
||||||
if (!format) {
|
if (!format) {
|
||||||
ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format '%d'\n", format);
|
ast_log(LOG_NOTICE, "Asked to get a channel of unsupported format %d while capability is %d\n", oldformat, capability);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
p = sip_alloc(NULL, NULL);
|
p = sip_alloc(NULL, NULL);
|
||||||
@@ -3397,8 +3423,6 @@ static struct sip_user *build_user(char *name, struct ast_variable *v)
|
|||||||
user->hascallerid=1;
|
user->hascallerid=1;
|
||||||
} else if (!strcasecmp(v->name, "accountcode")) {
|
} else if (!strcasecmp(v->name, "accountcode")) {
|
||||||
strncpy(user->accountcode, v->value, sizeof(user->accountcode)-1);
|
strncpy(user->accountcode, v->value, sizeof(user->accountcode)-1);
|
||||||
} else if (!strcasecmp(v->name, "mailbox")) {
|
|
||||||
strncpy(user->mailbox, v->value, sizeof(user->mailbox)-1);
|
|
||||||
} else if (!strcasecmp(v->name, "amaflags")) {
|
} else if (!strcasecmp(v->name, "amaflags")) {
|
||||||
format = ast_cdr_amaflags2int(v->value);
|
format = ast_cdr_amaflags2int(v->value);
|
||||||
if (format < 0) {
|
if (format < 0) {
|
||||||
@@ -3451,6 +3475,7 @@ static struct sip_peer *build_peer(char *name, struct ast_variable *v)
|
|||||||
memset(peer, 0, sizeof(struct sip_peer));
|
memset(peer, 0, sizeof(struct sip_peer));
|
||||||
peer->expire = -1;
|
peer->expire = -1;
|
||||||
peer->pokeexpire = -1;
|
peer->pokeexpire = -1;
|
||||||
|
peer->lastmsgssent = -1;
|
||||||
}
|
}
|
||||||
if (peer) {
|
if (peer) {
|
||||||
if (!found) {
|
if (!found) {
|
||||||
@@ -3515,7 +3540,7 @@ static struct sip_peer *build_peer(char *name, struct ast_variable *v)
|
|||||||
} else if (!strcasecmp(v->name, "username")) {
|
} else if (!strcasecmp(v->name, "username")) {
|
||||||
strncpy(peer->username, v->value, sizeof(peer->username)-1);
|
strncpy(peer->username, v->value, sizeof(peer->username)-1);
|
||||||
} else if (!strcasecmp(v->name, "mailbox")) {
|
} else if (!strcasecmp(v->name, "mailbox")) {
|
||||||
strncpy(peer->mailbox, v->value, sizeof(peer->mailbox)-1);
|
strncpy(peer->mailbox, v->value, sizeof(peer->mailbox)-1);
|
||||||
} else if (!strcasecmp(v->name, "allow")) {
|
} else if (!strcasecmp(v->name, "allow")) {
|
||||||
format = ast_getformatbyname(v->value);
|
format = ast_getformatbyname(v->value);
|
||||||
if (format < 1)
|
if (format < 1)
|
||||||
|
@@ -3320,6 +3320,8 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
|
|||||||
/* Assume calls are not idle calls unless we're told differently */
|
/* Assume calls are not idle calls unless we're told differently */
|
||||||
i->isidlecall = 0;
|
i->isidlecall = 0;
|
||||||
#endif
|
#endif
|
||||||
|
/* Assure there is no confmute on this channel */
|
||||||
|
zt_confmute(i, 0);
|
||||||
if (startpbx) {
|
if (startpbx) {
|
||||||
if (ast_pbx_start(tmp)) {
|
if (ast_pbx_start(tmp)) {
|
||||||
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
|
ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
|
||||||
@@ -5260,6 +5262,7 @@ static void *pri_dchannel(void *vpri)
|
|||||||
pri->pvt[x]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
|
pri->pvt[x]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case PRI_EVENT_INFO_RECEIVED:
|
||||||
case PRI_EVENT_RING:
|
case PRI_EVENT_RING:
|
||||||
chan = e->ring.channel;
|
chan = e->ring.channel;
|
||||||
if ((chan < 1) || (chan > pri->channels)) {
|
if ((chan < 1) || (chan > pri->channels)) {
|
||||||
@@ -5281,20 +5284,22 @@ static void *pri_dchannel(void *vpri)
|
|||||||
if (!chan && (e->ring.flexible))
|
if (!chan && (e->ring.flexible))
|
||||||
chan = pri_find_empty_chan(pri);
|
chan = pri_find_empty_chan(pri);
|
||||||
if (chan) {
|
if (chan) {
|
||||||
/* Get caller ID */
|
if (e->e==PRI_EVENT_RING) {
|
||||||
if (pri->pvt[chan]->use_callerid) {
|
/* Get caller ID */
|
||||||
if (strlen(e->ring.callingname)) {
|
if (pri->pvt[chan]->use_callerid) {
|
||||||
snprintf(pri->pvt[chan]->callerid, sizeof(pri->pvt[chan]->callerid), "\"%s\" <%s>", e->ring.callingname, e->ring.callingnum);
|
if (strlen(e->ring.callingname)) {
|
||||||
|
snprintf(pri->pvt[chan]->callerid, sizeof(pri->pvt[chan]->callerid), "\"%s\" <%s>", e->ring.callingname, e->ring.callingnum);
|
||||||
|
} else
|
||||||
|
strncpy(pri->pvt[chan]->callerid, e->ring.callingnum, sizeof(pri->pvt[chan]->callerid)-1);
|
||||||
} else
|
} else
|
||||||
strncpy(pri->pvt[chan]->callerid, e->ring.callingnum, sizeof(pri->pvt[chan]->callerid)-1);
|
strcpy(pri->pvt[chan]->callerid, "");
|
||||||
} else
|
strncpy(pri->pvt[chan]->rdnis, e->ring.redirectingnum, sizeof(pri->pvt[chan]->rdnis));
|
||||||
strcpy(pri->pvt[chan]->callerid, "");
|
}
|
||||||
/* Get called number */
|
/* Get called number */
|
||||||
if (strlen(e->ring.callednum)) {
|
if (strlen(e->ring.callednum)) {
|
||||||
strncpy(pri->pvt[chan]->exten, e->ring.callednum, sizeof(pri->pvt[chan]->exten)-1);
|
strncpy(pri->pvt[chan]->exten, e->ring.callednum, sizeof(pri->pvt[chan]->exten)-1);
|
||||||
} else
|
} else
|
||||||
strcpy(pri->pvt[chan]->exten, "s");
|
strcpy(pri->pvt[chan]->exten, "s");
|
||||||
strncpy(pri->pvt[chan]->rdnis, e->ring.redirectingnum, sizeof(pri->pvt[chan]->rdnis));
|
|
||||||
/* Make sure extension exists */
|
/* Make sure extension exists */
|
||||||
if (ast_exists_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid)) {
|
if (ast_exists_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid)) {
|
||||||
/* Setup law */
|
/* Setup law */
|
||||||
@@ -5324,10 +5329,15 @@ static void *pri_dchannel(void *vpri)
|
|||||||
pri->pvt[chan]->call = 0;
|
pri->pvt[chan]->call = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (option_verbose > 2)
|
if (ast_matchmore_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid))
|
||||||
ast_verbose(VERBOSE_PREFIX_3 "Extension '%s' in context '%s' from '%s' does not exist. Rejecting call on channel %d, span %d\n",
|
{
|
||||||
pri->pvt[chan]->exten, pri->pvt[chan]->context, pri->pvt[chan]->callerid, chan, pri->span);
|
if (e->e==PRI_EVENT_RING) pri_need_more_info(pri->pri, e->ring.call, chan, 1);
|
||||||
pri_release(pri->pri, e->ring.call, PRI_CAUSE_UNALLOCATED);
|
} else {
|
||||||
|
if (option_verbose > 2)
|
||||||
|
ast_verbose(VERBOSE_PREFIX_3 "Extension '%s' in context '%s' from '%s' does not exist. Rejecting call on channel %d, span %d\n",
|
||||||
|
pri->pvt[chan]->exten, pri->pvt[chan]->context, pri->pvt[chan]->callerid, chan, pri->span);
|
||||||
|
pri_release(pri->pri, e->ring.call, PRI_CAUSE_UNALLOCATED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
pri_release(pri->pri, e->ring.call, PRI_CAUSE_REQUESTED_CHAN_UNAVAIL);
|
pri_release(pri->pri, e->ring.call, PRI_CAUSE_REQUESTED_CHAN_UNAVAIL);
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
$Id$
|
$Id$
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.15 1999/12/01 05:25:58 markster
|
Revision 1.16 2003/02/12 13:59:14 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.1 1999/12/01 05:25:58 markster
|
Revision 1.1 1999/12/01 05:25:58 markster
|
||||||
Start on the Internet Phone Jack channel
|
Start on the Internet Phone Jack channel
|
||||||
|
3
cli.c
3
cli.c
@@ -198,6 +198,7 @@ static int handle_chanlist(int fd, int argc, char *argv[])
|
|||||||
#define FORMAT_STRING "%15s (%-10s %-12s %-4d) %7s %-12s %-15s\n"
|
#define FORMAT_STRING "%15s (%-10s %-12s %-4d) %7s %-12s %-15s\n"
|
||||||
#define FORMAT_STRING2 "%15s (%-10s %-12s %-4s) %7s %-12s %-15s\n"
|
#define FORMAT_STRING2 "%15s (%-10s %-12s %-4s) %7s %-12s %-15s\n"
|
||||||
struct ast_channel *c=NULL;
|
struct ast_channel *c=NULL;
|
||||||
|
int numchans = 0;
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
c = ast_channel_walk(NULL);
|
c = ast_channel_walk(NULL);
|
||||||
@@ -205,8 +206,10 @@ static int handle_chanlist(int fd, int argc, char *argv[])
|
|||||||
while(c) {
|
while(c) {
|
||||||
ast_cli(fd, FORMAT_STRING, c->name, c->context, c->exten, c->priority, ast_state2str(c->_state),
|
ast_cli(fd, FORMAT_STRING, c->name, c->context, c->exten, c->priority, ast_state2str(c->_state),
|
||||||
c->appl ? c->appl : "(None)", c->data ? ( strlen(c->data) ? c->data : "(Empty)" ): "(None)");
|
c->appl ? c->appl : "(None)", c->data ? ( strlen(c->data) ? c->data : "(Empty)" ): "(None)");
|
||||||
|
numchans++;
|
||||||
c = ast_channel_walk(c);
|
c = ast_channel_walk(c);
|
||||||
}
|
}
|
||||||
|
ast_cli(fd, "%d active channel(s)\n", numchans);
|
||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
codecs/.cvsignore
Executable file
2
codecs/.cvsignore
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
g723.1
|
||||||
|
g723.1b
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -79,9 +82,12 @@ static integer c__1 = 1;
|
|||||||
/* ANALYS Version 55 */
|
/* ANALYS Version 55 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -246,9 +252,12 @@ static integer c__1 = 1;
|
|||||||
real phi[100] /* was [10][10] */, psi[10];
|
real phi[100] /* was [10][10] */, psi[10];
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -277,9 +286,12 @@ static integer c__1 = 1;
|
|||||||
/* Frame size, Prediction order, Pitch period */
|
/* Frame size, Prediction order, Pitch period */
|
||||||
/* Arguments to ANALYS */
|
/* Arguments to ANALYS */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -48,9 +51,12 @@ extern struct {
|
|||||||
/* BSYNZ Version 54 */
|
/* BSYNZ Version 54 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -144,9 +150,12 @@ extern struct {
|
|||||||
real lpi0, hpi0;
|
real lpi0, hpi0;
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -175,9 +184,12 @@ extern struct {
|
|||||||
/* Frame size, Prediction order, Pitch period */
|
/* Frame size, Prediction order, Pitch period */
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -35,9 +38,12 @@ extern int chanrd_(integer *order, integer *ipitv, integer *irms, integer *irc,
|
|||||||
/* CHANL Version 49 */
|
/* CHANL Version 49 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int dcbias_(integer *len, real *speech, real *sigout);
|
|||||||
/* DCBIAS Version 50 */
|
/* DCBIAS Version 50 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -53,9 +56,12 @@ static integer c__2 = 2;
|
|||||||
/* DECODE Version 54 */
|
/* DECODE Version 54 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -188,9 +194,12 @@ static integer c__2 = 2;
|
|||||||
integer ishift, errcnt, lsb;
|
integer ishift, errcnt, lsb;
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -219,9 +228,12 @@ static integer c__2 = 2;
|
|||||||
/* Frame size, Prediction order, Pitch period */
|
/* Frame size, Prediction order, Pitch period */
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -37,9 +40,12 @@ extern int deemp_(real *x, integer *n, struct lpc10_decoder_state *st);
|
|||||||
/* DEEMP Version 48 */
|
/* DEEMP Version 48 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int difmag_(real *speech, integer *lpita, integer *tau, integer *ltau, in
|
|||||||
/* DIFMAG Version 49 */
|
/* DIFMAG Version 49 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:14 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:14 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -47,9 +50,12 @@ extern struct {
|
|||||||
/* DYPTRK Version 52 */
|
/* DYPTRK Version 52 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -136,9 +142,12 @@ extern struct {
|
|||||||
|
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -43,9 +46,12 @@ static integer c__2 = 2;
|
|||||||
/* ENCODE Version 54 */
|
/* ENCODE Version 54 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -128,9 +134,12 @@ static integer c__2 = 2;
|
|||||||
integer idel, nbit, i__, j, i2, i3, mrk;
|
integer idel, nbit, i__, j, i2, i3, mrk;
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -151,9 +160,12 @@ static integer c__2 = 2;
|
|||||||
/* Frame size, Prediction order, Pitch period */
|
/* Frame size, Prediction order, Pitch period */
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int energy_(integer *len, real *speech, real *rms);
|
|||||||
/* ENERGY Version 50 */
|
/* ENERGY Version 50 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int ham84_(integer *input, integer *output, integer *errcnt);
|
|||||||
/* HAM84 Version 45G */
|
/* HAM84 Version 45G */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -39,9 +42,12 @@ extern int inithp100_(void);
|
|||||||
/* HP100 Version 55 */
|
/* HP100 Version 55 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int invert_(integer *order, real *phi, real *psi, real *rc);
|
|||||||
/* INVERT Version 45G */
|
/* INVERT Version 45G */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -91,9 +97,12 @@ extern int invert_(integer *order, real *phi, real *psi, real *rc);
|
|||||||
|
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pas
|
|||||||
/* IRC2PC Version 48 */
|
/* IRC2PC Version 48 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -82,9 +88,12 @@ extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pas
|
|||||||
|
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *nsamp, real
|
|||||||
/* IVFILT Version 48 */
|
/* IVFILT Version 48 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 00:20:06 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.1 2000/01/05 00:20:06 markster
|
Revision 1.1 2000/01/05 00:20:06 markster
|
||||||
Add broken lpc10 code... It's not too far from working I don't think...
|
Add broken lpc10 code... It's not too far from working I don't think...
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -58,9 +61,12 @@ static integer c__10 = 10;
|
|||||||
/* ***************************************************************** */
|
/* ***************************************************************** */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -113,9 +119,12 @@ static integer c__10 = 10;
|
|||||||
real rms;
|
real rms;
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -147,9 +156,12 @@ static integer c__10 = 10;
|
|||||||
/* Frame size, Prediction order, Pitch period */
|
/* Frame size, Prediction order, Pitch period */
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -50,9 +53,12 @@ static integer c__10 = 10;
|
|||||||
/* ***************************************************************** */
|
/* ***************************************************************** */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -109,9 +115,12 @@ static integer c__10 = 10;
|
|||||||
|
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -45,9 +48,12 @@ struct {
|
|||||||
/* ***************************************************************** */
|
/* ***************************************************************** */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -71,9 +77,12 @@ struct {
|
|||||||
{
|
{
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -97,9 +106,12 @@ struct {
|
|||||||
/* LPC Configuration parameters: */
|
/* LPC Configuration parameters: */
|
||||||
/* Frame size, Prediction order, Pitch period */
|
/* Frame size, Prediction order, Pitch period */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *nsamp);
|
|||||||
/* LPFILT Version 55 */
|
/* LPFILT Version 55 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern integer median_(integer *d1, integer *d2, integer *d3);
|
|||||||
/* MEDIAN Version 45G */
|
/* MEDIAN Version 45G */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int mload_(integer *order, integer *awins, integer *awinf, real *speech,
|
|||||||
/* MLOAD Version 48 */
|
/* MLOAD Version 48 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -41,9 +44,12 @@ static real c_b2 = 1.f;
|
|||||||
/* ONSET Version 49 */
|
/* ONSET Version 49 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -143,9 +149,12 @@ static real c_b2 = 1.f;
|
|||||||
|
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -37,9 +40,12 @@ extern int pitsyn_(integer *order, integer *voice, integer *pitch, real *rms, re
|
|||||||
/* PITSYN Version 53 */
|
/* PITSYN Version 53 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -143,9 +149,12 @@ extern int pitsyn_(integer *order, integer *voice, integer *pitch, real *rms, re
|
|||||||
|
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2001/04/12 21:27:53 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.3 2001/04/12 21:27:53 markh
|
Revision 1.3 2001/04/12 21:27:53 markh
|
||||||
app_record now supports wildcards of sort so your output file is not overwritten every time it's run. File.h got a documentation update on the ast_fileexists to include the return call. Watch out for the placea.c placev.c code, it's updates have not been tested yet. Just a few parenthesis to make it compile nicer on newer gcc versions with all the -W flags set.
|
app_record now supports wildcards of sort so your output file is not overwritten every time it's run. File.h got a documentation update on the ast_fileexists to include the return call. Watch out for the placea.c placev.c code, it's updates have not been tested yet. Just a few parenthesis to make it compile nicer on newer gcc versions with all the -W flags set.
|
||||||
@@ -32,9 +35,12 @@ extern int placea_(integer *ipitch, integer *voibuf, integer *obound, integer *a
|
|||||||
/* PLACEA Version 48 */
|
/* PLACEA Version 48 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2001/04/12 21:27:53 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.3 2001/04/12 21:27:53 markh
|
/* Revision 1.3 2001/04/12 21:27:53 markh
|
||||||
/* app_record now supports wildcards of sort so your output file is not overwritten every time it's run. File.h got a documentation update on the ast_fileexists to include the return call. Watch out for the placea.c placev.c code, it's updates have not been tested yet. Just a few parenthesis to make it compile nicer on newer gcc versions with all the -W flags set.
|
/* app_record now supports wildcards of sort so your output file is not overwritten every time it's run. File.h got a documentation update on the ast_fileexists to include the return call. Watch out for the placea.c placev.c code, it's updates have not been tested yet. Just a few parenthesis to make it compile nicer on newer gcc versions with all the -W flags set.
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2001/04/12 21:27:53 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.3 2001/04/12 21:27:53 markh
|
Revision 1.3 2001/04/12 21:27:53 markh
|
||||||
app_record now supports wildcards of sort so your output file is not overwritten every time it's run. File.h got a documentation update on the ast_fileexists to include the return call. Watch out for the placea.c placev.c code, it's updates have not been tested yet. Just a few parenthesis to make it compile nicer on newer gcc versions with all the -W flags set.
|
app_record now supports wildcards of sort so your output file is not overwritten every time it's run. File.h got a documentation update on the ast_fileexists to include the return call. Watch out for the placea.c placev.c code, it's updates have not been tested yet. Just a few parenthesis to make it compile nicer on newer gcc versions with all the -W flags set.
|
||||||
@@ -32,9 +35,12 @@ extern int placev_(integer *osbuf, integer *osptr, integer *oslen, integer *obou
|
|||||||
/* PLACEV Version 48 */
|
/* PLACEV Version 48 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2001/04/12 21:27:53 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.3 2001/04/12 21:27:53 markh
|
/* Revision 1.3 2001/04/12 21:27:53 markh
|
||||||
/* app_record now supports wildcards of sort so your output file is not overwritten every time it's run. File.h got a documentation update on the ast_fileexists to include the return call. Watch out for the placea.c placev.c code, it's updates have not been tested yet. Just a few parenthesis to make it compile nicer on newer gcc versions with all the -W flags set.
|
/* app_record now supports wildcards of sort so your output file is not overwritten every time it's run. File.h got a documentation update on the ast_fileexists to include the return call. Watch out for the placea.c placev.c code, it's updates have not been tested yet. Just a few parenthesis to make it compile nicer on newer gcc versions with all the -W flags set.
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int preemp_(real *inbuf, real *pebuf, integer *nsamp, real *coef, real *z
|
|||||||
/* PREEMP Version 55 */
|
/* PREEMP Version 55 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -44,9 +47,12 @@ static integer c__1 = 1;
|
|||||||
/* PREPRO Version 48 */
|
/* PREPRO Version 48 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -37,9 +40,12 @@ extern integer random_(struct lpc10_decoder_state *st);
|
|||||||
/* RANDOM Version 49 */
|
/* RANDOM Version 49 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -29,9 +32,12 @@ extern int rcchk_(integer *order, real *rc1f, real *rc2f);
|
|||||||
/* RCCHK Version 45G */
|
/* RCCHK Version 45G */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:39 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:39 markster
|
Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -58,9 +61,12 @@ static real c_b2 = .7f;
|
|||||||
/* SYNTHS Version 54 */
|
/* SYNTHS Version 54 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -178,9 +184,12 @@ static real c_b2 = .7f;
|
|||||||
real rci[160] /* was [10][16] */;
|
real rci[160] /* was [10][16] */;
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -209,9 +218,12 @@ static real c_b2 = .7f;
|
|||||||
/* Frame size, Prediction order, Pitch period */
|
/* Frame size, Prediction order, Pitch period */
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:39 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:39 markster
|
/* Revision 1.2 2000/01/05 08:20:39 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:40 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:40 markster
|
Revision 1.2 2000/01/05 08:20:40 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -30,9 +33,12 @@ extern int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real
|
|||||||
/* TBDM Version 49 */
|
/* TBDM Version 49 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:40 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:40 markster
|
/* Revision 1.2 2000/01/05 08:20:40 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:40 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:40 markster
|
Revision 1.2 2000/01/05 08:20:40 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -48,9 +51,12 @@ extern struct {
|
|||||||
/* VOICIN Version 52 */
|
/* VOICIN Version 52 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:40 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:40 markster
|
/* Revision 1.2 2000/01/05 08:20:40 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
@@ -290,9 +296,12 @@ s*/
|
|||||||
/* Global Variables: */
|
/* Global Variables: */
|
||||||
/* Arguments */
|
/* Arguments */
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:40 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:40 markster
|
/* Revision 1.2 2000/01/05 08:20:40 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.13 2000/01/05 08:20:40 markster
|
Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
Version 0.3.0 from FTP
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
|
Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
mer feb 12 14:56:57 CET 2003
|
||||||
|
|
||||||
Revision 1.2 2000/01/05 08:20:40 markster
|
Revision 1.2 2000/01/05 08:20:40 markster
|
||||||
Some OSS fixes and a few lpc changes to make it actually work
|
Some OSS fixes and a few lpc changes to make it actually work
|
||||||
@@ -33,9 +36,12 @@ static real c_b2 = 1.f;
|
|||||||
/* VPARMS Version 50 */
|
/* VPARMS Version 50 */
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
* Revision 1.13 2000/01/05 08:20:40 markster
|
* Revision 1.14 2003/02/12 13:59:15 matteo
|
||||||
* Version 0.3.0 from FTP
|
* mer feb 12 14:56:57 CET 2003
|
||||||
*
|
*
|
||||||
|
/* Revision 1.1.1.1 2003/02/12 13:59:15 matteo
|
||||||
|
/* mer feb 12 14:56:57 CET 2003
|
||||||
|
/*
|
||||||
/* Revision 1.2 2000/01/05 08:20:40 markster
|
/* Revision 1.2 2000/01/05 08:20:40 markster
|
||||||
/* Some OSS fixes and a few lpc changes to make it actually work
|
/* Some OSS fixes and a few lpc changes to make it actually work
|
||||||
/*
|
/*
|
||||||
|
@@ -2,8 +2,7 @@
|
|||||||
; Static extension configuration files, used by
|
; Static extension configuration files, used by
|
||||||
; the pbx_config module.
|
; the pbx_config module.
|
||||||
;
|
;
|
||||||
; The "General" category is for certain variables. All other categories
|
; The "General" category is for certain variables.
|
||||||
; are interpreted as extension contexts
|
|
||||||
;
|
;
|
||||||
[general]
|
[general]
|
||||||
;
|
;
|
||||||
@@ -14,24 +13,68 @@
|
|||||||
; XXX Not yet implemented XXX
|
; XXX Not yet implemented XXX
|
||||||
;
|
;
|
||||||
static=yes
|
static=yes
|
||||||
|
|
||||||
;
|
;
|
||||||
; if stati=yes and writeprotect=no, you can save dialplan by
|
; if static=yes and writeprotect=no, you can save dialplan by
|
||||||
; CLI command 'save dialplan' too
|
; CLI command 'save dialplan' too
|
||||||
;
|
;
|
||||||
writeprotect=no
|
writeprotect=no
|
||||||
|
|
||||||
; Remote things always ring all phones first.
|
;
|
||||||
;[remote]
|
; The "Globals" category contains global variables that can be referenced
|
||||||
;exten => s,1,Dial,AdtranVoFR/4200&AdtranVoFR/4151&AdtranVoFR/4300|15
|
; in the dialplan with ${VARIABLE}
|
||||||
;exten => s,2,Goto,default|s|2
|
;
|
||||||
;include => default
|
[globals]
|
||||||
|
CONSOLE=Console/dsp ; Console interface for demo
|
||||||
|
;CONSOLE=Zap/1
|
||||||
|
;CONSOLE=Phone/phone0
|
||||||
|
IAXINFO=guest ; IAXtel username/password
|
||||||
|
;IAXINFO=myuser:mypass
|
||||||
|
TRUNK=Zap/g2 ; Trunk interface
|
||||||
|
;TRUNK=IAX/user:pass@provider
|
||||||
|
|
||||||
|
;
|
||||||
|
; Any category other than "General" and "Globals" represent
|
||||||
|
; extension contexts, which are collections of extensions.
|
||||||
|
;
|
||||||
|
; Extension names may be numbers, letters, or combinations
|
||||||
|
; thereof. If an extension name is prefixed by a '_'
|
||||||
|
; character, it is interpreted as a pattern rather than a
|
||||||
|
; literal. In patterns, some characters have special meanings:
|
||||||
|
;
|
||||||
|
; X - any digit from 0-9
|
||||||
|
; N - any digit from 2-9
|
||||||
|
; [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
|
||||||
|
; . - wildcard, matches anything remaining (e.g. _9011. matches anything starting with 9011 including 9011)
|
||||||
|
;
|
||||||
|
; For example the extenion _NXXXXXX would match normal 7 digit dialings, while
|
||||||
|
; _1NXXNXXXXXX would represent an area code plus phone number
|
||||||
|
; preceeded by a one.
|
||||||
|
;
|
||||||
|
; Contexts contain several lines, one for each step of each
|
||||||
|
; extension, which can take one of two forms as listed below,
|
||||||
|
; with the first form being preferred. One may include another
|
||||||
|
; context in the current one as well, optionally with a
|
||||||
|
; date and time. Included contexts are included in the order
|
||||||
|
; they are listed.
|
||||||
|
;
|
||||||
|
;[context]
|
||||||
|
;exten => someexten,priority,application(arg1,arg2,...)
|
||||||
|
;exten => someexten,priority,application,arg1|arg2...
|
||||||
;
|
;
|
||||||
; Timing list for includes is
|
; Timing list for includes is
|
||||||
;
|
;
|
||||||
; <time range>|<days of week>|<days of month>|<months>
|
; <time range>|<days of week>|<days of month>|<months>
|
||||||
;
|
;
|
||||||
;include => daytime|9:00-17:00|mon-fri|*|*
|
;include => daytime|9:00-17:00|mon-fri|*|*
|
||||||
|
;
|
||||||
|
; ignorepat can be used to instruct drivers to not cancel dialtone upon
|
||||||
|
; receipt of a particular pattern. The most commonly used example is
|
||||||
|
; of course '9' like this:
|
||||||
|
;
|
||||||
|
;ignorepat => 9
|
||||||
|
;
|
||||||
|
; so that dialtone remains even after dialing a 9.
|
||||||
|
;
|
||||||
|
|
||||||
;
|
;
|
||||||
; Here are the entries you need to participate in the IAXTEL
|
; Here are the entries you need to participate in the IAXTEL
|
||||||
@@ -39,35 +82,73 @@ writeprotect=no
|
|||||||
; there are exceptions. For more information, and to sign
|
; there are exceptions. For more information, and to sign
|
||||||
; up, please go to www.gnophone.com or www.iaxtel.com
|
; up, please go to www.gnophone.com or www.iaxtel.com
|
||||||
;
|
;
|
||||||
[iaxtel]
|
[iaxtel700]
|
||||||
exten => _91NXXNXXXXXX,1,StripMSD,1
|
exten => _91700NXXXXXX,1,Dial(IAX/${IAXINFO}@iaxtel.com/${EXTEN-1}@iaxtel)
|
||||||
exten => _1NXXNXXXXXX,2,Dial,IAX/iaxtel.com/BYEXTENSION@iaxtel
|
|
||||||
|
|
||||||
[provider]
|
[iaxprovider]
|
||||||
;switch => IAX/user:[key]@myserver/mycontext
|
;switch => IAX/user:[key]@myserver/mycontext
|
||||||
|
|
||||||
; Local stuff
|
[trunkint]
|
||||||
[local]
|
|
||||||
; Special extension for local phone numbers, long distance, etc, going
|
|
||||||
; out via the Frame Relay interface. Patterns are prefixed with "_", which
|
|
||||||
; is ignored.
|
|
||||||
;
|
;
|
||||||
; ignorepat can be used to instruct drivers to not cancel dialtone upon
|
; International long distance through trunk
|
||||||
; receipt of a particular pattern. The most commonly used example is
|
|
||||||
; of course '9' like this:
|
|
||||||
;
|
;
|
||||||
; ignorepat => 9
|
exten => 9011.,1,Dial(${TRUNK}/${EXTEN-1})
|
||||||
|
exten => 9011.,2,Congestion
|
||||||
|
|
||||||
|
[trunkld]
|
||||||
;
|
;
|
||||||
; so that dialtone remains even after dialing a 9.
|
; Long distance context accessed through trunk
|
||||||
|
;
|
||||||
|
exten => _91NXXNXXXXXX,1,Dial(${TRUNK}/${EXTEN-1})
|
||||||
|
exten => _91NXXNXXXXXX,2,Congestion
|
||||||
|
|
||||||
|
[trunklocal]
|
||||||
|
;
|
||||||
|
; Local seven-digit dialing accessed through trunk interface
|
||||||
|
;
|
||||||
|
exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN-1})
|
||||||
|
exten => _9NXXXXXX,2,Congestion
|
||||||
|
|
||||||
|
[trunktollfree]
|
||||||
|
;
|
||||||
|
; Long distance context accessed through trunk interface
|
||||||
|
;
|
||||||
|
exten => _91800NXXXXXX,1,Dial(${TRUNK}/${EXTEN-1})
|
||||||
|
exten => _91800NXXXXXX,2,Congestion
|
||||||
|
exten => _91888NXXXXXX,1,Dial(${TRUNK}/${EXTEN-1})
|
||||||
|
exten => _91888NXXXXXX,2,Congestion
|
||||||
|
exten => _91877NXXXXXX,1,Dial(${TRUNK}/${EXTEN-1})
|
||||||
|
exten => _91877NXXXXXX,2,Congestion
|
||||||
|
exten => _91866NXXXXXX,1,Dial(${TRUNK}/${EXTEN-1})
|
||||||
|
exten => _91866NXXXXXX,2,Congestion
|
||||||
|
|
||||||
|
[international]
|
||||||
|
;
|
||||||
|
; Master context for international long distance
|
||||||
|
;
|
||||||
|
ignorepat => 9
|
||||||
|
include => longdistance
|
||||||
|
include => trunkint
|
||||||
|
|
||||||
|
[longdistance]
|
||||||
|
;
|
||||||
|
; Master context for long distance
|
||||||
|
;
|
||||||
|
ignorepat => 9
|
||||||
|
include => local
|
||||||
|
include => trunkld
|
||||||
|
|
||||||
|
[local]
|
||||||
|
;
|
||||||
|
; Master context for local, toll-free, and iaxtel calls only
|
||||||
;
|
;
|
||||||
ignorepat => 9
|
ignorepat => 9
|
||||||
;exten => _9NXXXXXX,1,Dial,IAX/user:[key]@myserver/BYEXTENSION
|
|
||||||
;exten => _91NXXNXXXXXX,1,Dial,IAX/user:[key]@myserver/BYEXTENSION
|
|
||||||
;exten => _9911,1,Dial,IAX/user:[key]@myserver/BYEXTENSION
|
|
||||||
include => parkedcalls
|
|
||||||
include => default
|
include => default
|
||||||
|
include => parkedcalls
|
||||||
|
include => trunklocal
|
||||||
|
include => iaxtel700
|
||||||
|
include => trunktollfree
|
||||||
include => provider
|
include => provider
|
||||||
include => iaxtel
|
|
||||||
;
|
;
|
||||||
; You can use an alternative switch type as well, to resolve
|
; You can use an alternative switch type as well, to resolve
|
||||||
; extensions that are not known here, for example with remote
|
; extensions that are not known here, for example with remote
|
||||||
@@ -75,6 +156,18 @@ include => iaxtel
|
|||||||
;
|
;
|
||||||
; switch => IAX/user:password@bigserver/local
|
; switch => IAX/user:password@bigserver/local
|
||||||
|
|
||||||
|
[macro-stdexten];
|
||||||
|
;
|
||||||
|
; Standard extension macro:
|
||||||
|
; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
|
||||||
|
; ${ARG2} - Device(s) to ring
|
||||||
|
;
|
||||||
|
exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
|
||||||
|
exten => s,2,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
|
||||||
|
exten => s,3,Goto(default,s,1) ; If they press #, return to start
|
||||||
|
exten => s,102,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
|
||||||
|
exten => s,103,Goto(default,s,1) ; If they press #, return to start
|
||||||
|
|
||||||
|
|
||||||
[demo]
|
[demo]
|
||||||
;
|
;
|
||||||
@@ -84,71 +177,85 @@ exten => s,1,Wait,1 ; Wait a second, just for fun
|
|||||||
exten => s,2,Answer ; Answer the line
|
exten => s,2,Answer ; Answer the line
|
||||||
exten => s,3,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
|
exten => s,3,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
|
||||||
exten => s,4,ResponseTimeout,10 ; Set Response Timeout to 10 seconds
|
exten => s,4,ResponseTimeout,10 ; Set Response Timeout to 10 seconds
|
||||||
exten => s,5,BackGround,demo-congrats ; Play a congratulatory message
|
exten => s,5,BackGround(demo-congrats) ; Play a congratulatory message
|
||||||
exten => s,6,BackGround,demo-instruct ; Play some instructions
|
exten => s,6,BackGround(demo-instruct) ; Play some instructions
|
||||||
|
|
||||||
exten => 2,1,BackGround,demo-moreinfo ; Give some more information.
|
exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
|
||||||
exten => 2,2,Goto,s|6
|
exten => 2,2,Goto(s,6)
|
||||||
|
|
||||||
exten => 3,1,SetLanguage,fr ; Set language to french
|
exten => 3,1,SetLanguage(fr) ; Set language to french
|
||||||
exten => 3,2,Goto,s|5 ; Start with the congratulations
|
exten => 3,2,Goto(s,5) ; Start with the congratulations
|
||||||
|
|
||||||
|
exten => 1000,1,Goto(default,s,1)
|
||||||
;
|
;
|
||||||
; We also create an example user, 1234, who is on the console and has
|
; We also create an example user, 1234, who is on the console and has
|
||||||
; voicemail, etc.
|
; voicemail, etc.
|
||||||
;
|
;
|
||||||
exten => 1234,1,Playback,transfer|skip ; "Please hold while..."
|
exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
|
||||||
; (but skip if channel is not up)
|
; (but skip if channel is not up)
|
||||||
exten => 1234,2,Dial,Console/dsp|10 ; Ring the console, 10 secs max
|
exten => 1234,2,Macro(stdexten,1234,${CONSOLE})
|
||||||
exten => 1234,3,Voicemail,u1234 ; Send to voicemail...
|
|
||||||
exten => 1234,5,Goto,s|6 ; Start over
|
|
||||||
exten => 1234,103,Voicemail,b1234 ; (2 + 101) "I'm on the phone"
|
|
||||||
exten => 1234,104,Goto,5 ; Go to voicemail, etc.
|
|
||||||
|
|
||||||
exten => 1235,1,Goto,1234|3 ; Right to voicemail
|
exten => 1235,1,Voicemail(u1234) ; Right to voicemail
|
||||||
|
|
||||||
exten => 1236,1,Dial,Console/dsp ; Ring forever
|
exten => 1236,1,Dial(Console/dsp) ; Ring forever
|
||||||
exten => 1236,2,Goto,1234|103 ; Unless busy
|
exten => 1236,2,Voicemail(u1234) ; Unless busy
|
||||||
|
|
||||||
;
|
;
|
||||||
; # for when they're done with the demo
|
; # for when they're done with the demo
|
||||||
;
|
;
|
||||||
exten => #,1,Playback,demo-thanks ; "Thanks for trying the demo"
|
exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
|
||||||
exten => #,2,Hangup ; Hang them up.
|
exten => #,2,Hangup ; Hang them up.
|
||||||
|
|
||||||
;
|
;
|
||||||
; A timeout and "invalid extension rule"
|
; A timeout and "invalid extension rule"
|
||||||
;
|
;
|
||||||
exten => t,1,Goto,#|1 ; If they take too long, give up
|
exten => t,1,Goto(#,1) ; If they take too long, give up
|
||||||
exten => i,1,Playback,invalid ; "That's not valid, try again"
|
exten => i,1,Playback(invalid) ; "That's not valid, try again"
|
||||||
|
|
||||||
;
|
;
|
||||||
; Create an extension, 500, for dialing the
|
; Create an extension, 500, for dialing the
|
||||||
; Asterisk demo.
|
; Asterisk demo.
|
||||||
;
|
;
|
||||||
exten => 500,1,Playback,demo-abouttotry ; Let them know what's going on
|
exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
|
||||||
exten => 500,2,Dial,IAX/asterisk@demo ; Call the Asterisk demo
|
exten => 500,2,Dial(IAX/guest@misery.digium.com/s@default) ; Call the Asterisk demo
|
||||||
exten => 500,3,Playback,demo-nogo ; Couldn't connect to the demo site
|
exten => 500,3,Playback(demo-nogo) ; Couldn't connect to the demo site
|
||||||
exten => 500,4,Goto,s|6 ; Return to the start over message.
|
exten => 500,4,Goto(s,6) ; Return to the start over message.
|
||||||
|
|
||||||
;
|
;
|
||||||
; Create an extension, 600, for evaulating echo latency.
|
; Create an extension, 600, for evaulating echo latency.
|
||||||
;
|
;
|
||||||
exten => 600,1,Playback,demo-echotest ; Let them know what's going on
|
exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
|
||||||
exten => 600,2,Echo ; Do the echo test
|
exten => 600,2,Echo ; Do the echo test
|
||||||
exten => 600,3,Playback,demo-echodone ; Let them know it's over
|
exten => 600,3,Playback(demo-echodone) ; Let them know it's over
|
||||||
exten => 600,4,Goto,s|6 ; Start over
|
exten => 600,4,Goto(s,6) ; Start over
|
||||||
|
|
||||||
;
|
;
|
||||||
; Give voicemail at extension 8500
|
; Give voicemail at extension 8500
|
||||||
;
|
;
|
||||||
exten => 8500,1,VoicemailMain
|
exten => 8500,1,VoicemailMain
|
||||||
exten => 8500,2,Goto,s|6
|
exten => 8500,2,Goto(s,6)
|
||||||
;
|
;
|
||||||
; Here's what a phone entry would look like (IXJ for example)
|
; Here's what a phone entry would look like (IXJ for example)
|
||||||
;
|
;
|
||||||
;exten => 1265,1,Dial,Phone/phone0|15
|
;exten => 1265,1,Dial(Phone/phone0,15)
|
||||||
;exten => 1265,2,Goto,s|5
|
;exten => 1265,2,Goto(s,5)
|
||||||
|
|
||||||
|
;[mainmenu]
|
||||||
|
;
|
||||||
|
; Example "main menu" context with submenu
|
||||||
|
;
|
||||||
|
;exten => s,1,Answer
|
||||||
|
;exten => s,2,Background(thanks) ; "Thanks for calling press 1 for sales, 2 for support, ..."
|
||||||
|
;exten => 1,1,Goto(submenu,s,1)
|
||||||
|
;exten => 2,1,Hangup
|
||||||
|
;include => default
|
||||||
|
;
|
||||||
|
;[submenu]
|
||||||
|
;exten => s,1,Ringing ; Make them comfortable with 2 seconds of ringback
|
||||||
|
;exten => s,2,Wait,2
|
||||||
|
;exten => s,3,Background(submenuopts) ; "Thanks for calling the sales department. Press 1 for steve, 2 for..."
|
||||||
|
;exten => 1,1,Goto(default,steve,1)
|
||||||
|
;exten => 2,1,Goto(default,mark,2)
|
||||||
|
|
||||||
[default]
|
[default]
|
||||||
;
|
;
|
||||||
@@ -157,95 +264,29 @@ exten => 8500,2,Goto,s|6
|
|||||||
;
|
;
|
||||||
include => demo
|
include => demo
|
||||||
|
|
||||||
; This is a more complicated sample extension configuration, similar to
|
|
||||||
; what we used to use at LSS.
|
|
||||||
|
|
||||||
;[default]
|
; Real extensions would go here. Generally you want real extensions to be 4 or 5
|
||||||
;exten => s,1,Wait,0
|
; digits long (although there is no such requirement) and start with a single
|
||||||
;exten => s,2,Answer
|
; digit that is fairly large (like 6 or 7) so that you have plenty of room to
|
||||||
;exten => s,3,DigitTimeout,5
|
; overlap extensions and menu options without conflict. You can alias them with
|
||||||
;exten => s,4,ResponseTimeout,10
|
; names, too and use global variables
|
||||||
;exten => s,5,BackGround,welcome
|
|
||||||
;exten => *,1,Directory,default
|
|
||||||
;exten => *,2,Goto,s|4
|
;exten => 6275,Macro(stdexten,6275,${MARK}) ; assuming ${MARK} is something like Zap/2
|
||||||
;exten => #,1,Playback,goodbye
|
;exten => mark,1,Goto(6275|1) ; alias mark to 6275
|
||||||
;exten => #,2,Hangup
|
;exten => 6236,Macro(stdexten,6236,${WIL}) ; Ditto for wil
|
||||||
;exten => 100,1,Goto,other|s|1
|
;exten => wil,1,Goto(6236|1)
|
||||||
;exten => 200,1,Intercom
|
|
||||||
;exten => 400,1,MP3Player,song8.mp3
|
|
||||||
;exten => 401,1,MP3Player,sample.mp3
|
|
||||||
;exten => 402,1,MP3Player,sunscreen.mp3
|
|
||||||
;exten => 403,1,MP3Player,http://trode.vergenet.net:8000
|
|
||||||
;exten => 404,1,MP3Player,http://216.32.166.94:14900
|
|
||||||
;exten => 405,1,Playback,sample
|
|
||||||
;
|
;
|
||||||
; Here's the template for a typical extension, carefully broken apart
|
; Some other handy things are an extension for checking voicemail via
|
||||||
; for analysis. The others are pretty much the same, but not as well
|
; voicemailmain
|
||||||
; documented.
|
|
||||||
;
|
;
|
||||||
; Step 1: Play back a "Please hold while I try that extension" message
|
|
||||||
;exten => 4300,1,Playback,transfer
|
|
||||||
; Step 2: Dial the numbers where Ben is likely to be. Try for no more
|
|
||||||
; than 15 seconds.
|
|
||||||
;exten => 4300,2,Dial,AdtranVoFR/4300|15
|
|
||||||
; Step 3: Send them to voicemail, preceeded by their unavailable message.
|
|
||||||
;exten => 4300,3,Voicemail,u4300
|
|
||||||
; Step 4: If they return from voicemail, go back to the top
|
|
||||||
;exten => 4300,4,Goto,s|4
|
|
||||||
; Step 103: If the Dialing is busy, it will try here first. We'll play a
|
|
||||||
; special "I'm busy" message and send them to voicemail
|
|
||||||
;exten => 4300,103,Voicemail,b4300
|
|
||||||
; Step 104: And then continue from whereever the other would
|
|
||||||
;exten => 4300,104,Goto,4
|
|
||||||
; Exten. 4301: Provide a short-circuit so we can transfer striaght to
|
|
||||||
; voicemail.
|
|
||||||
;exten => 4301,1,Goto,4300|3
|
|
||||||
; Exten. 4302: Provide a way to ring a given phone indefinitely
|
|
||||||
;exten => 4302,1,Dial,AdtranVoFR/4300
|
|
||||||
|
|
||||||
;exten => 4200,1,Playback,transfer
|
|
||||||
;exten => 4200,2,Dial,AdtranVoFR/4200|15
|
|
||||||
;exten => 4200,3,Playback,vm/4200/unavail
|
|
||||||
;exten => 4200,4,Voicemail,4200
|
|
||||||
;exten => 4200,5,Goto,s|4
|
|
||||||
;exten => 4200,103,Playback,vm/4200/busy
|
|
||||||
;exten => 4200,104,Goto,4
|
|
||||||
;exten => 4201,1,Goto,4200|3
|
|
||||||
;exten => 4202,1,Dial,AdtranVoFR/4200
|
|
||||||
|
|
||||||
;exten => 4110,1,Playback,transfer
|
|
||||||
;exten => 4110,2,Dial,AdtranVoFR/4110|15
|
|
||||||
;exten => 4110,2,Wait,5
|
|
||||||
;exten => 4110,3,Playback,vm/4110/unavail
|
|
||||||
;exten => 4110,4,Voicemail,4110
|
|
||||||
;exten => 4110,5,Goto,s|4
|
|
||||||
;exten => 4110,103,Playback,vm/4110/busy
|
|
||||||
;exten => 4110,104,Goto,4
|
|
||||||
;exten => 4111,1,Goto,4110|3
|
|
||||||
;exten => 4112,1,Dial,AdtranVoFR/4110
|
|
||||||
;exten => 4113,1,Voicemail,s4110
|
|
||||||
|
|
||||||
;exten => 8500,1,VoicemailMain
|
;exten => 8500,1,VoicemailMain
|
||||||
;exten => 8500,2,Goto,s|4
|
;exten => 8500,2,Hangup
|
||||||
;exten => 762,1,Playback,somepeople
|
;
|
||||||
;exten => 762,2,Wait,4
|
; Or a conference room (you'll need to edit meetme.conf to enable this room)
|
||||||
;exten => 762,3,Goto,s|4
|
;
|
||||||
|
;exten => 8600,1,Meetme,1234
|
||||||
; Timeout stuff... We could send to an operator, or just ditch them.
|
;
|
||||||
;exten => t,1,Goto,#|1
|
; For more information on applications, just type "show applications" at your
|
||||||
;exten => i,1,BackGround,invalid
|
; friendly Asterisk CLI prompt.
|
||||||
include => parkedcalls
|
;
|
||||||
|
|
||||||
;[other]
|
|
||||||
;exten => s,1,Playback,digits/9
|
|
||||||
;exten => s,2,Playback,digits/8
|
|
||||||
;exten => s,3,Playback,digits/7
|
|
||||||
;exten => s,4,Goto,100|1
|
|
||||||
;exten => 100,1,Playback,digits/6
|
|
||||||
;exten => 100,2,Playback,digits/5
|
|
||||||
;exten => 100,3,Goto,default|s|4
|
|
||||||
|
|
||||||
;[outboundpri]
|
|
||||||
;exten => _91NXXNXXXXXX,1,StripMSD,1
|
|
||||||
;exten => _1NXXNXXXXXX,2,Dial,Zap/g2/BYEXTENSION
|
|
||||||
;ignorepat => 9
|
|
||||||
|
22
editline/.cvsignore
Executable file
22
editline/.cvsignore
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
np/vis.o_a
|
||||||
|
np/unvis.o_a
|
||||||
|
np/strlcpy.o_a
|
||||||
|
np/strlcat.o_a
|
||||||
|
np/fgetln.o_a
|
||||||
|
vi.h
|
||||||
|
tokenizer.o_a
|
||||||
|
readline.o_a
|
||||||
|
history.o_a
|
||||||
|
help.h
|
||||||
|
help.c
|
||||||
|
fcns.h
|
||||||
|
fcns.c
|
||||||
|
emacs.h
|
||||||
|
editline.o_a
|
||||||
|
editline.c
|
||||||
|
config.status
|
||||||
|
config.log
|
||||||
|
config.h
|
||||||
|
common.h
|
||||||
|
config.cache
|
||||||
|
Makefile
|
5
editline/np/.cvsignore
Executable file
5
editline/np/.cvsignore
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
vis.o_a
|
||||||
|
unvis.o_a
|
||||||
|
strlcpy.o_a
|
||||||
|
strlcat.o_a
|
||||||
|
fgetln.o_a
|
@@ -435,6 +435,10 @@ struct ast_ignorepat *ast_walk_context_ignorepats(struct ast_context *con,
|
|||||||
struct ast_ignorepat *ip);
|
struct ast_ignorepat *ip);
|
||||||
struct ast_sw *ast_walk_context_switches(struct ast_context *con, struct ast_sw *sw);
|
struct ast_sw *ast_walk_context_switches(struct ast_context *con, struct ast_sw *sw);
|
||||||
|
|
||||||
|
extern char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name);
|
||||||
|
extern void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value);
|
||||||
|
extern void pbx_builtin_clear_globals(void);
|
||||||
|
|
||||||
#if defined(__cplusplus) || defined(c_plusplus)
|
#if defined(__cplusplus) || defined(c_plusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -44,6 +44,10 @@ void ast_rtp_set_data(struct ast_rtp *rtp, void *data);
|
|||||||
|
|
||||||
int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *f);
|
int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *f);
|
||||||
|
|
||||||
|
struct ast_frame *ast_rtp_read(struct ast_rtp *rtp);
|
||||||
|
|
||||||
|
int ast_rtp_fd(struct ast_rtp *rtp);
|
||||||
|
|
||||||
int ast_rtp_senddigit(struct ast_rtp *rtp, char digit);
|
int ast_rtp_senddigit(struct ast_rtp *rtp, char digit);
|
||||||
|
|
||||||
int ast_rtp_settos(struct ast_rtp *rtp, int tos);
|
int ast_rtp_settos(struct ast_rtp *rtp, int tos);
|
||||||
|
229
pbx.c
229
pbx.c
@@ -145,10 +145,12 @@ static int pbx_builtin_ringing(struct ast_channel *, void *);
|
|||||||
static int pbx_builtin_congestion(struct ast_channel *, void *);
|
static int pbx_builtin_congestion(struct ast_channel *, void *);
|
||||||
static int pbx_builtin_busy(struct ast_channel *, void *);
|
static int pbx_builtin_busy(struct ast_channel *, void *);
|
||||||
static int pbx_builtin_setvar(struct ast_channel *, void *);
|
static int pbx_builtin_setvar(struct ast_channel *, void *);
|
||||||
|
static int pbx_builtin_noop(struct ast_channel *, void *);
|
||||||
static int pbx_builtin_gotoif(struct ast_channel *, void *);
|
static int pbx_builtin_gotoif(struct ast_channel *, void *);
|
||||||
void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value);
|
void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value);
|
||||||
char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name);
|
char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name);
|
||||||
|
|
||||||
|
static struct varshead globals = AST_LIST_HEAD_INITIALIZER(varshead);
|
||||||
|
|
||||||
static struct pbx_builtin {
|
static struct pbx_builtin {
|
||||||
char name[AST_MAX_APP];
|
char name[AST_MAX_APP];
|
||||||
@@ -261,6 +263,10 @@ static struct pbx_builtin {
|
|||||||
"Set variable to value",
|
"Set variable to value",
|
||||||
" Setvar(#n=value): Sets variable n to value" },
|
" Setvar(#n=value): Sets variable n to value" },
|
||||||
|
|
||||||
|
{ "NoOp", pbx_builtin_noop,
|
||||||
|
"No operation",
|
||||||
|
" NoOp(): No-operation; Does nothing." },
|
||||||
|
|
||||||
{ "GotoIf", pbx_builtin_gotoif,
|
{ "GotoIf", pbx_builtin_gotoif,
|
||||||
"Conditional goto",
|
"Conditional goto",
|
||||||
" GotoIf(Condition?label1:label2): Go to label 1 if condition is\n"
|
" GotoIf(Condition?label1:label2): Go to label 1 if condition is\n"
|
||||||
@@ -417,47 +423,83 @@ static void pbx_destroy(struct ast_pbx *p)
|
|||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define EXTENSION_MATCH_CORE(data,pattern,match) {\
|
||||||
|
/* All patterns begin with _ */\
|
||||||
|
if (pattern[0] != '_') \
|
||||||
|
return 0;\
|
||||||
|
/* Start optimistic */\
|
||||||
|
match=1;\
|
||||||
|
pattern++;\
|
||||||
|
while(match && *data && *pattern && (*pattern != '/')) {\
|
||||||
|
switch(toupper(*pattern)) {\
|
||||||
|
case '[': \
|
||||||
|
{\
|
||||||
|
int i,border=0;\
|
||||||
|
char *where;\
|
||||||
|
match=0;\
|
||||||
|
pattern++;\
|
||||||
|
where=strchr(pattern,']');\
|
||||||
|
if (where)\
|
||||||
|
border=(int)(where-pattern);\
|
||||||
|
if (!where || border > strlen(pattern)) {\
|
||||||
|
ast_log(LOG_WARNING, "Wrong usage of [] in the extension\n");\
|
||||||
|
return match;\
|
||||||
|
}\
|
||||||
|
for (i=0; i<border; i++) {\
|
||||||
|
int res=0;\
|
||||||
|
if (i+2<border)\
|
||||||
|
if (pattern[i+1]=='-') {\
|
||||||
|
if (*data >= pattern[i] && *data <= pattern[i+2]) {\
|
||||||
|
res=1;\
|
||||||
|
} else {\
|
||||||
|
i+=2;\
|
||||||
|
continue;\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
|
if (res==1 || *data==pattern[i]) {\
|
||||||
|
match = 1;\
|
||||||
|
break;\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
|
pattern+=border;\
|
||||||
|
break;\
|
||||||
|
}\
|
||||||
|
case 'N':\
|
||||||
|
if ((*data < '2') || (*data > '9'))\
|
||||||
|
match=0;\
|
||||||
|
break;\
|
||||||
|
case 'X':\
|
||||||
|
if ((*data < '0') || (*data > '9'))\
|
||||||
|
match = 0;\
|
||||||
|
break;\
|
||||||
|
case 'Z':\
|
||||||
|
if ((*data < '1') || (*data > '9'))\
|
||||||
|
match = 0;\
|
||||||
|
break;\
|
||||||
|
case '.':\
|
||||||
|
/* Must match */\
|
||||||
|
return 1;\
|
||||||
|
case ' ':\
|
||||||
|
case '-':\
|
||||||
|
/* Ignore these characters */\
|
||||||
|
data--;\
|
||||||
|
break;\
|
||||||
|
default:\
|
||||||
|
if (*data != *pattern)\
|
||||||
|
match =0;\
|
||||||
|
}\
|
||||||
|
data++;\
|
||||||
|
pattern++;\
|
||||||
|
}\
|
||||||
|
}
|
||||||
|
|
||||||
int ast_extension_match(char *pattern, char *data)
|
int ast_extension_match(char *pattern, char *data)
|
||||||
{
|
{
|
||||||
int match;
|
int match;
|
||||||
/* If they're the same return */
|
/* If they're the same return */
|
||||||
if (!strcasecmp(pattern, data))
|
if (!strcasecmp(pattern, data))
|
||||||
return 1;
|
return 1;
|
||||||
/* All patterns begin with _ */
|
EXTENSION_MATCH_CORE(data,pattern,match);
|
||||||
if (pattern[0] != '_')
|
|
||||||
return 0;
|
|
||||||
/* Start optimistic */
|
|
||||||
match=1;
|
|
||||||
pattern++;
|
|
||||||
while(match && *data && *pattern && (*pattern != '/')) {
|
|
||||||
switch(toupper(*pattern)) {
|
|
||||||
case 'N':
|
|
||||||
if ((*data < '2') || (*data > '9'))
|
|
||||||
match=0;
|
|
||||||
break;
|
|
||||||
case 'X':
|
|
||||||
if ((*data < '0') || (*data > '9'))
|
|
||||||
match = 0;
|
|
||||||
break;
|
|
||||||
case 'Z':
|
|
||||||
if ((*data < '1') || (*data > '9'))
|
|
||||||
match = 0;
|
|
||||||
break;
|
|
||||||
case '.':
|
|
||||||
/* Must match */
|
|
||||||
return 1;
|
|
||||||
case ' ':
|
|
||||||
case '-':
|
|
||||||
/* Ignore these characters */
|
|
||||||
data--;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (*data != *pattern)
|
|
||||||
match =0;
|
|
||||||
}
|
|
||||||
data++;
|
|
||||||
pattern++;
|
|
||||||
}
|
|
||||||
/* Must be at the end of both */
|
/* Must be at the end of both */
|
||||||
if (*data || (*pattern && (*pattern != '/')))
|
if (*data || (*pattern && (*pattern != '/')))
|
||||||
match = 0;
|
match = 0;
|
||||||
@@ -476,41 +518,7 @@ static int extension_close(char *pattern, char *data, int needmore)
|
|||||||
(!needmore || (strlen(pattern) > strlen(data)))) {
|
(!needmore || (strlen(pattern) > strlen(data)))) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* All patterns begin with _ */
|
EXTENSION_MATCH_CORE(data,pattern,match);
|
||||||
if (pattern[0] != '_')
|
|
||||||
return 0;
|
|
||||||
/* Start optimistic */
|
|
||||||
match=1;
|
|
||||||
pattern++;
|
|
||||||
while(match && *data && *pattern && (*pattern != '/')) {
|
|
||||||
switch(toupper(*pattern)) {
|
|
||||||
case 'N':
|
|
||||||
if ((*data < '2') || (*data > '9'))
|
|
||||||
match=0;
|
|
||||||
break;
|
|
||||||
case 'X':
|
|
||||||
if ((*data < '0') || (*data > '9'))
|
|
||||||
match = 0;
|
|
||||||
break;
|
|
||||||
case 'Z':
|
|
||||||
if ((*data < '1') || (*data > '9'))
|
|
||||||
match = 0;
|
|
||||||
break;
|
|
||||||
case '.':
|
|
||||||
/* Must match instantly */
|
|
||||||
return 1;
|
|
||||||
case ' ':
|
|
||||||
case '-':
|
|
||||||
/* Ignore these characters */
|
|
||||||
data--;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (*data != *pattern)
|
|
||||||
match =0;
|
|
||||||
}
|
|
||||||
data++;
|
|
||||||
pattern++;
|
|
||||||
}
|
|
||||||
/* If there's more or we don't care about more, return non-zero, otlherwise it's a miss */
|
/* If there's more or we don't care about more, return non-zero, otlherwise it's a miss */
|
||||||
if (!needmore || *pattern) {
|
if (!needmore || *pattern) {
|
||||||
return match;
|
return match;
|
||||||
@@ -665,7 +673,7 @@ static void *pbx_substitute_variables(struct ast_channel *c, struct ast_exten *e
|
|||||||
char *cp1,*cp3,*cp4,*cp5;
|
char *cp1,*cp3,*cp4,*cp5;
|
||||||
void *cp2;
|
void *cp2;
|
||||||
char c1,c2;
|
char c1,c2;
|
||||||
int m,mve,origlen,quoted,dolsign,docopy;
|
int m,mve,origlen,quoted,dolsign,docopy,offset;
|
||||||
struct ast_var_t *variables;
|
struct ast_var_t *variables;
|
||||||
struct varshead *headp;
|
struct varshead *headp;
|
||||||
char pri[80];
|
char pri[80];
|
||||||
@@ -767,6 +775,13 @@ static void *pbx_substitute_variables(struct ast_channel *c, struct ast_exten *e
|
|||||||
} else if (!strcmp(cp3, "EXTEN")) {
|
} else if (!strcmp(cp3, "EXTEN")) {
|
||||||
cp4 = c->exten;
|
cp4 = c->exten;
|
||||||
break;
|
break;
|
||||||
|
} else if (!strncmp(cp3, "EXTEN-", strlen("EXTEN-")) &&
|
||||||
|
(sscanf(cp3 + strlen("EXTEN-"), "%d", &offset) == 1)) {
|
||||||
|
if (offset < 0)
|
||||||
|
offset=0;
|
||||||
|
if (offset > strlen(c->exten))
|
||||||
|
offset = strlen(c->exten);
|
||||||
|
cp4 = c->exten + offset;
|
||||||
} else if (!strcmp(cp3, "RDNIS")) {
|
} else if (!strcmp(cp3, "RDNIS")) {
|
||||||
cp4 = c->rdnis;
|
cp4 = c->rdnis;
|
||||||
if (!cp4)
|
if (!cp4)
|
||||||
@@ -782,12 +797,22 @@ static void *pbx_substitute_variables(struct ast_channel *c, struct ast_exten *e
|
|||||||
} else {
|
} else {
|
||||||
AST_LIST_TRAVERSE(headp,variables,entries) {
|
AST_LIST_TRAVERSE(headp,variables,entries) {
|
||||||
// ast_log(LOG_WARNING,"Comparing variable '%s' with '%s'\n",cp3,ast_var_name(variables));
|
// ast_log(LOG_WARNING,"Comparing variable '%s' with '%s'\n",cp3,ast_var_name(variables));
|
||||||
if (strncasecmp(ast_var_name(variables),cp3,m)==0) {
|
if (strncasecmp(ast_var_name(variables),cp3,m)==0) {
|
||||||
cp4=ast_var_value(variables);
|
cp4=ast_var_value(variables);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!cp4) {
|
||||||
|
/* Try globals */
|
||||||
|
AST_LIST_TRAVERSE(&globals,variables,entries) {
|
||||||
|
// ast_log(LOG_WARNING,"Comparing variable '%s' with '%s'\n",cp3,ast_var_name(variables));
|
||||||
|
if (strncasecmp(ast_var_name(variables),cp3,m)==0) {
|
||||||
|
cp4=ast_var_value(variables);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
free(cp3);
|
free(cp3);
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
@@ -811,12 +836,13 @@ static void *pbx_substitute_variables(struct ast_channel *c, struct ast_exten *e
|
|||||||
if (cp4!=NULL) {
|
if (cp4!=NULL) {
|
||||||
cp2=realloc(cp2,origlen+strlen(cp4)+1);
|
cp2=realloc(cp2,origlen+strlen(cp4)+1);
|
||||||
strncat((char *)cp2,cp4,strlen(cp4));
|
strncat((char *)cp2,cp4,strlen(cp4));
|
||||||
|
origlen += strlen(cp4);
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING,"mve!=0 and cp4=NULL, something gone astray\n");
|
ast_log(LOG_WARNING,"mve!=0 and cp4=NULL, something gone astray\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cp4 = NULL;
|
||||||
} while (*cp1++!='\0');
|
} while (*cp1++!='\0');
|
||||||
|
|
||||||
/* Second stage, expression evaluation */
|
/* Second stage, expression evaluation */
|
||||||
@@ -2764,6 +2790,7 @@ int ast_async_goto(struct ast_channel *chan, char *context, char *exten, int pri
|
|||||||
struct ast_frame *f;
|
struct ast_frame *f;
|
||||||
tmpchan = ast_channel_alloc(0);
|
tmpchan = ast_channel_alloc(0);
|
||||||
if (tmpchan) {
|
if (tmpchan) {
|
||||||
|
ast_setstate(tmpchan, chan->_state);
|
||||||
snprintf(tmpchan->name, sizeof(tmpchan->name), "AsyncGoto/%s", chan->name);
|
snprintf(tmpchan->name, sizeof(tmpchan->name), "AsyncGoto/%s", chan->name);
|
||||||
/* Make formats okay */
|
/* Make formats okay */
|
||||||
tmpchan->readformat = chan->readformat;
|
tmpchan->readformat = chan->readformat;
|
||||||
@@ -2826,7 +2853,8 @@ static void ext_strncpy(char *dst, char *src, int len)
|
|||||||
while(*src && (count < len - 1)) {
|
while(*src && (count < len - 1)) {
|
||||||
switch(*src) {
|
switch(*src) {
|
||||||
case ' ':
|
case ' ':
|
||||||
case '-':
|
//otherwise exten => [a-b],1,... doesn't work
|
||||||
|
// case '-':
|
||||||
/* Ignore */
|
/* Ignore */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -3485,21 +3513,35 @@ char *pbx_builtin_getvar_helper(struct ast_channel *chan, char *name) {
|
|||||||
struct ast_var_t *variables;
|
struct ast_var_t *variables;
|
||||||
struct varshead *headp;
|
struct varshead *headp;
|
||||||
|
|
||||||
headp = &chan->varshead;
|
if (chan)
|
||||||
|
headp=&chan->varshead;
|
||||||
|
else
|
||||||
|
headp=&globals;
|
||||||
|
|
||||||
if (name)
|
if (name) {
|
||||||
AST_LIST_TRAVERSE(headp,variables,entries) {
|
AST_LIST_TRAVERSE(headp,variables,entries) {
|
||||||
if (!strcmp(name, ast_var_name(variables)))
|
if (!strcmp(name, ast_var_name(variables)))
|
||||||
return ast_var_value(variables);
|
return ast_var_value(variables);
|
||||||
}
|
}
|
||||||
|
if (headp != &globals) {
|
||||||
|
/* Check global variables if we haven't already */
|
||||||
|
headp = &globals;
|
||||||
|
AST_LIST_TRAVERSE(headp,variables,entries) {
|
||||||
|
if (!strcmp(name, ast_var_name(variables)))
|
||||||
|
return ast_var_value(variables);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value) {
|
void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value) {
|
||||||
struct ast_var_t *newvariable;
|
struct ast_var_t *newvariable;
|
||||||
struct varshead *headp;
|
struct varshead *headp;
|
||||||
|
if (chan)
|
||||||
headp=&chan->varshead;
|
headp=&chan->varshead;
|
||||||
|
else
|
||||||
|
headp=&globals;
|
||||||
|
|
||||||
AST_LIST_TRAVERSE (headp,newvariable,entries) {
|
AST_LIST_TRAVERSE (headp,newvariable,entries) {
|
||||||
if (strncasecmp(ast_var_name(newvariable),name,strlen(name))==0) {
|
if (strncasecmp(ast_var_name(newvariable),name,strlen(name))==0) {
|
||||||
@@ -3510,10 +3552,12 @@ void pbx_builtin_setvar_helper(struct ast_channel *chan, char *name, char *value
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newvariable=ast_var_assign(name,value);
|
if (value) {
|
||||||
AST_LIST_INSERT_HEAD(headp,newvariable,entries);
|
if ((option_verbose > 1) && (headp == &globals))
|
||||||
|
ast_verbose(VERBOSE_PREFIX_3 "Setting global variable '%s' to '%s'\n",name, value);
|
||||||
return;
|
newvariable=ast_var_assign(name,value);
|
||||||
|
AST_LIST_INSERT_HEAD(headp,newvariable,entries);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pbx_builtin_setvar(struct ast_channel *chan, void *data)
|
static int pbx_builtin_setvar(struct ast_channel *chan, void *data)
|
||||||
@@ -3536,6 +3580,22 @@ static int pbx_builtin_setvar(struct ast_channel *chan, void *data)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int pbx_builtin_noop(struct ast_channel *chan, void *data)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void pbx_builtin_clear_globals(void)
|
||||||
|
{
|
||||||
|
struct ast_var_t *vardata;
|
||||||
|
while (!AST_LIST_EMPTY(&globals)) {
|
||||||
|
vardata = AST_LIST_FIRST(&globals);
|
||||||
|
AST_LIST_REMOVE_HEAD(&globals, entries);
|
||||||
|
ast_var_delete(vardata);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int pbx_checkcondition(char *condition) {
|
static int pbx_checkcondition(char *condition) {
|
||||||
char *s;
|
char *s;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -3552,7 +3612,6 @@ static int pbx_checkcondition(char *condition) {
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int pbx_builtin_gotoif(struct ast_channel *chan, void *data)
|
static int pbx_builtin_gotoif(struct ast_channel *chan, void *data)
|
||||||
{
|
{
|
||||||
char *condition,*branch1,*branch2,*branch;
|
char *condition,*branch1,*branch2,*branch;
|
||||||
|
1
pbx/.cvsignore
Executable file
1
pbx/.cvsignore
Executable file
@@ -0,0 +1 @@
|
|||||||
|
pbx_kdeconsole.moc
|
@@ -1059,6 +1059,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[])
|
|||||||
char *whole_exten;
|
char *whole_exten;
|
||||||
char *exten, *prior;
|
char *exten, *prior;
|
||||||
char *cidmatch, *app, *app_data;
|
char *cidmatch, *app, *app_data;
|
||||||
|
char *start, *end;
|
||||||
|
|
||||||
/* check for arguments at first */
|
/* check for arguments at first */
|
||||||
if (argc != 5 && argc != 6) return RESULT_SHOWUSAGE;
|
if (argc != 5 && argc != 6) return RESULT_SHOWUSAGE;
|
||||||
@@ -1075,7 +1076,14 @@ static int handle_context_add_extension(int fd, int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
prior = strsep(&whole_exten,",");
|
prior = strsep(&whole_exten,",");
|
||||||
app = strsep(&whole_exten,",");
|
app = strsep(&whole_exten,",");
|
||||||
app_data = whole_exten;
|
if ((start = strchr(app, '(')) && (end = strrchr(app, ')'))) {
|
||||||
|
*start = *end = '\0';
|
||||||
|
app_data = start + 1;
|
||||||
|
for (start = app_data; *start; start++)
|
||||||
|
if (*start == ',')
|
||||||
|
*start = '|';
|
||||||
|
} else
|
||||||
|
app_data = whole_exten;
|
||||||
|
|
||||||
if (!exten || !prior || !app || !app_data) return RESULT_SHOWUSAGE;
|
if (!exten || !prior || !app || !app_data) return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
@@ -1466,6 +1474,7 @@ static int pbx_load_module(void)
|
|||||||
struct ast_variable *v;
|
struct ast_variable *v;
|
||||||
char *cxt, *ext, *pri, *appl, *data, *tc, *cidmatch;
|
char *cxt, *ext, *pri, *appl, *data, *tc, *cidmatch;
|
||||||
struct ast_context *con;
|
struct ast_context *con;
|
||||||
|
char *start, *end;
|
||||||
|
|
||||||
cfg = ast_load(config);
|
cfg = ast_load(config);
|
||||||
if (cfg) {
|
if (cfg) {
|
||||||
@@ -1474,10 +1483,15 @@ static int pbx_load_module(void)
|
|||||||
"static"));
|
"static"));
|
||||||
write_protect_config = ast_true(ast_variable_retrieve(cfg, "general",
|
write_protect_config = ast_true(ast_variable_retrieve(cfg, "general",
|
||||||
"writeprotect"));
|
"writeprotect"));
|
||||||
|
v = ast_variable_browse(cfg, "globals");
|
||||||
|
while(v) {
|
||||||
|
pbx_builtin_setvar_helper(NULL, v->name, v->value);
|
||||||
|
v = v->next;
|
||||||
|
}
|
||||||
cxt = ast_category_browse(cfg, NULL);
|
cxt = ast_category_browse(cfg, NULL);
|
||||||
while(cxt) {
|
while(cxt) {
|
||||||
/* All categories but "general" are considered contexts */
|
/* All categories but "general" are considered contexts */
|
||||||
if (!strcasecmp(cxt, "general")) {
|
if (!strcasecmp(cxt, "general") || !strcasecmp(cxt, "globals")) {
|
||||||
cxt = ast_category_browse(cfg, cxt);
|
cxt = ast_category_browse(cfg, cxt);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1495,10 +1509,18 @@ static int pbx_load_module(void)
|
|||||||
pri = strsep(&stringp, ",");
|
pri = strsep(&stringp, ",");
|
||||||
if (!pri)
|
if (!pri)
|
||||||
pri="";
|
pri="";
|
||||||
appl = strsep(&stringp, ",");
|
appl = stringp;
|
||||||
|
if (!(start = strchr(appl, '(')))
|
||||||
|
appl = strsep(&stringp, ",");
|
||||||
if (!appl)
|
if (!appl)
|
||||||
appl="";
|
appl="";
|
||||||
if (stringp!=NULL && *stringp=='"') {
|
if (start && (end = strrchr(appl, ')'))) {
|
||||||
|
*start = *end = '\0';
|
||||||
|
data = start + 1;
|
||||||
|
for (start = data; *start; start++)
|
||||||
|
if (*start == ',')
|
||||||
|
*start = '|';
|
||||||
|
} else if (stringp!=NULL && *stringp=='"') {
|
||||||
stringp++;
|
stringp++;
|
||||||
data = strsep(&stringp, "\"");
|
data = strsep(&stringp, "\"");
|
||||||
stringp++;
|
stringp++;
|
||||||
@@ -1566,6 +1588,7 @@ int load_module(void)
|
|||||||
int reload(void)
|
int reload(void)
|
||||||
{
|
{
|
||||||
ast_context_destroy(NULL, registrar);
|
ast_context_destroy(NULL, registrar);
|
||||||
|
pbx_builtin_clear_globals();
|
||||||
pbx_load_module();
|
pbx_load_module();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
69
rtp.c
69
rtp.c
@@ -61,6 +61,10 @@ struct ast_rtp {
|
|||||||
ast_rtp_callback callback;
|
ast_rtp_callback callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int ast_rtp_fd(struct ast_rtp *rtp)
|
||||||
|
{
|
||||||
|
return rtp->s;
|
||||||
|
}
|
||||||
|
|
||||||
static int g723_len(unsigned char buf)
|
static int g723_len(unsigned char buf)
|
||||||
{
|
{
|
||||||
@@ -106,7 +110,7 @@ void ast_rtp_set_callback(struct ast_rtp *rtp, ast_rtp_callback callback)
|
|||||||
rtp->callback = callback;
|
rtp->callback = callback;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_dtmf(struct ast_rtp *rtp)
|
static struct ast_frame *send_dtmf(struct ast_rtp *rtp)
|
||||||
{
|
{
|
||||||
printf("Sending dtmf: %d (%c)\n", rtp->resp, rtp->resp);
|
printf("Sending dtmf: %d (%c)\n", rtp->resp, rtp->resp);
|
||||||
rtp->f.frametype = AST_FRAME_DTMF;
|
rtp->f.frametype = AST_FRAME_DTMF;
|
||||||
@@ -116,15 +120,15 @@ static void send_dtmf(struct ast_rtp *rtp)
|
|||||||
rtp->f.mallocd = 0;
|
rtp->f.mallocd = 0;
|
||||||
rtp->f.src = "RTP";
|
rtp->f.src = "RTP";
|
||||||
rtp->resp = 0;
|
rtp->resp = 0;
|
||||||
if (rtp->callback)
|
return &rtp->f;
|
||||||
rtp->callback(rtp, &rtp->f, rtp->data);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void process_rfc2833(struct ast_rtp *rtp, unsigned char *data, int len)
|
static struct ast_frame *process_rfc2833(struct ast_rtp *rtp, unsigned char *data, int len)
|
||||||
{
|
{
|
||||||
unsigned int event;
|
unsigned int event;
|
||||||
char resp = 0;
|
char resp = 0;
|
||||||
|
struct ast_frame *f = NULL;
|
||||||
event = ntohl(*((unsigned int *)(data)));
|
event = ntohl(*((unsigned int *)(data)));
|
||||||
event >>= 24;
|
event >>= 24;
|
||||||
#if 0
|
#if 0
|
||||||
@@ -140,16 +144,17 @@ static void process_rfc2833(struct ast_rtp *rtp, unsigned char *data, int len)
|
|||||||
resp = 'A' + (event - 12);
|
resp = 'A' + (event - 12);
|
||||||
}
|
}
|
||||||
if (rtp->resp && (rtp->resp != resp)) {
|
if (rtp->resp && (rtp->resp != resp)) {
|
||||||
send_dtmf(rtp);
|
f = send_dtmf(rtp);
|
||||||
}
|
}
|
||||||
rtp->resp = resp;
|
rtp->resp = resp;
|
||||||
rtp->dtmfcount = dtmftimeout;
|
rtp->dtmfcount = dtmftimeout;
|
||||||
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void process_type121(struct ast_rtp *rtp, unsigned char *data, int len)
|
static struct ast_frame *process_type121(struct ast_rtp *rtp, unsigned char *data, int len)
|
||||||
{
|
{
|
||||||
char resp = 0;
|
char resp = 0;
|
||||||
|
struct ast_frame *f = NULL;
|
||||||
unsigned char b0,b1,b2,b3,b4,b5,b6,b7;
|
unsigned char b0,b1,b2,b3,b4,b5,b6,b7;
|
||||||
|
|
||||||
b0=*(data+0);b1=*(data+1);b2=*(data+2);b3=*(data+3);
|
b0=*(data+0);b1=*(data+1);b2=*(data+2);b3=*(data+3);
|
||||||
@@ -169,7 +174,7 @@ static void process_type121(struct ast_rtp *rtp, unsigned char *data, int len)
|
|||||||
resp='A'+(b3-12);
|
resp='A'+(b3-12);
|
||||||
}
|
}
|
||||||
rtp->resp=resp;
|
rtp->resp=resp;
|
||||||
send_dtmf(rtp);
|
f = send_dtmf(rtp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (b2==3) {
|
if (b2==3) {
|
||||||
@@ -178,11 +183,23 @@ static void process_type121(struct ast_rtp *rtp, unsigned char *data, int len)
|
|||||||
if (b2==0) {
|
if (b2==0) {
|
||||||
// printf("Stop(0) %d\n",b3);
|
// printf("Stop(0) %d\n",b3);
|
||||||
}
|
}
|
||||||
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtpread(int *id, int fd, short events, void *cbdata)
|
static int rtpread(int *id, int fd, short events, void *cbdata)
|
||||||
{
|
{
|
||||||
struct ast_rtp *rtp = cbdata;
|
struct ast_rtp *rtp = cbdata;
|
||||||
|
struct ast_frame *f;
|
||||||
|
f = ast_rtp_read(rtp);
|
||||||
|
if (f) {
|
||||||
|
if (rtp->callback)
|
||||||
|
rtp->callback(rtp, f, rtp->data);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
|
||||||
|
{
|
||||||
int res;
|
int res;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
int len;
|
int len;
|
||||||
@@ -191,6 +208,7 @@ static int rtpread(int *id, int fd, short events, void *cbdata)
|
|||||||
int hdrlen = 12;
|
int hdrlen = 12;
|
||||||
unsigned int timestamp;
|
unsigned int timestamp;
|
||||||
unsigned int *rtpheader;
|
unsigned int *rtpheader;
|
||||||
|
static struct ast_frame *f, null_frame = { AST_FRAME_NULL, };
|
||||||
|
|
||||||
len = sizeof(sin);
|
len = sizeof(sin);
|
||||||
|
|
||||||
@@ -202,11 +220,11 @@ static int rtpread(int *id, int fd, short events, void *cbdata)
|
|||||||
ast_log(LOG_WARNING, "RTP Read error: %s\n", strerror(errno));
|
ast_log(LOG_WARNING, "RTP Read error: %s\n", strerror(errno));
|
||||||
if (errno == EBADF)
|
if (errno == EBADF)
|
||||||
CRASH;
|
CRASH;
|
||||||
return 1;
|
return &null_frame;
|
||||||
}
|
}
|
||||||
if (res < hdrlen) {
|
if (res < hdrlen) {
|
||||||
ast_log(LOG_WARNING, "RTP Read too short\n");
|
ast_log(LOG_WARNING, "RTP Read too short\n");
|
||||||
return 1;
|
return &null_frame;
|
||||||
}
|
}
|
||||||
/* Get fields */
|
/* Get fields */
|
||||||
seqno = ntohl(rtpheader[0]);
|
seqno = ntohl(rtpheader[0]);
|
||||||
@@ -219,19 +237,23 @@ static int rtpread(int *id, int fd, short events, void *cbdata)
|
|||||||
rtp->f.frametype = AST_FRAME_VOICE;
|
rtp->f.frametype = AST_FRAME_VOICE;
|
||||||
rtp->f.subclass = rtp2ast(payloadtype);
|
rtp->f.subclass = rtp2ast(payloadtype);
|
||||||
if (rtp->f.subclass < 0) {
|
if (rtp->f.subclass < 0) {
|
||||||
|
f = NULL;
|
||||||
if (payloadtype == 101) {
|
if (payloadtype == 101) {
|
||||||
/* It's special -- rfc2833 process it */
|
/* It's special -- rfc2833 process it */
|
||||||
process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
|
f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
|
||||||
} else if (payloadtype == 121) {
|
} else if (payloadtype == 121) {
|
||||||
/* CISCO proprietary DTMF bridge */
|
/* CISCO proprietary DTMF bridge */
|
||||||
process_type121(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
|
f = process_type121(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
|
||||||
} else if (payloadtype == 100) {
|
} else if (payloadtype == 100) {
|
||||||
/* CISCO's notso proprietary DTMF bridge */
|
/* CISCO's notso proprietary DTMF bridge */
|
||||||
process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
|
f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_NOTICE, "Unknown RTP codec %d received\n", payloadtype);
|
ast_log(LOG_NOTICE, "Unknown RTP codec %d received\n", payloadtype);
|
||||||
}
|
}
|
||||||
return 1;
|
if (f)
|
||||||
|
return f;
|
||||||
|
else
|
||||||
|
return &null_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rtp->lastrxts)
|
if (!rtp->lastrxts)
|
||||||
@@ -253,10 +275,8 @@ static int rtpread(int *id, int fd, short events, void *cbdata)
|
|||||||
|
|
||||||
/* Send any pending DTMF */
|
/* Send any pending DTMF */
|
||||||
if (rtp->resp && !rtp->dtmfcount) {
|
if (rtp->resp && !rtp->dtmfcount) {
|
||||||
send_dtmf(rtp);
|
printf("Sending pending DTMF\n");
|
||||||
/* Setup the voice frame again */
|
return send_dtmf(rtp);
|
||||||
rtp->f.frametype = AST_FRAME_VOICE;
|
|
||||||
rtp->f.subclass = rtp2ast(payloadtype);
|
|
||||||
}
|
}
|
||||||
rtp->f.mallocd = 0;
|
rtp->f.mallocd = 0;
|
||||||
rtp->f.datalen = res - hdrlen;
|
rtp->f.datalen = res - hdrlen;
|
||||||
@@ -287,9 +307,7 @@ static int rtpread(int *id, int fd, short events, void *cbdata)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rtp->f.src = "RTP";
|
rtp->f.src = "RTP";
|
||||||
if (rtp->callback)
|
return &rtp->f;
|
||||||
rtp->callback(rtp, &rtp->f, rtp->data);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
@@ -370,9 +388,12 @@ struct ast_rtp *ast_rtp_new(struct sched_context *sched, struct io_context *io)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rtp->io = io;
|
if (io && sched) {
|
||||||
rtp->sched = sched;
|
/* Operate this one in a callback mode */
|
||||||
rtp->ioid = ast_io_add(rtp->io, rtp->s, rtpread, AST_IO_IN, rtp);
|
rtp->sched = sched;
|
||||||
|
rtp->io = io;
|
||||||
|
rtp->ioid = ast_io_add(rtp->io, rtp->s, rtpread, AST_IO_IN, rtp);
|
||||||
|
}
|
||||||
return rtp;
|
return rtp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user