[asterisk-commits] branch oej/subscribemwi r9521 - in
/team/oej/subscribemwi: ./ apps/ cdr/ chan...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Feb 11 06:56:52 MST 2006
Author: oej
Date: Sat Feb 11 07:56:02 2006
New Revision: 9521
URL: http://svn.digium.com/view/asterisk?rev=9521&view=rev
Log:
Upgrades
Added:
team/oej/subscribemwi/codecs/gsm/libgsm.vcproj
- copied unchanged from r9508, trunk/codecs/gsm/libgsm.vcproj
team/oej/subscribemwi/codecs/ilbc/libilbc.vcproj
- copied unchanged from r9508, trunk/codecs/ilbc/libilbc.vcproj
team/oej/subscribemwi/codecs/lpc10/liblpc10.vcproj
- copied unchanged from r9508, trunk/codecs/lpc10/liblpc10.vcproj
team/oej/subscribemwi/configs/smdi.conf.sample
- copied unchanged from r9508, trunk/configs/smdi.conf.sample
team/oej/subscribemwi/doc/smdi.txt
- copied unchanged from r9508, trunk/doc/smdi.txt
team/oej/subscribemwi/funcs/func_sha1.c
- copied unchanged from r9508, trunk/funcs/func_sha1.c
team/oej/subscribemwi/include/asterisk/sha1.h
- copied unchanged from r9508, trunk/include/asterisk/sha1.h
team/oej/subscribemwi/include/asterisk/smdi.h
- copied unchanged from r9508, trunk/include/asterisk/smdi.h
team/oej/subscribemwi/res/res_smdi.c
- copied unchanged from r9508, trunk/res/res_smdi.c
team/oej/subscribemwi/sha1.c
- copied unchanged from r9508, trunk/sha1.c
Removed:
team/oej/subscribemwi/funcs/pbx_functions.c
Modified:
team/oej/subscribemwi/ (props changed)
team/oej/subscribemwi/Makefile
team/oej/subscribemwi/UPGRADE.txt
team/oej/subscribemwi/apps/Makefile
team/oej/subscribemwi/apps/app_macro.c
team/oej/subscribemwi/apps/app_osplookup.c
team/oej/subscribemwi/apps/app_voicemail.c
team/oej/subscribemwi/cdr.c
team/oej/subscribemwi/cdr/Makefile
team/oej/subscribemwi/channel.c
team/oej/subscribemwi/channels/Makefile
team/oej/subscribemwi/channels/chan_iax2.c
team/oej/subscribemwi/channels/chan_local.c
team/oej/subscribemwi/channels/chan_mgcp.c
team/oej/subscribemwi/channels/chan_misdn.c
team/oej/subscribemwi/channels/chan_misdn_config.c
team/oej/subscribemwi/channels/chan_oss.c
team/oej/subscribemwi/channels/chan_sip.c
team/oej/subscribemwi/channels/chan_zap.c
team/oej/subscribemwi/channels/misdn/ (props changed)
team/oej/subscribemwi/channels/misdn/Makefile
team/oej/subscribemwi/channels/misdn/isdn_lib.c
team/oej/subscribemwi/channels/misdn/isdn_lib_intern.h
team/oej/subscribemwi/channels/misdn/isdn_msg_parser.c
team/oej/subscribemwi/cli.c
team/oej/subscribemwi/codecs/gsm/src/add.c
team/oej/subscribemwi/codecs/gsm/src/code.c
team/oej/subscribemwi/codecs/gsm/src/decode.c
team/oej/subscribemwi/codecs/gsm/src/long_term.c
team/oej/subscribemwi/codecs/gsm/src/lpc.c
team/oej/subscribemwi/codecs/gsm/src/preprocess.c
team/oej/subscribemwi/codecs/gsm/src/rpe.c
team/oej/subscribemwi/codecs/gsm/src/short_term.c
team/oej/subscribemwi/codecs/lpc10/bsynz.c
team/oej/subscribemwi/codecs/lpc10/decode.c
team/oej/subscribemwi/codecs/lpc10/encode.c
team/oej/subscribemwi/codecs/lpc10/energy.c
team/oej/subscribemwi/codecs/lpc10/f2clib.c
team/oej/subscribemwi/codecs/lpc10/irc2pc.c
team/oej/subscribemwi/codecs/lpc10/lpc10.h
team/oej/subscribemwi/codecs/lpc10/onset.c
team/oej/subscribemwi/codecs/lpc10/pitsyn.c
team/oej/subscribemwi/codecs/lpc10/tbdm.c
team/oej/subscribemwi/codecs/lpc10/voicin.c
team/oej/subscribemwi/codecs/lpc10/vparms.c
team/oej/subscribemwi/config.c
team/oej/subscribemwi/configs/misdn.conf.sample
team/oej/subscribemwi/configs/voicemail.conf.sample
team/oej/subscribemwi/configs/zapata.conf.sample
team/oej/subscribemwi/db.c
team/oej/subscribemwi/devicestate.c
team/oej/subscribemwi/dnsmgr.c
team/oej/subscribemwi/doc/channelvariables.txt
team/oej/subscribemwi/dsp.c
team/oej/subscribemwi/enum.c
team/oej/subscribemwi/file.c
team/oej/subscribemwi/funcs/Makefile
team/oej/subscribemwi/funcs/func_base64.c (contents, props changed)
team/oej/subscribemwi/funcs/func_callerid.c
team/oej/subscribemwi/funcs/func_cdr.c
team/oej/subscribemwi/funcs/func_cut.c
team/oej/subscribemwi/funcs/func_db.c
team/oej/subscribemwi/funcs/func_enum.c
team/oej/subscribemwi/funcs/func_env.c
team/oej/subscribemwi/funcs/func_groupcount.c
team/oej/subscribemwi/funcs/func_language.c
team/oej/subscribemwi/funcs/func_logic.c
team/oej/subscribemwi/funcs/func_math.c
team/oej/subscribemwi/funcs/func_md5.c
team/oej/subscribemwi/funcs/func_moh.c
team/oej/subscribemwi/funcs/func_odbc.c
team/oej/subscribemwi/funcs/func_rand.c
team/oej/subscribemwi/funcs/func_strings.c
team/oej/subscribemwi/funcs/func_timeout.c
team/oej/subscribemwi/funcs/func_uri.c
team/oej/subscribemwi/include/asterisk/callerid.h
team/oej/subscribemwi/include/asterisk/channel.h
team/oej/subscribemwi/include/asterisk/utils.h
team/oej/subscribemwi/logger.c
team/oej/subscribemwi/res/Makefile
team/oej/subscribemwi/utils.c
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
automerge = anna
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
branchinfo = Adding to support for MWI subscriptions in chan_sip
Propchange: team/oej/subscribemwi/
('svnmerge-blocked' removed)
Propchange: team/oej/subscribemwi/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Feb 11 07:56:02 2006
@@ -1,1 +1,1 @@
-/trunk:1-9127
+/trunk:1-9519
Modified: team/oej/subscribemwi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/Makefile?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/Makefile (original)
+++ team/oej/subscribemwi/Makefile Sat Feb 11 07:56:02 2006
@@ -3,7 +3,7 @@
#
# Top level Makefile
#
-# Copyright (C) 1999-2005, Mark Spencer
+# Copyright (C) 1999-2006, Digium, Inc.
#
# Mark Spencer <markster at digium.com>
#
@@ -72,6 +72,11 @@
#ifneq ($(CROSS_COMPILE),)
#OPTIONS += -DLOW_MEMORY
#endif
+
+#
+# Asterisk SMDI integration
+#
+WITH_SMDI = 1
# Optional debugging parameters
DEBUG_THREADS = #-DDUMP_SCHEDULER #-DDEBUG_SCHEDULER #-DDEBUG_THREADS #-DDO_CRASH #-DDETECT_DEADLOCKS
@@ -349,7 +354,7 @@
astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
- cryptostub.o
+ cryptostub.o sha1.o
ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
OBJS+= poll.o
@@ -943,4 +948,4 @@
rm -rf $(DESTDIR)$(ASTSPOOLDIR)
rm -rf $(DESTDIR)$(ASTETCDIR)
rm -rf $(DESTDIR)$(ASTLOGDIR)
-
+
Modified: team/oej/subscribemwi/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/UPGRADE.txt?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/UPGRADE.txt (original)
+++ team/oej/subscribemwi/UPGRADE.txt Sat Feb 11 07:56:02 2006
@@ -35,6 +35,11 @@
* The function ${CHECK_MD5()} has been deprecated in favor of using an
expression: $[${MD5(<string>)} = ${saved_md5}].
+* The 'builtin' functions that used to be combined in pbx_functions.so are
+ now built as separate modules. If you are not using 'autoload=yes' in your
+ modules.conf file then you will need to explicitly load the modules that
+ contain the functions you want to use.
+
The SIP channel:
* The "incominglimit" setting is replaced by the "call-limit" setting in sip.conf.
Modified: team/oej/subscribemwi/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/Makefile?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/Makefile (original)
+++ team/oej/subscribemwi/apps/Makefile Sat Feb 11 07:56:02 2006
@@ -59,7 +59,12 @@
APPS+=app_sms.so
endif
+# Asterisk SMDI integration
#
+ifeq (${WITH_SMDI},1)
+CFLAGS+=-DWITH_SMDI
+endif
+
# If you have UnixODBC you can use ODBC voicemail
# storage
#
@@ -91,15 +96,6 @@
app_curl.so: app_curl.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
-app_sql_postgres.o: app_sql_postgres.c
- $(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
-
-app_sql_postgres.so: app_sql_postgres.o
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
-
-app_sql_odbc.so: app_sql_odbc.o
- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
-
look: look.c
$(CC) -pipe -O6 -g look.c -o look -lncurses
Modified: team/oej/subscribemwi/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_macro.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_macro.c (original)
+++ team/oej/subscribemwi/apps/app_macro.c Sat Feb 11 07:56:02 2006
@@ -107,7 +107,7 @@
char oldcontext[AST_MAX_CONTEXT] = "";
int offset, depth = 0;
int setmacrocontext=0;
- int autoloopflag;
+ int autoloopflag, dead = 0;
char *save_macro_exten;
char *save_macro_context;
@@ -208,8 +208,8 @@
break;
}
switch(res) {
- case MACRO_EXIT_RESULT:
- res = 0;
+ case MACRO_EXIT_RESULT:
+ res = 0;
goto out;
case AST_PBX_KEEPALIVE:
if (option_debug)
@@ -223,6 +223,7 @@
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);
+ dead = 1;
goto out;
}
}
@@ -242,37 +243,44 @@
out:
/* Reset the depth back to what it was when the routine was entered (like if we called Macro recursively) */
snprintf(depthc, sizeof(depthc), "%d", depth);
- pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
-
- ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
- for (x=1; x<argc; x++) {
+ if (!dead) {
+ pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
+
+ ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
+ }
+
+ 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]);
+ if (!dead)
+ pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
free(oldargs[x]);
- } else {
+ } else if (!dead) {
pbx_builtin_setvar_helper(chan, varname, NULL);
}
}
/* Restore macro variables */
- pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+ if (!dead) {
+ pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
+ pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
+ pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
+ }
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 (setmacrocontext) {
+
+ if (!dead && setmacrocontext) {
chan->macrocontext[0] = '\0';
chan->macroexten[0] = '\0';
chan->macropriority = 0;
}
- if (!strcasecmp(chan->context, fullmacro)) {
+ if (!dead && !strcasecmp(chan->context, fullmacro)) {
/* If we're leaving the macro normally, restore original information */
chan->priority = oldpriority;
ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
@@ -292,7 +300,8 @@
}
}
- pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
+ if (!dead)
+ pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
if (save_macro_offset)
free(save_macro_offset);
LOCAL_USER_REMOVE(u);
Modified: team/oej/subscribemwi/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_osplookup.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_osplookup.c (original)
+++ team/oej/subscribemwi/apps/app_osplookup.c Sat Feb 11 07:56:02 2006
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster at digium.com>
*
@@ -184,6 +184,7 @@
int res=0;
struct localuser *u;
char *temp;
+ const char *val;
int cause;
struct ast_osp_result result;
int priority_jump = 0;
@@ -212,11 +213,11 @@
}
cause = str2cause(args.cause);
- temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
+ val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
result.handle = -1;
- if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
- temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
- if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
+ if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
+ val = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
+ if (ast_strlen_zero(val) || (sscanf(val, "%d", &result.numresults) != 1)) {
result.numresults = 0;
}
if ((res = ast_osp_next(&result, cause)) > 0) {
@@ -255,6 +256,7 @@
int res=0;
struct localuser *u;
char *temp;
+ const char *val;
int cause;
time_t start=0, duration=0;
struct ast_osp_result result;
@@ -293,9 +295,9 @@
ast_log(LOG_WARNING, "OSPFinish called on channel '%s' with no CDR!\n", chan->name);
cause = str2cause(args.status);
- temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
+ val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
result.handle = -1;
- if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
+ if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
if (!ast_osp_terminate(result.handle, cause, start, duration)) {
pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", "SUCCESS");
Modified: team/oej/subscribemwi/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/apps/app_voicemail.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/apps/app_voicemail.c (original)
+++ team/oej/subscribemwi/apps/app_voicemail.c Sat Feb 11 07:56:02 2006
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster at digium.com>
*
@@ -73,6 +73,10 @@
#include "asterisk/cli.h"
#include "asterisk/utils.h"
#include "asterisk/stringfields.h"
+#ifdef WITH_SMDI
+#include "asterisk/smdi.h"
+#define SMDI_MWI_WAIT_TIMEOUT 1000 /* 1 second */
+#endif
#ifdef USE_ODBC_STORAGE
#include "asterisk/res_odbc.h"
#endif
@@ -393,7 +397,9 @@
static char serveremail[80];
static char mailcmd[160]; /* Configurable mail cmd */
static char externnotify[160];
-
+#ifdef WITH_SMDI
+static struct ast_smdi_interface *smdi_iface = NULL;
+#endif
static char vmfmts[80];
static int vmminmessage;
static int vmmaxmessage;
@@ -2318,13 +2324,37 @@
char arguments[255];
char ext_context[256] = "";
int newvoicemails = 0, oldvoicemails = 0;
+#ifdef WITH_SMDI
+ struct ast_smdi_mwi_message *mwi_msg;
+#endif
if (!ast_strlen_zero(context))
snprintf(ext_context, sizeof(ext_context), "%s@%s", extension, context);
else
ast_copy_string(ext_context, extension, sizeof(ext_context));
+#ifdef WITH_SMDI
+ if (!strcasecmp(externnotify, "smdi")) {
+ if (ast_app_has_voicemail(ext_context, NULL))
+ ast_smdi_mwi_set(smdi_iface, extension);
+ else
+ ast_smdi_mwi_unset(smdi_iface, extension);
+
+ if ((mwi_msg = ast_smdi_mwi_message_wait(smdi_iface, SMDI_MWI_WAIT_TIMEOUT))) {
+ ast_log(LOG_ERROR, "Error executing SMDI MWI change for %s on %s\n", extension, smdi_iface->name);
+ if (!strncmp(mwi_msg->cause, "INV", 3))
+ ast_log(LOG_ERROR, "Invalid MWI extension: %s\n", mwi_msg->fwd_st);
+ else if (!strncmp(mwi_msg->cause, "BLK", 3))
+ ast_log(LOG_WARNING, "MWI light was already on or off for %s\n", mwi_msg->fwd_st);
+ ast_log(LOG_WARNING, "The switch reported '%s'\n", mwi_msg->cause);
+ ASTOBJ_UNREF(mwi_msg, ast_smdi_mwi_message_destroy);
+ } else {
+ ast_log(LOG_DEBUG, "Successfully executed SMDI MWI change for %s on %s\n", extension, smdi_iface->name);
+ }
+ } else if (!ast_strlen_zero(externnotify)) {
+#else
if (!ast_strlen_zero(externnotify)) {
+#endif
if (messagecount(ext_context, &newvoicemails, &oldvoicemails)) {
ast_log(LOG_ERROR, "Problem in calculating number of voicemail messages available for extension %s\n", extension);
} else {
@@ -5842,6 +5872,9 @@
char *cat;
struct ast_variable *var;
char *notifystr = NULL;
+#ifdef WITH_SMDI
+ char *smdistr = NULL;
+#endif
char *astattach;
char *astsearch;
char *astsaycid;
@@ -5951,6 +5984,24 @@
if ((notifystr = ast_variable_retrieve(cfg, "general", "externnotify"))) {
ast_copy_string(externnotify, notifystr, sizeof(externnotify));
ast_log(LOG_DEBUG, "found externnotify: %s\n", externnotify);
+#ifdef WITH_SMDI
+ if (!strcasecmp(externnotify, "smdi")) {
+ ast_log(LOG_DEBUG, "Using SMDI for external voicemail notification\n");
+ if ((smdistr = ast_variable_retrieve(cfg, "general", "smdiport"))) {
+ smdi_iface = ast_smdi_interface_find(smdistr);
+ } else {
+ ast_log(LOG_DEBUG, "No SMDI interface set, trying default (/dev/ttyS0)\n");
+ smdi_iface = ast_smdi_interface_find("/dev/ttyS0");
+ }
+
+ if (!smdi_iface) {
+ ast_log(LOG_ERROR, "No valid SMDI interface specfied, disabling external voicemail notification\n");
+ externnotify[0] = '\0';
+ } else {
+ ast_log(LOG_DEBUG, "Using SMDI port %s\n", smdi_iface->name);
+ }
+ }
+#endif
} else {
externnotify[0] = '\0';
}
Modified: team/oej/subscribemwi/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/cdr.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/cdr.c (original)
+++ team/oej/subscribemwi/cdr.c Sat Feb 11 07:56:02 2006
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster at digium.com>
*
@@ -1181,8 +1181,6 @@
if it does not exist */
if (enabled && batchmode && (!was_enabled || !was_batchmode) && (cdr_thread == AST_PTHREADT_NULL)) {
ast_cond_init(&cdr_pending_cond, NULL);
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (ast_pthread_create(&cdr_thread, &attr, do_cdr, NULL) < 0) {
ast_log(LOG_ERROR, "Unable to start CDR thread.\n");
ast_sched_del(sched, cdr_sched);
Modified: team/oej/subscribemwi/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/cdr/Makefile?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/cdr/Makefile (original)
+++ team/oej/subscribemwi/cdr/Makefile Sat Feb 11 07:56:02 2006
@@ -45,11 +45,11 @@
#
# FreeTDS stuff...
#
-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/freetds/tds.h),)
+ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.63),1)
CFLAGS += -DFREETDS_0_63
else
- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
+ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/include/freetds/tdsver.h | grep -c 0.62),1)
CFLAGS += -DFREETDS_0_62
else
CFLAGS += -DFREETDS_PRE_0_62
Modified: team/oej/subscribemwi/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/channel.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/channel.c (original)
+++ team/oej/subscribemwi/channel.c Sat Feb 11 07:56:02 2006
@@ -72,6 +72,7 @@
#include "asterisk/app.h"
#include "asterisk/transcap.h"
#include "asterisk/devicestate.h"
+#include "asterisk/sha1.h"
struct channel_spy_trans {
int last_format;
@@ -163,6 +164,22 @@
{ AST_CAUSE_INTERWORKING, "Interworking, unspecified" },
};
+
+struct ast_variable *ast_channeltype_list(void)
+{
+ struct chanlist *cl;
+ struct ast_variable *var=NULL, *prev = NULL;
+ AST_LIST_TRAVERSE(&backends, cl, list) {
+ if (prev) {
+ if ((prev->next = ast_variable_new(cl->tech->type, cl->tech->description)))
+ prev = prev->next;
+ } else {
+ var = ast_variable_new(cl->tech->type, cl->tech->description);
+ prev = var;
+ }
+ }
+ return var;
+}
static int show_channeltypes(int fd, int argc, char *argv[])
{
Modified: team/oej/subscribemwi/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/channels/Makefile?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/channels/Makefile (original)
+++ team/oej/subscribemwi/channels/Makefile Sat Feb 11 07:56:02 2006
@@ -63,6 +63,13 @@
ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
CHANNEL_LIBS+=chan_phone.so
+endif
+
+#
+# Asterisk SMDI integration
+#
+ifeq (${WITH_SMDI},1)
+CFLAGS+=-DWITH_SMDI
endif
ifneq ($(wildcard h323/libchanh323.a),)
Modified: team/oej/subscribemwi/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/channels/chan_iax2.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/channels/chan_iax2.c (original)
+++ team/oej/subscribemwi/channels/chan_iax2.c Sat Feb 11 07:56:02 2006
@@ -234,7 +234,8 @@
enum {
IAX_STATE_STARTED = (1 << 0),
IAX_STATE_AUTHENTICATED = (1 << 1),
- IAX_STATE_TBD = (1 << 2)
+ IAX_STATE_TBD = (1 << 2),
+ IAX_STATE_UNCHANGED = (1 << 3),
} iax2_state;
struct iax2_context {
@@ -5011,7 +5012,7 @@
int x;
int expire = 0;
- ast_clear_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED);
+ ast_clear_flag(&iaxs[callno]->state, IAX_STATE_AUTHENTICATED | IAX_STATE_UNCHANGED);
iaxs[callno]->peer[0] = '\0';
if (ies->username)
ast_copy_string(peer, ies->username, sizeof(peer));
@@ -5056,6 +5057,8 @@
destroy_peer(p);
return -1;
}
+ if (!inaddrcmp(&p->addr, sin))
+ ast_set_flag(&iaxs[callno]->state, IAX_STATE_UNCHANGED);
ast_copy_string(iaxs[callno]->secret, p->secret, sizeof(iaxs[callno]->secret));
ast_copy_string(iaxs[callno]->inkeys, p->inkeys, sizeof(iaxs[callno]->inkeys));
/* Check secret against what we have on file */
@@ -7362,7 +7365,8 @@
auth_fail(fr.callno, IAX_COMMAND_REGREJ);
break;
}
- if ((ast_strlen_zero(iaxs[fr.callno]->secret) && ast_strlen_zero(iaxs[fr.callno]->inkeys)) || ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_AUTHENTICATED)) {
+ if ((ast_strlen_zero(iaxs[fr.callno]->secret) && ast_strlen_zero(iaxs[fr.callno]->inkeys)) ||
+ ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_AUTHENTICATED | IAX_STATE_UNCHANGED)) {
if (f.subclass == IAX_COMMAND_REGREL)
memset(&sin, 0, sizeof(sin));
if (update_registry(iaxs[fr.callno]->peer, &sin, fr.callno, ies.devicetype, fd, ies.refresh))
@@ -8131,6 +8135,7 @@
peer->pokefreqok = DEFAULT_FREQ_OK;
peer->pokefreqnotok = DEFAULT_FREQ_NOTOK;
peer->context[0] = '\0';
+ peer->peercontext[0] = '\0';
while(v) {
if (!strcasecmp(v->name, "secret")) {
if (!ast_strlen_zero(peer->secret)) {
Modified: team/oej/subscribemwi/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/channels/chan_local.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/channels/chan_local.c (original)
+++ team/oej/subscribemwi/channels/chan_local.c Sat Feb 11 07:56:02 2006
@@ -69,9 +69,6 @@
#define IS_OUTBOUND(a,b) (a == b->chan ? 1 : 0)
-/* Protect the interface list (of sip_pvt's) */
-AST_MUTEX_DEFINE_STATIC(locallock);
-
static struct ast_channel *local_request(const char *type, int format, void *data, int *cause);
static int local_digit(struct ast_channel *ast, char digit);
static int local_call(struct ast_channel *ast, char *dest, int timeout);
@@ -101,7 +98,7 @@
.send_html = local_sendhtml,
};
-static struct local_pvt {
+struct local_pvt {
ast_mutex_t lock; /* Channel private lock */
char context[AST_MAX_CONTEXT]; /* Context to call */
char exten[AST_MAX_EXTENSION]; /* Extension to call */
@@ -113,8 +110,10 @@
int nooptimization; /* Don't leave masq state */
struct ast_channel *owner; /* Master Channel */
struct ast_channel *chan; /* Outbound channel */
- struct local_pvt *next; /* Next entity */
-} *locals = NULL;
+ AST_LIST_ENTRY(local_pvt) list; /* Next entity */
+};
+
+static AST_LIST_HEAD_STATIC(locals, local_pvt);
static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_frame *f, struct ast_channel *us)
{
@@ -357,23 +356,19 @@
#if 0
static void local_destroy(struct local_pvt *p)
{
- struct local_pvt *cur, *prev = NULL;
- ast_mutex_lock(&locallock);
- cur = locals;
- while(cur) {
+ struct local_pvt *cur;
+
+ AST_LIST_LOCK(&locals);
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&locals, cur, list) {
if (cur == p) {
- if (prev)
- prev->next = cur->next;
- else
- locals = cur->next;
- ast_mutex_destroy(cur);
+ AST_LIST_REMOVE_CURRENT(&locals, list);
+ ast_mutex_destroy(&cur->lock);
free(cur);
break;
}
- prev = cur;
- cur = cur->next;
- }
- ast_mutex_unlock(&locallock);
+ }
+ AST_LIST_TRAVERSE_SAFE_END
+ AST_LIST_UNLOCK(&locals);
if (!cur)
ast_log(LOG_WARNING, "Unable ot find local '%s@%s' in local list\n", p->exten, p->context);
}
@@ -385,7 +380,6 @@
struct local_pvt *p = ast->tech_pvt;
int isoutbound;
struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
- struct local_pvt *cur, *prev=NULL;
struct ast_channel *ochan = NULL;
int glaredetect;
const char *status;
@@ -394,7 +388,7 @@
isoutbound = IS_OUTBOUND(ast, p);
if (isoutbound) {
status = pbx_builtin_getvar_helper(p->chan, "DIALSTATUS");
- if(status)
+ if ((status) && (p->owner))
pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status);
p->chan = NULL;
p->launchedpbx = 0;
@@ -415,20 +409,9 @@
p->cancelqueue = 1;
ast_mutex_unlock(&p->lock);
/* Remove from list */
- ast_mutex_lock(&locallock);
- cur = locals;
- while(cur) {
- if (cur == p) {
- if (prev)
- prev->next = cur->next;
- else
- locals = cur->next;
- break;
- }
- prev = cur;
- cur = cur->next;
- }
- ast_mutex_unlock(&locallock);
+ AST_LIST_LOCK(&locals);
+ AST_LIST_REMOVE(&locals, p, list);
+ AST_LIST_UNLOCK(&locals);
/* Grab / release lock just in case */
ast_mutex_lock(&p->lock);
ast_mutex_unlock(&p->lock);
@@ -484,10 +467,9 @@
tmp = NULL;
} else {
/* Add to list */
- ast_mutex_lock(&locallock);
- tmp->next = locals;
- locals = tmp;
- ast_mutex_unlock(&locallock);
+ AST_LIST_LOCK(&locals);
+ AST_LIST_INSERT_HEAD(&locals, tmp, list);
+ AST_LIST_UNLOCK(&locals);
}
return tmp;
@@ -563,17 +545,15 @@
if (argc != 3)
return RESULT_SHOWUSAGE;
- ast_mutex_lock(&locallock);
- p = locals;
- while(p) {
+ if (AST_LIST_EMPTY(&locals))
+ ast_cli(fd, "No local channels in use\n");
+ AST_LIST_LOCK(&locals);
+ AST_LIST_TRAVERSE(&locals, p, list) {
ast_mutex_lock(&p->lock);
ast_cli(fd, "%s -- %s@%s\n", p->owner ? p->owner->name : "<unowned>", p->exten, p->context);
ast_mutex_unlock(&p->lock);
- p = p->next;
- }
- if (!locals)
- ast_cli(fd, "No local channels in use\n");
- ast_mutex_unlock(&locallock);
+ }
+ AST_LIST_UNLOCK(&locals);
return RESULT_SUCCESS;
}
@@ -611,16 +591,14 @@
/* First, take us out of the channel loop */
ast_cli_unregister(&cli_show_locals);
ast_channel_unregister(&local_tech);
- if (!ast_mutex_lock(&locallock)) {
+ if (!AST_LIST_LOCK(&locals)) {
/* Hangup all interfaces if they have an owner */
- p = locals;
- while(p) {
+ AST_LIST_TRAVERSE(&locals, p, list) {
if (p->owner)
ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
- p = p->next;
}
- locals = NULL;
- ast_mutex_unlock(&locallock);
+ AST_LIST_UNLOCK(&locals);
+ AST_LIST_HEAD_DESTROY(&locals);
} else {
ast_log(LOG_WARNING, "Unable to lock the monitor\n");
return -1;
Modified: team/oej/subscribemwi/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/channels/chan_mgcp.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/channels/chan_mgcp.c (original)
+++ team/oej/subscribemwi/channels/chan_mgcp.c Sat Feb 11 07:56:02 2006
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster at digium.com>
*
@@ -3528,10 +3528,6 @@
static int restart_monitor(void)
{
- pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
/* If we're supposed to be stopped -- stay stopped */
if (monitor_thread == AST_PTHREADT_STOP)
return 0;
@@ -3549,7 +3545,7 @@
pthread_kill(monitor_thread, SIGURG);
} else {
/* Start a new monitor */
- if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
+ if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
ast_mutex_unlock(&monlock);
ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
return -1;
Modified: team/oej/subscribemwi/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/oej/subscribemwi/channels/chan_misdn.c?rev=9521&r1=9520&r2=9521&view=diff
==============================================================================
--- team/oej/subscribemwi/channels/chan_misdn.c (original)
+++ team/oej/subscribemwi/channels/chan_misdn.c Sat Feb 11 07:56:02 2006
@@ -120,6 +120,7 @@
MISDN_EXTCANTMATCH, /*!< when asterisk couldnt match our ext */
MISDN_DIALING, /*!< when pbx_start */
MISDN_PROGRESS, /*!< we got a progress */
+ MISDN_PROCEEDING, /*!< we got a progress */
MISDN_CALLING, /*!< when misdn_call is called */
MISDN_CALLING_ACKNOWLEDGE, /*!< when we get SETUP_ACK */
MISDN_ALERTING, /*!< when Alerting */
@@ -158,6 +159,8 @@
int ast_dsp;
+ int jb_len;
+ int jb_upper_threshold;
struct misdn_jb *jb;
struct ast_dsp *dsp;
@@ -595,27 +598,29 @@
return NULL;
}
-static int misdn_reload (int fd, int argc, char *argv[])
+
+
+void reload_config(void)
{
int i, cfg_debug;
-
- ast_cli(fd, "Reloading mISDN Config\n");
chan_misdn_log(-1, 0, "Dynamic Crypting Activation is not support during reload at the moment\n");
free_robin_list();
-
misdn_cfg_reload();
-
misdn_cfg_update_ptp();
-
misdn_cfg_get( 0, MISDN_GEN_TRACEFILE, global_tracefile, BUFFERSIZE);
-
misdn_cfg_get( 0, MISDN_GEN_DEBUG, &cfg_debug, sizeof(int));
+
for (i = 0; i <= max_ports; i++) {
misdn_debug[i] = cfg_debug;
misdn_debug_only[i] = 0;
}
-
+}
+
+static int misdn_reload (int fd, int argc, char *argv[])
+{
+ ast_cli(fd, "Reloading mISDN Config\n");
+ reload_config();
return 0;
}
@@ -888,7 +893,7 @@
return RESULT_SUCCESS ;
}
-static char *complete_ch_helper(char *line, char *word, int pos, int state, int rpos)
+static char *complete_ch_helper(const char *line, const char *word, int pos, int state, int rpos)
{
struct ast_channel *c;
int which=0;
@@ -912,12 +917,12 @@
return ret;
}
-static char *complete_ch(char *line, char *word, int pos, int state)
+static char *complete_ch(const char *line, const char *word, int pos, int state)
{
return complete_ch_helper(line, word, pos, state, 3);
}
-static char *complete_debug_port (char *line, char *word, int pos, int state)
+static char *complete_debug_port (const char *line, const char *word, int pos, int state)
{
if (state)
return NULL;
@@ -1138,6 +1143,40 @@
}
+
+
+void config_jitterbuffer(struct chan_list *ch)
+{
+ struct misdn_bchannel *bc=ch->bc;
+ int len=ch->jb_len, threshold=ch->jb_upper_threshold;
+
+ chan_misdn_log(1,bc->port, "config_jb: Called\n");
+
+ if ( ! len ) {
+ chan_misdn_log(1,bc->port, "config_jb: Deactivating Jitterbuffer\n");
+ bc->nojitter=1;
+ } else {
+
+ if (len <=100 || len > 8000) {
+ chan_misdn_log(-1,bc->port,"config_jb: Jitterbuffer out of Bounds, setting to 1000\n");
+ len=1000;
+ }
+
+ if ( threshold > len ) {
+ chan_misdn_log(-1,bc->port,"config_jb: Jitterbuffer Threshold > Jitterbuffer setting to Jitterbuffer -1\n");
+ }
+
+ if ( ch->jb) {
+ cb_log(0,bc->port,"config_jb: We've got a Jitterbuffer Already on this port.\n");
+ misdn_jb_destroy(ch->jb);
+ ch->jb=NULL;
+ }
+
+ ch->jb=misdn_jb_init(len, threshold);
+ }
+}
+
+
static int read_config(struct chan_list *ch, int orig) {
if (!ch) {
@@ -1178,33 +1217,10 @@
/*Initialize new Jitterbuffer*/
{
- int jb_len,jb_upper_threshold;
- misdn_cfg_get( port, MISDN_CFG_JITTERBUFFER, &jb_len, sizeof(int));
- misdn_cfg_get( port, MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD, &jb_upper_threshold, sizeof(int));
-
- if ( ! jb_len ) {
- chan_misdn_log(1,bc->port, "read_config: Deactivating Jitterbuffer\n");
- bc->nojitter=1;
- } else {
-
- if (jb_len <=100 || jb_len > 8000) {
- chan_misdn_log(-1,bc->port,"read_config: Jitterbuffer out of Bounds, setting to 1000\n");
- jb_len=1000;
- }
-
- if ( jb_upper_threshold > jb_len ) {
- chan_misdn_log(-1,bc->port,"read_config: Jitterbuffer Threshold > Jitterbuffer setting to Jitterbuffer -1\n");
- }
-
-
- if ( ch->jb) {
- cb_log(0,bc->port,"read_config: We've got a Jitterbuffer Already on this port.\n");
- misdn_jb_destroy(ch->jb);
- ch->jb=NULL;
- }
-
- ch->jb=misdn_jb_init(jb_len, jb_upper_threshold);
- }
+ misdn_cfg_get( port, MISDN_CFG_JITTERBUFFER, &ch->jb_len, sizeof(int));
+ misdn_cfg_get( port, MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD, &ch->jb_upper_threshold, sizeof(int));
+
+ config_jitterbuffer(ch);
}
misdn_cfg_get( bc->port, MISDN_CFG_CONTEXT, ch->context, sizeof(ch->context));
@@ -1418,14 +1434,7 @@
struct misdn_bchannel *newbc;
char *opts=NULL, *ext,*tokb;
char dest_cp[256];
- struct ast_channel *bridged;
-
- if ( (bridged=ast_bridged_channel(ast)) ) {
- chan_misdn_log(0,0,"Our Bridged Partner is %s\n",bridged->tech->type);
- } else {
- chan_misdn_log(0,0,"No Bridged Partner\n");
- }
-
+
{
strncpy(dest_cp,dest,sizeof(dest_cp)-1);
dest_cp[sizeof(dest_cp)]=0;
@@ -1480,7 +1489,7 @@
strncpy(ast->exten,ext,sizeof(ast->exten));
- chan_misdn_log(1, 0, "* CALL: %s\n",dest);
+ chan_misdn_log(1, port, "* CALL: %s\n",dest);
chan_misdn_log(1, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
@@ -1521,7 +1530,7 @@
if (opts)
misdn_set_opt_exec(ast,opts);
else
- chan_misdn_log(1,0,"NO OPTS GIVEN\n");
+ chan_misdn_log(2,port,"NO OPTS GIVEN\n");
ch->state=MISDN_CALLING;
@@ -1767,7 +1776,11 @@
break;
case -1 :
chan_misdn_log(1, p->bc->port, " --> * IND :\t-1! (stop indication) pid:%d\n",p->bc?p->bc->pid:-1);
- tone_indicate(p, TONE_NONE);
+
+ if (p->state == MISDN_CONNECTED)
+ start_bc_tones(p);
+ else
+ tone_indicate(p, TONE_NONE);
break;
case AST_CONTROL_HOLD:
@@ -1865,6 +1878,8 @@
break;
case MISDN_ALERTING:
+ case MISDN_PROGRESS:
+ case MISDN_PROCEEDING:
chan_misdn_log(2, bc->port, " --> * State Alerting\n");
if (p->orginator != ORG_AST)
@@ -2342,8 +2357,8 @@
}
if (!newbc) {
- chan_misdn_log(1, 0, " --> ! No free channel chan ext:%s even after Group Call\n",ext);
- chan_misdn_log(1, 0, " --> SEND: State Down\n");
+ chan_misdn_log(-1, 0, " --> ! No free channel chan ext:%s even after Group Call\n",ext);
+ chan_misdn_log(-1, 0, " --> SEND: State Down\n");
return NULL;
}
@@ -2773,7 +2788,6 @@
} else {
chan_misdn_log(2, bc->port, "* --> Hangup\n");
ast_queue_hangup(ast);
- //ast_hangup(ast);
}
break;
@@ -2817,7 +2831,6 @@
holded_chan->state=MISDN_CONNECTED;
holded_chan->holded=0;
misdn_lib_transfer(holded_chan->bc?holded_chan->bc:holded_chan->holded_bc);
-
ast_channel_masquerade(holded_chan->ast, AST_BRIDGED_P(tmp_ch->ast));
}
@@ -2832,7 +2845,6 @@
strncpy(predial, ast->exten, sizeof(predial) -1 );
ch->state=MISDN_DIALING;
-
if (bc->nt) {
int ret;
@@ -2845,7 +2857,6 @@
ret = misdn_lib_send_event(bc, EVENT_PROCEEDING );
}
}
-
tone_indicate(ch,TONE_DIAL);
chan_misdn_log(1, bc->port, "* Starting Ast ctx:%s dad:%s oad:%s with 's' extension\n", ast->context, ast->exten, AST_CID_P(ast));
@@ -3010,6 +3021,21 @@
}
/* chan_misdn_log(5, bc->port, "Can Match Extension: dad:%s oad:%s\n",bc->dad,bc->oad);*/
+ /* Check for Pickup Request first */
+ if (!strcmp(ch->ast->exten, ast_pickup_ext())) {
+ int ret;/** Sending SETUP_ACK**/
+ ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+ if (ast_pickup_call(ch->ast)) {
+ ast_hangup(ch->ast);
+ } else {
+ struct ast_channel *chan=ch->ast;
+ ch->state = MISDN_CALLING_ACKNOWLEDGE;
+ ch->ast=NULL;
+ ast_setstate(chan, AST_STATE_DOWN);
+ ast_hangup(chan);
+ break;
+ }
+ }
if(!ast_canmatch_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
@@ -3130,7 +3156,21 @@
/** queue new chan **/
cl_queue_chan(&cl_te, ch) ;
-
+
+ /* Check for Pickup Request first */
+ if (!strcmp(chan->exten, ast_pickup_ext())) {
+ int ret;/** Sending SETUP_ACK**/
+ ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+ if (ast_pickup_call(chan)) {
+ ast_hangup(chan);
+ } else {
+ ch->state = MISDN_CALLING_ACKNOWLEDGE;
+ ch->ast=NULL;
+ ast_setstate(chan, AST_STATE_DOWN);
+ ast_hangup(chan);
+ break;
+ }
+ }
/*
[... 4771 lines stripped ...]
More information about the asterisk-commits
mailing list