[asterisk-commits] branch oej/siptransfer r30425 - in
/team/oej/siptransfer: ./ apps/ build_tool...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu May 25 14:23:43 MST 2006
Author: oej
Date: Thu May 25 16:23:42 2006
New Revision: 30425
URL: http://svn.digium.com/view/asterisk?rev=30425&view=rev
Log:
Update...
Added:
team/oej/siptransfer/channels/chan_jingle.c
- copied unchanged from r29848, trunk/channels/chan_jingle.c
team/oej/siptransfer/configs/jabber.conf.sample
- copied unchanged from r29848, trunk/configs/jabber.conf.sample
team/oej/siptransfer/configs/jingle.conf.sample
- copied unchanged from r29848, trunk/configs/jingle.conf.sample
team/oej/siptransfer/doc/jabber.txt
- copied unchanged from r29848, trunk/doc/jabber.txt
team/oej/siptransfer/doc/jingle.txt
- copied unchanged from r29848, trunk/doc/jingle.txt
team/oej/siptransfer/include/asterisk/jabber.h
- copied unchanged from r29848, trunk/include/asterisk/jabber.h
team/oej/siptransfer/include/asterisk/jingle.h
- copied unchanged from r29848, trunk/include/asterisk/jingle.h
team/oej/siptransfer/res/res_jabber.c
- copied unchanged from r29848, trunk/res/res_jabber.c
Modified:
team/oej/siptransfer/ (props changed)
team/oej/siptransfer/CREDITS
team/oej/siptransfer/UPGRADE.txt
team/oej/siptransfer/app.c
team/oej/siptransfer/apps/app_dial.c
team/oej/siptransfer/apps/app_directed_pickup.c
team/oej/siptransfer/apps/app_meetme.c
team/oej/siptransfer/apps/app_queue.c
team/oej/siptransfer/apps/app_record.c
team/oej/siptransfer/apps/app_waitforsilence.c
team/oej/siptransfer/build_tools/cflags.xml
team/oej/siptransfer/build_tools/menuselect-deps.in
team/oej/siptransfer/channels/Makefile
team/oej/siptransfer/channels/chan_local.c
team/oej/siptransfer/channels/chan_misdn.c
team/oej/siptransfer/channels/chan_sip.c
team/oej/siptransfer/channels/chan_zap.c
team/oej/siptransfer/channels/misdn/chan_misdn_config.h
team/oej/siptransfer/channels/misdn/isdn_lib.c
team/oej/siptransfer/channels/misdn/isdn_lib.h
team/oej/siptransfer/channels/misdn_config.c
team/oej/siptransfer/configs/extensions.conf.sample
team/oej/siptransfer/configs/features.conf.sample
team/oej/siptransfer/configs/func_odbc.conf.sample
team/oej/siptransfer/configs/misdn.conf.sample
team/oej/siptransfer/configure
team/oej/siptransfer/configure.ac
team/oej/siptransfer/funcs/func_odbc.c
team/oej/siptransfer/include/asterisk/channel.h
team/oej/siptransfer/include/asterisk/devicestate.h
team/oej/siptransfer/include/asterisk/linkedlists.h
team/oej/siptransfer/include/asterisk/lock.h
team/oej/siptransfer/include/autoconfig.h.in
team/oej/siptransfer/makeopts.in
team/oej/siptransfer/pbx.c
team/oej/siptransfer/pbx/Makefile
team/oej/siptransfer/res/Makefile
team/oej/siptransfer/res/res_features.c
Propchange: team/oej/siptransfer/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/siptransfer/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.
Propchange: team/oej/siptransfer/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/siptransfer/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 25 16:23:42 2006
@@ -1,1 +1,1 @@
-/trunk:1-29256
+/trunk:1-29848
Modified: team/oej/siptransfer/CREDITS
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/CREDITS?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/CREDITS (original)
+++ team/oej/siptransfer/CREDITS Thu May 25 16:23:42 2006
@@ -82,6 +82,8 @@
Steve Murphy - privacy support, $[ ] parser upgrade, AEL2 parser upgrade
Claude Patry - bug fixes, feature enhancements, and bug marshalling
cpatry at gmail.com
+Miroslav Nachev, miro at space-comm.com COSMOS Software Enterprises, Ltd.
+ - for Variable for No Answer Timeout for Attended Transfer
=== OTHER CONTRIBUTIONS ===
John Todd - Monkey sounds and associated teletorture prompt
Modified: team/oej/siptransfer/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/UPGRADE.txt?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/UPGRADE.txt (original)
+++ team/oej/siptransfer/UPGRADE.txt Thu May 25 16:23:42 2006
@@ -97,6 +97,12 @@
record conversations queue members are having with queue callers. Please
see configs/queues.conf.sample for more information on this option.
+* app_meetme: The 'm' option (monitor) is renamed to 'l' (listen only), and
+ the 'm' option now provides the functionality of "initially muted".
+ In practice, most existing dialplans using the 'm' flag should not notice
+ any difference, unless the keypad menu is enabled, allowing the user
+ to unmute themsleves.
+
* ast_play_and_record would attempt to cancel the recording if a DTMF
'0' was received. This behavior was not documented in most of the
applications that used ast_play_and_record and the return codes from
@@ -132,6 +138,12 @@
headers are not automatically sent, unless you specify them as separate
arguments. Please see the application help for the new syntax.
+* app_meetme: Mute and Unmute events are now reported via the Manager API.
+ Native Manager API commands MeetMeMute and MeetMeUnmute are provided, which
+ are easier to use than "Action Command:". The MeetMeStopTalking event has
+ also been deprecated in favor of the already existing MeetmeTalking event
+ with a "Status" of "on" or "off" added.
+
Variables:
* The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
Modified: team/oej/siptransfer/app.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/app.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/app.c (original)
+++ team/oej/siptransfer/app.c Thu May 25 16:23:42 2006
@@ -549,8 +549,7 @@
sfmt[fmtcnt++] = ast_strdupa(fmt);
}
- time(&start);
- end = start; /* pre-initialize end to be same as start in case we never get into loop */
+ end = start = time(NULL); /* pre-initialize end to be same as start in case we never get into loop */
for (x = 0; x < fmtcnt; x++) {
others[x] = ast_writefile(prepend ? prependfile : recordfile, sfmt[x], comment, O_TRUNC, 0, 0700);
if (option_verbose > 2)
@@ -670,7 +669,7 @@
}
}
if (maxtime) {
- time(&end);
+ end = time(NULL);
if (maxtime < (end - start)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Took too long, cutting it short...\n");
@@ -689,7 +688,8 @@
} else {
ast_frfree(f);
}
- if (end == start) time(&end);
+ if (end == start)
+ end = time(NULL);
} else {
ast_log(LOG_WARNING, "Error creating writestream '%s', format '%s'\n", recordfile, sfmt[x]);
}
@@ -931,7 +931,7 @@
close(fd);
snprintf(s, strlen(path) + 9, "%s/.lock", path);
- time(&start);
+ start = time(NULL);
while (((res = link(fs, s)) < 0) && (errno == EEXIST) && (time(NULL) - start < 5))
usleep(1);
if (res) {
Modified: team/oej/siptransfer/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_dial.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_dial.c (original)
+++ team/oej/siptransfer/apps/app_dial.c Thu May 25 16:23:42 2006
@@ -183,7 +183,11 @@
" w - Allow the called party to enable recording of the call by sending\n"
" the DTMF sequence defined for one-touch recording in features.conf.\n"
" W - Allow the calling party to enable recording of the call by sending\n"
-" the DTMF sequence defined for one-touch recording in features.conf.\n";
+" the DTMF sequence defined for one-touch recording in features.conf.\n"
+" k - Allow the called party to enable parking of the call by sending\n"
+" the DTMF sequence defined for call parking in features.conf.\n"
+" K - Allow the calling party to enable parking of the call by sending\n"
+" the DTMF sequence defined for call parking in features.conf.\n";
/* RetryDial App by Anthony Minessale II <anthmct at yahoo.com> Jan/2005 */
static char *rapp = "RetryDial";
@@ -227,6 +231,8 @@
OPT_CALLER_MONITOR = (1 << 22),
OPT_GOTO = (1 << 23),
OPT_OPERMODE = (1 << 24),
+ OPT_CALLEE_PARK = (1 << 25),
+ OPT_CALLER_PARK = (1 << 26),
} dial_exec_option_flags;
#define DIAL_STILLGOING (1 << 30)
@@ -272,6 +278,8 @@
AST_APP_OPTION('T', OPT_CALLER_TRANSFER),
AST_APP_OPTION('w', OPT_CALLEE_MONITOR),
AST_APP_OPTION('W', OPT_CALLER_MONITOR),
+ AST_APP_OPTION('k', OPT_CALLEE_PARK),
+ AST_APP_OPTION('K', OPT_CALLER_PARK),
});
/* We define a custom "local user" structure because we
@@ -441,6 +449,7 @@
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+ OPT_CALLEE_PARK | OPT_CALLER_PARK |
DIAL_NOFORWARDHTML);
}
continue;
@@ -551,6 +560,7 @@
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+ OPT_CALLEE_PARK | OPT_CALLER_PARK |
DIAL_NOFORWARDHTML);
/* Setup early media if appropriate */
ast_rtp_early_media(in, peer);
@@ -1016,6 +1026,7 @@
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+ OPT_CALLEE_PARK | OPT_CALLER_PARK |
OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID);
ast_set2_flag(tmp, args.url, DIAL_NOFORWARDHTML);
}
@@ -1497,6 +1508,10 @@
ast_set_flag(&(config.features_callee), AST_FEATURE_AUTOMON);
if (ast_test_flag(peerflags, OPT_CALLER_MONITOR))
ast_set_flag(&(config.features_caller), AST_FEATURE_AUTOMON);
+ if (ast_test_flag(peerflags, OPT_CALLEE_PARK))
+ ast_set_flag(&(config.features_callee), AST_FEATURE_PARKCALL);
+ if (ast_test_flag(peerflags, OPT_CALLER_PARK))
+ ast_set_flag(&(config.features_caller), AST_FEATURE_PARKCALL);
config.timelimit = timelimit;
config.play_warning = play_warning;
Modified: team/oej/siptransfer/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_directed_pickup.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_directed_pickup.c (original)
+++ team/oej/siptransfer/apps/app_directed_pickup.c Thu May 25 16:23:42 2006
@@ -20,7 +20,7 @@
*
* \brief Directed Call Pickup Support
*
- * \author Joshua Colp <jcolp at asterlink.com>
+ * \author Joshua Colp <jcolp at digium.com>
*
* \ingroup applications
*/
@@ -42,12 +42,16 @@
#include "asterisk/lock.h"
#include "asterisk/app.h"
+#define PICKUPMARK "PICKUPMARK"
+
static const char *app = "Pickup";
static const char *synopsis = "Directed Call Pickup";
static const char *descrip =
" Pickup(extension[@context][&extension2 at context...]): This application can pickup any ringing channel\n"
"that is calling the specified extension. If no context is specified, the current\n"
-"context will be used.\n";
+"context will be used. If you use the special string \"PICKUPMARK\" for the context parameter, for example\n"
+"10 at PICKUPMARK, this application tries to find a channel which has defined a channel variable with the same context\n"
+"as \"extension\".";
LOCAL_USER_DECL;
@@ -58,6 +62,7 @@
struct ast_channel *origin = NULL, *target = NULL;
char *tmp = NULL, *exten = NULL, *context = NULL, *rest=data;
char workspace[256] = "";
+ const char *tmp2 = NULL;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Pickup requires an argument (extension) !\n");
@@ -77,8 +82,21 @@
if (context)
*context++ = '\0';
- /* Find a channel to pickup */
- origin = ast_get_channel_by_exten_locked(exten, context);
+ /* If the context is the pickup mark, iterate through all channels finding the right origin one */
+ if (!strcmp(context, PICKUPMARK)) {
+ while ((origin = ast_channel_walk_locked(origin))) {
+ if (origin) {
+ tmp2 = pbx_builtin_getvar_helper(origin, PICKUPMARK);
+ if (tmp2 && !strcmp(tmp2, exten))
+ break;
+ ast_mutex_unlock(&origin->lock);
+ }
+ }
+ } else {
+ /* Use the classic mode of searching */
+ origin = ast_get_channel_by_exten_locked(exten, context);
+ }
+
if (origin) {
ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
sizeof(workspace), 0, 0);
Modified: team/oej/siptransfer/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_meetme.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_meetme.c (original)
+++ team/oej/siptransfer/apps/app_meetme.c Thu May 25 16:23:42 2006
@@ -74,8 +74,9 @@
#define DEFAULT_AUDIO_BUFFERS 32
enum {
- ADMINFLAG_MUTED = (1 << 1), /*!< User is muted */
- ADMINFLAG_KICKME = (1 << 2) /*!< User has been kicked */
+ ADMINFLAG_MUTED = (1 << 1), /*!< User is muted */
+ ADMINFLAG_SELFMUTED = (1 << 2), /*!< User muted self */
+ ADMINFLAG_KICKME = (1 << 3) /*!< User has been kicked */
};
#define MEETME_DELAYDETECTTALK 300
@@ -146,9 +147,11 @@
/*! If set, won't speak the extra prompt when the first person
* enters the conference */
CONFFLAG_NOONLYPERSON = (1 << 22),
- CONFFLAG_INTROUSERNOREVIEW = (1 << 23)
+ CONFFLAG_INTROUSERNOREVIEW = (1 << 23),
/*! If set, user will be asked to record name on entry of conference
* without review */
+ CONFFLAG_STARTMUTED = (1 << 24)
+ /*! If set, the user will be initially muted by admin */
};
AST_APP_OPTIONS(meetme_opts, {
@@ -163,7 +166,7 @@
AST_APP_OPTION('i', CONFFLAG_INTROUSER ),
AST_APP_OPTION('I', CONFFLAG_INTROUSERNOREVIEW ),
AST_APP_OPTION('M', CONFFLAG_MOH ),
- AST_APP_OPTION('m', CONFFLAG_MONITOR ),
+ AST_APP_OPTION('m', CONFFLAG_STARTMUTED ),
AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
AST_APP_OPTION('P', CONFFLAG_ALWAYSPROMPT ),
AST_APP_OPTION('p', CONFFLAG_POUNDEXIT ),
@@ -171,6 +174,7 @@
AST_APP_OPTION('r', CONFFLAG_RECORDCONF ),
AST_APP_OPTION('s', CONFFLAG_STARMENU ),
AST_APP_OPTION('T', CONFFLAG_MONITORTALKER ),
+ AST_APP_OPTION('l', CONFFLAG_MONITOR ),
AST_APP_OPTION('t', CONFFLAG_TALKER ),
AST_APP_OPTION('w', CONFFLAG_WAITMARKED ),
AST_APP_OPTION('X', CONFFLAG_EXIT_CONTEXT ),
@@ -207,7 +211,8 @@
" 'E' -- select an empty pinless conference\n"
" 'i' -- announce user join/leave with review\n"
" 'I' -- announce user join/leave without review\n"
-" 'm' -- set monitor only mode (Listen only, no talking)\n"
+" 'l' -- set listen only mode (Listen only, no talking)\n"
+" 'm' -- set initially muted by admin\n"
" 'M' -- enable music on hold when the conference has a single caller\n"
" 'o' -- set talker optimization - treats talkers who aren't speaking as\n"
" being muted, meaning (a) No encode is done on transmission and\n"
@@ -688,7 +693,7 @@
user->chan->name,
user->userflags & CONFFLAG_ADMIN ? "(Admin)" : "",
user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
- user->adminflags & ADMINFLAG_MUTED ? "(Admn Muted)" : "",
+ user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : "",
istalking(user->talking), hr, min, sec);
else
ast_cli(fd, "%d!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
@@ -948,7 +953,7 @@
user->chan = chan;
user->userflags = confflags;
- user->adminflags = 0;
+ user->adminflags = (confflags & CONFFLAG_STARTMUTED) ? ADMINFLAG_MUTED : 0;
user->talking = -1;
conf->users++;
/* Update table */
@@ -1298,39 +1303,51 @@
break;
}
- /* Check if the admin changed my modes */
- if (user->adminflags) {
- /* Set the new modes */
- if ((user->adminflags & ADMINFLAG_MUTED) && (ztc.confmode & ZT_CONF_TALKER)) {
- ztc.confmode ^= ZT_CONF_TALKER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
- ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
- ret = -1;
- break;
- }
- }
- if (!(user->adminflags & ADMINFLAG_MUTED) && !(confflags & CONFFLAG_MONITOR) && !(ztc.confmode & ZT_CONF_TALKER)) {
- ztc.confmode |= ZT_CONF_TALKER;
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
- ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
- ret = -1;
- break;
- }
- }
- if (user->adminflags & ADMINFLAG_KICKME) {
- /* You have been kicked. */
- if (!ast_streamfile(chan, "conf-kicked", chan->language))
- ast_waitstream(chan, "");
- ret = 0;
+ /* Check if my modes have changed */
+
+ /* If I should be muted but am still talker, mute me */
+ if ((user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && (ztc.confmode & ZT_CONF_TALKER)) {
+ ztc.confmode ^= ZT_CONF_TALKER;
+ if (ioctl(fd, ZT_SETCONF, &ztc)) {
+ ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
+ ret = -1;
break;
}
- } else if (!(confflags & CONFFLAG_MONITOR) && !(ztc.confmode & ZT_CONF_TALKER)) {
+
+ manager_event(EVENT_FLAG_CALL, "MeetmeMute",
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Meetme: %s\r\n"
+ "Usernum: %i\r\n"
+ "Status: on\r\n",
+ chan->name, chan->uniqueid, conf->confno, user->user_no);
+ }
+
+ /* If I should be un-muted but am not talker, un-mute me */
+ if (!(user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) && !(confflags & CONFFLAG_MONITOR) && !(ztc.confmode & ZT_CONF_TALKER)) {
ztc.confmode |= ZT_CONF_TALKER;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
ret = -1;
break;
}
+
+ manager_event(EVENT_FLAG_CALL, "MeetmeMute",
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Meetme: %s\r\n"
+ "Usernum: %i\r\n"
+ "Status: off\r\n",
+ chan->name, chan->uniqueid, conf->confno, user->user_no);
+ }
+
+ /* If I have been kicked, exit the conference */
+ if (user->adminflags & ADMINFLAG_KICKME) {
+ //You have been kicked.
+ if (!ast_streamfile(chan, "conf-kicked", chan->language))
+ ast_waitstream(chan, "");
+ ret = 0;
+ break;
}
if (c) {
@@ -1369,17 +1386,19 @@
"Channel: %s\r\n"
"Uniqueid: %s\r\n"
"Meetme: %s\r\n"
- "Usernum: %d\r\n",
+ "Usernum: %d\r\n"
+ "Status: on\r\n",
chan->name, chan->uniqueid, conf->confno, user->user_no);
}
if (user->talking && totalsilence > MEETME_DELAYDETECTENDTALK) {
user->talking = 0;
if (confflags & CONFFLAG_MONITORTALKER)
- manager_event(EVENT_FLAG_CALL, "MeetmeStopTalking",
+ manager_event(EVENT_FLAG_CALL, "MeetmeTalking",
"Channel: %s\r\n"
"Uniqueid: %s\r\n"
"Meetme: %s\r\n"
- "Usernum: %d\r\n",
+ "Usernum: %d\r\n"
+ "Status: off\r\n",
chan->name, chan->uniqueid, conf->confno, user->user_no);
}
}
@@ -1445,22 +1464,14 @@
switch(dtmf) {
case '1': /* Un/Mute */
menu_active = 0;
- if (ztc.confmode & ZT_CONF_TALKER) {
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_LISTENER;
- confflags |= CONFFLAG_MONITOR ^ CONFFLAG_TALKER;
- } else {
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
- confflags ^= CONFFLAG_MONITOR | CONFFLAG_TALKER;
- }
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
- ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
- ret = -1;
- break;
- }
- if (ztc.confmode & ZT_CONF_TALKER) {
+
+ /* for admin, change both admin and use flags */
+ if (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) {
+ user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
if (!ast_streamfile(chan, "conf-unmuted", chan->language))
ast_waitstream(chan, "");
} else {
+ user->adminflags |= (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
if (!ast_streamfile(chan, "conf-muted", chan->language))
ast_waitstream(chan, "");
}
@@ -1525,23 +1536,16 @@
switch(dtmf) {
case '1': /* Un/Mute */
menu_active = 0;
- if (ztc.confmode & ZT_CONF_TALKER) {
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_LISTENER;
- confflags |= CONFFLAG_MONITOR ^ CONFFLAG_TALKER;
- } else if (!(user->adminflags & ADMINFLAG_MUTED)) {
- ztc.confmode = ZT_CONF_CONF | ZT_CONF_TALKER | ZT_CONF_LISTENER;
- confflags ^= CONFFLAG_MONITOR | CONFFLAG_TALKER;
- }
- if (ioctl(fd, ZT_SETCONF, &ztc)) {
- ast_log(LOG_WARNING, "Error setting conference - Un/Mute \n");
- ret = -1;
- break;
- }
- if (ztc.confmode & ZT_CONF_TALKER) {
- if (!ast_streamfile(chan, "conf-unmuted", chan->language))
+
+ /* user can only toggle the self-muted state */
+ user->adminflags ^= ADMINFLAG_SELFMUTED;
+
+ /* they can't override the admin mute state */
+ if (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) {
+ if (!ast_streamfile(chan, "conf-muted", chan->language))
ast_waitstream(chan, "");
} else {
- if (!ast_streamfile(chan, "conf-muted", chan->language))
+ if (!ast_streamfile(chan, "conf-unmuted", chan->language))
ast_waitstream(chan, "");
}
break;
@@ -1694,14 +1698,14 @@
"Uniqueid: %s\r\n"
"Meetme: %s\r\n"
"Usernum: %d\r\n"
- "CIDnum: %s\r\n"
- "CIDname: %s\r\n"
- "Duration: %02d:%02d:%02d\r\n",
+ "CallerIDnum: %s\r\n"
+ "CallerIDname: %s\r\n"
+ "Duration: %ld\r\n",
chan->name, chan->uniqueid, conf->confno,
user->user_no,
S_OR(user->chan->cid.cid_num, "<unknown>"),
- S_OR(user->chan->cid.cid_name, "<no name>"),
- hr, min, sec);
+ S_OR(user->chan->cid.cid_name, "<unknown>"),
+ (now - user->jointime));
conf->users--;
conf->refcount--;
@@ -2266,31 +2270,21 @@
case 77: /* M: Mute */
if (user) {
user->adminflags |= ADMINFLAG_MUTED;
- manager_event(EVENT_FLAG_CALL, "MeetmeMute",
- "Status: on"
- "Meetme: %s\r\n"
- "Usernum: %d\r\n",
- cnf->confno, user->user_no);
} else {
ast_log(LOG_NOTICE, "Specified User not found!\n");
}
break;
- case 78: /* N: Mute all users */
+ case 78: /* N: Mute all (non-admin) users */
AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
if (!(user->userflags & CONFFLAG_ADMIN))
user->adminflags |= ADMINFLAG_MUTED;
}
break;
case 109: /* m: Unmute */
- if (user && (user->adminflags & ADMINFLAG_MUTED)) {
- user->adminflags ^= ADMINFLAG_MUTED;
- manager_event(EVENT_FLAG_CALL, "MeetmeMute",
- "Status: off"
- "Meetme: %s\r\n"
- "Usernum: %d\r\n",
- cnf->confno, user->user_no);
+ if (user) {
+ user->adminflags &= ~ADMINFLAG_MUTED;
} else {
- ast_log(LOG_NOTICE, "Specified User not found or he muted himself!\n");
+ ast_log(LOG_NOTICE, "Specified User not found!\n");
}
break;
case 110: /* n: Unmute all users */
@@ -2315,6 +2309,77 @@
return 0;
}
+static int meetmemute(struct mansession *s, struct message *m, int mute)
+{
+ struct ast_conference *conf;
+ struct ast_conf_user *user;
+ char *confid = astman_get_header(m, "Meetme");
+ char *userid = astman_get_header(m, "Usernum");
+ int userno;
+
+ if (!confid || ast_strlen_zero(confid)) {
+ astman_send_error(s, m, "Meetme conference not specified");
+ return 0;
+ }
+
+ if (!userid || ast_strlen_zero(userid)) {
+ astman_send_error(s, m, "Meetme user number not specified");
+ return 0;
+ }
+
+ userno = strtoul(userid, &userid, 10);
+
+ if (*userid) {
+ astman_send_error(s, m, "Invalid user number");
+ return 0;
+ }
+
+ /* Look in the conference list */
+ AST_LIST_LOCK(&confs);
+ AST_LIST_TRAVERSE(&confs, conf, list) {
+ if (!strcmp(confid, conf->confno))
+ break;
+ }
+
+ if (!conf) {
+ AST_LIST_UNLOCK(&confs);
+ astman_send_error(s, m, "Meetme conference does not exist");
+ return 0;
+ }
+
+ AST_LIST_TRAVERSE(&conf->userlist, user, list)
+ if (user->user_no == userno)
+ break;
+
+ if (!user) {
+ AST_LIST_UNLOCK(&confs);
+ astman_send_error(s, m, "User number not found");
+ return 0;
+ }
+
+ if (mute)
+ user->adminflags |= ADMINFLAG_MUTED; /* request user muting */
+ else
+ user->adminflags &= ~ADMINFLAG_MUTED; /* request user unmuting */
+
+ AST_LIST_UNLOCK(&confs);
+
+ ast_log(LOG_NOTICE, "Requested to %smute conf %s user %d userchan %s uniqueid %s\n", mute ? "" : "un", conf->confno, user->user_no, user->chan->name, user->chan->uniqueid);
+
+ astman_send_ack(s, m, mute ? "User muted" : "User unmuted");
+ return 0;
+}
+
+static int action_meetmemute(struct mansession *s, struct message *m)
+{
+ return meetmemute(s, m, 1);
+}
+
+static int action_meetmeunmute(struct mansession *s, struct message *m)
+{
+ return meetmemute(s, m, 0);
+}
+
static void *recordthread(void *args)
{
struct ast_conference *cnf = args;
@@ -2410,6 +2475,8 @@
int res;
res = ast_cli_unregister(&cli_conf);
+ res |= ast_manager_unregister("MeetmeMute");
+ res |= ast_manager_unregister("MeetmeUnmute");
res |= ast_unregister_application(app3);
res |= ast_unregister_application(app2);
res |= ast_unregister_application(app);
@@ -2426,6 +2493,8 @@
load_config();
res = ast_cli_register(&cli_conf);
+ res |= ast_manager_register("MeetmeMute", EVENT_FLAG_CALL, action_meetmemute, "Mute a Meetme user");
+ res |= ast_manager_register("MeetmeUnmute", EVENT_FLAG_CALL, action_meetmeunmute, "Unmute a Meetme user");
res |= ast_register_application(app3, admin_exec, synopsis3, descrip3);
res |= ast_register_application(app2, count_exec, synopsis2, descrip2);
res |= ast_register_application(app, conf_exec, synopsis, descrip);
Modified: team/oej/siptransfer/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_queue.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_queue.c (original)
+++ team/oej/siptransfer/apps/app_queue.c Thu May 25 16:23:42 2006
@@ -1263,8 +1263,8 @@
/* Take us out of the queue */
manager_event(EVENT_FLAG_CALL, "Leave",
- "Channel: %s\r\nQueue: %s\r\nCount: %d\r\n",
- qe->chan->name, q->name, q->count);
+ "Channel: %s\r\nQueue: %s\r\nCount: %d\r\nUniqueid: %s\r\n",
+ qe->chan->name, q->name, q->count, qe->chan->uniqueid);
if (option_debug)
ast_log(LOG_DEBUG, "Queue '%s' Leave, Channel '%s'\n", q->name, qe->chan->name );
/* Take us out of the queue */
Modified: team/oej/siptransfer/apps/app_record.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_record.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_record.c (original)
+++ team/oej/siptransfer/apps/app_record.c Thu May 25 16:23:42 2006
@@ -62,7 +62,8 @@
" 'n' : do not answer, but record anyway if line not yet answered\n"
" 'q' : quiet (do not play a beep tone)\n"
" 's' : skip recording if the line is not yet answered\n"
-" 't' : use alternate '*' terminator key instead of default '#'\n"
+" 't' : use alternate '*' terminator key (DTMF) instead of default '#'\n"
+" 'x' : ignore all terminator keys (DTMF) and keep recording until hangup\n"
"\n"
"If filename contains '%d', these characters will be replaced with a number\n"
"incremented by one each time the file is recorded. \n\n"
@@ -167,6 +168,8 @@
option_append = 1;
if (strchr(options, 't'))
terminator = '*';
+ if (strchr(options, 'x'))
+ terminator = 0;
if (strchr(options, 'q'))
option_quiet = 1;
}
Modified: team/oej/siptransfer/apps/app_waitforsilence.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/apps/app_waitforsilence.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/apps/app_waitforsilence.c (original)
+++ team/oej/siptransfer/apps/app_waitforsilence.c Thu May 25 16:23:42 2006
@@ -69,7 +69,7 @@
int totalsilence = 0;
int dspsilence = 0;
int gotsilence = 0;
- static int silencethreshold = 64;
+ static int silencethreshold = 128;
int rfmt = 0;
int res = 0;
struct ast_dsp *sildet; /* silence detector dsp */
Modified: team/oej/siptransfer/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/build_tools/cflags.xml?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/build_tools/cflags.xml (original)
+++ team/oej/siptransfer/build_tools/cflags.xml Thu May 25 16:23:42 2006
@@ -1,4 +1,6 @@
<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
+ <member name="DEBUG_CHANNEL_LOCKS" displayname="Debug Channel Locking">
+ </member>
<member name="DEBUG_SCHEDULER" displayname="Enable Scheduler Debugging Output">
</member>
<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
Modified: team/oej/siptransfer/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/build_tools/menuselect-deps.in?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/build_tools/menuselect-deps.in (original)
+++ team/oej/siptransfer/build_tools/menuselect-deps.in Thu May 25 16:23:42 2006
@@ -24,4 +24,5 @@
ZLIB=@PBX_LIBZLIB@
ZAPTEL=@PBX_LIBZAPTEL@
LIBGSM=@PBX_LIBgsm@
+IKSEMEL=@PBX_LIBIKSEMEL@
IXJUSER=@PBX_IXJUSER@
Modified: team/oej/siptransfer/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/channels/Makefile?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/channels/Makefile (original)
+++ team/oej/siptransfer/channels/Makefile Thu May 25 16:23:42 2006
@@ -131,6 +131,12 @@
chan_vpb.so: chan_vpb.o
$(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
+chan_jingle.o: chan_jingle.c
+ $(CC) -c -o $@ $(CFLAGS) $(IKSEMEL_INCLUDE) $<
+
+chan_jingle.so: chan_jingle.o
+ $(CC) $(SOLINK) -o $@ $< $(IKSEMEL_LIB)
+
ifeq ($(OSARCH),Linux)
chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
$(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
Modified: team/oej/siptransfer/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/channels/chan_local.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/channels/chan_local.c (original)
+++ team/oej/siptransfer/channels/chan_local.c Thu May 25 16:23:42 2006
@@ -369,7 +369,7 @@
p->chan->cid.cid_name = ast_strdup(p->owner->cid.cid_name);
p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis);
p->chan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani);
-
+ p->chan->cid.cid_pres = p->owner->cid.cid_pres;
ast_string_field_set(p->chan, language, p->owner->language);
ast_string_field_set(p->chan, accountcode, p->owner->accountcode);
p->chan->cdrflags = p->owner->cdrflags;
Modified: team/oej/siptransfer/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/oej/siptransfer/channels/chan_misdn.c?rev=30425&r1=30424&r2=30425&view=diff
==============================================================================
--- team/oej/siptransfer/channels/chan_misdn.c (original)
+++ team/oej/siptransfer/channels/chan_misdn.c Thu May 25 16:23:42 2006
@@ -280,6 +280,10 @@
static int *misdn_debug_only;
static int max_ports;
+static int *misdn_in_calls;
+static int *misdn_out_calls;
+
+
struct chan_list dummy_cl;
struct chan_list *cl_te=NULL;
@@ -310,6 +314,11 @@
void debug_numplan(int port, int numplan, char *type);
+
+
+int add_out_calls(int port);
+int add_in_calls(int port);
+
/*************** Helpers *****************/
@@ -780,6 +789,24 @@
}
+
+static int misdn_show_ports_stats (int fd, int argc, char *argv[])
+{
+ int port;
+
+ ast_cli(fd, "Port\tin_calls\tout_calls\n");
+
+ for (port=misdn_cfg_get_next_port(0); port > 0;
+ port=misdn_cfg_get_next_port(port)) {
+ ast_cli(fd,"%d\t%d\t\t%d\n",port,misdn_in_calls[port],misdn_out_calls[port]);
+ }
+ ast_cli(fd,"\n");
+
+ return 0;
+
+}
+
+
static int misdn_show_port (int fd, int argc, char *argv[])
{
int port;
@@ -1077,6 +1104,14 @@
"Usage: misdn show stacks\n"
};
+static struct ast_cli_entry cli_show_ports_stats =
+{ {"misdn","show","ports","stats", NULL},
+ misdn_show_ports_stats,
+ "Shows chan_misdns call statistics per port",
+ "Usage: misdn show port stats\n"
+};
+
+
static struct ast_cli_entry cli_show_port =
{ {"misdn","show","port", NULL},
misdn_show_port,
@@ -1523,6 +1558,14 @@
port=newbc->port;
strncpy(newbc->dad,ext,sizeof( newbc->dad));
strncpy(ast->exten,ext,sizeof(ast->exten));
+
+ int exceed;
+ if ((exceed=add_out_calls(port))) {
+ char tmp[16];
+ sprintf(tmp,"%d",exceed);
+ pbx_builtin_setvar_helper(ast,"MAX_OVERFLOW",tmp);
+ return -1;
+ }
chan_misdn_log(1, port, "* CALL: %s\n",dest);
@@ -2742,6 +2785,13 @@
} else {
if (!bc->nojitter)
chan_misdn_log(5,bc->port,"Jitterbuffer already destroyed.\n");
+ }
+
+
+ if (ch->orginator == ORG_AST) {
+ misdn_out_calls[bc->port]--;
+ } else {
+ misdn_in_calls[bc->port]--;
}
if (ch) {
@@ -2946,10 +2996,6 @@
tmp=pbx_builtin_getvar_helper(chan,"PRI_USER1");
if (tmp) bc->user1=atoi(tmp);
-
- tmp=pbx_builtin_getvar_helper(chan,"RDNIS");
- if (tmp) ast_copy_string(bc->rad,tmp,sizeof(bc->rad));
-
}
void export_ies(struct ast_channel *chan, struct misdn_bchannel *bc)
@@ -2957,18 +3003,52 @@
char tmp[32];
sprintf(tmp,"%d",bc->mode);
- pbx_builtin_setvar_helper(chan,"PRI_MODE",tmp);
+ pbx_builtin_setvar_helper(chan,"_PRI_MODE",tmp);
sprintf(tmp,"%d",bc->urate);
- pbx_builtin_setvar_helper(chan,"PRI_URATE",tmp);
+ pbx_builtin_setvar_helper(chan,"_PRI_URATE",tmp);
sprintf(tmp,"%d",bc->rate);
- pbx_builtin_setvar_helper(chan,"PRI_RATE",tmp);
+ pbx_builtin_setvar_helper(chan,"_PRI_RATE",tmp);
sprintf(tmp,"%d",bc->user1);
- pbx_builtin_setvar_helper(chan,"PRI_USER1",tmp);
-
- pbx_builtin_setvar_helper(chan,"RDNIS",bc->rad);
+ pbx_builtin_setvar_helper(chan,"_PRI_USER1",tmp);
+
+ pbx_builtin_setvar_helper(chan,"_RDNIS",bc->rad);
+}
+
+
+int add_in_calls(int port)
+{
+ int max_in_calls;
+
+ misdn_cfg_get( port, MISDN_CFG_MAX_IN, &max_in_calls, sizeof(max_in_calls));
+
+ misdn_in_calls[port]++;
+
+ if (max_in_calls >=0 && max_in_calls<misdn_in_calls[port]) {
+ ast_log(LOG_NOTICE,"Marking Incoming Call on port[%d]\n",port);
+ return misdn_in_calls[port]-max_in_calls;
+ }
+
+ return 0;
+}
+
+int add_out_calls(int port)
+{
+ int max_out_calls;
+
+ misdn_cfg_get( port, MISDN_CFG_MAX_OUT, &max_out_calls, sizeof(max_out_calls));
+
+
+ if (max_out_calls >=0 && max_out_calls<=misdn_out_calls[port]) {
+ ast_log(LOG_NOTICE,"Rejecting Outgoing Call on port[%d]\n",port);
+ return (misdn_out_calls[port]+1)-max_out_calls;
+ }
+
+ misdn_out_calls[port]++;
+
+ return 0;
}
@@ -3022,6 +3102,17 @@
case EVENT_NEW_L3ID:
ch->l3id=bc->l3_id;
+ ch->addr=bc->addr;
+
+ if (bc->nt) {
+ /* OK we've got the very new l3id so we can answer
+ now */
+ start_bc_tones(ch);
+
+ ch->state = MISDN_CONNECTED;
+ ast_queue_control(ch->ast, AST_CONTROL_ANSWER);
+
+ }
break;
case EVENT_NEW_BC:
@@ -3169,12 +3260,14 @@
chan_misdn_log(1, bc->port, " --> Ignoring Call, its not in our MSN List\n");
return RESPONSE_IGNORE_SETUP; /* Ignore MSNs which are not in our List */
}
+
print_bearer(bc);
{
struct chan_list *ch=init_chan_list(ORG_MISDN);
struct ast_channel *chan;
+ int exceed;
if (!ch) { chan_misdn_log(-1, bc->port, "cb_events: malloc for chan_list failed!\n"); return 0;}
@@ -3185,6 +3278,12 @@
chan=misdn_new(ch, AST_STATE_RESERVED,bc->dad, bc->oad, AST_FORMAT_ALAW, bc->port, bc->channel);
ch->ast = chan;
+
+ if ((exceed=add_in_calls(bc->port))) {
+ char tmp[16];
+ sprintf(tmp,"%d",exceed);
+ pbx_builtin_setvar_helper(chan,"MAX_OVERFLOW",tmp);
+ }
read_config(ch, ORG_MISDN);
@@ -3401,15 +3500,21 @@
misdn_lib_echo(bc,0);
tone_indicate(ch, TONE_NONE);
- if (bridged && strcasecmp(bridged->tech->type,"mISDN")) {
+ if (bridged && !strcasecmp(bridged->tech->type,"mISDN")) {
struct chan_list *bridged_ch=MISDN_ASTERISK_TECH_PVT(bridged);
chan_misdn_log(1,bc->port," --> copying cpndialplan:%d and cad:%s to the A-Channel\n",bc->cpnnumplan,bc->cad);
-
- bridged_ch->bc->cpnnumplan=bc->cpnnumplan;
- ast_copy_string(bridged_ch->bc->cad,bc->cad,sizeof(bc->cad));
- }
- }
+ if (bridged_ch) {
+ bridged_ch->bc->cpnnumplan=bc->cpnnumplan;
+ ast_copy_string(bridged_ch->bc->cad,bc->cad,sizeof(bc->cad));
+ }
+ }
+ }
+
+ /*we answer when we've got our very new L3 ID from the NT stack */
+ if (bc->nt) break;
+
+ /* notice that we don't break here!*/
case EVENT_CONNECT_ACKNOWLEDGE:
{
@@ -3432,7 +3537,7 @@
send_cause2ast(ch->ast,bc);
- chan_misdn_log(0,bc->port," org:%d nt:%d, inbandavail:%d state:%d\n", ch->orginator, bc->nt, misdn_inband_avail(bc), ch->state);
+ chan_misdn_log(3,bc->port," --> org:%d nt:%d, inbandavail:%d state:%d\n", ch->orginator, bc->nt, misdn_inband_avail(bc), ch->state);
if ( ch->orginator==ORG_AST && !bc->nt && misdn_inband_avail(bc) && ch->state != MISDN_CONNECTED) {
/* If there's inband information available (e.g. a
recorded message saying what was wrong with the
@@ -3708,6 +3813,7 @@
ast_cli_unregister(&cli_show_cl);
ast_cli_unregister(&cli_show_config);
ast_cli_unregister(&cli_show_port);
+ ast_cli_unregister(&cli_show_ports_stats);
ast_cli_unregister(&cli_show_stacks);
ast_cli_unregister(&cli_restart_port);
ast_cli_unregister(&cli_port_up);
@@ -3764,14 +3870,26 @@
if (strlen(tempbuf))
tracing = 1;
}
-
+
+ misdn_in_calls = (int *)malloc(sizeof(int) * (max_ports+1));
+ misdn_out_calls = (int *)malloc(sizeof(int) * (max_ports+1));
+
+ for (i=1; i <= max_ports; i++) {
+ misdn_in_calls[i]=0;
+ misdn_out_calls[i]=0;
+ }
+
ast_mutex_init(&cl_te_lock);
ast_mutex_init(&release_lock_mutex);
misdn_cfg_update_ptp();
misdn_cfg_get_ports_string(ports);
-
+
+
+ int l1watcher_timeout=0;
+ misdn_cfg_get( 0, MISDN_GEN_L1_TIMEOUT, &l1watcher_timeout, sizeof(int));
+
if (strlen(ports))
chan_misdn_log(0, 0, "Got: %s from get_ports\n",ports);
@@ -3780,7 +3898,9 @@
.cb_event = cb_events,
.cb_log = chan_misdn_log,
.cb_jb_empty = chan_misdn_jb_empty,
+ .l1watcher_timeout=l1watcher_timeout,
};
+
if (misdn_lib_init(ports, &iface, NULL))
chan_misdn_log(0, 0, "No te ports initialized\n");
}
@@ -3805,6 +3925,7 @@
[... 21064 lines stripped ...]
More information about the asterisk-commits
mailing list