Posted: Tue Jan 10, 2006 10:51 pm Post subject: [svn-commits] branch crichter/0.2.1 - r7951 in /team/crichte
Author: crichter
Date: Tue Jan 10 16:41:23 2006
New Revision: 7951
URL: http://svn.digium.com/view/asterisk?rev=7951&view=rev
Log:
Merged revisions 7425,7427,7429-7430,7433,7435,7448-7449,7451,7453,7468,7470,7482,7490,7497,7508,7510,7513,7515,7517,7519,7521,7523,7529,7546,7550,7552,7557,7577,7580,7582,7586,7595,7599,7601,7605-7606,7608,7634,7637,7641,7663,7665,7677,7706,7709,7736,7738,7740,7743,7746,7771,7773,7792,7795,7799-7800,7803,7805,7807,7809,7812,7819,7823,7825,7827,7829,7831,7848,7870-7871,7898-7900,7904,7908,7915,7917,7939 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
use the stream's current point when pausing/unpausing, instead of elapsed time (which doesn't work when the stream has been skipped forward or backward) (issue #5897)
* Added mISDN/mISDNuser Echo cancel Patch
* Fixed Makefiles so that chan_misdn can be compiled again
* added some hints, that mISDN cannot be compiled against gcc-4, SMP, Spinlock Debug
* fixed some Minor issues in chan_misdn, regarding Type Of Number and Presentation
forcibly expire previous subscriptions from a peer when they resubscribe (keeps them from building up and waiting for expiration, and stops us sending unwanted NOTIFY messages to devices)
I messed up and accidently committed this to the trunk first ...
- add note on required values of sip_methods struct
- remove duplicate function prototype
- remove duplicate ast_mutex_lock (issue #6025)
add license reference to copyright notice displayed when CLI session begins
add 'show warranty' and 'show license' CLI commands (still need a complete list of non-GPL components included in Asterisk)
eliminate rounding errors that caused call time limits to be inaccurate (issue #5913)
round 'time left' reported during call limit warnings up to sound more accurate
Modified: team/crichter/0.2.1/app.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.2.1/app.c?rev=7951&r1=7950&r2=7951&view=diff
==============================================================================
--- team/crichter/0.2.1/app.c (original)
+++ team/crichter/0.2.1/app.c Tue Jan 10 16:41:23 2006
@@ -430,11 +430,11 @@
const char *stop, const char *pause,
const char *restart, int skipms)
{
- long elapsed = 0, last_elapsed = 0;
char *breaks = NULL;
char *end = NULL;
int blen = 2;
int res;
+ long pause_restart_point = 0;
if (stop)
blen += strlen(stop);
@@ -456,9 +456,6 @@
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
- if (chan)
- ast_stopstream(chan);
-
if (file) {
if ((end = strchr(file,':'))) {
if (!strcasecmp(end, ":end")) {
@@ -469,25 +466,18 @@
}
for (;;) {
- struct timeval started = ast_tvnow();
-
- if (chan)
- ast_stopstream(chan);
+ ast_stopstream(chan);
res = ast_streamfile(chan, file, chan->language);
if (!res) {
- if (end) {
+ if (pause_restart_point) {
+ ast_seekstream(chan->stream, pause_restart_point, SEEK_SET);
+ pause_restart_point = 0;
+ }
+ else if (end) {
ast_seekstream(chan->stream, 0, SEEK_END);
- end=NULL;
- }
- res = 1;
- if (elapsed) {
- ast_stream_fastforward(chan->stream, elapsed);
- last_elapsed = elapsed - 200;
- }
- if (res)
- res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms);
- else
- break;
+ end = NULL;
+ };
+ res = ast_waitstream_fr(chan, breaks, fwd, rev, skipms);
}
if (res < 1)
@@ -496,17 +486,16 @@
/* We go at next loop if we got the restart char */
if (restart && strchr(restart, res)) {
ast_log(LOG_DEBUG, "we'll restart the stream here at next loop\n");
- elapsed=0; /* To make sure the next stream will start at beginning */
+ pause_restart_point = 0;
continue;
}
- if (pause != NULL && strchr(pause, res)) {
- elapsed = ast_tvdiff_ms(ast_tvnow(), started) + last_elapsed;
- for(;;) {
- if (chan)
- ast_stopstream(chan);
+ if (pause && strchr(pause, res)) {
+ pause_restart_point = ast_tellstream(chan->stream);
+ for (;;) {
+ ast_stopstream(chan);
res = ast_waitfordigit(chan, 1000);
- if (res == 0)
+ if (!res)
continue;
else if (res == -1 || strchr(pause, res) || (stop && strchr(stop, res)))
break;
@@ -516,17 +505,16 @@
continue;
}
}
+
if (res == -1)
break;
/* if we get one of our stop chars, return it to the calling function */
- if (stop && strchr(stop, res)) {
- /* res = 0; */
- break;
- }
- }
- if (chan)
- ast_stopstream(chan);
+ if (stop && strchr(stop, res))
+ break;
+ }
+
+ ast_stopstream(chan);
static void stop_spying(struct ast_channel *chan, struct ast_channel_spy *spy)
{
- /* If our status has changed, then the channel we're spying on is gone....
+ /* If our status has changed to DONE, then the channel we're spying on is gone....
DON'T TOUCH IT!!! RUN AWAY!!! */
- if (spy->status != CHANSPY_RUNNING)
+ if (spy->status == CHANSPY_DONE)
return;
Modified: team/crichter/0.2.1/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.2.1/apps/app_dial.c?rev=7951&r1=7950&r2=7951&view=diff
==============================================================================
--- team/crichter/0.2.1/apps/app_dial.c (original)
+++ team/crichter/0.2.1/apps/app_dial.c Tue Jan 10 16:41:23 2006
@@ -962,7 +962,7 @@
/* If a channel group has been specified, get it for use when we create peer channels */
outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
- ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID);
+ ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP);
cur = args.peers;
do {
/* Remember where to start next time */
-static int careful_write(int fd, unsigned char *data, int len)
+static int careful_write(int fd, unsigned char *data, int len, int block)
{
int res;
int x;
while (len) {
- x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
- res = ioctl(fd, ZT_IOMUX, &x);
+ if (block) {
+ x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
+ res = ioctl(fd, ZT_IOMUX, &x);
+ } else
+ res = 0;
if (res >= 0)
res = write(fd, data, len);
if (res < 1) {
@@ -423,7 +426,7 @@
len = 0;
}
if (data)
- careful_write(conf->fd, data, len);
+ careful_write(conf->fd, data, len, 1);
ast_mutex_unlock(&conflock);
@@ -1307,7 +1310,11 @@
audio frames (in which case carefully writing would only
have delayed the audio even further).
*/
- write(fd, f->data, f->datalen);
+ /* As it turns out, we do want to use careful write. We just
+ don't want to block, but we do want to at least *try*
+ to write out all the samples.
+ */
+ careful_write(fd, f->data, f->datalen, 0);
}
} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT)) {
char tmp[2];
static void stopmon(struct ast_channel *chan, struct ast_channel_spy *spy)
{
- /* If our status has changed, then the channel we're spying on is gone....
+ /* If our status has changed to DONE, then the channel we're spying on is gone....
DON'T TOUCH IT!!! RUN AWAY!!! */
- if (spy->status != CHANSPY_RUNNING)
+ if (spy->status == CHANSPY_DONE)
return;
/*Got a number, play sounds and send them on their way*/
- if ((retries < maxretries) && res == 1 ) {
+ if ((retries < maxretries) && !res ) {
res = ast_streamfile(chan, "privacy-thankyou", chan->language);
if (!res)
res = ast_waitstream(chan, "");
static const char *gosub_descrip =
"Gosub([[context|]exten|]priority)\n"
-" Jumps to the label specified, saving the return address.\n"
-" Returns 0 if the label exists or -1 otherwise.\n";
+" Jumps to the label specified, saving the return address.\n";
static const char *gosubif_descrip =
-"Gosub(condition?labeliftrue[:labeliffalse])\n"
+"GosubIf(condition?labeliftrue[:labeliffalse])\n"
" If the condition is true, then jump to labeliftrue. If false, jumps to\n"
"labeliffalse, if specified. In either case, a jump saves the return point\n"
-"in the dialplan, to be returned to with a Return.\n"
-" Returns 0 if the label exists or -1 otherwise.\n";
+"in the dialplan, to be returned to with a Return.\n";
static const char *return_descrip =
"Return()\n"
-" Jumps to the last label in the stack, removing it.\n"
-" Returns 0 if there's a label in the stack or -1 otherwise.\n";
+" Jumps to the last label on the stack, removing it.\n";
static const char *pop_descrip =
"StackPop()\n"
-" Removes last label in the stack, discarding it.\n"
-" Always returns 0, even if the stack is empty.\n";
+" Removes last label on the stack, discarding it.\n";
STANDARD_LOCAL_USER;
Modified: team/crichter/0.2.1/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.2.1/apps/app_voicemail.c?rev=7951&r1=7950&r2=7951&view=diff
==============================================================================
--- team/crichter/0.2.1/apps/app_voicemail.c (original)
+++ team/crichter/0.2.1/apps/app_voicemail.c Tue Jan 10 16:41:23 2006
@@ -582,7 +582,7 @@
while (cur) {
if (ast_test_flag((&globalflags), VM_SEARCH) && !strcasecmp(mailbox, cur->mailbox))
break;
- if ((!strcasecmp(context, cur->context)) && (!strcasecmp(mailbox, cur->mailbox)))
+ if (context && (!strcasecmp(context, cur->context)) && (!strcasecmp(mailbox, cur->mailbox)))
break;
cur=cur->next;
}
@@ -2005,7 +2005,7 @@
ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
goto yuck;
}
- snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like \"%%%s/%s/%s\"%c", odbc_table, context, tmp, "INBOX", '\0');
+ snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir LIKE '%%%s/%s/%s'", odbc_table, context, tmp, "INBOX");
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -2038,7 +2038,7 @@
ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
goto yuck;
}
- snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like \"%%%s/%s/%s\"%c", odbc_table, context, tmp, "Old", '\0');
+ snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like '%%%s/%s/%s'", odbc_table, context, tmp, "Old");
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -2105,7 +2105,7 @@
ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
goto yuck;
}
- snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like \"%%%s/%s/%s\"%c", odbc_table, context, tmp, "INBOX", '\0');
+ snprintf(sql, sizeof(sql), "SELECT COUNT(*) FROM %s WHERE dir like '%%%s/%s/%s'", odbc_table, context, tmp, "INBOX");
res = SQLPrepare(stmt, sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -3919,9 +3919,9 @@
static int vm_play_folder_name_gr(struct ast_channel *chan, char *mbox)
{
int cmd;
- char buf[sizeof(mbox)+1];
-
- memset(buf, '\0', sizeof(char)*(sizeof(buf)));
+ char *buf;
+
+ buf = alloca(strlen(mbox)+2);
strcpy(buf, mbox);
strcat(buf,"s");
Modified: team/crichter/0.2.1/apps/app_waitforsilence.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.2.1/apps/app_waitforsilence.c?rev=7951&r1=7950&r2=7951&view=diff
==============================================================================
--- team/crichter/0.2.1/apps/app_waitforsilence.c (original)
+++ team/crichter/0.2.1/apps/app_waitforsilence.c Tue Jan 10 16:41:23 2006
@@ -56,7 +56,7 @@
"SILENCE - if silence of x ms was detected"
"TIMEOUT - if silence of x ms was not detected."
"Examples:\n"
-" - WaitForSilence(500,2) will wait for 1/2 second of silence, twice\n"
+" - WaitForSilence(500|2) will wait for 1/2 second of silence, twice\n"
" - WaitForSilence(1000) will wait for 1 second of silence, once\n";
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum