[asterisk-commits] russell: branch russell/events r84238 - in /team/russell/events: ./ apps/ cdr...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Oct 1 15:01:52 CDT 2007
Author: russell
Date: Mon Oct 1 15:01:51 2007
New Revision: 84238
URL: http://svn.digium.com/view/asterisk?view=rev&rev=84238
Log:
resolve, reset
Added:
team/russell/events/pbx/ael/ael-test/ael-ntest22/
- copied from r84237, trunk/pbx/ael/ael-test/ael-ntest22/
team/russell/events/pbx/ael/ael-test/ael-ntest22/extensions.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/extensions.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/qq.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/qq.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t1/
- copied from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t1/
team/russell/events/pbx/ael/ael-test/ael-ntest22/t1/a.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t1/a.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t1/b.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t1/b.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t1/c.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t1/c.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t2/
- copied from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t2/
team/russell/events/pbx/ael/ael-test/ael-ntest22/t2/d.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t2/d.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t2/e.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t2/e.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t2/f.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t2/f.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t3/
- copied from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t3/
team/russell/events/pbx/ael/ael-test/ael-ntest22/t3/g.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t3/g.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t3/h.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t3/h.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t3/i.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t3/i.ael
team/russell/events/pbx/ael/ael-test/ael-ntest22/t3/j.ael
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ael-ntest22/t3/j.ael
team/russell/events/pbx/ael/ael-test/ref.ael-ntest22
- copied unchanged from r84237, trunk/pbx/ael/ael-test/ref.ael-ntest22
Modified:
team/russell/events/ (props changed)
team/russell/events/apps/app_dial.c
team/russell/events/apps/app_meetme.c
team/russell/events/apps/app_minivm.c
team/russell/events/cdr/cdr_manager.c
team/russell/events/channels/Makefile
team/russell/events/channels/chan_iax2.c
team/russell/events/channels/chan_mgcp.c
team/russell/events/channels/chan_misdn.c
team/russell/events/channels/chan_sip.c
team/russell/events/channels/chan_skinny.c
team/russell/events/channels/iax2-parser.c
team/russell/events/codecs/g722/Makefile
team/russell/events/configs/musiconhold.conf.sample
team/russell/events/funcs/func_lock.c
team/russell/events/include/asterisk/lock.h
team/russell/events/include/asterisk/module.h
team/russell/events/main/asterisk.c
team/russell/events/main/cli.c
team/russell/events/main/dnsmgr.c
team/russell/events/main/frame.c
team/russell/events/main/rtp.c
team/russell/events/main/say.c
team/russell/events/main/translate.c
team/russell/events/pbx/ael/ael-test/ref.ael-test2
team/russell/events/pbx/ael/ael-test/ref.ael-test3
team/russell/events/pbx/ael/ael-test/ref.ael-test4
team/russell/events/pbx/dundi-parser.c
team/russell/events/res/Makefile
team/russell/events/res/ael/ael.flex
team/russell/events/res/ael/ael_lex.c
team/russell/events/res/res_agi.c
team/russell/events/res/res_config_odbc.c
team/russell/events/res/res_musiconhold.c
Propchange: team/russell/events/
------------------------------------------------------------------------------
automerge = *
Propchange: team/russell/events/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/russell/events/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/russell/events/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Oct 1 15:01:51 2007
@@ -1,1 +1,1 @@
-/trunk:1-84109
+/trunk:1-84237
Modified: team/russell/events/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_dial.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/apps/app_dial.c (original)
+++ team/russell/events/apps/app_dial.c Mon Oct 1 15:01:51 2007
@@ -313,6 +313,10 @@
AST_APP_OPTION('W', OPT_CALLER_MONITOR),
});
+#define CAN_EARLY_BRIDGE(flags) (!ast_test_flag64(flags, OPT_CALLEE_HANGUP | \
+ OPT_CALLER_HANGUP | OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | \
+ OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR | OPT_CALLEE_PARK | OPT_CALLER_PARK))
+
/*
* The list of active channels
*/
@@ -660,8 +664,9 @@
DIAL_NOFORWARDHTML);
ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
ast_copy_string(c->exten, "", sizeof(c->exten));
- /* Setup early bridge if appropriate */
- ast_channel_early_bridge(in, peer);
+ if (CAN_EARLY_BRIDGE(peerflags))
+ /* Setup early bridge if appropriate */
+ ast_channel_early_bridge(in, peer);
}
/* If call has been answered, then the eventual hangup is likely to be normal hangup */
in->hangupcause = AST_CAUSE_NORMAL_CLEARING;
@@ -686,7 +691,7 @@
case AST_CONTROL_RINGING:
ast_verb(3, "%s is ringing\n", c->name);
/* Setup early media if appropriate */
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!(pa->sentringing) && !ast_test_flag64(outgoing, OPT_MUSICBACK)) {
ast_indicate(in, AST_CONTROL_RINGING);
@@ -696,7 +701,7 @@
case AST_CONTROL_PROGRESS:
ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
/* Setup early media if appropriate */
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROGRESS);
@@ -707,7 +712,7 @@
break;
case AST_CONTROL_PROCEEDING:
ast_verb(3, "%s is proceeding passing it to %s\n", c->name, in->name);
- if (single)
+ if (single && CAN_EARLY_BRIDGE(peerflags))
ast_channel_early_bridge(in, c);
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING);
Modified: team/russell/events/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_meetme.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/apps/app_meetme.c (original)
+++ team/russell/events/apps/app_meetme.c Mon Oct 1 15:01:51 2007
@@ -1477,7 +1477,7 @@
}
conf->recordingformat = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFORMAT");
if (!conf->recordingformat) {
- snprintf(recordingtmp, sizeof(recordingtmp), "wav");
+ ast_copy_string(recordingtmp, "wav", sizeof(recordingtmp));
conf->recordingformat = ast_strdupa(recordingtmp);
}
ast_verb(4, "Starting recording of MeetMe Conference %s into file %s.%s.\n",
Modified: team/russell/events/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_minivm.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/apps/app_minivm.c (original)
+++ team/russell/events/apps/app_minivm.c Mon Oct 1 15:01:51 2007
@@ -934,7 +934,7 @@
char tmpcmd[PATH_MAX];
int tmpfd;
- snprintf(newtmp, sizeof(newtmp), "/tmp/XXXXXX");
+ ast_copy_string(newtmp, "/tmp/XXXXXX", sizeof(newtmp));
ast_debug(3, "newtmp: %s\n", newtmp);
tmpfd = mkstemp(newtmp);
snprintf(tmpcmd, sizeof(tmpcmd), "sox -v %.4f %s.%s %s.%s", vmu->volgain, filename, format, newtmp, format);
Modified: team/russell/events/cdr/cdr_manager.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/cdr/cdr_manager.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/cdr/cdr_manager.c (original)
+++ team/russell/events/cdr/cdr_manager.c Mon Oct 1 15:01:51 2007
@@ -114,6 +114,7 @@
ast_cdr_unregister(name);
else if (!enablecdr && newenablecdr)
ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log);
+ enablecdr = newenablecdr;
return 1;
}
Modified: team/russell/events/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/Makefile?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/channels/Makefile (original)
+++ team/russell/events/channels/Makefile Mon Oct 1 15:01:51 2007
@@ -68,6 +68,7 @@
H323LDFLAGS+=-Wl,--version-script=h323/noexport.map
clean::
$(MAKE) -C h323 clean
+ rm -f h323/Makefile
else
h323/libchanh323.a h323/Makefile.ast:
$(CMD_PREFIX) $(MAKE) -C h323
Modified: team/russell/events/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_iax2.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/channels/chan_iax2.c (original)
+++ team/russell/events/channels/chan_iax2.c Mon Oct 1 15:01:51 2007
@@ -5969,9 +5969,9 @@
else if (reg->messages > 1)
snprintf(msgstatus, sizeof(msgstatus), " with %d new messages waiting\n", reg->messages);
else if (reg->messages > 0)
- snprintf(msgstatus, sizeof(msgstatus), " with 1 new message waiting\n");
+ ast_copy_string(msgstatus, " with 1 new message waiting\n", sizeof(msgstatus));
else
- snprintf(msgstatus, sizeof(msgstatus), " with no messages waiting\n");
+ ast_copy_string(msgstatus, " with no messages waiting\n", sizeof(msgstatus));
snprintf(ourip, sizeof(ourip), "%s:%d", ast_inet_ntoa(reg->us.sin_addr), ntohs(reg->us.sin_port));
ast_verb(3, "Registered IAX2 to '%s', who sees us as %s%s\n", ast_inet_ntoa(sin->sin_addr), ourip, msgstatus);
manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: IAX2\r\nDomain: %s\r\nStatus: Registered\r\n", ast_inet_ntoa(sin->sin_addr));
Modified: team/russell/events/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_mgcp.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/channels/chan_mgcp.c (original)
+++ team/russell/events/channels/chan_mgcp.c Mon Oct 1 15:01:51 2007
@@ -882,7 +882,7 @@
ast_verb(3, "MGCP distinctive callwait %s\n", tone);
}
} else {
- snprintf(tone, sizeof(tone), "L/wt");
+ ast_copy_string(tone, "L/wt", sizeof(tone));
if (mgcpdebug) {
ast_verb(3, "MGCP normal callwait %s\n", tone);
}
@@ -896,7 +896,7 @@
ast_verb(3, "MGCP distinctive ring %s\n", tone);
}
} else {
- snprintf(tone, sizeof(tone), "L/rg");
+ ast_copy_string(tone, "L/rg", sizeof(tone));
if (mgcpdebug) {
ast_verb(3, "MGCP default ring\n");
}
@@ -1932,7 +1932,7 @@
}
if (!req->lines) {
/* Add extra empty return */
- snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n");
+ ast_copy_string(req->data + req->len, "\r\n", sizeof(req->data) - req->len);
req->len += strlen(req->data + req->len);
}
req->line[req->lines] = req->data + req->len;
@@ -2065,11 +2065,11 @@
if (mgcpdebug) {
ast_verbose("We're at %s port %d\n", ast_inet_ntoa(p->parent->ourip), ntohs(sin.sin_port));
}
- snprintf(v, sizeof(v), "v=0\r\n");
+ ast_copy_string(v, "v=0\r\n", sizeof(v));
snprintf(o, sizeof(o), "o=root %d %d IN IP4 %s\r\n", (int)getpid(), (int)getpid(), ast_inet_ntoa(dest.sin_addr));
- snprintf(s, sizeof(s), "s=session\r\n");
+ ast_copy_string(s, "s=session\r\n", sizeof(s));
snprintf(c, sizeof(c), "c=IN IP4 %s\r\n", ast_inet_ntoa(dest.sin_addr));
- snprintf(t, sizeof(t), "t=0 0\r\n");
+ ast_copy_string(t, "t=0 0\r\n", sizeof(t));
snprintf(m, sizeof(m), "m=audio %d RTP/AVP", ntohs(dest.sin_port));
for (x = 1; x <= AST_FORMAT_MAX_AUDIO; x <<= 1) {
if (p->capability & x) {
@@ -2136,7 +2136,7 @@
ast_rtp_get_peer(rtp, &sub->tmpdest);
return 0;
}
- snprintf(local, sizeof(local), "p:20");
+ ast_copy_string(local, "p:20", sizeof(local));
for (x=1;x<= AST_FORMAT_MAX_AUDIO; x <<= 1) {
if (p->capability & x) {
snprintf(tmp, sizeof(tmp), ", a:%s", ast_rtp_lookup_mime_subtype(1, x, 0));
@@ -2166,7 +2166,7 @@
int x;
struct mgcp_endpoint *p = sub->parent;
- snprintf(local, sizeof(local), "p:20");
+ ast_copy_string(local, "p:20", sizeof(local));
for (x=1;x<= AST_FORMAT_MAX_AUDIO; x <<= 1) {
if (p->capability & x) {
snprintf(tmp, sizeof(tmp), ", a:%s", ast_rtp_lookup_mime_subtype(1, x, 0));
Modified: team/russell/events/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_misdn.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/channels/chan_misdn.c (original)
+++ team/russell/events/channels/chan_misdn.c Mon Oct 1 15:01:51 2007
@@ -1701,7 +1701,7 @@
misdn_cfg_get(bc->port, MISDN_CFG_ECHOCANCEL, &ec, sizeof(ec));
if (ec == 1)
- snprintf(bc->pipeline, sizeof(bc->pipeline), "mg2ec");
+ ast_copy_string(bc->pipeline, "mg2ec", sizeof(bc->pipeline));
else if (ec > 1)
snprintf(bc->pipeline, sizeof(bc->pipeline), "mg2ec(deftaps=%d)", ec);
Modified: team/russell/events/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_sip.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/channels/chan_sip.c (original)
+++ team/russell/events/channels/chan_sip.c Mon Oct 1 15:01:51 2007
@@ -2586,7 +2586,7 @@
{
if (!req->lines) {
/* Add extra empty return. add_header() reserves 4 bytes so cannot be truncated */
- snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n");
+ ast_copy_string(req->data + req->len, "\r\n", sizeof(req->data) - req->len);
req->len += strlen(req->data + req->len);
}
}
@@ -5856,7 +5856,7 @@
/* Note: should really look at the 'freq' and '#chans' params too */
/* Note: This should all be done in the context of the m= above */
- if (!strncasecmp(mimeSubtype, "H26",3)) { /* Video */
+ if (!strncasecmp(mimeSubtype, "H26", 3) || !strncasecmp(mimeSubtype, "MP4", 3)) { /* Video */
/* Not going to do anything here for the moment, but we will soon */
} else if (!strncasecmp(mimeSubtype, "T140",4)) { /* Text */
if (p->trtp) {
@@ -6175,7 +6175,7 @@
}
if (!req->lines) {
/* Add extra empty return */
- snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n");
+ ast_copy_string(req->data + req->len, "\r\n", sizeof(req->data) - req->len);
req->len += strlen(req->data + req->len);
}
if (req->len >= sizeof(req->data) - 4) {
@@ -18912,7 +18912,7 @@
ast_verbose("Previous SIP reload not yet done\n");
else {
sip_reloading = TRUE;
- sip_reloadreason = a->fd ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD;
+ sip_reloadreason = (a && a->fd) ? CHANNEL_CLI_RELOAD : CHANNEL_MODULE_RELOAD;
}
ast_mutex_unlock(&sip_reload_lock);
restart_monitor();
Modified: team/russell/events/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_skinny.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/channels/chan_skinny.c (original)
+++ team/russell/events/channels/chan_skinny.c Mon Oct 1 15:01:51 2007
@@ -4221,8 +4221,8 @@
return -1;
req->data.speeddialreq.speedDialNumber = htolel(instance);
- snprintf(req->data.speeddial.speedDialDirNumber, sizeof(req->data.speeddial.speedDialDirNumber), sd->exten);
- snprintf(req->data.speeddial.speedDialDisplayName, sizeof(req->data.speeddial.speedDialDisplayName), sd->label);
+ ast_copy_string(req->data.speeddial.speedDialDirNumber, sd->exten, sizeof(req->data.speeddial.speedDialDirNumber));
+ ast_copy_string(req->data.speeddial.speedDialDisplayName, sd->label, sizeof(req->data.speeddial.speedDialDisplayName));
transmit_response(s, req);
return 1;
@@ -4442,7 +4442,7 @@
if (!(req = req_alloc(sizeof(struct version_res_message), VERSION_RES_MESSAGE)))
return -1;
- snprintf(req->data.version.version, sizeof(req->data.version.version), d->version_id);
+ ast_copy_string(req->data.version.version, d->version_id, sizeof(req->data.version.version));
transmit_response(s, req);
return 1;
}
Modified: team/russell/events/channels/iax2-parser.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/iax2-parser.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/channels/iax2-parser.c (original)
+++ team/russell/events/channels/iax2-parser.c Mon Oct 1 15:01:51 2007
@@ -82,7 +82,7 @@
memcpy(&sin, value, len);
snprintf(output, maxlen, "IPV4 %s:%d", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
} else {
- snprintf(output, maxlen, "Invalid Address");
+ ast_copy_string(output, "Invalid Address", maxlen);
}
}
Modified: team/russell/events/codecs/g722/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/events/codecs/g722/Makefile?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/codecs/g722/Makefile (original)
+++ team/russell/events/codecs/g722/Makefile Mon Oct 1 15:01:51 2007
@@ -14,3 +14,4 @@
clean:
rm -f $(LIB) *.o
+ rm -f .*.o.d
Modified: team/russell/events/configs/musiconhold.conf.sample
URL: http://svn.digium.com/view/asterisk/team/russell/events/configs/musiconhold.conf.sample?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/configs/musiconhold.conf.sample (original)
+++ team/russell/events/configs/musiconhold.conf.sample Mon Oct 1 15:01:51 2007
@@ -39,11 +39,16 @@
;[native-random]
;mode=files
;directory=/var/lib/asterisk/moh
-;random=yes ; Play the files in a random order
;digit=# ; If this option is set for a class, then when callers are
; ; listening to music on hold, they can press this digit, and
; ; they will switch to listening to this music class.
+;sort=random ; Sort the files in random order
+;[native-alphabetical]
+;mode=files
+;directory=/var/lib/asterisk/moh
+;sort=alpha ; Sort the files in alphabetical order. If this option is
+; ; not specified, the sort order is undefined.
; =========
; Other (non-native) playback methods
Modified: team/russell/events/funcs/func_lock.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/funcs/func_lock.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/funcs/func_lock.c (original)
+++ team/russell/events/funcs/func_lock.c Mon Oct 1 15:01:51 2007
@@ -187,11 +187,12 @@
/* Okay, we have both frames, so now we need to try to lock the mutex. */
if (count_channel_locks > 1) {
- /* If we fail after a certain number of attempts, assume a possible deadlock and bail. */
- int x;
- for (x = 0; x < 30; x++) {
+ struct timeval start = ast_tvnow();
+ for (;;) {
if ((res = ast_mutex_trylock(¤t->mutex)) == 0)
break;
+ if (ast_tvdiff_ms(ast_tvnow(), start) > 3000)
+ break; /* bail after 3 seconds of waiting */
usleep(1);
}
} else {
@@ -256,13 +257,19 @@
static int lock_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
+ ast_autoservice_start(chan);
ast_copy_string(buf, get_lock(chan, data, 0) ? "0" : "1", len);
+ ast_autoservice_stop(chan);
+
return 0;
}
static int trylock_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
+ ast_autoservice_start(chan);
ast_copy_string(buf, get_lock(chan, data, 1) ? "0" : "1", len);
+ ast_autoservice_stop(chan);
+
return 0;
}
Modified: team/russell/events/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/russell/events/include/asterisk/lock.h?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/include/asterisk/lock.h (original)
+++ team/russell/events/include/asterisk/lock.h Mon Oct 1 15:01:51 2007
@@ -702,6 +702,84 @@
return pthread_rwlock_destroy(prwlock);
}
+#ifdef DEBUG_THREADS
+#define ast_rwlock_unlock(a) \
+ _ast_rwlock_unlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_unlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ res = pthread_rwlock_unlock(lock);
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#define ast_rwlock_rdlock(a) \
+ _ast_rwlock_rdlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_rdlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ ast_store_lock_info(file, line, func, name, lock);
+ res = pthread_rwlock_rdlock(lock);
+ if (!res)
+ ast_mark_lock_acquired();
+ else
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#define ast_rwlock_wrlock(a) \
+ _ast_rwlock_wrlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_wrlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ ast_store_lock_info(file, line, func, name, lock);
+ res = pthread_rwlock_wrlock(lock);
+ if (!res)
+ ast_mark_lock_acquired();
+ else
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#define ast_rwlock_tryrdlock(a) \
+ _ast_rwlock_tryrdlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_tryrdlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ ast_store_lock_info(file, line, func, name, lock);
+ res = pthread_rwlock_tryrdlock(lock);
+ if (!res)
+ ast_mark_lock_acquired();
+ else
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#define ast_rwlock_trywrlock(a) \
+ _ast_rwlock_trywrlock(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+
+static inline int _ast_rwlock_trywrlock(ast_rwlock_t *lock, const char *name,
+ const char *file, int line, const char *func)
+{
+ int res;
+ ast_store_lock_info(file, line, func, name, lock);
+ res = pthread_rwlock_trywrlock(lock);
+ if (!res)
+ ast_mark_lock_acquired();
+ else
+ ast_remove_lock_info(lock);
+ return res;
+}
+
+#else
static inline int ast_rwlock_unlock(ast_rwlock_t *prwlock)
{
return pthread_rwlock_unlock(prwlock);
@@ -726,6 +804,7 @@
{
return pthread_rwlock_trywrlock(prwlock);
}
+#endif /* DEBUG_THREADS */
/* Statically declared read/write locks */
Modified: team/russell/events/include/asterisk/module.h
URL: http://svn.digium.com/view/asterisk/team/russell/events/include/asterisk/module.h?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/include/asterisk/module.h (original)
+++ team/russell/events/include/asterisk/module.h Mon Oct 1 15:01:51 2007
@@ -237,8 +237,8 @@
static struct ast_module_info __mod_info = { \
NULL, \
load_func, \
+ reload_func, \
unload_func, \
- reload_func, \
AST_MODULE, \
desc, \
keystr, \
Modified: team/russell/events/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/asterisk.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/main/asterisk.c (original)
+++ team/russell/events/main/asterisk.c Mon Oct 1 15:01:51 2007
@@ -1880,7 +1880,7 @@
} else if (remotehostname)
snprintf(prompt, sizeof(prompt), ASTERISK_PROMPT2, remotehostname);
else
- snprintf(prompt, sizeof(prompt), ASTERISK_PROMPT);
+ ast_copy_string(prompt, ASTERISK_PROMPT, sizeof(prompt));
return(prompt);
}
@@ -2206,7 +2206,7 @@
snprintf(tmp, sizeof(tmp), "core set debug atleast %d", option_debug);
fdprint(ast_consock, tmp);
if (ast_opt_mute) {
- snprintf(tmp, sizeof(tmp), "log and verbose output currently muted ('logger unmute' to unmute)");
+ ast_copy_string(tmp, "log and verbose output currently muted ('logger unmute' to unmute)", sizeof(tmp));
fdprint(ast_consock, tmp);
}
ast_verbose("Connected to Asterisk %s currently running on %s (pid = %d)\n", version, hostname, pid);
Modified: team/russell/events/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/cli.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/main/cli.c (original)
+++ team/russell/events/main/cli.c Mon Oct 1 15:01:51 2007
@@ -1407,16 +1407,14 @@
}
*dst++ = NULL;
}
- if (set_full_cmd(e))
- goto done;
AST_RWLIST_WRLOCK(&helpers);
if (find_cli(e->cmda, 1)) {
ast_log(LOG_WARNING, "Command '%s' already registered (or something close enough)\n", e->_full_cmd);
- ast_free(e->_full_cmd);
- e->_full_cmd = NULL;
goto done;
}
+ if (set_full_cmd(e))
+ goto done;
if (!ed) {
e->deprecated = 0;
} else {
Modified: team/russell/events/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/dnsmgr.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/main/dnsmgr.c (original)
+++ team/russell/events/main/dnsmgr.c Mon Oct 1 15:01:51 2007
@@ -408,7 +408,6 @@
if (ast_pthread_create_background(&refresh_thread, NULL, do_refresh, NULL) < 0) {
ast_log(LOG_ERROR, "Unable to start refresh thread.\n");
}
- ast_cli_register(&cli_refresh);
}
/* make a background refresh happen right away */
refresh_sched = ast_sched_add_variable(sched, 100, refresh_list, &master_refresh_info, 1);
Modified: team/russell/events/main/frame.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/frame.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/main/frame.c (original)
+++ team/russell/events/main/frame.c Mon Oct 1 15:01:51 2007
@@ -555,7 +555,7 @@
}
}
if (start == end)
- snprintf(start, size, "nothing)");
+ ast_copy_string(start, "nothing)", size);
else if (size > 1)
*(end -1) = ')';
return buf;
Modified: team/russell/events/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/rtp.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/main/rtp.c (original)
+++ team/russell/events/main/rtp.c Mon Oct 1 15:01:51 2007
@@ -2113,7 +2113,7 @@
}
if (start == end)
- snprintf(start, size, "nothing)");
+ ast_copy_string(start, "nothing)", size);
else if (size > 1)
*(end -1) = ')';
Modified: team/russell/events/main/say.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/say.c?view=diff&rev=84238&r1=84237&r2=84238
==============================================================================
--- team/russell/events/main/say.c (original)
+++ team/russell/events/main/say.c Mon Oct 1 15:01:51 2007
@@ -486,40 +486,40 @@
while (!res && (num || playh)) {
if (num < 0) {
- snprintf(fn, sizeof(fn), "digits/minus");
+ ast_copy_string(fn, "digits/minus", sizeof(fn));
if ( num > INT_MIN ) {
num = -num;
} else {
num = 0;
}
} else if (playh) {
- snprintf(fn, sizeof(fn), "digits/hundred");
+ ast_copy_string(fn, "digits/hundred", sizeof(fn));
playh = 0;
} else if (num < 20) {
snprintf(fn, sizeof(fn), "digits/%d", num);
num = 0;
} else if (num < 100) {
snprintf(fn, sizeof(fn), "digits/%d", (num /10) * 10);
- num -= ((num / 10) * 10);
+ num %= 10;
} else {
if (num < 1000){
snprintf(fn, sizeof(fn), "digits/%d", (num/100));
playh++;
- num -= ((num / 100) * 100);
+ num %= 100;
} else {
if (num < 1000000) { /* 1,000,000 */
res = ast_say_number_full_en(chan, num / 1000, ints, language, audiofd, ctrlfd);
if (res)
return res;
- num = num % 1000;
+ num %= 1000;
snprintf(fn, sizeof(fn), "digits/thousand");
} else {
if (num < 1000000000) { /* 1,000,000,000 */
res = ast_say_number_full_en(chan, num / 1000000, ints, language, audiofd, ctrlfd);
if (res)
return res;
- num = num % 1000000;
- snprintf(fn, sizeof(fn), "digits/million");
+ num %= 1000000;
+ ast_copy_string(fn, "digits/million", sizeof(fn));
} else {
ast_debug(1, "Number '%d' is too big for me\n", num);
res = -1;
@@ -588,7 +588,7 @@
while (!res && (num || playh)) {
if (num < 0) {
- snprintf(fn, sizeof(fn), "digits/minus");
+ ast_copy_string(fn, "digits/minus", sizeof(fn));
if ( num > INT_MIN ) {
num = -num;
} else {
@@ -604,21 +604,21 @@
num = 0;
} else if (num < 100) {
snprintf(fn, sizeof(fn), "digits/%d", (num /10) * 10);
- num -= ((num / 10) * 10);
+ num %= 10;
} else if (num < 1000) {
hundered = num / 100;
if ( hundered == 1 ) {
- snprintf(fn, sizeof(fn), "digits/1sto");
+ ast_copy_string(fn, "digits/1sto", sizeof(fn));
} else if ( hundered == 2 ) {
- snprintf(fn, sizeof(fn), "digits/2ste");
+ ast_copy_string(fn, "digits/2ste", sizeof(fn));
} else {
res = ast_say_number_full_cz(chan,hundered,ints,language,options,audiofd,ctrlfd);
if (res)
return res;
if (hundered == 3 || hundered == 4) {
- snprintf(fn, sizeof(fn), "digits/sta");
+ ast_copy_string(fn, "digits/sta", sizeof(fn));
} else if ( hundered > 4 ) {
- snprintf(fn, sizeof(fn), "digits/set");
+ ast_copy_string(fn, "digits/set", sizeof(fn));
}
}
num -= (hundered * 100);
@@ -691,20 +691,20 @@
* four-and thirty" and 1000012 is "one million and twelve".
*/
if (num < 0) {
- snprintf(fn, sizeof(fn), "digits/minus");
+ ast_copy_string(fn, "digits/minus", sizeof(fn));
if ( num > INT_MIN ) {
num = -num;
} else {
num = 0;
}
} else if (playh) {
- snprintf(fn, sizeof(fn), "digits/hundred");
+ ast_copy_string(fn, "digits/hundred", sizeof(fn));
playh = 0;
} else if (playa) {
- snprintf(fn, sizeof(fn), "digits/and");
+ ast_copy_string(fn, "digits/and", sizeof(fn));
playa = 0;
} else if (num == 1 && cn == -1) {
- snprintf(fn, sizeof(fn), "digits/1N");
+ ast_copy_string(fn, "digits/1N", sizeof(fn));
num = 0;
} else if (num < 20) {
snprintf(fn, sizeof(fn), "digits/%d", num);
@@ -722,7 +722,7 @@
if (num < 1000) {
int hundreds = num / 100;
if (hundreds == 1)
- snprintf(fn, sizeof(fn), "digits/1N");
+ ast_copy_string(fn, "digits/1N", sizeof(fn));
else
snprintf(fn, sizeof(fn), "digits/%d", (num / 100));
@@ -737,7 +737,7 @@
if (res)
return res;
num = num % 1000;
- snprintf(fn, sizeof(fn), "digits/thousand");
+ ast_copy_string(fn, "digits/thousand", sizeof(fn));
} else {
if (num < 1000000000) {
int millions = num / 1000000;
@@ -745,9 +745,9 @@
if (res)
return res;
if (millions == 1)
- snprintf(fn, sizeof(fn), "digits/million");
+ ast_copy_string(fn, "digits/million", sizeof(fn));
else
- snprintf(fn, sizeof(fn), "digits/millions");
+ ast_copy_string(fn, "digits/millions", sizeof(fn));
num = num % 1000000;
} else {
ast_debug(1, "Number '%d' is too big for me\n", num);
@@ -804,14 +804,14 @@
* - "million" is different in singular and plural form
*/
if (num < 0) {
- snprintf(fn, sizeof(fn), "digits/minus");
+ ast_copy_string(fn, "digits/minus", sizeof(fn));
if ( num > INT_MIN ) {
num = -num;
} else {
num = 0;
}
} else if (num < 100 && t) {
- snprintf(fn, sizeof(fn), "digits/and");
+ ast_copy_string(fn, "digits/and", sizeof(fn));
t = 0;
} else if (num == 1 && mf == -1) {
snprintf(fn, sizeof(fn), "digits/%dF", num);
@@ -829,60 +829,60 @@
num = 0;
}
} else if (num == 100 && t == 0) {
- snprintf(fn, sizeof(fn), "digits/hundred");
+ ast_copy_string(fn, "digits/hundred", sizeof(fn));
num = 0;
} else if (num < 1000) {
int hundreds = num / 100;
num = num % 100;
if (hundreds == 1) {
- snprintf(fn, sizeof(fn), "digits/1N");
+ ast_copy_string(fn, "digits/1N", sizeof(fn));
} else {
snprintf(fn, sizeof(fn), "digits/%d", hundreds);
}
- snprintf(fna, sizeof(fna), "digits/hundred");
+ ast_copy_string(fna, "digits/hundred", sizeof(fna));
t = 1;
} else if (num == 1000 && t == 0) {
- snprintf(fn, sizeof(fn), "digits/thousand");
+ ast_copy_string(fn, "digits/thousand", sizeof(fn));
num = 0;
} else if (num < 1000000) {
int thousands = num / 1000;
num = num % 1000;
t = 1;
if (thousands == 1) {
- snprintf(fn, sizeof(fn), "digits/1N");
- snprintf(fna, sizeof(fna), "digits/thousand");
+ ast_copy_string(fn, "digits/1N", sizeof(fn));
+ ast_copy_string(fna, "digits/thousand", sizeof(fna));
} else {
res = ast_say_number_full_de(chan, thousands, ints, language, options, audiofd, ctrlfd);
if (res)
return res;
- snprintf(fn, sizeof(fn), "digits/thousand");
+ ast_copy_string(fn, "digits/thousand", sizeof(fn));
}
} else if (num < 1000000000) {
int millions = num / 1000000;
num = num % 1000000;
t = 1;
if (millions == 1) {
- snprintf(fn, sizeof(fn), "digits/1F");
- snprintf(fna, sizeof(fna), "digits/million");
+ ast_copy_string(fn, "digits/1F", sizeof(fn));
+ ast_copy_string(fna, "digits/million", sizeof(fna));
} else {
res = ast_say_number_full_de(chan, millions, ints, language, options, audiofd, ctrlfd);
if (res)
return res;
- snprintf(fn, sizeof(fn), "digits/millions");
+ ast_copy_string(fn, "digits/millions", sizeof(fn));
}
} else if (num <= INT_MAX) {
int billions = num / 1000000000;
num = num % 1000000000;
t = 1;
if (billions == 1) {
- snprintf(fn, sizeof(fn), "digits/1F");
- snprintf(fna, sizeof(fna), "digits/milliard");
+ ast_copy_string(fn, "digits/1F", sizeof(fn));
+ ast_copy_string(fna, "digits/milliard", sizeof(fna));
} else {
res = ast_say_number_full_de(chan, billions, ints, language, options, audiofd, ctrlfd);
if (res) {
return res;
}
- snprintf(fn, sizeof(fn), "digits/milliards");
+ ast_copy_string(fn, "digits/milliards", sizeof(fn));
}
} else {
ast_debug(1, "Number '%d' is too big for me\n", num);
@@ -926,24 +926,24 @@
while (!res && (num || playh || playa )) {
if (num < 0) {
- snprintf(fn, sizeof(fn), "digits/minus");
+ ast_copy_string(fn, "digits/minus", sizeof(fn));
if ( num > INT_MIN ) {
num = -num;
} else {
num = 0;
}
} else if (playh) {
- snprintf(fn, sizeof(fn), "digits/hundred");
+ ast_copy_string(fn, "digits/hundred", sizeof(fn));
playh = 0;
} else if (playa) {
- snprintf(fn, sizeof(fn), "digits/and");
+ ast_copy_string(fn, "digits/and", sizeof(fn));
playa = 0;
} else if (num < 20) {
snprintf(fn, sizeof(fn), "digits/%d", num);
num = 0;
} else if (num < 100) {
snprintf(fn, sizeof(fn), "digits/%d", (num /10) * 10);
- num -= ((num / 10) * 10);
+ num %= 10;
} else if (num < 1000) {
int hundreds = num / 100;
snprintf(fn, sizeof(fn), "digits/%d", (num / 100));
@@ -956,8 +956,8 @@
res = ast_say_number_full_en_GB(chan, num / 1000, ints, language, audiofd, ctrlfd);
if (res)
return res;
- snprintf(fn, sizeof(fn), "digits/thousand");
- num = num % 1000;
+ ast_copy_string(fn, "digits/thousand", sizeof(fn));
+ num %= 1000;
if (num && num < 100)
playa++;
} else if (num < 1000000000) {
@@ -965,8 +965,8 @@
res = ast_say_number_full_en_GB(chan, millions, ints, language, audiofd, ctrlfd);
if (res)
return res;
- snprintf(fn, sizeof(fn), "digits/million");
- num = num % 1000000;
+ ast_copy_string(fn, "digits/million", sizeof(fn));
+ num %= 1000000;
if (num && num < 100)
playa++;
} else {
@@ -1011,14 +1011,14 @@
while (!res && num) {
if (num < 0) {
- snprintf(fn, sizeof(fn), "digits/minus");
+ ast_copy_string(fn, "digits/minus", sizeof(fn));
if ( num > INT_MIN ) {
num = -num;
} else {
num = 0;
}
} else if (playa) {
- snprintf(fn, sizeof(fn), "digits/and");
+ ast_copy_string(fn, "digits/and", sizeof(fn));
playa = 0;
} else if (num == 1) {
if (mf < 0)
@@ -1033,43 +1033,43 @@
num = 0;
} else if (num < 100) {
snprintf(fn, sizeof(fn), "digits/%d", (num/10)*10);
- num -= ((num/10)*10);
+ num %= 10;
if (num)
playa++;
} else if (num == 100) {
- snprintf(fn, sizeof(fn), "digits/100");
+ ast_copy_string(fn, "digits/100", sizeof(fn));
num = 0;
} else if (num < 200) {
- snprintf(fn, sizeof(fn), "digits/100-and");
+ ast_copy_string(fn, "digits/100-and", sizeof(fn));
num -= 100;
} else {
if (num < 1000) {
snprintf(fn, sizeof(fn), "digits/%d", (num/100)*100);
- num -= ((num/100)*100);
+ num %= 100;
} else if (num < 2000) {
- num = num % 1000;
- snprintf(fn, sizeof(fn), "digits/thousand");
+ num %= 1000;
+ ast_copy_string(fn, "digits/thousand", sizeof(fn));
} else {
if (num < 1000000) {
res = ast_say_number_full_es(chan, num / 1000, ints, language, options, audiofd, ctrlfd);
if (res)
return res;
- num = num % 1000;
- snprintf(fn, sizeof(fn), "digits/thousand");
+ num %= 1000;
+ ast_copy_string(fn, "digits/thousand", sizeof(fn));
} else {
if (num < 2147483640) {
if ((num/1000000) == 1) {
res = ast_say_number_full_es(chan, num / 1000000, ints, language, "M", audiofd, ctrlfd);
if (res)
return res;
- snprintf(fn, sizeof(fn), "digits/million");
+ ast_copy_string(fn, "digits/million", sizeof(fn));
} else {
res = ast_say_number_full_es(chan, num / 1000000, ints, language, options, audiofd, ctrlfd);
if (res)
return res;
- snprintf(fn, sizeof(fn), "digits/millions");
+ ast_copy_string(fn, "digits/millions", sizeof(fn));
}
- num = num % 1000000;
+ num %= 1000000;
} else {
ast_debug(1, "Number '%d' is too big for me\n", num);
res = -1;
@@ -1112,17 +1112,17 @@
while (!res && (num || playh || playa)) {
if (num < 0) {
- snprintf(fn, sizeof(fn), "digits/minus");
+ ast_copy_string(fn, "digits/minus", sizeof(fn));
if ( num > INT_MIN ) {
[... 2766 lines stripped ...]
More information about the asterisk-commits
mailing list