[asterisk-commits] oej: branch oej/videocaps r172850 - in /team/oej/videocaps: ./ apps/ autoconf...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Feb 2 05:35:48 CST 2009
Author: oej
Date: Mon Feb 2 05:35:48 2009
New Revision: 172850
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=172850
Log:
Resolve conflict, reset automerge
Added:
team/oej/videocaps/funcs/func_aes.c
- copied unchanged from r172816, trunk/funcs/func_aes.c
Modified:
team/oej/videocaps/ (props changed)
team/oej/videocaps/CHANGES
team/oej/videocaps/apps/app_channelredirect.c
team/oej/videocaps/apps/app_dial.c
team/oej/videocaps/apps/app_queue.c
team/oej/videocaps/apps/app_rpt.c
team/oej/videocaps/apps/app_voicemail.c
team/oej/videocaps/autoconf/ast_func_fork.m4
team/oej/videocaps/channels/chan_agent.c
team/oej/videocaps/channels/chan_dahdi.c
team/oej/videocaps/channels/chan_local.c
team/oej/videocaps/channels/chan_misdn.c
team/oej/videocaps/channels/chan_sip.c
team/oej/videocaps/configs/chan_dahdi.conf.sample
team/oej/videocaps/configs/features.conf.sample
team/oej/videocaps/configs/func_odbc.conf.sample
team/oej/videocaps/configs/sip.conf.sample
team/oej/videocaps/configure
team/oej/videocaps/contrib/scripts/realtime_pgsql.sql
team/oej/videocaps/funcs/func_strings.c
team/oej/videocaps/include/asterisk/app.h
team/oej/videocaps/include/asterisk/causes.h
team/oej/videocaps/include/asterisk/channel.h
team/oej/videocaps/include/asterisk/global_datastores.h
team/oej/videocaps/include/asterisk/say.h
team/oej/videocaps/main/app.c
team/oej/videocaps/main/ast_expr2.c
team/oej/videocaps/main/ast_expr2.h
team/oej/videocaps/main/asterisk.c
team/oej/videocaps/main/cli.c
team/oej/videocaps/main/features.c
team/oej/videocaps/main/global_datastores.c
team/oej/videocaps/main/manager.c
team/oej/videocaps/main/pbx.c
team/oej/videocaps/main/slinfactory.c
team/oej/videocaps/res/res_config_odbc.c
Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
automerge = http://www.codename-pineapple.org/
Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Feb 2 05:35:48 2009
@@ -1,1 +1,1 @@
-/trunk:1-171399
+/trunk:1-172816
Modified: team/oej/videocaps/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/CHANGES?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/CHANGES (original)
+++ team/oej/videocaps/CHANGES Mon Feb 2 05:35:48 2009
@@ -28,8 +28,8 @@
* Added a new 'faxdetect=yes|no' configuration option to sip.conf. When this
option is enabled, a SIP channel will go to the fax extension (if it exists)
after T38 is negotiated. This option is disabled by default.
- * If ATTENDED_TRANSFER_COMPLETE_SOUND is set, the sound will be played to the
- target of an attended transfer
+ * If the channel variable ATTENDED_TRANSFER_COMPLETE_SOUND is set,
+ the sound will be played to the target of an attended transfer
* Added two new configuration options, "qualifygap" and "qualifypeers", which allow
finer control over how many peers Asterisk will qualify and the gap between them
when all peers need to be qualified at the same time.
@@ -46,6 +46,8 @@
information
* Added a function to remove SIP headers added in the dialplan before the
first INVITE is generated - SIPRemoveHeader()
+ * Channel variables set with setvar= in a device configuration is now
+ set both for inbound and outbound calls.
Skinny Changes
--------------
@@ -78,6 +80,10 @@
Totally. Hopefully, that means more to you than it does to me.
* Added AUDIOHOOK_INHERIT. For information on its use, please see the output
of "core show function AUDIOHOOK_INHERIT" from the CLI
+ * Added AES_ENCRYPT. For information on its use, please see the output
+ of "core show function AES_ENCRYPT" from the CLI
+ * Added AES_DECRYPT. For information on its use, please see the output
+ of "core show function AES_DECRYPT" from the CLI
Applications
------------
@@ -327,6 +333,9 @@
* A new configuration option, "timeoutpriority" has been added. Please see the section labeled
"QUEUE TIMING OPTIONS" in configs/queues.conf.sample for a detailed explanation of the option
as well as an explanation about timeout options in general
+ * Added a new option - C - for forcing the "answered elsewhere" flag on
+ cancellation of calls in to members of the queue. This is to avoid the
+ call to a member of a queue having the call listed as a "missed call".
Realtime changes
----------------
@@ -854,6 +863,13 @@
Call Features (res_features) Changes
------------------------------------
* Added the parkedcalltransfers option to features.conf
+ * Added parkedcallparking option to control one touch parking w/ parking
+ pickup
+ * Added parkedcallhangup option to control disconnect feature w/ parking
+ pickup
+ * Added parkedcallrecording option to control one-touch record w/ parking
+ pickup
+ * Added BRIDGE_FEATURES variable to set available features for a channel
* The built-in method for doing attended transfers has been updated to
include some new options that allow you to have the transferee sent
back to the person that did the transfer if the transfer is not successful.
Modified: team/oej/videocaps/apps/app_channelredirect.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_channelredirect.c?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/apps/app_channelredirect.c (original)
+++ team/oej/videocaps/apps/app_channelredirect.c Mon Feb 2 05:35:48 2009
@@ -93,6 +93,9 @@
return 0;
}
+ if (chan2->pbx) {
+ ast_set_flag(chan2, AST_FLAG_BRIDGE_HANGUP_DONT); /* don't let the after-bridge code run the h-exten */
+ }
res = ast_async_parseable_goto(chan2, args.label);
pbx_builtin_setvar_helper(chan, "CHANNELREDIRECT_STATUS", "SUCCESS");
ast_channel_unlock(chan2);
Modified: team/oej/videocaps/apps/app_dial.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_dial.c?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/apps/app_dial.c (original)
+++ team/oej/videocaps/apps/app_dial.c Mon Feb 2 05:35:48 2009
@@ -568,8 +568,12 @@
while (outgoing) {
/* Hangup any existing lines we have open */
if (outgoing->chan && (outgoing->chan != exception)) {
- if (answered_elsewhere)
+ if (answered_elsewhere) {
+ /* The flag is used for local channel inheritance and stuff */
ast_set_flag(outgoing->chan, AST_FLAG_ANSWERED_ELSEWHERE);
+ /* This is for the channel drivers */
+ outgoing->chan->hangupcause = AST_CAUSE_ANSWERED_ELSEWHERE;
+ }
ast_hangup(outgoing->chan);
}
oo = outgoing;
@@ -1463,19 +1467,6 @@
return 1; /* success */
}
-static void set_dial_features(struct ast_flags64 *opts, struct ast_dial_features *features)
-{
- struct ast_flags64 perm_opts = {.flags = 0};
-
- ast_copy_flags64(&perm_opts, opts,
- OPT_CALLER_TRANSFER | OPT_CALLER_PARK | OPT_CALLER_MONITOR | OPT_CALLER_MIXMONITOR | OPT_CALLER_HANGUP |
- OPT_CALLEE_TRANSFER | OPT_CALLEE_PARK | OPT_CALLEE_MONITOR | OPT_CALLEE_MIXMONITOR | OPT_CALLEE_HANGUP);
-
- memset(features->options, 0, sizeof(features->options));
-
- ast_app_options2str64(dial_exec_options, &perm_opts, features->options, sizeof(features->options));
-}
-
static void end_bridge_callback(void *data)
{
char buf[80];
@@ -1539,9 +1530,6 @@
struct ast_flags64 opts = { 0, };
char *opt_args[OPT_ARG_ARRAY_SIZE];
struct ast_datastore *datastore = NULL;
- struct ast_datastore *ds_caller_features = NULL;
- struct ast_datastore *ds_callee_features = NULL;
- struct ast_dial_features *caller_features;
int fulldial = 0, num_dialed = 0;
/* Reset all DIAL variables back to blank, to prevent confusion (in case we don't reset all of them). */
@@ -1572,6 +1560,7 @@
pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
goto done;
}
+
if (ast_test_flag64(&opts, OPT_OPERMODE)) {
opermode = ast_strlen_zero(opt_args[OPT_ARG_OPERMODE]) ? 1 : atoi(opt_args[OPT_ARG_OPERMODE]);
@@ -1624,28 +1613,6 @@
}
ast_channel_unlock(chan);
ast_copy_flags64(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING);
-
- /* Create datastore for channel dial features for caller */
- if (!(ds_caller_features = ast_datastore_alloc(&dial_features_info, NULL))) {
- ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n");
- goto out;
- }
-
- if (!(caller_features = ast_malloc(sizeof(*caller_features)))) {
- ast_log(LOG_WARNING, "Unable to allocate memory for feature flags. Aborting!\n");
- goto out;
- }
-
- ast_copy_flags(&(caller_features->features_callee), &(config.features_caller), AST_FLAGS_ALL);
- caller_features->is_caller = 1;
- set_dial_features(&opts, caller_features);
-
- ds_caller_features->inheritance = DATASTORE_INHERIT_FOREVER;
- ds_caller_features->data = caller_features;
-
- ast_channel_lock(chan);
- ast_channel_datastore_add(chan, ds_caller_features);
- ast_channel_unlock(chan);
/* loop through the list of dial destinations */
rest = args.peers;
@@ -1658,7 +1625,6 @@
char *tech = strsep(&number, "/");
/* find if we already dialed this interface */
struct ast_dialed_interface *di;
- struct ast_dial_features *callee_features;
AST_LIST_HEAD(, ast_dialed_interface) *dialed_interfaces;
num_dialed++;
if (!number) {
@@ -1788,6 +1754,14 @@
/* If we have an outbound group, set this peer channel to it */
if (outbound_group)
ast_app_group_set_channel(tc, outbound_group);
+ /* If the calling channel has the ANSWERED_ELSEWHERE flag set, inherit it. This is to support local channels */
+ if (ast_test_flag(chan, AST_FLAG_ANSWERED_ELSEWHERE))
+ ast_set_flag(tc, AST_FLAG_ANSWERED_ELSEWHERE);
+
+ /* Check if we're forced by configuration */
+ if (ast_test_flag64(&opts, OPT_CANCEL_ELSEWHERE))
+ ast_set_flag(tc, AST_FLAG_ANSWERED_ELSEWHERE);
+
/* Inherit context and extension */
ast_string_field_set(tc, dialcontext, ast_strlen_zero(chan->macrocontext) ? chan->context : chan->macrocontext);
@@ -1795,30 +1769,6 @@
ast_copy_string(tc->exten, chan->macroexten, sizeof(tc->exten));
else
ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten));
-
- /* Save callee features */
- if (!(ds_callee_features = ast_datastore_alloc(&dial_features_info, NULL))) {
- ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n");
- ast_free(tmp);
- goto out;
- }
-
- if (!(callee_features = ast_malloc(sizeof(*callee_features)))) {
- ast_log(LOG_WARNING, "Unable to allocate memory for feature flags. Aborting!\n");
- ast_free(tmp);
- goto out;
- }
-
- ast_copy_flags(&(callee_features->features_callee), &(config.features_callee), AST_FLAGS_ALL);
- callee_features->is_caller = 0;
- set_dial_features(&opts, callee_features);
-
- ds_callee_features->inheritance = DATASTORE_INHERIT_FOREVER;
- ds_callee_features->data = callee_features;
-
- ast_channel_lock(chan);
- ast_channel_datastore_add(tc, ds_callee_features);
- ast_channel_unlock(chan);
res = ast_call(tc, numsubst, 0); /* Place the call, but don't wait on the answer */
Modified: team/oej/videocaps/apps/app_queue.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_queue.c?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/apps/app_queue.c (original)
+++ team/oej/videocaps/apps/app_queue.c Mon Feb 2 05:35:48 2009
@@ -118,6 +118,9 @@
<parameter name="queuename" required="true" />
<parameter name="options">
<optionlist>
+ <option name="C">
+ <para>Mark all calls as "answered elsewhere" when cancelled.</para>
+ </option>
<option name="c">
<para>Continue in the dialplan if the callee hangs up.</para>
</option>
@@ -643,6 +646,7 @@
int linwrapped; /*!< Is the linpos wrapped? */
time_t start; /*!< When we started holding */
time_t expire; /*!< When this entry should expire (time out of queue) */
+ int cancel_answered_elsewhere; /*!< Whether we should force the CAE flag on this call (C) option*/
struct ast_channel *chan; /*!< Our channel */
AST_LIST_HEAD_NOLOCK(,penalty_rule) qe_rules; /*!< Local copy of the queue's penalty rules */
struct penalty_rule *pr; /*!< Pointer to the next penalty rule to implement */
@@ -875,22 +879,21 @@
}
/*! \brief Set variables of queue */
-static void set_queue_variables(struct queue_ent *qe)
+static void set_queue_variables(struct call_queue *q, struct ast_channel *chan)
{
char interfacevar[256]="";
float sl = 0;
- if (qe->parent->setqueuevar) {
+ if (q->setqueuevar) {
sl = 0;
- if (qe->parent->callscompleted > 0)
- sl = 100 * ((float) qe->parent->callscompletedinsl / (float) qe->parent->callscompleted);
+ if (q->callscompleted > 0)
+ sl = 100 * ((float) q->callscompletedinsl / (float) q->callscompleted);
snprintf(interfacevar, sizeof(interfacevar),
"QUEUENAME=%s,QUEUEMAX=%d,QUEUESTRATEGY=%s,QUEUECALLS=%d,QUEUEHOLDTIME=%d,QUEUETALKTIME=%d,QUEUECOMPLETED=%d,QUEUEABANDONED=%d,QUEUESRVLEVEL=%d,QUEUESRVLEVELPERF=%2.1f",
- qe->parent->name, qe->parent->maxlen, int2strat(qe->parent->strategy), qe->parent->count, qe->parent->holdtime, qe->parent->talktime, qe->parent->callscompleted,
- qe->parent->callsabandoned, qe->parent->servicelevel, sl);
+ q->name, q->maxlen, int2strat(q->strategy), q->count, q->holdtime, q->talktime, q->callscompleted, q->callsabandoned, q->servicelevel, sl);
- pbx_builtin_setvar_multiple(qe->chan, interfacevar);
+ pbx_builtin_setvar_multiple(chan, interfacevar);
}
}
@@ -2223,15 +2226,15 @@
}
/*! \brief Hang up a list of outgoing calls */
-static void hangupcalls(struct callattempt *outgoing, struct ast_channel *exception)
+static void hangupcalls(struct callattempt *outgoing, struct ast_channel *exception, int cancel_answered_elsewhere)
{
struct callattempt *oo;
while (outgoing) {
/* If someone else answered the call we should indicate this in the CANCEL */
/* Hangup any existing lines we have open */
- if (outgoing->chan && (outgoing->chan != exception)) {
- if (exception)
+ if (outgoing->chan && (outgoing->chan != exception || cancel_answered_elsewhere)) {
+ if (exception || cancel_answered_elsewhere)
ast_set_flag(outgoing->chan, AST_FLAG_ANSWERED_ELSEWHERE);
ast_hangup(outgoing->chan);
}
@@ -2410,6 +2413,9 @@
return 0;
}
+ if (qe->cancel_answered_elsewhere) {
+ ast_set_flag(tmp->chan, AST_FLAG_ANSWERED_ELSEWHERE);
+ }
tmp->chan->appl = "AppQueue";
tmp->chan->data = "(Outgoing Line)";
memset(&tmp->chan->whentohangup, 0, sizeof(tmp->chan->whentohangup));
@@ -2644,7 +2650,7 @@
static void record_abandoned(struct queue_ent *qe)
{
ao2_lock(qe->parent);
- set_queue_variables(qe);
+ set_queue_variables(qe->parent, qe->chan);
manager_event(EVENT_FLAG_AGENT, "QueueCallerAbandon",
"Queue: %s\r\n"
"Uniqueid: %s\r\n"
@@ -3387,13 +3393,31 @@
return ds;
}
+struct queue_end_bridge {
+ struct call_queue *q;
+ struct ast_channel *chan;
+};
+
+static void end_bridge_callback_data_fixup(struct ast_bridge_config *bconfig, struct ast_channel *originator, struct ast_channel *terminator)
+{
+ struct queue_end_bridge *qeb = bconfig->end_bridge_callback_data;
+ ao2_ref(qeb, +1);
+ qeb->chan = originator;
+}
+
static void end_bridge_callback(void *data)
{
- struct queue_ent *qe = data;
-
- ao2_lock(qe->parent);
- set_queue_variables(qe);
- ao2_unlock(qe->parent);
+ struct queue_end_bridge *qeb = data;
+ struct call_queue *q = qeb->q;
+ struct ast_channel *chan = qeb->chan;
+
+ if (ao2_ref(qeb, -1) == 1) {
+ ao2_lock(q);
+ set_queue_variables(q, chan);
+ ao2_unlock(q);
+ /* This unrefs the reference we made in try_calling when we allocated qeb */
+ queue_unref(q);
+ }
}
/*! \brief A large function which calls members, updates statistics, and bridges the caller and a member
@@ -3463,6 +3487,7 @@
int callcompletedinsl;
struct ao2_iterator memi;
struct ast_datastore *datastore, *transfer_ds;
+ struct queue_end_bridge *queue_end_bridge = NULL;
ast_channel_lock(qe->chan);
datastore = ast_channel_datastore_find(qe->chan, &dialed_interface_info, NULL);
@@ -3530,11 +3555,31 @@
case 'X':
ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_AUTOMIXMON);
break;
-
- }
-
- bridge_config.end_bridge_callback = end_bridge_callback;
- bridge_config.end_bridge_callback_data = qe;
+ case 'C':
+ qe->cancel_answered_elsewhere = 1;
+ break;
+
+ }
+
+ if ((queue_end_bridge = ao2_alloc(sizeof(*queue_end_bridge), NULL))) {
+ queue_end_bridge->q = qe->parent;
+ queue_end_bridge->chan = qe->chan;
+ bridge_config.end_bridge_callback = end_bridge_callback;
+ bridge_config.end_bridge_callback_data = queue_end_bridge;
+ bridge_config.end_bridge_callback_data_fixup = end_bridge_callback_data_fixup;
+ /* Since queue_end_bridge can survive beyond the life of this call to Queue, we need
+ * to make sure to increase the refcount of this queue so it cannot be freed until we
+ * are done with it. We remove this reference in end_bridge_callback.
+ */
+ queue_ref(qe->parent);
+ }
+
+ /* if the calling channel has the ANSWERED_ELSEWHERE flag set, make sure this is inherited.
+ (this is mainly to support chan_local)
+ */
+ if (ast_test_flag(qe->chan, AST_FLAG_ANSWERED_ELSEWHERE)) {
+ qe->cancel_answered_elsewhere = 1;
+ }
/* Hold the lock while we setup the outgoing calls */
if (use_weight)
@@ -3716,7 +3761,7 @@
member = lpeer->member;
/* Increment the refcount for this member, since we're going to be using it for awhile in here. */
ao2_ref(member, 1);
- hangupcalls(outgoing, peer);
+ hangupcalls(outgoing, peer, qe->cancel_answered_elsewhere);
outgoing = NULL;
if (announce || qe->parent->reportholdtime || qe->parent->memberdelay) {
int res2;
@@ -3822,7 +3867,7 @@
}
/* try to set queue variables if configured to do so*/
- set_queue_variables(qe);
+ set_queue_variables(qe->parent, qe->chan);
ao2_unlock(qe->parent);
ast_channel_lock(qe->chan);
@@ -4119,7 +4164,7 @@
ao2_ref(member, -1);
}
out:
- hangupcalls(outgoing, NULL);
+ hangupcalls(outgoing, NULL, qe->cancel_answered_elsewhere);
return res;
}
@@ -5089,7 +5134,7 @@
ast_stopstream(chan);
}
- set_queue_variables(&qe);
+ set_queue_variables(qe.parent, qe.chan);
leave_queue(&qe);
if (reason != QUEUE_UNKNOWN)
Modified: team/oej/videocaps/apps/app_rpt.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_rpt.c?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/apps/app_rpt.c (original)
+++ team/oej/videocaps/apps/app_rpt.c Mon Feb 2 05:35:48 2009
@@ -359,6 +359,8 @@
#include "asterisk/cdr.h"
#include "asterisk/options.h"
#include "asterisk/manager.h"
+#include "asterisk/app.h"
+
#include <termios.h>
#ifdef NEW_ASTERISK
@@ -1966,7 +1968,7 @@
sprintf(str,"%s?node=%s&time=%u&seqno=%u",myrpt->p.statpost_url,
myrpt->name,(unsigned int) now,seq);
if (pairs) sprintf(str + strlen(str),"&%s",pairs);
- if (!(pid = fork()))
+ if (!(pid = ast_safe_fork(0)))
{
execv(astrs[0],astrs);
ast_log(LOG_ERROR, "exec of %s failed.\n", astrs[0]);
Modified: team/oej/videocaps/apps/app_voicemail.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/apps/app_voicemail.c?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/apps/app_voicemail.c (original)
+++ team/oej/videocaps/apps/app_voicemail.c Mon Feb 2 05:35:48 2009
@@ -9627,6 +9627,11 @@
AST_NONSTANDARD_APP_ARGS(arg, args, '@');
+ if (ast_strlen_zero(arg.mbox)) {
+ ast_log(LOG_ERROR, "MAILBOX_EXISTS requires an argument (<mailbox>[@<context>])\n");
+ return -1;
+ }
+
ast_copy_string(buf, find_user(&svm, ast_strlen_zero(arg.context) ? "default" : arg.context, arg.mbox) ? "1" : "0", len);
return 0;
}
Modified: team/oej/videocaps/autoconf/ast_func_fork.m4
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/autoconf/ast_func_fork.m4?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/autoconf/ast_func_fork.m4 (original)
+++ team/oej/videocaps/autoconf/ast_func_fork.m4 Mon Feb 2 05:35:48 2009
@@ -39,6 +39,8 @@
fi
if test "x$ac_cv_func_fork_works" = xyes; then
AC_DEFINE(HAVE_WORKING_FORK, 1, [Define to 1 if `fork' works.])
+ PBX_WORKING_FORK=1
+ AC_SUBST(PBX_WORKING_FORK)
fi
])# AST_FUNC_FORK
Modified: team/oej/videocaps/channels/chan_agent.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/channels/chan_agent.c?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/channels/chan_agent.c (original)
+++ team/oej/videocaps/channels/chan_agent.c Mon Feb 2 05:35:48 2009
@@ -221,7 +221,6 @@
static char savecallsin[AST_MAX_BUF] = "";
static int updatecdr = 0;
static char beep[AST_MAX_BUF] = "beep";
-struct ast_event_sub *agent_devicestate_sub = NULL;
#define GETAGENTBYCALLERID "AGENTBYCALLERID"
@@ -254,7 +253,6 @@
char agent[AST_MAX_AGENT]; /*!< Agent ID */
char password[AST_MAX_AGENT]; /*!< Password for Agent login */
char name[AST_MAX_AGENT];
- int inherited_devicestate; /*!< Does the underlying channel have a devicestate to pass? */
ast_mutex_t app_lock; /**< Synchronization between owning applications */
int app_lock_flag;
ast_cond_t app_complete_cond;
@@ -347,53 +345,6 @@
.set_base_channel = agent_set_base_channel,
};
-static void agent_devicestate_cb(const struct ast_event *event, void *unused)
-{
- int res, i;
- struct agent_pvt *p;
- char base[AST_CHANNEL_NAME], *tmp;
- const char *device;
- enum ast_device_state state;
-
- state = ast_event_get_ie_uint(event, AST_EVENT_IE_STATE);
- device = ast_event_get_ie_str(event, AST_EVENT_IE_DEVICE);
-
- if (ast_strlen_zero(device)) {
- return;
- }
-
- /* Skip Agent status */
- if (!strncasecmp(device, "Agent/", 6)) {
- return;
- }
-
- /* Try to be safe, but don't deadlock */
- for (i = 0; i < 10; i++) {
- if ((res = AST_LIST_TRYLOCK(&agents)) == 0) {
- break;
- }
- }
- if (res) {
- return;
- }
-
- AST_LIST_TRAVERSE(&agents, p, list) {
- ast_mutex_lock(&p->lock);
- if (p->chan) {
- ast_copy_string(base, p->chan->name, sizeof(base));
- if ((tmp = strrchr(base, '-'))) {
- *tmp = '\0';
- }
- if (strcasecmp(p->chan->name, device) == 0 || strcasecmp(base, device) == 0) {
- p->inherited_devicestate = state;
- ast_devstate_changed(state, "Agent/%s", p->agent);
- }
- }
- ast_mutex_unlock(&p->lock);
- }
- AST_LIST_UNLOCK(&agents);
-}
-
/*!
* Adds an agent to the global list of agents.
*
@@ -457,7 +408,6 @@
p->app_sleep_cond = 1;
p->group = group;
p->pending = pending;
- p->inherited_devicestate = -1;
AST_LIST_INSERT_TAIL(&agents, p, list);
}
@@ -611,7 +561,6 @@
p->lastdisc = ast_tvadd(ast_tvnow(), ast_samp2tv(p->wrapuptime, 1000));
}
p->chan = NULL;
- p->inherited_devicestate = -1;
ast_devstate_changed(AST_DEVICE_UNAVAILABLE, "Agent/%s", p->agent);
p->acknowledged = 0;
}
@@ -833,7 +782,6 @@
} else {
/* Agent hung-up */
p->chan = NULL;
- p->inherited_devicestate = -1;
ast_devstate_changed(AST_DEVICE_UNAVAILABLE, "Agent/%s", p->agent);
}
@@ -955,7 +903,6 @@
/* Recognize the hangup and pass it along immediately */
ast_hangup(p->chan);
p->chan = NULL;
- p->inherited_devicestate = -1;
ast_devstate_changed(AST_DEVICE_UNAVAILABLE, "Agent/%s", p->agent);
}
ast_debug(1, "Hungup, howlong is %d, autologoff is %d\n", howlong, p->autologoff);
@@ -1695,7 +1642,6 @@
set_agentbycallerid(p->logincallerid, NULL);
p->loginchan[0] ='\0';
p->logincallerid[0] = '\0';
- p->inherited_devicestate = -1;
ast_devstate_changed(AST_DEVICE_UNAVAILABLE, "Agent/%s", p->agent);
if (persistent_agents)
dump_agents();
@@ -2266,7 +2212,6 @@
/* Log us off if appropriate */
if (p->chan == chan) {
p->chan = NULL;
- p->inherited_devicestate = -1;
}
p->acknowledged = 0;
logintime = time(NULL) - p->loginstart;
@@ -2481,8 +2426,6 @@
if (p->owner) {
if (res != AST_DEVICE_INUSE)
res = AST_DEVICE_BUSY;
- } else if (p->inherited_devicestate > -1) {
- res = p->inherited_devicestate;
} else {
if (res == AST_DEVICE_BUSY)
res = AST_DEVICE_INUSE;
@@ -2614,9 +2557,6 @@
/* Dialplan Functions */
ast_custom_function_register(&agent_function);
- agent_devicestate_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE,
- agent_devicestate_cb, NULL, AST_EVENT_IE_END);
-
return AST_MODULE_LOAD_SUCCESS;
}
@@ -2634,10 +2574,6 @@
struct agent_pvt *p;
/* First, take us out of the channel loop */
ast_channel_unregister(&agent_tech);
- /* Delete devicestate subscription */
- if (agent_devicestate_sub) {
- agent_devicestate_sub = ast_event_unsubscribe(agent_devicestate_sub);
- }
/* Unregister dialplan functions */
ast_custom_function_unregister(&agent_function);
/* Unregister CLI commands */
Modified: team/oej/videocaps/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/videocaps/channels/chan_dahdi.c?view=diff&rev=172850&r1=172849&r2=172850
==============================================================================
--- team/oej/videocaps/channels/chan_dahdi.c (original)
+++ team/oej/videocaps/channels/chan_dahdi.c Mon Feb 2 05:35:48 2009
@@ -371,6 +371,10 @@
struct dahdi_pvt;
+/*!
+ * \brief Configured ring timeout base.
+ * \note Value computed from "ringtimeout" read in from chan_dahdi.conf if it exists.
+ */
static int ringt_base = DEFAULT_RINGT;
#ifdef HAVE_SS7
@@ -455,17 +459,23 @@
struct pri *dchans[NUM_DCHANS]; /*!< Actual d-channels */
int dchanavail[NUM_DCHANS]; /*!< Whether each channel is available */
struct pri *pri; /*!< Currently active D-channel */
+ /*! \brief TRUE if to dump PRI event info (Tested but never set) */
int debug;
int fds[NUM_DCHANS]; /*!< FD's for d-channels */
+ /*! \brief Value set but not used */
int offset;
+ /*! \brief Span number put into user output messages */
int span;
+ /*! \brief TRUE if span is being reset/restarted */
int resetting;
+ /*! \brief Current position during a reset (-1 if not started) */
int resetpos;
#ifdef HAVE_PRI_INBANDDISCONNECT
unsigned int inbanddisconnect:1; /*!< Should we support inband audio after receiving DISCONNECT? */
#endif
time_t lastreset; /*!< time when unused channels were last reset */
long resetinterval; /*!< Interval (in seconds) for resetting unused channels */
+ /*! \brief ISDN signalling type (SIG_PRI, SIG_BRI, SIG_BRI_PTMP, etc...) */
int sig;
struct dahdi_pvt *pvts[MAX_CHANNELS]; /*!< Member channel pvt structs */
struct dahdi_pvt *crvs; /*!< Member CRV structs */
@@ -546,14 +556,14 @@
* First three states are required for send Ring Pulse Alert Signal
*/
typedef enum {
- MWI_SEND_NULL = 0,
- MWI_SEND_SA,
- MWI_SEND_SA_WAIT,
- MWI_SEND_PAUSE,
- MWI_SEND_SPILL,
- MWI_SEND_CLEANUP,
- MWI_SEND_DONE,
-} mwisend_states ;
+ MWI_SEND_NULL = 0,
+ MWI_SEND_SA,
+ MWI_SEND_SA_WAIT,
+ MWI_SEND_PAUSE,
+ MWI_SEND_SPILL,
+ MWI_SEND_CLEANUP,
+ MWI_SEND_DONE,
+} mwisend_states;
struct mwisend_info {
struct timeval pause;
@@ -576,117 +586,375 @@
int buf_no; /*!< Number of buffers */
int buf_policy; /*!< Buffer policy */
int sig; /*!< Signalling style */
- int radio; /*!< radio type */
+ /*!
+ * \brief Nonzero if the signaling type is sent over a radio.
+ * \note Set to a couple of nonzero values but it is only tested like a boolean.
+ */
+ int radio;
int outsigmod; /*!< Outbound Signalling style (modifier) */
int oprmode; /*!< "Operator Services" mode */
struct dahdi_pvt *oprpeer; /*!< "Operator Services" peer tech_pvt ptr */
- float cid_rxgain; /*!< "Gain to apply during caller id */
+ /*! \brief Amount of gain to increase during caller id */
+ float cid_rxgain;
+ /*! \brief Rx gain set by chan_dahdi.conf */
float rxgain;
+ /*! \brief Tx gain set by chan_dahdi.conf */
float txgain;
int tonezone; /*!< tone zone for this chan, or -1 for default */
struct dahdi_pvt *next; /*!< Next channel in list */
struct dahdi_pvt *prev; /*!< Prev channel in list */
/* flags */
+
+ /*!
+ * \brief TRUE if ADSI (Analog Display Services Interface) available
+ * \note Set from the "adsi" value read in from chan_dahdi.conf
+ */
unsigned int adsi:1;
+ /*!
+ * \brief TRUE if we can use a polarity reversal to mark when an outgoing
+ * call is answered by the remote party.
+ * \note Set from the "answeronpolarityswitch" value read in from chan_dahdi.conf
+ */
unsigned int answeronpolarityswitch:1;
+ /*!
+ * \brief TRUE if busy detection is enabled.
+ * (Listens for the beep-beep busy pattern.)
+ * \note Set from the "busydetect" value read in from chan_dahdi.conf
+ */
unsigned int busydetect:1;
+ /*!
+ * \brief TRUE if call return is enabled.
+ * (*69, if your dialplan doesn't catch this first)
+ * \note Set from the "callreturn" value read in from chan_dahdi.conf
+ */
unsigned int callreturn:1;
+ /*!
+ * \brief TRUE if busy extensions will hear the call-waiting tone
+ * and can use hook-flash to switch between callers.
+ * \note Can be disabled by dialing *70.
+ * \note Initialized with the "callwaiting" value read in from chan_dahdi.conf
+ */
unsigned int callwaiting:1;
+ /*!
+ * \brief TRUE if send caller ID for Call Waiting
+ * \note Set from the "callwaitingcallerid" value read in from chan_dahdi.conf
+ */
unsigned int callwaitingcallerid:1;
+ /*!
+ * \brief TRUE if support for call forwarding enabled.
+ * Dial *72 to enable call forwarding.
+ * Dial *73 to disable call forwarding.
+ * \note Set from the "cancallforward" value read in from chan_dahdi.conf
+ */
unsigned int cancallforward:1;
+ /*!
+ * \brief TRUE if support for call parking is enabled.
+ * \note Set from the "canpark" value read in from chan_dahdi.conf
+ */
unsigned int canpark:1;
- unsigned int confirmanswer:1; /*!< Wait for '#' to confirm answer */
+ /*! \brief TRUE if to wait for a DTMF digit to confirm answer */
+ unsigned int confirmanswer:1;
+ /*!
+ * \brief TRUE if the channel is to be destroyed on hangup.
+ * (Used by pseudo channels.)
+ */
unsigned int destroy:1;
unsigned int didtdd:1; /*!< flag to say its done it once */
+ /*! \brief TRUE if analog type line dialed no digits in Dial() */
unsigned int dialednone:1;
+ /*! \brief TRUE if in the process of dialing digits or sending something. */
unsigned int dialing:1;
+ /*! \brief TRUE if the transfer capability of the call is digital. */
unsigned int digital:1;
+ /*! \brief TRUE if Do-Not-Disturb is enabled. */
unsigned int dnd:1;
+ /*! \brief XXX BOOLEAN Purpose??? */
unsigned int echobreak:1;
+ /*!
+ * \brief TRUE if echo cancellation enabled when bridged.
+ * \note Initialized with the "echocancelwhenbridged" value read in from chan_dahdi.conf
+ * \note Disabled if the echo canceller is not setup.
+ */
unsigned int echocanbridged:1;
+ /*! \brief TRUE if echo cancellation is turned on. */
unsigned int echocanon:1;
- unsigned int faxhandled:1; /*!< Has a fax tone already been handled? */
+ /*! \brief TRUE if a fax tone has already been handled. */
+ unsigned int faxhandled:1;
+ /*! \brief TRUE if over a radio and dahdi_read() has been called. */
unsigned int firstradio:1;
+ /*!
+ * \brief TRUE if the call will be considered "hung up" on a polarity reversal.
+ * \note Set from the "hanguponpolarityswitch" value read in from chan_dahdi.conf
+ */
unsigned int hanguponpolarityswitch:1;
+ /*! \brief TRUE if DTMF detection needs to be done by hardware. */
unsigned int hardwaredtmf:1;
+ /*!
+ * \brief TRUE if the outgoing caller ID is blocked/hidden.
+ * \note Caller ID can be disabled by dialing *67.
+ * \note Caller ID can be enabled by dialing *82.
+ * \note Initialized with the "hidecallerid" value read in from chan_dahdi.conf
+ */
unsigned int hidecallerid:1;
- unsigned int hidecalleridname:1; /*!< Hide just the name not the number for legacy PBX use */
+ /*!
+ * \brief TRUE if hide just the name not the number for legacy PBX use.
+ * \note Only applies to PRI channels.
+ * \note Set from the "hidecalleridname" value read in from chan_dahdi.conf
+ */
+ unsigned int hidecalleridname:1;
+ /*! \brief TRUE if DTMF detection is disabled. */
unsigned int ignoredtmf:1;
- unsigned int immediate:1; /*!< Answer before getting digits? */
+ /*!
+ * \brief TRUE if the channel should be answered immediately
+ * without attempting to gather any digits.
+ * \note Set from the "immediate" value read in from chan_dahdi.conf
+ */
+ unsigned int immediate:1;
+ /*! \brief TRUE if in an alarm condition. */
unsigned int inalarm:1;
- unsigned int mate:1; /*!< flag to say its in MATE mode */
+ /*! \brief TRUE if TDD in MATE mode */
+ unsigned int mate:1;
+ /*! \brief TRUE if we originated the call leg. */
unsigned int outgoing:1;
/* unsigned int overlapdial:1; unused and potentially confusing */
+ /*!
+ * \brief TRUE if busy extensions will hear the call-waiting tone
+ * and can use hook-flash to switch between callers.
+ * \note Set from the "callwaiting" value read in from chan_dahdi.conf
+ */
unsigned int permcallwaiting:1;
- unsigned int permhidecallerid:1; /*!< Whether to hide our outgoing caller ID or not */
+ /*!
+ * \brief TRUE if the outgoing caller ID is blocked/restricted/hidden.
+ * \note Set from the "hidecallerid" value read in from chan_dahdi.conf
+ */
+ unsigned int permhidecallerid:1;
+ /*!
+ * \brief TRUE if PRI congestion/busy indications are sent out-of-band.
+ * \note Set from the "priindication" value read in from chan_dahdi.conf
+ */
unsigned int priindication_oob:1;
+ /*!
+ * \brief TRUE if PRI B channels are always exclusively selected.
+ * \note Set from the "priexclusive" value read in from chan_dahdi.conf
+ */
unsigned int priexclusive:1;
+ /*!
+ * \brief TRUE if we will pulse dial.
+ * \note Set from the "pulsedial" value read in from chan_dahdi.conf
+ */
unsigned int pulse:1;
- unsigned int pulsedial:1; /*!< whether a pulse dial phone is detected */
+ /*! \brief TRUE if a pulsed digit was detected. (Pulse dial phone detected) */
+ unsigned int pulsedial:1;
unsigned int restartpending:1; /*!< flag to ensure counted only once for restart */
- unsigned int restrictcid:1; /*!< Whether restrict the callerid -> only send ANI */
+ /*!
+ * \brief TRUE if caller ID is restricted.
+ * \note Set but not used. Should be deleted. Redundant with permhidecallerid.
+ * \note Set from the "restrictcid" value read in from chan_dahdi.conf
+ */
+ unsigned int restrictcid:1;
+ /*!
+ * \brief TRUE if three way calling is enabled
+ * \note Set from the "threewaycalling" value read in from chan_dahdi.conf
+ */
unsigned int threewaycalling:1;
+ /*!
+ * \brief TRUE if call transfer is enabled
+ * \note For FXS ports (either direct analog or over T1/E1):
+ * Support flash-hook call transfer
+ * \note For digital ports using ISDN PRI protocols:
+ * Support switch-side transfer (called 2BCT, RLT or other names)
+ * \note Set from the "transfer" value read in from chan_dahdi.conf
+ */
unsigned int transfer:1;
- unsigned int use_callerid:1; /*!< Whether or not to use caller id on this channel */
- unsigned int use_callingpres:1; /*!< Whether to use the callingpres the calling switch sends */
+ /*!
+ * \brief TRUE if caller ID is used on this channel.
+ * \note PRI and SS7 spans will save caller ID from the networking peer.
+ * \note FXS ports will generate the caller ID spill.
+ * \note FXO ports will listen for the caller ID spill.
+ * \note Set from the "usecallerid" value read in from chan_dahdi.conf
+ */
+ unsigned int use_callerid:1;
+ /*!
+ * \brief TRUE if we will use the calling presentation setting
+ * from the Asterisk channel for outgoing calls.
+ * \note Only applies to PRI and SS7 channels.
+ * \note Set from the "usecallingpres" value read in from chan_dahdi.conf
+ */
+ unsigned int use_callingpres:1;
+ /*!
+ * \brief TRUE if distinctive rings are to be detected.
+ * \note For FXO lines
+ * \note Set indirectly from the "usedistinctiveringdetection" value read in from chan_dahdi.conf
+ */
unsigned int usedistinctiveringdetection:1;
- unsigned int dahditrcallerid:1; /*!< should we use the callerid from incoming call on dahdi transfer or not */
- unsigned int transfertobusy:1; /*!< allow flash-transfers to busy channels */
- unsigned int mwimonitor_neon:1; /*!< monitor this FXO port for neon type MWI indication from other end */
- unsigned int mwimonitor_fsk:1; /*!< monitor this FXO port for fsk MWI indication from other end */
- unsigned int mwimonitor_rpas:1; /*!< monitor this FXO port for rpas precursor to fsk MWI indication */
- unsigned int mwimonitoractive:1; /*!< an MWI monitor thread is currently active */
- unsigned int mwisendactive:1; /*!< a MWI message sending thread is active */
- /* Channel state or unavilability flags */
+ /*!
+ * \brief TRUE if we should use the callerid from incoming call on dahdi transfer.
+ * \note Set from the "useincomingcalleridondahditransfer" value read in from chan_dahdi.conf
+ */
+ unsigned int dahditrcallerid:1;
+ /*!
+ * \brief TRUE if allowed to flash-transfer to busy channels.
+ * \note Set from the "transfertobusy" value read in from chan_dahdi.conf
+ */
+ unsigned int transfertobusy:1;
+ /*!
+ * \brief TRUE if the FXO port monitors for neon type MWI indications from the other end.
+ * \note Set if the "mwimonitor" value read in contains "neon" from chan_dahdi.conf
+ */
+ unsigned int mwimonitor_neon:1;
+ /*!
+ * \brief TRUE if the FXO port monitors for fsk type MWI indications from the other end.
+ * \note Set if the "mwimonitor" value read in contains "fsk" from chan_dahdi.conf
+ */
+ unsigned int mwimonitor_fsk:1;
+ /*!
+ * \brief TRUE if the FXO port monitors for rpas precursor to fsk MWI indications from the other end.
+ * \note RPAS - Ring Pulse Alert Signal
+ * \note Set if the "mwimonitor" value read in contains "rpas" from chan_dahdi.conf
+ */
+ unsigned int mwimonitor_rpas:1;
+ /*! \brief TRUE if an MWI monitor thread is currently active */
+ unsigned int mwimonitoractive:1;
+ /*! \brief TRUE if a MWI message sending thread is active */
+ unsigned int mwisendactive:1;
+ /*!
+ * \brief TRUE if channel is out of reset and ready
+ * \note Set but not used.
+ */
unsigned int inservice:1;
+ /*!
+ * \brief TRUE if the channel is locally blocked.
+ * \note Applies to SS7 channels.
+ */
unsigned int locallyblocked:1;
+ /*!
+ * \brief TRUE if the channel is remotely blocked.
+ * \note Applies to SS7 channels.
+ */
[... 3035 lines stripped ...]
More information about the asterisk-commits
mailing list