[asterisk-commits] branch oej/test-this-branch r17947 - in
/team/oej/test-this-branch: ./ config...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Apr 6 10:45:10 MST 2006
Author: oej
Date: Thu Apr 6 12:45:00 2006
New Revision: 17947
URL: http://svn.digium.com/view/asterisk?rev=17947&view=rev
Log:
- Fix dialplan reload event
- resolve automerge conflicts
Modified:
team/oej/test-this-branch/ (props changed)
team/oej/test-this-branch/channel.c
team/oej/test-this-branch/configs/extensions.conf.sample
team/oej/test-this-branch/configs/iax.conf.sample
team/oej/test-this-branch/configs/meetme.conf.sample
team/oej/test-this-branch/configs/mgcp.conf.sample
team/oej/test-this-branch/configs/queues.conf.sample
team/oej/test-this-branch/configs/sip.conf.sample
team/oej/test-this-branch/configs/skinny.conf.sample
team/oej/test-this-branch/configs/voicemail.conf.sample
team/oej/test-this-branch/file.c
team/oej/test-this-branch/formats/Makefile
team/oej/test-this-branch/http.c
team/oej/test-this-branch/pbx/pbx_config.c
team/oej/test-this-branch/res/res_monitor.c
Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Apr 6 12:45:00 2006
@@ -1,1 +1,1 @@
-/trunk:1-17817
+/trunk:1-17865
Modified: team/oej/test-this-branch/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channel.c?rev=17947&r1=17946&r2=17947&view=diff
==============================================================================
--- team/oej/test-this-branch/channel.c (original)
+++ team/oej/test-this-branch/channel.c Thu Apr 6 12:45:00 2006
@@ -194,8 +194,8 @@
return -1;
}
AST_LIST_TRAVERSE(&backends, cl, list) {
- ast_cli(fd, FORMAT, cl->tech->type, cl->tech->description,
- (cl->tech->devicestate) ? "yes" : "no",
+ ast_cli(fd, FORMAT, cl->tech->type, cl->tech->description,
+ (cl->tech->devicestate) ? "yes" : "no",
(cl->tech->indicate) ? "yes" : "no",
(cl->tech->transfer) ? "yes" : "no");
count_chan++;
@@ -231,7 +231,7 @@
ast_cli(fd, "\n%s is not a registered channel driver.\n", argv[2]);
AST_LIST_UNLOCK(&channels);
return RESULT_FAILURE;
- }
+ }
ast_cli(fd,
"-- Info about channel driver: %s --\n"
@@ -281,15 +281,15 @@
return ret;
}
-static char show_channeltypes_usage[] =
+static char show_channeltypes_usage[] =
"Usage: show channeltypes\n"
" Shows available channel types registered in your Asterisk server.\n";
-static char show_channeltype_usage[] =
+static char show_channeltype_usage[] =
"Usage: show channeltype <name>\n"
" Show details about the specified channel type, <name>.\n";
-static struct ast_cli_entry cli_show_channeltypes =
+static struct ast_cli_entry cli_show_channeltypes =
{ { "show", "channeltypes", NULL }, show_channeltypes, "Show available channel types", show_channeltypes_usage };
static struct ast_cli_entry cli_show_channeltype =
@@ -298,22 +298,15 @@
/*! \brief Checks to see if a channel is needing hang up */
int ast_check_hangup(struct ast_channel *chan)
{
- time_t myt;
-
- /* if soft hangup flag, return true */
- if (chan->_softhangup)
+ if (chan->_softhangup) /* yes if soft hangup flag set */
return 1;
- /* if no technology private data, return true */
- if (!chan->tech_pvt)
+ if (!chan->tech_pvt) /* yes if no technology private data */
return 1;
- /* if no hangup scheduled, just return here */
- if (!chan->whentohangup)
+ if (!chan->whentohangup) /* no if no hangup scheduled */
return 0;
- time(&myt); /* get current time */
- /* return, if not yet */
- if (chan->whentohangup > myt)
+ if (chan->whentohangup > time(NULL)) /* no if hangup time has not come yet. */
return 0;
- chan->_softhangup |= AST_SOFTHANGUP_TIMEOUT;
+ chan->_softhangup |= AST_SOFTHANGUP_TIMEOUT; /* record event */
return 1;
}
@@ -366,15 +359,8 @@
/*! \brief Set when to hangup channel */
void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset)
{
- time_t myt;
- struct ast_frame fr = { AST_FRAME_NULL, };
-
- time(&myt);
- if (offset)
- chan->whentohangup = myt + offset;
- else
- chan->whentohangup = 0;
- ast_queue_frame(chan, &fr);
+ chan->whentohangup = offset ? time(NULL) + offset : 0;
+ ast_queue_frame(chan, &ast_null_frame);
return;
}
@@ -384,12 +370,9 @@
time_t whentohangup;
if (chan->whentohangup == 0) {
- if (offset == 0)
- return (0);
- else
- return (-1);
- } else {
- if (offset == 0)
+ return (offset == 0) ? 0 : -1;
+ } else {
+ if (offset == 0) /* XXX why is this special ? */
return (1);
else {
whentohangup = offset + time (NULL);
@@ -486,9 +469,10 @@
{
int x;
- for (x=0; x < sizeof(causes) / sizeof(causes[0]); x++)
+ for (x=0; x < sizeof(causes) / sizeof(causes[0]); x++) {
if (causes[x].cause == cause)
return causes[x].desc;
+ }
return "Unknown";
}
@@ -548,7 +532,7 @@
/* This just our opinion, expressed in code. We are asked to choose
the best codec to use, given no information */
int x;
- static int prefs[] =
+ static int prefs[] =
{
/*! Best quality */
AST_FORMAT_G722,
@@ -598,8 +582,7 @@
struct ast_channel *tmp;
int x;
int flags;
- struct varshead *headp;
-
+ struct varshead *headp;
/* If shutting down, don't allocate any new channels */
if (shutting_down) {
@@ -607,9 +590,8 @@
return NULL;
}
- if (!(tmp = ast_calloc(1, sizeof(*tmp)))) {
+ if (!(tmp = ast_calloc(1, sizeof(*tmp))))
return NULL;
- }
if (!(tmp->sched = sched_context_create())) {
ast_log(LOG_WARNING, "Channel allocation failed: Unable to create schedule context\n");
@@ -649,8 +631,7 @@
flags = fcntl(tmp->alertpipe[1], F_GETFL);
fcntl(tmp->alertpipe[1], F_SETFL, flags | O_NONBLOCK);
}
- } else
- /* Make sure we've got it done right if they don't */
+ } else /* Make sure we've got it done right if they don't */
tmp->alertpipe[0] = tmp->alertpipe[1] = -1;
/* Always watch the alertpipe */
@@ -785,8 +766,8 @@
}
/*!
- * \brief Helper function to find channels.
- *
+ * \brief Helper function to find channels.
+ *
* It supports these modes:
*
* prev != NULL : get channel next in list after prev
@@ -794,10 +775,10 @@
* name != NULL && namelen != 0 : get channel whose name starts with prefix
* exten != NULL : get channel whose exten or macroexten matches
* context != NULL && exten != NULL : get channel whose context or macrocontext
- *
+ *
* It returns with the channel's lock held. If getting the individual lock fails,
* unlock and retry quickly up to 10 times, then give up.
- *
+ *
* \note XXX Note that this code has cost O(N) because of the need to verify
* that the object is still on the global list.
*
@@ -983,7 +964,7 @@
ast_translator_free_path(chan->readtrans);
if (chan->writetrans)
ast_translator_free_path(chan->writetrans);
- if (chan->pbx)
+ if (chan->pbx)
ast_log(LOG_WARNING, "PBX may not have been terminated properly on '%s'\n", chan->name);
free_cid(&chan->cid);
ast_mutex_destroy(&chan->lock);
@@ -1132,7 +1113,7 @@
}
}
-static void detach_spies(struct ast_channel *chan)
+static void detach_spies(struct ast_channel *chan)
{
struct ast_channel_spy *spy;
@@ -1157,17 +1138,15 @@
/*! \brief Softly hangup a channel, don't lock */
int ast_softhangup_nolock(struct ast_channel *chan, int cause)
{
- int res = 0;
- struct ast_frame f = { AST_FRAME_NULL };
if (option_debug)
ast_log(LOG_DEBUG, "Soft-Hanging up channel '%s'\n", chan->name);
/* Inform channel driver that we need to be hung up, if it cares */
chan->_softhangup |= cause;
- ast_queue_frame(chan, &f);
+ ast_queue_frame(chan, &ast_null_frame);
/* Interrupt any poll call or such */
if (ast_test_flag(chan, AST_FLAG_BLOCKING))
pthread_kill(chan->blocker, SIGURG);
- return res;
+ return 0;
}
/*! \brief Softly hangup a channel, lock */
@@ -1341,7 +1320,7 @@
detach_spies(chan); /* get rid of spies */
if (chan->masq) {
- if (ast_do_masquerade(chan))
+ if (ast_do_masquerade(chan))
ast_log(LOG_WARNING, "Failed to perform masquerade\n");
}
@@ -1350,7 +1329,7 @@
ast_mutex_unlock(&chan->lock);
return 0;
}
- /* If this channel is one which will be masqueraded into something,
+ /* If this channel is one which will be masqueraded into something,
mark it as a zombie already, so we know to free it later */
if (chan->masqr) {
ast_set_flag(chan, AST_FLAG_ZOMBIE);
@@ -1367,13 +1346,13 @@
chan->sched = NULL;
}
- if (chan->generatordata) /* Clear any tone stuff remaining */
+ if (chan->generatordata) /* Clear any tone stuff remaining */
chan->generator->release(chan, chan->generatordata);
chan->generatordata = NULL;
chan->generator = NULL;
- if (chan->cdr) { /* End the CDR if it hasn't already */
+ if (chan->cdr) { /* End the CDR if it hasn't already */
ast_cdr_end(chan->cdr);
- ast_cdr_detach(chan->cdr); /* Post and Free the CDR */
+ ast_cdr_detach(chan->cdr); /* Post and Free the CDR */
chan->cdr = NULL;
}
if (ast_test_flag(chan, AST_FLAG_BLOCKING)) {
@@ -1393,13 +1372,13 @@
}
ast_mutex_unlock(&chan->lock);
- manager_event(EVENT_FLAG_CALL, "Hangup",
+ manager_event(EVENT_FLAG_CALL, "Hangup",
"Channel: %s\r\n"
"Uniqueid: %s\r\n"
"Cause: %d\r\n"
"Cause-txt: %s\r\n",
- chan->name,
- chan->uniqueid,
+ chan->name,
+ chan->uniqueid,
chan->hangupcause,
ast_cause2str(chan->hangupcause)
);
@@ -1440,7 +1419,7 @@
{
ast_mutex_lock(&chan->lock);
if (chan->generatordata) {
- if (chan->generator && chan->generator->release)
+ if (chan->generator && chan->generator->release)
chan->generator->release(chan, chan->generatordata);
chan->generatordata = NULL;
chan->generator = NULL;
@@ -1506,7 +1485,7 @@
}
/*! \brief Wait for x amount of time on a file descriptor to have input. */
-struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds,
+struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds, int nfds,
int *exception, int *outfd, int *ms)
{
struct timeval start = { 0 , 0 };
@@ -1588,7 +1567,7 @@
max += ast_add_fd(&pfds[max], fds[x]);
}
- if (*ms > 0)
+ if (*ms > 0)
start = ast_tvnow();
if (sizeof(int) == 4) { /* XXX fix timeout > 600000 on linux x86-32 */
@@ -1678,19 +1657,19 @@
int result = 0;
/* Stop if we're a zombie or need a soft hangup */
- if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
+ if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
return -1;
/* Wait for a digit, no more than ms milliseconds total. */
while(ms && !result) {
ms = ast_waitfor(c, ms);
if (ms < 0) /* Error */
- result = -1;
+ result = -1;
else if (ms > 0) {
/* Read something */
f = ast_read(c);
if (f) {
- if (f->frametype == AST_FRAME_DTMF)
+ if (f->frametype == AST_FRAME_DTMF)
result = f->subclass;
ast_frfree(f);
} else
@@ -1726,13 +1705,13 @@
int res;
/* Stop if we're a zombie or need a soft hangup */
- if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
+ if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
return -1;
/* Wait for a digit, no more than ms milliseconds total. */
while(ms) {
errno = 0;
rchan = ast_waitfor_nandfds(&c, 1, &cmdfd, (cmdfd > -1) ? 1 : 0, NULL, &outfd, &ms);
- if ((!rchan) && (outfd < 0) && (ms)) {
+ if ((!rchan) && (outfd < 0) && (ms)) {
if (errno == 0 || errno == EINTR)
continue;
ast_log(LOG_WARNING, "Wait failed (%s)\n", strerror(errno));
@@ -1826,7 +1805,7 @@
blah = -1;
/* IF we can't get event, assume it's an expired as-per the old interface */
res = ioctl(chan->timingfd, ZT_GETEVENT, &blah);
- if (res)
+ if (res)
blah = ZT_EVENT_TIMER_EXPIRED;
if (blah == ZT_EVENT_TIMER_PING) {
@@ -1887,7 +1866,7 @@
} else {
chan->blocker = pthread_self();
if (ast_test_flag(chan, AST_FLAG_EXCEPTION)) {
- if (chan->tech->exception)
+ if (chan->tech->exception)
f = chan->tech->exception(chan);
else {
ast_log(LOG_WARNING, "Exception flag set on '%s', but no exception handler\n", chan->name);
@@ -2042,7 +2021,7 @@
int ast_internal_timing_enabled(struct ast_channel *chan)
{
int ret = ast_opt_internal_timing && chan->timingfd > -1;
- if (option_debug > 3)
+ if (option_debug > 3)
ast_log(LOG_DEBUG, "Internal timing is %s (option_internal_timing=%d chan->timingfd=%d)\n", ret? "enabled": "disabled", ast_opt_internal_timing, chan->timingfd);
return ret;
}
@@ -2155,7 +2134,7 @@
{
int res = 0;
/* Stop if we're a zombie or need a soft hangup */
- if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan))
+ if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan))
return -1;
CHECK_BLOCKING(chan);
if (chan->tech->send_text)
@@ -2526,7 +2505,7 @@
if (oh->priority)
chan->priority = oh->priority;
}
- if (chan->_state == AST_STATE_UP)
+ if (chan->_state == AST_STATE_UP)
state = AST_CONTROL_ANSWER;
}
if (outstate)
@@ -2616,29 +2595,29 @@
return NULL;
}
-int ast_call(struct ast_channel *chan, char *addr, int timeout)
-{
- /* Place an outgoing call, but don't wait any longer than timeout ms before returning.
- If the remote end does not answer within the timeout, then do NOT hang up, but
+int ast_call(struct ast_channel *chan, char *addr, int timeout)
+{
+ /* Place an outgoing call, but don't wait any longer than timeout ms before returning.
+ If the remote end does not answer within the timeout, then do NOT hang up, but
return anyway. */
int res = -1;
/* Stop if we're a zombie or need a soft hangup */
ast_mutex_lock(&chan->lock);
- if (!ast_test_flag(chan, AST_FLAG_ZOMBIE) && !ast_check_hangup(chan))
+ if (!ast_test_flag(chan, AST_FLAG_ZOMBIE) && !ast_check_hangup(chan))
if (chan->tech->call)
res = chan->tech->call(chan, addr, timeout);
ast_mutex_unlock(&chan->lock);
return res;
}
-/*!
+/*!
\brief Transfer a call to dest, if the channel supports transfer
- Called by:
+ Called by:
\arg app_transfer
\arg the manager interface
*/
-int ast_transfer(struct ast_channel *chan, char *dest)
+int ast_transfer(struct ast_channel *chan, char *dest)
{
int res = -1;
@@ -2664,7 +2643,7 @@
/* XXX Merge with full version? XXX */
/* Stop if we're a zombie or need a soft hangup */
- if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
+ if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
return -1;
if (!len)
return -1;
@@ -2703,7 +2682,7 @@
int d;
/* Stop if we're a zombie or need a soft hangup */
- if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
+ if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
return -1;
if (!len)
return -1;
@@ -2828,10 +2807,10 @@
ast_log(LOG_DEBUG, "Planning to masquerade channel %s into the structure of %s\n",
clone->name, original->name);
if (original->masq) {
- ast_log(LOG_WARNING, "%s is already going to masquerade as %s\n",
+ ast_log(LOG_WARNING, "%s is already going to masquerade as %s\n",
original->masq->name, original->name);
} else if (clone->masqr) {
- ast_log(LOG_WARNING, "%s is already going to masquerade as %s\n",
+ ast_log(LOG_WARNING, "%s is already going to masquerade as %s\n",
clone->name, clone->masqr->name);
} else {
original->masq = clone;
@@ -2897,11 +2876,11 @@
/*!
\brief Clone channel variables from 'clone' channel into 'original' channel
-
+
All variables except those related to app_groupcount are cloned.
Variables are actually _removed_ from 'clone' channel, presumably
because it will subsequently be destroyed.
-
+
\note Assumes locks will be in place on both channels when called.
*/
static void clone_variables(struct ast_channel *original, struct ast_channel *clone)
@@ -2931,7 +2910,7 @@
/*!
\brief Masquerade a channel
- \note Assumes channel will be locked when called
+ \note Assumes channel will be locked when called
*/
int ast_do_masquerade(struct ast_channel *original)
{
@@ -2956,7 +2935,7 @@
/* XXX This is a seriously wacked out operation. We're essentially putting the guts of
the clone channel into the original channel. Start by killing off the original
- channel's backend. I'm not sure we're going to keep this function, because
+ channel's backend. I'm not sure we're going to keep this function, because
while the features are nice, the cost is very high in terms of pure nastiness. XXX */
/* We need the clone's lock, too */
@@ -3028,7 +3007,7 @@
x++;
prev = cur;
}
- /* If we had any, prepend them to the ones already in the queue, and
+ /* If we had any, prepend them to the ones already in the queue, and
* load up the alertpipe */
if (prev) {
prev->next = original->readq;
@@ -3052,7 +3031,7 @@
if (clone->tech->fixup){
res = clone->tech->fixup(original, clone);
- if (res)
+ if (res)
ast_log(LOG_WARNING, "Fixup failed on channel %s, strange things may happen.\n", clone->name);
}
@@ -3143,13 +3122,13 @@
if (ast_test_flag(clone, AST_FLAG_ZOMBIE)) {
ast_log(LOG_DEBUG, "Destroying channel clone '%s'\n", clone->name);
ast_mutex_unlock(&clone->lock);
- manager_event(EVENT_FLAG_CALL, "Hangup",
+ manager_event(EVENT_FLAG_CALL, "Hangup",
"Channel: %s\r\n"
"Uniqueid: %s\r\n"
"Cause: %d\r\n"
"Cause-txt: %s\r\n",
- clone->name,
- clone->uniqueid,
+ clone->name,
+ clone->uniqueid,
clone->hangupcause,
ast_cause2str(clone->hangupcause)
);
@@ -3196,15 +3175,15 @@
}
if (chan->cdr)
ast_cdr_setcid(chan->cdr, chan);
- manager_event(EVENT_FLAG_CALL, "Newcallerid",
+ manager_event(EVENT_FLAG_CALL, "Newcallerid",
"Channel: %s\r\n"
"CallerID: %s\r\n"
"CallerIDName: %s\r\n"
"Uniqueid: %s\r\n"
"CID-CallingPres: %d (%s)\r\n",
- chan->name, chan->cid.cid_num ?
- chan->cid.cid_num : "<Unknown>",
- chan->cid.cid_name ?
+ chan->name, chan->cid.cid_num ?
+ chan->cid.cid_num : "<Unknown>",
+ chan->cid.cid_name ?
chan->cid.cid_name : "<Unknown>",
chan->uniqueid,
chan->cid.cid_pres,
@@ -3228,9 +3207,9 @@
"CallerID: %s\r\n"
"CallerIDName: %s\r\n"
"Uniqueid: %s\r\n",
- chan->name, ast_state2str(chan->_state),
- chan->cid.cid_num ? chan->cid.cid_num : "<unknown>",
- chan->cid.cid_name ? chan->cid.cid_name : "<unknown>",
+ chan->name, ast_state2str(chan->_state),
+ chan->cid.cid_num ? chan->cid.cid_num : "<unknown>",
+ chan->cid.cid_name ? chan->cid.cid_name : "<unknown>",
chan->uniqueid);
return 0;
@@ -3241,17 +3220,17 @@
{
struct ast_channel *bridged;
bridged = chan->_bridge;
- if (bridged && bridged->tech->bridged_channel)
+ if (bridged && bridged->tech->bridged_channel)
bridged = bridged->tech->bridged_channel(chan, bridged);
return bridged;
}
-static void bridge_playfile(struct ast_channel *chan, struct ast_channel *peer, const char *sound, int remain)
+static void bridge_playfile(struct ast_channel *chan, struct ast_channel *peer, const char *sound, int remain)
{
int min = 0, sec = 0, check;
check = ast_autoservice_start(peer);
- if (check)
+ if (check)
return;
if (remain > 0) {
@@ -3384,7 +3363,7 @@
}
if ((f->frametype == AST_FRAME_VOICE) ||
(f->frametype == AST_FRAME_DTMF) ||
- (f->frametype == AST_FRAME_VIDEO) ||
+ (f->frametype == AST_FRAME_VIDEO) ||
(f->frametype == AST_FRAME_IMAGE) ||
(f->frametype == AST_FRAME_HTML) ||
(f->frametype == AST_FRAME_MODEM) ||
@@ -3403,7 +3382,7 @@
} else {
#if 0
ast_log(LOG_DEBUG, "Read from %s\n", who->name);
- if (who == last)
+ if (who == last)
ast_log(LOG_DEBUG, "Servicing channel %s twice in a row?\n", last->name);
last = who;
#endif
@@ -3434,7 +3413,7 @@
/*! \brief Bridge two channels together */
enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1,
- struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc)
+ struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc)
{
struct ast_channel *who = NULL;
enum ast_bridge_result res = AST_BRIDGE_COMPLETE;
@@ -3449,19 +3428,19 @@
int to;
if (c0->_bridge) {
- ast_log(LOG_WARNING, "%s is already in a bridge with %s\n",
+ ast_log(LOG_WARNING, "%s is already in a bridge with %s\n",
c0->name, c0->_bridge->name);
return -1;
}
if (c1->_bridge) {
- ast_log(LOG_WARNING, "%s is already in a bridge with %s\n",
+ ast_log(LOG_WARNING, "%s is already in a bridge with %s\n",
c1->name, c1->_bridge->name);
return -1;
}
/* Stop if we're a zombie or need a soft hangup */
if (ast_test_flag(c0, AST_FLAG_ZOMBIE) || ast_check_hangup_locked(c0) ||
- ast_test_flag(c1, AST_FLAG_ZOMBIE) || ast_check_hangup_locked(c1))
+ ast_test_flag(c1, AST_FLAG_ZOMBIE) || ast_check_hangup_locked(c1))
return -1;
*fo = NULL;
@@ -3486,7 +3465,7 @@
c0->_bridge = c1;
c1->_bridge = c0;
- manager_event(EVENT_FLAG_CALL, "Link",
+ manager_event(EVENT_FLAG_CALL, "Link",
"Channel1: %s\r\n"
"Channel2: %s\r\n"
"Uniqueid1: %s\r\n"
@@ -3494,7 +3473,7 @@
"CallerID1: %s\r\n"
"CallerID2: %s\r\n",
c0->name, c1->name, c0->uniqueid, c1->uniqueid, c0->cid.cid_num, c1->cid.cid_num);
-
+
o0nativeformats = c0->nativeformats;
o1nativeformats = c1->nativeformats;
@@ -3522,7 +3501,7 @@
if (callee_warning && config->end_sound)
bridge_playfile(c1, c0, config->end_sound, 0);
*fo = NULL;
- if (who)
+ if (who)
*rc = who;
res = 0;
break;
@@ -3581,7 +3560,7 @@
ast_set_flag(c0, AST_FLAG_NBRIDGE);
ast_set_flag(c1, AST_FLAG_NBRIDGE);
if ((res = c0->tech->bridge(c0, c1, config->flags, fo, rc, to)) == AST_BRIDGE_COMPLETE) {
- manager_event(EVENT_FLAG_CALL, "Unlink",
+ manager_event(EVENT_FLAG_CALL, "Unlink",
"Channel1: %s\r\n"
"Channel2: %s\r\n"
"Uniqueid1: %s\r\n"
@@ -3737,7 +3716,7 @@
struct tonepair_state *ts = data;
int x;
- /* we need to prepare a frame with 16 * timelen samples as we're
+ /* we need to prepare a frame with 16 * timelen samples as we're
* generating SLIN audio
*/
len = samples * 2;
@@ -3781,10 +3760,7 @@
d.freq1 = freq1;
d.freq2 = freq2;
d.duration = duration;
- if (vol < 1)
- d.vol = 8192;
- else
- d.vol = vol;
+ d.vol = (vol < 1) ? 8192 : vol; /* force invalid to 8192 */
if (ast_activate_generator(chan, &tonepair, &d))
return -1;
return 0;
@@ -3797,15 +3773,14 @@
int ast_tonepair(struct ast_channel *chan, int freq1, int freq2, int duration, int vol)
{
- struct ast_frame *f;
int res;
if ((res = ast_tonepair_start(chan, freq1, freq2, duration, vol)))
return res;
/* Give us some wiggle room */
- while (chan->generatordata && (ast_waitfor(chan, 100) >= 0)) {
- f = ast_read(chan);
+ while (chan->generatordata && ast_waitfor(chan, 100) >= 0) {
+ struct ast_frame *f = ast_read(chan);
if (f)
ast_frfree(f);
else
@@ -3859,7 +3834,7 @@
ast_moh_cleanup_ptr = cleanup_ptr;
}
-void ast_uninstall_music_functions(void)
+void ast_uninstall_music_functions(void)
{
ast_moh_start_ptr = NULL;
ast_moh_stop_ptr = NULL;
@@ -3867,7 +3842,7 @@
}
/*! \brief Turn on music on hold on a given channel */
-int ast_moh_start(struct ast_channel *chan, const char *mclass)
+int ast_moh_start(struct ast_channel *chan, const char *mclass)
{
if (ast_moh_start_ptr)
return ast_moh_start_ptr(chan, mclass);
@@ -3879,13 +3854,13 @@
}
/*! \brief Turn off music on hold on a given channel */
-void ast_moh_stop(struct ast_channel *chan)
+void ast_moh_stop(struct ast_channel *chan)
{
if (ast_moh_stop_ptr)
ast_moh_stop_ptr(chan);
}
-void ast_moh_cleanup(struct ast_channel *chan)
+void ast_moh_cleanup(struct ast_channel *chan)
{
if (ast_moh_cleanup_ptr)
ast_moh_cleanup_ptr(chan);
@@ -3898,7 +3873,7 @@
}
/*! \brief Print call group and pickup group ---*/
-char *ast_print_group(char *buf, int buflen, ast_group_t group)
+char *ast_print_group(char *buf, int buflen, ast_group_t group)
{
unsigned int i;
int first=1;
@@ -4075,37 +4050,23 @@
/* nothing to do */
}
-static int silence_generator_generate(struct ast_channel *chan, void *data, int len, int samples)
-{
- if (samples == 160) {
- short buf[160] = { 0, };
- struct ast_frame frame = {
- .frametype = AST_FRAME_VOICE,
- .subclass = AST_FORMAT_SLINEAR,
- .data = buf,
- .samples = 160,
- .datalen = sizeof(buf),
- };
-
- if (ast_write(chan, &frame))
- return -1;
- } else {
- short buf[samples];
- int x;
- struct ast_frame frame = {
- .frametype = AST_FRAME_VOICE,
- .subclass = AST_FORMAT_SLINEAR,
- .data = buf,
- .samples = samples,
- .datalen = sizeof(buf),
- };
-
- for (x = 0; x < samples; x++)
- buf[x] = 0;
-
- if (ast_write(chan, &frame))
- return -1;
- }
+static int silence_generator_generate(struct ast_channel *chan, void *data, int len, int samples)
+{
+ short buf[samples];
+ int x;
+ struct ast_frame frame = {
+ .frametype = AST_FRAME_VOICE,
+ .subclass = AST_FORMAT_SLINEAR,
+ .data = buf,
+ .samples = samples,
+ .datalen = sizeof(buf),
+ };
+
+ for (x = 0; x < samples; x++)
+ buf[x] = 0;
+
+ if (ast_write(chan, &frame))
+ return -1;
return 0;
}
@@ -4113,7 +4074,7 @@
static struct ast_generator silence_generator = {
.alloc = silence_generator_alloc,
.release = silence_generator_release,
- .generate = silence_generator_generate,
+ .generate = silence_generator_generate,
};
struct ast_silence_generator {
@@ -4162,16 +4123,19 @@
/*! \ brief Convert channel reloadreason (ENUM) to text string for manager event */
-const char *channelreloadreason2txt(enum channelreloadreason reason) {
+const char *channelreloadreason2txt(enum channelreloadreason reason)
+{
switch (reason) {
- case CHANNEL_MODULE_LOAD: return "LOAD (Channel module load)";
- break;
- case CHANNEL_MODULE_RELOAD: return "RELOAD (Channel module reload)";
- break;
- case CHANNEL_CLI_RELOAD: return "CLIRELOAD (Channel module reload by CLI command)";
- break;
- default: return "MANAGERRELOAD (Channel module reload by manager)";
- break;
+ case CHANNEL_MODULE_LOAD:
+ return "LOAD (Channel module load)";
+
+ case CHANNEL_MODULE_RELOAD:
+ return "RELOAD (Channel module reload)";
+
+ case CHANNEL_CLI_RELOAD:
+ return "CLIRELOAD (Channel module reload by CLI command)";
+
+ default:
+ return "MANAGERRELOAD (Channel module reload by manager)";
}
};
-
Modified: team/oej/test-this-branch/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/extensions.conf.sample?rev=17947&r1=17946&r2=17947&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/extensions.conf.sample (original)
+++ team/oej/test-this-branch/configs/extensions.conf.sample Thu Apr 6 12:45:00 2006
@@ -310,18 +310,18 @@
; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
; ${ARG2} - Device(s) to ring
;
-exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
-exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
-
-exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
-exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
-
-exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
-exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
-
-exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
-
-exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain
+exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
+exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
+
+exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
+exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
+
+exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
+exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
+
+exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
+
+exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain
[macro-stdPrivacyexten];
;
@@ -331,22 +331,23 @@
; ${ARG3} - Optional DONTCALL context name to jump to (assumes the s,1 extension-priority)
; ${ARG4} - Optional TORTURE context name to jump to (assumes the s,1 extension-priority)`
;
-exten => s,1,Dial(${ARG2},20|p) ; Ring the interface, 20 seconds maximum, call screening option (or use P for databased call screening)
-exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
-
-exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
-exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
-
-exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
-exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
-
-exten => s-DONTCALL,1,Goto(${ARG3},s,1) ; Callee chose to send this call to a polite "Don't call again" script.
-
-exten => s-TORTURE,1,Goto(${ARG4},s,1) ; Callee chose to send this call to a telemarketer torture script.
-
-exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
-
-exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain
+exten => s,1,Dial(${ARG2},20|p) ; Ring the interface, 20 seconds maximum, call screening
+ ; option (or use P for databased call screening)
+exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
+
+exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
+exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
+
+exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
+exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
+
+exten => s-DONTCALL,1,Goto(${ARG3},s,1) ; Callee chose to send this call to a polite "Don't call again" script.
+
+exten => s-TORTURE,1,Goto(${ARG4},s,1) ; Callee chose to send this call to a telemarketer torture script.
+
+exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
+
+exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain
[macro-page];
;
@@ -356,13 +357,13 @@
;
; ${ARG1} - Device to page
-exten => s,1,ChanIsAvail(${ARG1}|js) ; j is for Jump and s is for ANY call
-exten => s,2,GoToIf([${AVAILSTATUS} = "1"]?3:7)
-exten => s,3,Set(_ALERT_INFO="RA") ; This is for the PolyComs
-exten => s,4,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others
-exten => s,5,NoOp() ; Add others here and Post on the Wiki!!!!
-exten => s,6,Dial(${ARG1}||)
-exten => s,7,Hangup
+exten => s,1,ChanIsAvail(${ARG1}|js) ; j is for Jump and s is for ANY call
+exten => s,n,GoToIf([${AVAILSTATUS} = "1"]?autoanswer:fail)
+exten => s,n(autoanswer),Set(_ALERT_INFO="RA") ; This is for the PolyComs
+exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others
+exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!!
+exten => s,n,Dial(${ARG1}||)
+exten => s,n(fail),Hangup
[demo]
@@ -375,13 +376,13 @@
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
-exten => s,n,WaitExten ; Wait for an extension to be dialed.
+exten => s,n,WaitExten ; Wait for an extension to be dialed.
exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
exten => 2,n,Goto(s,instruct)
exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
-exten => 3,n,Goto(s,restart) ; Start with the congratulations
+exten => 3,n,Goto(s,restart) ; Start with the congratulations
exten => 1000,1,Goto(default,s,1)
;
@@ -400,7 +401,7 @@
;
; # for when they're done with the demo
;
-exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
+exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
exten => #,n,Hangup ; Hang them up.
;
@@ -498,7 +499,7 @@
;exten => 6245,hint,SIP/Grandstream1&SIP/Xlite1,Joe Schmoe ; Channel hints for presence
;exten => 6245,1,Dial(SIP/Grandstream1,20,rt) ; permit transfer
-;exten => 6245,n(dial),Dial(${HINT},20,rtT) ; Use hint as listed
+;exten => 6245,n(dial),Dial(${HINT},20,rtT) ; Use hint as listed
;exten => 6245,n,Voicemail(u6245) ; Voicemail (unavailable)
;exten => 6245,s+1,Hangup ; s+1, same as n
;exten => 6245,dial+101,Voicemail(b6245) ; Voicemail (busy)
@@ -530,4 +531,6 @@
;
; 'show application <command>' will show details of how you
; use that particular application in this file, the dial plan.
-;
+; 'show functions" will list all dialplan functions
+; 'show function <COMMAND>' will show you more information about
+; one function. Remember that function names are UPPER CASE.
Modified: team/oej/test-this-branch/configs/iax.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/iax.conf.sample?rev=17947&r1=17946&r2=17947&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/iax.conf.sample (original)
+++ team/oej/test-this-branch/configs/iax.conf.sample Thu Apr 6 12:45:00 2006
@@ -11,9 +11,10 @@
;
[general]
;bindport=4569 ; bindport and bindaddr may be specified
-; ; NOTE: bindport must be specified BEFORE bindaddr
-; ; or may be specified on a specific bindaddr if followed by
-; ; colon and port (e.g. bindaddr=192.168.0.1:4569)
+; ; NOTE: bindport must be specified BEFORE
+ ; bindaddr or may be specified on a specific
+ ; bindaddr if followed by colon and port
+ ; (e.g. bindaddr=192.168.0.1:4569)
;bindaddr=192.168.0.1 ; more than once to bind to multiple
; ; addresses, but the first will be the
; ; default
@@ -123,19 +124,22 @@
; the jitter buffer can end up bigger than necessary. If it ends up
; more than "maxexcessbuffer" bigger than needed, Asterisk will start
; gradually decreasing the amount of jitter buffering.
-; [This option is not applicable to, and ignored by the new jitterbuffer implementation]
+; This option is not applicable to,
+; and ignored by the new jitterbuffer implementation
;
; minexcessbuffer: Sets a desired mimimum amount of headroom in
; the jitter buffer. If Asterisk has less headroom than this, then
; it will start gradually increasing the amount of jitter buffering.
-; [This option is not applicable to, and ignored by the new jitterbuffer implementation]
+; This option is not applicable to,
+; and ignored by the new jitterbuffer implementation
;
; jittershrinkrate: when the jitter buffer is being gradually shrunk
; (or enlarged), how many millisecs shall we take off per 20ms frame
; received? Use a small number, or you will be able to hear it
; changing. An example: if you set this to 2, then the jitter buffer
; size will change by 100 millisecs per second.
-; [This option is not applicable to, and ignored by the new jitterbuffer implementation]
+; This option is not applicable to,
+; and ignored by the new jitterbuffer implementation
jitterbuffer=no
forcejitterbuffer=no
@@ -246,25 +250,26 @@
;
;codecpriority=host
-;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
- ; just like friends added from the config file only on a
- ; as-needed basis? (yes|no)
-
-;rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
- ; If set to yes, when a IAX2 peer registers successfully, the ip address,
- ; the origination port, the registration period, and the username of
- ; the peer will be set to database via realtime. If not present, defaults to 'yes'.
-
-;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
- ; as if it had just registered? (yes|no|<seconds>)
- ; If set to yes, when the registration expires, the friend will vanish from
- ; the configuration until requested again. If set to an integer,
- ; friends expire within this number of seconds instead of the
- ; registration interval.
-
-;rtignoreexpire=yes ; When reading a peer from Realtime, if the peer's registration
- ; has expired based on its registration interval, used the stored
- ; address information regardless. (yes|no)
+;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
+ ; just like friends added from the config file only on a
+ ; as-needed basis? (yes|no)
+
+;rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
+ ; If set to yes, when a IAX2 peer registers successfully,
+ ; the ip address, the origination port, the registration period,
+ ; and the username of the peer will be set to database via realtime.
+ ; If not present, defaults to 'yes'.
+
+;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
+ ; as if it had just registered? (yes|no|<seconds>)
+ ; If set to yes, when the registration expires, the friend will
+ ; vanish from the configuration until requested again.
+ ; If set to an integer, friends expire within this number of
+ ; seconds instead of the registration interval.
+
+;rtignoreexpire=yes ; When reading a peer from Realtime, if the peer's registration
+ ; has expired based on its registration interval, used the stored
+ ; address information regardless. (yes|no)
;parkinglot=edvina ; Default parkinglot for IAX peers and users
; This can also be configured per device
Modified: team/oej/test-this-branch/configs/meetme.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/configs/meetme.conf.sample?rev=17947&r1=17946&r2=17947&view=diff
==============================================================================
--- team/oej/test-this-branch/configs/meetme.conf.sample (original)
+++ team/oej/test-this-branch/configs/meetme.conf.sample Thu Apr 6 12:45:00 2006
@@ -4,14 +4,14 @@
; This configuration file is read every time you call app meetme()
[general]
-;audiobuffers=32 ; The number of 20ms audio buffers to be used
- ; when feeding audio frames from non-Zap channels
- ; into the conference; larger numbers will allow
- ; for the conference to 'de-jitter' audio that arrives
- ; at different timing than the conference's timing
- ; source, but can also allow for latency in hearing
- ; the audio from the speaker. Minimum value is 2,
- ; maximum value is 32.
+;audiobuffers=32 ; The number of 20ms audio buffers to be used
+ ; when feeding audio frames from non-Zap channels
+ ; into the conference; larger numbers will allow
[... 891 lines stripped ...]
More information about the asterisk-commits
mailing list