[svn-commits] branch oej/siptransfer r19511 - in
/team/oej/siptransfer: ./ apps/ channels/ ...
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Wed Apr 12 12:53:12 MST 2006
Author: oej
Date: Wed Apr 12 14:52:47 2006
New Revision: 19511
URL: http://svn.digium.com/view/asterisk?rev=19511&view=rev
Log:
Reset automerge
Modified:
team/oej/siptransfer/ (props changed)
team/oej/siptransfer/Makefile
team/oej/siptransfer/UPGRADE.txt
team/oej/siptransfer/acl.c
team/oej/siptransfer/apps/app_adsiprog.c
team/oej/siptransfer/apps/app_alarmreceiver.c
team/oej/siptransfer/apps/app_amd.c
team/oej/siptransfer/apps/app_authenticate.c
team/oej/siptransfer/apps/app_chanisavail.c
team/oej/siptransfer/apps/app_channelredirect.c
team/oej/siptransfer/apps/app_controlplayback.c
team/oej/siptransfer/apps/app_db.c
team/oej/siptransfer/apps/app_dial.c
team/oej/siptransfer/apps/app_directory.c
team/oej/siptransfer/apps/app_page.c
team/oej/siptransfer/apps/app_voicemail.c
team/oej/siptransfer/asterisk.c
team/oej/siptransfer/channel.c
team/oej/siptransfer/channels/chan_iax2.c
team/oej/siptransfer/channels/chan_sip.c
team/oej/siptransfer/channels/chan_skinny.c
team/oej/siptransfer/channels/misdn/isdn_lib.c
team/oej/siptransfer/configs/iax.conf.sample
team/oej/siptransfer/doc/00README.1st
team/oej/siptransfer/include/asterisk.h
team/oej/siptransfer/include/asterisk/linkedlists.h
team/oej/siptransfer/include/asterisk/lock.h
team/oej/siptransfer/include/asterisk/module.h
team/oej/siptransfer/loader.c
team/oej/siptransfer/manager.c
team/oej/siptransfer/pbx/pbx_config.c
team/oej/siptransfer/res/res_agi.c
team/oej/siptransfer/res/res_clioriginate.c
team/oej/siptransfer/res/res_config_odbc.c
team/oej/siptransfer/res/res_config_pgsql.c
team/oej/siptransfer/res/res_convert.c
team/oej/siptransfer/res/res_crypto.c
team/oej/siptransfer/translate.c
Propchange: team/oej/siptransfer/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/siptransfer/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/siptransfer/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Apr 12 14:52:47 2006
@@ -1,1 +1,1 @@
-/trunk:1-19122
+/trunk:1-19510
Modified: team/oej/siptransfer/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/Makefile?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/Makefile (original)
+++ team/oej/siptransfer/Makefile Wed Apr 12 14:52:47 2006
@@ -674,7 +674,6 @@
if [ -n "$(OLDHEADERS)" ]; then \
rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
fi
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
@@ -693,7 +692,6 @@
else \
echo "You need to do cvs update -d not just cvs update" ; \
fi
- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
@echo " +---- Asterisk Installation Complete -------+"
@echo " + +"
Modified: team/oej/siptransfer/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/UPGRADE.txt?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/UPGRADE.txt (original)
+++ team/oej/siptransfer/UPGRADE.txt Wed Apr 12 14:52:47 2006
@@ -35,6 +35,15 @@
using indication tones, so typing in skip would give you unexpected results.
* OSPAuth is added to authenticate OSP tokens in in_bound call setup messages.
+
+Manager:
+
+* After executing the 'status' manager action, the "Status" manager events
+ included the header "CallerID:" which was actually only the CallerID number,
+ and not the full CallerID string. This header has been renamed to
+ "CallerIDNum". For compatibility purposes, the CallerID parameter will remain
+ until after the release of 1.4, when it will be removed. Please use the time
+ during the 1.4 release to make this transition.
Variables:
Modified: team/oej/siptransfer/acl.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/acl.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/acl.c (original)
+++ team/oej/siptransfer/acl.c Wed Apr 12 14:52:47 2006
@@ -70,10 +70,6 @@
#include "asterisk/lock.h"
#include "asterisk/srv.h"
#include "asterisk/compat.h"
-
-#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
-AST_MUTEX_DEFINE_STATIC(routeseq_lock);
-#endif
struct ast_ha {
/* Host access rule */
Modified: team/oej/siptransfer/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_adsiprog.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_adsiprog.c (original)
+++ team/oej/siptransfer/apps/app_adsiprog.c Wed Apr 12 14:52:47 2006
@@ -48,8 +48,6 @@
#include "asterisk/options.h"
#include "asterisk/utils.h"
#include "asterisk/lock.h"
-
-static char *tdesc = "Asterisk ADSI Programming Application";
static char *app = "ADSIProg";
@@ -1588,7 +1586,7 @@
const char *description(void)
{
- return tdesc;
+ return "Asterisk ADSI Programming Application";
}
int usecount(void)
@@ -1598,7 +1596,7 @@
return res;
}
-const char *key()
+const char *key(void)
{
return ASTERISK_GPL_KEY;
}
Modified: team/oej/siptransfer/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_alarmreceiver.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_alarmreceiver.c (original)
+++ team/oej/siptransfer/apps/app_alarmreceiver.c Wed Apr 12 14:52:47 2006
@@ -67,8 +67,6 @@
};
typedef struct event_node event_node_t;
-
-static char *tdesc = "Alarm Receiver for Asterisk";
static char *app = "AlarmReceiver";
@@ -839,7 +837,7 @@
const char *description(void)
{
- return tdesc;
+ return "Alarm Receiver for Asterisk";
}
int usecount(void)
@@ -849,7 +847,7 @@
return res;
}
-const char *key()
+const char *key(void)
{
return ASTERISK_GPL_KEY;
}
Modified: team/oej/siptransfer/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_amd.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_amd.c (original)
+++ team/oej/siptransfer/apps/app_amd.c Wed Apr 12 14:52:47 2006
@@ -35,7 +35,6 @@
#include "asterisk/app.h"
-static char *tdesc = "Answering Machine Detection Application";
static char *app = "AMD";
static char *synopsis = "Attempts to detect answering machines";
static char *descrip =
@@ -413,7 +412,7 @@
const char *description(void)
{
- return tdesc;
+ return "Answering Machine Detection Application";
}
int usecount(void)
@@ -423,7 +422,7 @@
return res;
}
-const char *key()
+const char *key(void)
{
return ASTERISK_GPL_KEY;
}
Modified: team/oej/siptransfer/apps/app_authenticate.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_authenticate.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_authenticate.c (original)
+++ team/oej/siptransfer/apps/app_authenticate.c Wed Apr 12 14:52:47 2006
@@ -62,7 +62,6 @@
AST_APP_OPTION('r', OPT_REMOVE),
});
-static char *tdesc = "Authentication Application";
static char *app = "Authenticate";
@@ -254,7 +253,7 @@
const char *description(void)
{
- return tdesc;
+ return "Authentication Application";
}
int usecount(void)
@@ -264,7 +263,7 @@
return res;
}
-const char *key()
+const char *key(void)
{
return ASTERISK_GPL_KEY;
}
Modified: team/oej/siptransfer/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_chanisavail.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_chanisavail.c (original)
+++ team/oej/siptransfer/apps/app_chanisavail.c Wed Apr 12 14:52:47 2006
@@ -47,8 +47,6 @@
#include "asterisk/app.h"
#include "asterisk/devicestate.h"
#include "asterisk/options.h"
-
-static char *tdesc = "Check channel availability";
static char *app = "ChanIsAvail";
@@ -175,7 +173,7 @@
const char *description(void)
{
- return tdesc;
+ return "Check channel availability";
}
int usecount(void)
@@ -185,7 +183,7 @@
return res;
}
-const char *key()
+const char *key(void)
{
return ASTERISK_GPL_KEY;
}
Modified: team/oej/siptransfer/apps/app_channelredirect.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_channelredirect.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_channelredirect.c (original)
+++ team/oej/siptransfer/apps/app_channelredirect.c Wed Apr 12 14:52:47 2006
@@ -41,7 +41,6 @@
#include "asterisk/app.h"
#include "asterisk/features.h"
-static char *tdesc = "Channel Redirect";
static char *app = "ChannelRedirect";
static char *synopsis = "Redirects given channel to a dialplan target.";
static char *descrip =
@@ -139,7 +138,7 @@
const char *description(void)
{
- return tdesc;
+ return "Channel Redirect";
}
int usecount(void)
@@ -151,7 +150,7 @@
return res;
}
-const char *key()
+const char *key(void)
{
return ASTERISK_GPL_KEY;
}
Modified: team/oej/siptransfer/apps/app_controlplayback.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_controlplayback.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_controlplayback.c (original)
+++ team/oej/siptransfer/apps/app_controlplayback.c Wed Apr 12 14:52:47 2006
@@ -43,8 +43,6 @@
#include "asterisk/translate.h"
#include "asterisk/utils.h"
#include "asterisk/options.h"
-
-static const char *tdesc = "Control Playback Application";
static const char *app = "ControlPlayback";
@@ -174,7 +172,7 @@
const char *description(void)
{
- return (char *) tdesc;
+ return "Control Playback Application";
}
int usecount(void)
@@ -185,7 +183,7 @@
return res;
}
-const char *key()
+const char *key(void)
{
return ASTERISK_GPL_KEY;
}
Modified: team/oej/siptransfer/apps/app_db.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_db.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_db.c (original)
+++ team/oej/siptransfer/apps/app_db.c Wed Apr 12 14:52:47 2006
@@ -47,8 +47,6 @@
#include "asterisk/astdb.h"
#include "asterisk/lock.h"
#include "asterisk/options.h"
-
-static char *tdesc = "Database Access Functions";
static char *d_descrip =
" DBdel(family/key): This applicaiton will delete a key from the Asterisk\n"
@@ -169,7 +167,7 @@
const char *description(void)
{
- return tdesc;
+ return "Database Access Functions";
}
int usecount(void)
@@ -179,7 +177,7 @@
return res;
}
-const char *key()
+const char *key(void)
{
return ASTERISK_GPL_KEY;
}
Modified: team/oej/siptransfer/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_dial.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_dial.c (original)
+++ team/oej/siptransfer/apps/app_dial.c Wed Apr 12 14:52:47 2006
@@ -60,8 +60,6 @@
#include "asterisk/manager.h"
#include "asterisk/privacy.h"
#include "asterisk/stringfields.h"
-
-static char *tdesc = "Dialing Application";
static char *app = "Dial";
@@ -308,6 +306,8 @@
if (chan->cdr) \
ast_cdr_failed(chan->cdr); \
numnochan++; \
+ break; \
+ case AST_CAUSE_NORMAL_CLEARING: \
break; \
default: \
numnochan++; \
@@ -734,12 +734,12 @@
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags)
{
- int res=-1;
+ int res = -1;
struct localuser *u;
char *tech, *number, *rest, *cur;
char privcid[256];
char privintro[1024];
- struct dial_localuser *outgoing=NULL, *tmp;
+ struct dial_localuser *outgoing = NULL, *tmp;
struct ast_channel *peer;
int to;
int numbusy = 0;
@@ -750,20 +750,20 @@
char cidname[AST_MAX_EXTENSION];
char toast[80];
char *l;
- int privdb_val=0;
- unsigned int calldurationlimit=0;
+ int privdb_val = 0;
+ unsigned int calldurationlimit = 0;
struct ast_bridge_config config;
long timelimit = 0;
long play_warning = 0;
- long warning_freq=0;
- const char *warning_sound=NULL;
- const char *end_sound=NULL;
- const char *start_sound=NULL;
- char *dtmfcalled=NULL, *dtmfcalling=NULL;
+ long warning_freq = 0;
+ const char *warning_sound = NULL;
+ const char *end_sound = NULL;
+ const char *start_sound = NULL;
+ char *dtmfcalled = NULL, *dtmfcalling = NULL;
const char *var;
char status[256];
- int play_to_caller=0,play_to_callee=0;
- int sentringing=0, moh=0;
+ int play_to_caller = 0, play_to_callee = 0;
+ int sentringing = 0, moh = 0;
const char *outbound_group = NULL;
const char *macro_result = NULL;
char *macro_transfer_dest = NULL;
@@ -810,8 +810,13 @@
if (ast_test_flag(&opts, OPT_DURATION_STOP) && !ast_strlen_zero(opt_args[OPT_ARG_DURATION_STOP])) {
calldurationlimit = atoi(opt_args[OPT_ARG_DURATION_STOP]);
+ if (!calldurationlimit) {
+ ast_log(LOG_WARNING, "Dial does not accept S(%s), hanging up.\n", opt_args[OPT_ARG_DURATION_STOP]);
+ LOCAL_USER_REMOVE(u);
+ return -1;
+ }
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n", calldurationlimit);
+ ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n", calldurationlimit);
}
if (ast_test_flag(&opts, OPT_SENDDTMF) && !ast_strlen_zero(opt_args[OPT_ARG_SENDDTMF])) {
@@ -835,8 +840,24 @@
warning_freq = atol(warnfreq_str);
if (!timelimit) {
- timelimit = play_to_caller = play_to_callee = play_warning = warning_freq = 0;
- warning_sound = NULL;
+ ast_log(LOG_WARNING, "Dial does not accept L(%s), hanging up.\n", limit_str);
+ LOCAL_USER_REMOVE(u);
+ return -1;
+ } else if (play_warning > timelimit) {
+ /* If the first warning is requested _after_ the entire call would end,
+ and no warning frequency is requested, then turn off the warning. If
+ a warning frequency is requested, reduce the 'first warning' time by
+ that frequency until it falls within the call's total time limit.
+ */
+
+ if (!warning_freq) {
+ play_warning = 0;
+ } else {
+ while (play_warning > timelimit)
+ play_warning -= warning_freq;
+ if (play_warning < 1)
+ play_warning = warning_freq = 0;
+ }
}
var = pbx_builtin_getvar_helper(chan,"LIMIT_PLAYAUDIO_CALLER");
@@ -846,33 +867,35 @@
play_to_callee = var ? ast_true(var) : 0;
if (!play_to_caller && !play_to_callee)
- play_to_caller=1;
+ play_to_caller = 1;
var = pbx_builtin_getvar_helper(chan,"LIMIT_WARNING_FILE");
- warning_sound = var ? var : "timeleft";
+ warning_sound = (!ast_strlen_zero(var)) ? var : "timeleft";
var = pbx_builtin_getvar_helper(chan,"LIMIT_TIMEOUT_FILE");
- end_sound = var ? var : NULL;
+ end_sound = (!ast_strlen_zero(var)) ? var : NULL;
var = pbx_builtin_getvar_helper(chan,"LIMIT_CONNECT_FILE");
- start_sound = var ? var : NULL;
+ start_sound = (!ast_strlen_zero(var)) ? var : NULL;
/* undo effect of S(x) in case they are both used */
- calldurationlimit = 0;
- /* more efficient do it like S(x) does since no advanced opts*/
- if (!play_warning && !start_sound && !end_sound && timelimit) {
- calldurationlimit = timelimit/1000;
+ calldurationlimit = 0;
+ /* more efficient to do it like S(x) does since no advanced opts */
+ if (!play_warning && !start_sound && !end_sound && timelimit) {
+ calldurationlimit = timelimit / 1000;
+ if (option_verbose > 2)
+ ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n", calldurationlimit);
timelimit = play_to_caller = play_to_callee = play_warning = warning_freq = 0;
} else if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "Limit Data for this call:\n");
- ast_verbose(VERBOSE_PREFIX_3 "- timelimit = %ld\n", timelimit);
- ast_verbose(VERBOSE_PREFIX_3 "- play_warning = %ld\n", play_warning);
- ast_verbose(VERBOSE_PREFIX_3 "- play_to_caller= %s\n", play_to_caller ? "yes" : "no");
- ast_verbose(VERBOSE_PREFIX_3 "- play_to_callee= %s\n", play_to_callee ? "yes" : "no");
- ast_verbose(VERBOSE_PREFIX_3 "- warning_freq = %ld\n", warning_freq);
- ast_verbose(VERBOSE_PREFIX_3 "- start_sound = %s\n", start_sound ? start_sound : "UNDEF");
- ast_verbose(VERBOSE_PREFIX_3 "- warning_sound = %s\n", warning_sound ? warning_sound : "UNDEF");
- ast_verbose(VERBOSE_PREFIX_3 "- end_sound = %s\n", end_sound ? end_sound : "UNDEF");
+ ast_verbose(VERBOSE_PREFIX_4 "timelimit = %ld\n", timelimit);
+ ast_verbose(VERBOSE_PREFIX_4 "play_warning = %ld\n", play_warning);
+ ast_verbose(VERBOSE_PREFIX_4 "play_to_caller = %s\n", play_to_caller ? "yes" : "no");
+ ast_verbose(VERBOSE_PREFIX_4 "play_to_callee = %s\n", play_to_callee ? "yes" : "no");
+ ast_verbose(VERBOSE_PREFIX_4 "warning_freq = %ld\n", warning_freq);
+ ast_verbose(VERBOSE_PREFIX_4 "start_sound = %s\n", start_sound);
+ ast_verbose(VERBOSE_PREFIX_4 "warning_sound = %s\n", warning_sound);
+ ast_verbose(VERBOSE_PREFIX_4 "end_sound = %s\n", end_sound);
}
}
@@ -1730,7 +1753,8 @@
STATIC_MODULE const char *description(void)
{
- return tdesc;
+ return "Dialing Application";
+
}
STATIC_MODULE int usecount(void)
Modified: team/oej/siptransfer/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_directory.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_directory.c (original)
+++ team/oej/siptransfer/apps/app_directory.c Wed Apr 12 14:52:47 2006
@@ -65,8 +65,10 @@
" extension that the user has selected, or when jumping to the\n"
" 'o' or 'a' extension.\n\n"
" Options:\n"
+" e - In addition to the name, also read the extension number to the\n"
+" caller before presenting dialing options.\n"
" f - Allow the caller to enter the first name of a user in the directory\n"
-" instead of using the last name.\n";
+" instead of using the last name.\n";
/* For simplicity, I'm keeping the format compatible with the voicemail config,
but i'm open to suggestions for isolating it */
@@ -152,7 +154,7 @@
* '1' for selected entry from directory
* '*' for skipped entry from directory
*/
-static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dialcontext, char *ext, char *name) {
+static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dialcontext, char *ext, char *name, int readext) {
int res = 0;
int loop = 3;
char fn[256];
@@ -172,15 +174,38 @@
res = ast_waitstream(chan, AST_DIGIT_ANY);
}
ast_stopstream(chan);
+ /* If Option 'e' was specified, also read the extension number with the name */
+ if (readext) {
+ res = ast_streamfile(chan, "vm-extension", chan->language);
+ if (!res) {
+ res = ast_waitstream(chan, AST_DIGIT_ANY);
+ }
+ res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
+ }
} else if (ast_fileexists(fn2, NULL, chan->language) > 0) {
res = ast_streamfile(chan, fn2, chan->language);
if (!res) {
res = ast_waitstream(chan, AST_DIGIT_ANY);
}
ast_stopstream(chan);
+ /* If Option 'e' was specified, also read the extension number with the name */
+ if (readext) {
+ res = ast_streamfile(chan, "vm-extension", chan->language);
+ if (!res) {
+ res = ast_waitstream(chan, AST_DIGIT_ANY);
+ }
+ res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
+ }
} else {
res = ast_say_character_str(chan, S_OR(name, ext),
AST_DIGIT_ANY, chan->language);
+ if (!ast_strlen_zero(name) && readext) {
+ res = ast_streamfile(chan, "vm-extension", chan->language);
+ if (!res) {
+ res = ast_waitstream(chan, AST_DIGIT_ANY);
+ }
+ res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
+ }
}
while (loop) {
@@ -289,7 +314,7 @@
return cfg;
}
-static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *context, char *dialcontext, char digit, int last)
+static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *context, char *dialcontext, char digit, int last, int readext)
{
/* Read in the first three digits.. "digit" is the first digit, already read */
char ext[NUMDIGITS + 1];
@@ -368,7 +393,7 @@
if (v) {
/* We have a match -- play a greeting if they have it */
- res = play_mailbox_owner(chan, context, dialcontext, v->name, name);
+ res = play_mailbox_owner(chan, context, dialcontext, v->name, name, readext);
switch (res) {
case -1:
/* user pressed '1' but extension does not exist, or
@@ -415,6 +440,7 @@
struct localuser *u;
struct ast_config *cfg;
int last = 1;
+ int readext = 0;
char *dirintro, *parse;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(vmcontext);
@@ -439,6 +465,8 @@
if (args.options) {
if (strchr(args.options, 'f'))
last = 0;
+ if (strchr(args.options, 'e'))
+ readext = 1;
}
if (ast_strlen_zero(args.dialcontext))
@@ -473,7 +501,7 @@
if (!res)
res = ast_waitfordigit(chan, 5000);
if (res > 0) {
- res = do_directory(chan, cfg, args.vmcontext, args.dialcontext, res, last);
+ res = do_directory(chan, cfg, args.vmcontext, args.dialcontext, res, last, readext);
if (res > 0) {
res = ast_waitstream(chan, AST_DIGIT_ANY);
ast_stopstream(chan);
Modified: team/oej/siptransfer/apps/app_page.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_page.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_page.c (original)
+++ team/oej/siptransfer/apps/app_page.c Wed Apr 12 14:52:47 2006
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (c) 2004 - 2005 Digium, Inc. All rights reserved.
+ * Copyright (c) 2004 - 2006 Digium, Inc. All rights reserved.
*
* Mark Spencer <markster at digium.com>
*
@@ -147,6 +147,7 @@
struct ast_app *app;
char *tmp;
int res=0;
+ char originator[AST_CHANNEL_NAME];
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "This application requires at least one argument (destination(s) to page)\n");
@@ -171,7 +172,16 @@
ast_app_parse_options(page_opts, &flags, NULL, options);
snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%sqxdw", confid, ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m");
+
+ ast_copy_string(originator, chan->name, sizeof(originator));
+ if ((tmp = strchr(originator, '-')))
+ *tmp = '\0';
+
while ((tech = strsep(&tmp, "&"))) {
+ /* don't call the originating device */
+ if (!strcasecmp(tech, originator))
+ continue;
+
if ((resource = strchr(tech, '/'))) {
*resource++ = '\0';
launch_page(chan, meetmeopts, tech, resource);
@@ -179,6 +189,7 @@
ast_log(LOG_WARNING, "Incomplete destination '%s' supplied.\n", tech);
}
}
+
if (!ast_test_flag(&flags, PAGE_QUIET)) {
res = ast_streamfile(chan, "beep", chan->language);
if (!res)
Modified: team/oej/siptransfer/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_voicemail.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_voicemail.c (original)
+++ team/oej/siptransfer/apps/app_voicemail.c Wed Apr 12 14:52:47 2006
@@ -1280,7 +1280,7 @@
len = fdlen; /* SQL_LEN_DATA_AT_EXEC(fdlen); */
SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(dir), 0, (void *)dir, 0, NULL);
SQLBindParameter(stmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(msgnums), 0, (void *)msgnums, 0, NULL);
- SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_BINARY, fdlen, 0, (void *)fdm, fdlen, &len);
+ SQLBindParameter(stmt, 3, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_LONGVARBINARY, fdlen, 0, (void *)fdm, fdlen, &len);
SQLBindParameter(stmt, 4, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(context), 0, (void *)context, 0, NULL);
SQLBindParameter(stmt, 5, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(macrocontext), 0, (void *)macrocontext, 0, NULL);
SQLBindParameter(stmt, 6, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(callerid), 0, (void *)callerid, 0, NULL);
Modified: team/oej/siptransfer/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/asterisk.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/asterisk.c (original)
+++ team/oej/siptransfer/asterisk.c Wed Apr 12 14:52:47 2006
@@ -597,6 +597,8 @@
consoles[x].fd = s;
if (ast_pthread_create(&consoles[x].t, &attr, netconsole, &consoles[x])) {
ast_log(LOG_ERROR, "Unable to spawn thread to handle connection: %s\n", strerror(errno));
+ close(consoles[x].p[0]);
+ close(consoles[x].p[1]);
consoles[x].fd = -1;
fdprint(s, "Server failed to spawn thread\n");
close(s);
Modified: team/oej/siptransfer/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/channel.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/channel.c (original)
+++ team/oej/siptransfer/channel.c Wed Apr 12 14:52:47 2006
@@ -1276,7 +1276,6 @@
struct ast_frame *translated_frame = NULL;
struct ast_channel_spy *spy;
struct ast_channel_spy_queue *queue;
- struct ast_channel_spy_queue *other_queue;
struct channel_spy_trans *trans;
struct ast_frame *last;
@@ -1338,48 +1337,42 @@
if (queue->samples > SPY_QUEUE_SAMPLE_LIMIT) {
if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE) {
- other_queue = (dir == SPY_WRITE) ? &spy->read_queue : &spy->write_queue;
-
- if (other_queue->samples == 0) {
- switch (ast_test_flag(spy, CHANSPY_TRIGGER_MODE)) {
- case CHANSPY_TRIGGER_READ:
- if (dir == SPY_WRITE) {
- ast_set_flag(spy, CHANSPY_TRIGGER_WRITE);
- ast_clear_flag(spy, CHANSPY_TRIGGER_READ);
- if (option_debug)
- ast_log(LOG_DEBUG, "Switching spy '%s' on '%s' to write-trigger mode\n",
- spy->type, chan->name);
- }
- break;
- case CHANSPY_TRIGGER_WRITE:
- if (dir == SPY_READ) {
- ast_set_flag(spy, CHANSPY_TRIGGER_READ);
- ast_clear_flag(spy, CHANSPY_TRIGGER_WRITE);
- if (option_debug)
- ast_log(LOG_DEBUG, "Switching spy '%s' on '%s' to read-trigger mode\n",
- spy->type, chan->name);
- }
- break;
+ switch (ast_test_flag(spy, CHANSPY_TRIGGER_MODE)) {
+ case CHANSPY_TRIGGER_READ:
+ if (dir == SPY_WRITE) {
+ ast_set_flag(spy, CHANSPY_TRIGGER_WRITE);
+ ast_clear_flag(spy, CHANSPY_TRIGGER_READ);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Switching spy '%s' on '%s' to write-trigger mode\n",
+ spy->type, chan->name);
}
- if (option_debug)
- ast_log(LOG_DEBUG, "Triggering queue flush for spy '%s' on '%s'\n",
- spy->type, chan->name);
- ast_set_flag(spy, CHANSPY_TRIGGER_FLUSH);
- ast_cond_signal(&spy->trigger);
- ast_mutex_unlock(&spy->lock);
- continue;
+ break;
+ case CHANSPY_TRIGGER_WRITE:
+ if (dir == SPY_READ) {
+ ast_set_flag(spy, CHANSPY_TRIGGER_READ);
+ ast_clear_flag(spy, CHANSPY_TRIGGER_WRITE);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Switching spy '%s' on '%s' to read-trigger mode\n",
+ spy->type, chan->name);
+ }
+ break;
}
- }
-
- if (option_debug)
- ast_log(LOG_DEBUG, "Spy '%s' on channel '%s' %s queue too long, dropping frames\n",
- spy->type, chan->name, (dir == SPY_READ) ? "read" : "write");
- while (queue->samples > SPY_QUEUE_SAMPLE_LIMIT) {
- struct ast_frame *drop = queue->head;
-
- queue->samples -= drop->samples;
- queue->head = drop->next;
- ast_frfree(drop);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Triggering queue flush for spy '%s' on '%s'\n",
+ spy->type, chan->name);
+ ast_set_flag(spy, CHANSPY_TRIGGER_FLUSH);
+ ast_cond_signal(&spy->trigger);
+ } else {
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Spy '%s' on channel '%s' %s queue too long, dropping frames\n",
+ spy->type, chan->name, (dir == SPY_READ) ? "read" : "write");
+ while (queue->samples > SPY_QUEUE_SAMPLE_LIMIT) {
+ struct ast_frame *drop = queue->head;
+
+ queue->samples -= drop->samples;
+ queue->head = drop->next;
+ ast_frfree(drop);
+ }
}
} else {
switch (ast_test_flag(spy, CHANSPY_TRIGGER_MODE)) {
Modified: team/oej/siptransfer/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/channels/chan_iax2.c?rev=19511&r1=19510&r2=19511&view=diff
==============================================================================
--- team/oej/siptransfer/channels/chan_iax2.c (original)
+++ team/oej/siptransfer/channels/chan_iax2.c Wed Apr 12 14:52:47 2006
@@ -92,6 +92,7 @@
#include "asterisk/devicestate.h"
#include "asterisk/netsock.h"
#include "asterisk/stringfields.h"
+#include "asterisk/linkedlists.h"
#include "iax2.h"
#include "iax2-parser.h"
@@ -134,6 +135,7 @@
#define CALLNO_TO_PTR(a) ((void *)(unsigned long)(a))
#define DEFAULT_THREAD_COUNT 10
+#define DEFAULT_MAX_THREAD_COUNT 100
#define DEFAULT_RETRY_TIME 1000
#define MEMORY_SIZE 100
#define DEFAULT_DROP 3
@@ -444,6 +446,8 @@
static int min_jitter_buffer = MIN_JITTER_BUFFER;
static int iaxthreadcount = DEFAULT_THREAD_COUNT;
+static int iaxmaxthreadcount = DEFAULT_MAX_THREAD_COUNT;
+static int iaxdynamicthreadcount = 0;
struct iax_rr {
int jitter;
@@ -681,8 +685,12 @@
#define IAX_IOSTATE_PROCESSING 2
#define IAX_IOSTATE_SCHEDREADY 3
+#define IAX_TYPE_POOL 1
+#define IAX_TYPE_DYNAMIC 2
+
struct iax2_thread {
- ASTOBJ_COMPONENTS(struct iax2_thread);
+ AST_LIST_ENTRY(iax2_thread) list;
+ int type;
int iostate;
#ifdef SCHED_MULTITHREADED
void (*schedfunc)(void *);
@@ -704,11 +712,12 @@
ast_cond_t cond;
};
-struct iax2_thread_list {
- ASTOBJ_CONTAINER_COMPONENTS(struct iax2_thread);
-};
-
-static struct iax2_thread_list idlelist, activelist;
+/* Thread lists */
+static AST_LIST_HEAD_STATIC(idle_list, iax2_thread);
+static AST_LIST_HEAD_STATIC(active_list, iax2_thread);
+static AST_LIST_HEAD_STATIC(dynamic_list, iax2_thread);
+
+static void *iax2_process_thread(void *data);
static void signal_condition(ast_mutex_t *lock, ast_cond_t *cond)
{
@@ -831,19 +840,57 @@
static struct iax2_thread *find_idle_thread(void)
{
- struct iax2_thread *thread;
- thread = ASTOBJ_CONTAINER_UNLINK_START(&idlelist);
+ struct iax2_thread *thread = NULL;
+
+ /* Find free idle thread in the list, get a pointer to it, and remove it from the list */
+ AST_LIST_LOCK(&idle_list);
+ thread = AST_LIST_FIRST(&idle_list);
+ if (thread != NULL) {
+ AST_LIST_REMOVE(&idle_list, thread, list);
+ }
+ AST_LIST_UNLOCK(&idle_list);
+
+ /* If no idle thread is available from the regular list, try dynamic */
+ if (thread == NULL) {
+ AST_LIST_LOCK(&dynamic_list);
+ thread = AST_LIST_FIRST(&dynamic_list);
+ if (thread != NULL) {
+ AST_LIST_REMOVE(&dynamic_list, thread, list);
+ }
+ /* Make sure we absolutely have a thread... if not, try to make one if allowed */
+ if (thread == NULL && iaxmaxthreadcount > iaxdynamicthreadcount) {
+ /* We need to MAKE a thread! */
+ thread = ast_calloc(1, sizeof(*thread));
+ if (thread != NULL) {
+ thread->threadnum = iaxdynamicthreadcount;
+ thread->type = IAX_TYPE_DYNAMIC;
+ ast_mutex_init(&thread->lock);
+ ast_cond_init(&thread->cond, NULL);
+ if (ast_pthread_create(&thread->threadid, NULL, iax2_process_thread, thread)) {
+ free(thread);
+ thread = NULL;
+ } else {
+ /* All went well and the thread is up, so increment our count */
+ iaxdynamicthreadcount++;
+ }
+ }
+ }
+ AST_LIST_UNLOCK(&dynamic_list);
+ }
+
return thread;
}
#ifdef SCHED_MULTITHREADED
static int __schedule_action(void (*func)(void *data), void *data, const char *funcname)
{
- struct iax2_thread *thread;
+ struct iax2_thread *thread = NULL;
static time_t lasterror;
static time_t t;
+
thread = find_idle_thread();
- if (thread) {
+
+ if (thread != NULL) {
thread->schedfunc = func;
thread->scheddata = data;
thread->iostate = IAX_IOSTATE_SCHEDREADY;
@@ -857,6 +904,7 @@
if (t != lasterror)
ast_log(LOG_NOTICE, "Out of idle IAX2 threads for scheduling!\n");
lasterror = t;
+
return -1;
}
#define schedule_action(func, data) __schedule_action(func, data, __PRETTY_FUNCTION__)
@@ -4419,42 +4467,60 @@
static int iax2_show_threads(int fd, int argc, char *argv[])
{
+ struct iax2_thread *thread = NULL;
time_t t;
- int threadcount = 0;
+ int threadcount = 0, dynamiccount = 0;
+ char type;
+
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, "IAX2 Thread Information\n");
time(&t);
ast_cli(fd, "Idle Threads:\n");
+ AST_LIST_LOCK(&idle_list);
+ AST_LIST_TRAVERSE(&idle_list, thread, list) {
#ifdef DEBUG_SCHED_MULTITHREAD
- ASTOBJ_CONTAINER_TRAVERSE(&idlelist, 1, {
- ast_cli(fd, "Thread %d: state=%d, update=%d, actions=%d, refcnt=%d, func ='%s'\n",
- iterator->threadnum, iterator->iostate, (int)(t - iterator->checktime), iterator->actions, iterator->refcount, iterator->curfunc);
+ ast_cli(fd, "Thread %d: state=%d, update=%d, actions=%d, func ='%s'\n",
+ thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions, thread->curfunc);
+#else
+ ast_cli(fd, "Thread %d: state=%d, update=%d, actions=%d\n",
+ thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions);
+#endif
threadcount++;
- });
+ }
+ AST_LIST_UNLOCK(&idle_list);
+ ast_cli(fd, "Active Threads:\n");
+ AST_LIST_LOCK(&active_list);
+ AST_LIST_TRAVERSE(&active_list, thread, list) {
+ if (thread->type == IAX_TYPE_DYNAMIC)
+ type = 'D';
+ else
+ type = 'P';
+#ifdef DEBUG_SCHED_MULTITHREAD
+ ast_cli(fd, "Thread %c%d: state=%d, update=%d, actions=%d, func ='%s'\n",
+ type, thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions, thread->curfunc);
#else
- ASTOBJ_CONTAINER_TRAVERSE(&idlelist, 1, {
- ast_cli(fd, "Thread %d: state=%d, update=%d, actions=%d, refcnt=%d\n",
- iterator->threadnum, iterator->iostate, (int)(t - iterator->checktime), iterator->actions, iterator->refcount);
+ ast_cli(fd, "Thread %c%d: state=%d, update=%d, actions=%d\n",
+ type, thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions);
+#endif
threadcount++;
- });
+ }
+ AST_LIST_UNLOCK(&active_list);
+ ast_cli(fd, "Dynamic Threads:\n");
+ AST_LIST_LOCK(&dynamic_list);
+ AST_LIST_TRAVERSE(&dynamic_list, thread, list) {
+#ifdef DEBUG_SCHED_MULTITHREAD
+ ast_cli(fd, "Thread %d: state=%d, update=%d, actions=%d, func ='%s'\n",
+ thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions, thread->curfunc);
+#else
+ ast_cli(fd, "Thread %d: state=%d, update=%d, actions=%d\n",
+ thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions);
#endif
- ast_cli(fd, "Active Threads:\n");
-#ifdef DEBUG_SCHED_MULTITHREAD
- ASTOBJ_CONTAINER_TRAVERSE(&activelist, 1, {
- ast_cli(fd, "Thread %d: state=%d, update=%d, actions=%d, refcnt=%d, func ='%s'\n",
- iterator->threadnum, iterator->iostate, (int)(t - iterator->checktime), iterator->actions, iterator->refcount, iterator->curfunc);
- threadcount++;
- });
-#else
- ASTOBJ_CONTAINER_TRAVERSE(&activelist, 1, {
- ast_cli(fd, "Thread %d: state=%d, update=%d, actions=%d, refcnt=%d\n",
- iterator->threadnum, iterator->iostate, (int)(t - iterator->checktime), iterator->actions, iterator->refcount);
- threadcount++;
- });
-#endif
- ast_cli(fd, "%d of %d threads accounted for\n", threadcount, iaxthreadcount);
+ dynamiccount++;
+ }
+ AST_LIST_UNLOCK(&dynamic_list);
+ ast_cli(fd, "%d of %d threads accounted for with %d dynamic threads\n", threadcount, iaxthreadcount, dynamiccount);
return RESULT_SUCCESS;
}
@@ -6512,11 +6578,15 @@
if (errno != ECONNREFUSED)
ast_log(LOG_WARNING, "Error: %s\n", strerror(errno));
handle_error();
- ASTOBJ_CONTAINER_LINK_END(&idlelist, thread);
+ AST_LIST_LOCK(&idle_list);
+ AST_LIST_INSERT_TAIL(&idle_list, thread, list);
+ AST_LIST_UNLOCK(&idle_list);
return 1;
}
if (test_losspct && ((100.0 * ast_random() / (RAND_MAX + 1.0)) < test_losspct)) { /* simulate random loss condition */
- ASTOBJ_CONTAINER_LINK_END(&idlelist, thread);
+ AST_LIST_LOCK(&idle_list);
+ AST_LIST_INSERT_TAIL(&idle_list, thread, list);
+ AST_LIST_UNLOCK(&idle_list);
return 1;
}
/* Mark as ready and send on its way */
@@ -7891,34 +7961,44 @@
return 1;
}
-static void destroy_helper(struct iax2_thread *thread)
-{
- ast_log(LOG_DEBUG, "Destroying helper %d!\n", thread->threadnum);
- ast_mutex_destroy(&thread->lock);
- ast_cond_destroy(&thread->cond);
- free(thread);
-}
-
static void *iax2_process_thread(void *data)
{
- struct iax2_thread *thread_copy, *thread = data;
+ struct iax2_thread *thread = data;
+ struct timeval tv;
+ struct timespec ts;
for(;;) {
/* Wait for something to signal us to be awake */
ast_mutex_lock(&thread->lock);
- ast_cond_wait(&thread->cond, &thread->lock);
+ if (thread->type == IAX_TYPE_DYNAMIC) {
+ /* Wait to be signalled or time out */
+ tv = ast_tvadd(ast_tvnow(), ast_samp2tv(30000, 1000));
+ ts.tv_sec = tv.tv_sec;
+ ts.tv_nsec = tv.tv_usec * 1000;
+ if (ast_cond_timedwait(&thread->cond, &thread->lock, &ts) == ETIMEDOUT) {
+ ast_mutex_unlock(&thread->lock);
+ AST_LIST_LOCK(&dynamic_list);
+ AST_LIST_REMOVE(&dynamic_list, thread, list);
+ iaxdynamicthreadcount--;
+ AST_LIST_UNLOCK(&dynamic_list);
+ break;
+ }
+ } else {
+ ast_cond_wait(&thread->cond, &thread->lock);
+ }
ast_mutex_unlock(&thread->lock);
- /* Unlink from idlelist / activelist if there*/
- ASTOBJ_CONTAINER_UNLINK(&idlelist, thread);
- ASTOBJ_CONTAINER_UNLINK(&activelist, thread);
- /* If instructed to halt, stop now */
+
+ /* If we were signalled, then we are already out of both lists or we are shutting down */
if (thread->halt) {
- ast_log(LOG_DEBUG, "Halting, refcount = %d\n", thread->refcount);
- ASTOBJ_UNREF(thread, destroy_helper);
break;
}
- /* Remove our reference */
- ASTOBJ_CONTAINER_LINK_END(&activelist, thread);
+
+ /* Add ourselves to the active list now */
+ AST_LIST_LOCK(&active_list);
+ AST_LIST_INSERT_HEAD(&active_list, thread, list);
+ AST_LIST_UNLOCK(&active_list);
+
[... 1391 lines stripped ...]
More information about the svn-commits
mailing list