[asterisk-commits] oej: branch oej/earlyrtpfix r48072 - in
/team/oej/earlyrtpfix: ./ apps/ chann...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Nov 27 13:33:13 MST 2006
Author: oej
Date: Mon Nov 27 14:33:13 2006
New Revision: 48072
URL: http://svn.digium.com/view/asterisk?view=rev&rev=48072
Log:
Update to trunk
Modified:
team/oej/earlyrtpfix/ (props changed)
team/oej/earlyrtpfix/apps/app_voicemail.c
team/oej/earlyrtpfix/channels/chan_sip.c
team/oej/earlyrtpfix/main/manager.c
team/oej/earlyrtpfix/pbx/pbx_spool.c
team/oej/earlyrtpfix/res/res_musiconhold.c
Propchange: team/oej/earlyrtpfix/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Propchange: team/oej/earlyrtpfix/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Nov 27 14:33:13 2006
@@ -1,1 +1,1 @@
-/branches/1.4:1-48019
+/branches/1.4:1-48071
Modified: team/oej/earlyrtpfix/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/earlyrtpfix/apps/app_voicemail.c?view=diff&rev=48072&r1=48071&r2=48072
==============================================================================
--- team/oej/earlyrtpfix/apps/app_voicemail.c (original)
+++ team/oej/earlyrtpfix/apps/app_voicemail.c Mon Nov 27 14:33:13 2006
@@ -6875,22 +6875,13 @@
}
}
AST_LIST_TRAVERSE(&users, vmu, list) {
- char dirname[256];
- DIR *vmdir;
- struct dirent *vment;
- int vmcount = 0;
- char count[12];
+ int newmsgs = 0, oldmsgs = 0;
+ char count[12], tmp[256] = "";
if ((argc == 3) || ((argc == 5) && !strcmp(argv[4],vmu->context))) {
- make_dir(dirname, 255, vmu->context, vmu->mailbox, "INBOX");
- if ((vmdir = opendir(dirname))) {
- /* No matter what the format of VM, there will always be a .txt file for each message. */
- while ((vment = readdir(vmdir)))
- if (strlen(vment->d_name) > 7 && !strncmp(vment->d_name + 7,".txt",4))
- vmcount++;
- closedir(vmdir);
- }
- snprintf(count,sizeof(count),"%d",vmcount);
+ snprintf(tmp, sizeof(tmp), "%s@%s", vmu->mailbox, ast_strlen_zero(vmu->context) ? "default" : vmu->context);
+ inboxcount(tmp, &newmsgs, &oldmsgs);
+ snprintf(count,sizeof(count),"%d",newmsgs);
ast_cli(fd, output_format, vmu->context, vmu->mailbox, vmu->fullname, vmu->zonetag, count);
}
}
Modified: team/oej/earlyrtpfix/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/earlyrtpfix/channels/chan_sip.c?view=diff&rev=48072&r1=48071&r2=48072
==============================================================================
--- team/oej/earlyrtpfix/channels/chan_sip.c (original)
+++ team/oej/earlyrtpfix/channels/chan_sip.c Mon Nov 27 14:33:13 2006
@@ -12115,7 +12115,8 @@
if (sipmethod == SIP_INVITE) {
/* First we ACK */
transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
- ast_log(LOG_WARNING, "INVITE with REPLACEs failed to '%s'\n", get_header(&p->initreq, "From"));
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Got 481 on Invite. Assuming INVITE with REPLACEs failed to '%s'\n", get_header(&p->initreq, "From"));
if (owner)
ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
Modified: team/oej/earlyrtpfix/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/earlyrtpfix/main/manager.c?view=diff&rev=48072&r1=48071&r2=48072
==============================================================================
--- team/oej/earlyrtpfix/main/manager.c (original)
+++ team/oej/earlyrtpfix/main/manager.c Mon Nov 27 14:33:13 2006
@@ -137,10 +137,6 @@
struct sockaddr_in sin;
/*! TCP socket */
int fd;
- /*! Whether or not we're busy doing an action */
- int busy;
- /*! Whether or not we're "dead" */
- int dead;
/*! Whether an HTTP manager is in use */
int inuse;
/*! Whether an HTTP session should be destroyed */
@@ -1167,8 +1163,6 @@
if (!s->send_events)
s->send_events = -1;
/* Once waitevent is called, always queue events from now on */
- if (s->busy == 1)
- s->busy = 2;
}
ast_mutex_unlock(&s->__lock);
s->waiting_thread = pthread_self();
@@ -1880,7 +1874,6 @@
int ret = 0;
ast_mutex_lock(&s->__lock);
if (s->fd > -1) {
- s->busy--;
if (!s->eventq)
s->eventq = master_eventq;
while(s->eventq->next) {
@@ -1980,9 +1973,6 @@
} else
astman_send_error(s, m, "Authentication Required");
} else {
- ast_mutex_lock(&s->__lock);
- s->busy++;
- ast_mutex_unlock(&s->__lock);
while (tmp) {
if (!strcasecmp(action, tmp->action)) {
if ((s->writeperm & tmp->authority) == tmp->authority) {
@@ -2039,8 +2029,6 @@
ast_mutex_unlock(&s->__lock);
if (res < 0) {
if (errno == EINTR) {
- if (s->dead)
- return -1;
return 0;
}
ast_log(LOG_WARNING, "Select returned error: %s\n", strerror(errno));
Modified: team/oej/earlyrtpfix/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/team/oej/earlyrtpfix/pbx/pbx_spool.c?view=diff&rev=48072&r1=48071&r2=48072
==============================================================================
--- team/oej/earlyrtpfix/pbx/pbx_spool.c (original)
+++ team/oej/earlyrtpfix/pbx/pbx_spool.c Mon Nov 27 14:33:13 2006
@@ -387,8 +387,8 @@
now += o->retrytime;
if (o->callingpid && (o->callingpid == ast_mainpid)) {
safe_append(o, time(NULL), "DelayedRetry");
+ ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
free_outgoing(o);
- ast_log(LOG_DEBUG, "Delaying retry since we're currently running '%s'\n", o->fn);
} else {
/* Increment retries */
o->retries++;
Modified: team/oej/earlyrtpfix/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/oej/earlyrtpfix/res/res_musiconhold.c?view=diff&rev=48072&r1=48071&r2=48072
==============================================================================
--- team/oej/earlyrtpfix/res/res_musiconhold.c (original)
+++ team/oej/earlyrtpfix/res/res_musiconhold.c Mon Nov 27 14:33:13 2006
@@ -205,7 +205,7 @@
if (state->origwfmt && ast_set_write_format(chan, state->origwfmt)) {
ast_log(LOG_WARNING, "Unable to restore channel '%s' to format '%d'\n", chan->name, state->origwfmt);
}
- state->save_pos = state->pos + 1;
+ state->save_pos = state->pos;
}
}
@@ -216,32 +216,29 @@
int tries;
if (state->save_pos) {
- state->pos = state->save_pos - 1;
+ state->pos = state->save_pos;
state->save_pos = 0;
- } else {
+ }
+
+ state->samples = 0;
+ if (chan->stream) {
+ ast_closestream(chan->stream);
+ chan->stream = NULL;
+ state->pos++;
+ state->pos %= state->class->total_files;
+ }
+
+ if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
/* Try 20 times to find something good */
- for (tries=0;tries < 20;tries++) {
- state->samples = 0;
- if (chan->stream) {
- ast_closestream(chan->stream);
- chan->stream = NULL;
- state->pos++;
- }
-
- if (ast_test_flag(state->class, MOH_RANDOMIZE))
- state->pos = ast_random();
-
- state->pos %= state->class->total_files;
+ for (tries = 0; tries < 20; tries++) {
+ state->pos = rand() % state->class->total_files;
/* check to see if this file's format can be opened */
if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0)
break;
-
- }
- }
-
- state->pos = state->pos % state->class->total_files;
-
+ }
+ }
+
if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", state->class->filearray[state->pos], strerror(errno));
state->pos++;
More information about the asterisk-commits
mailing list