[asterisk-commits] russell: branch russell/chan_refcount r89499 - in /team/russell/chan_refcount...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Nov 21 13:36:18 CST 2007
Author: russell
Date: Wed Nov 21 13:36:16 2007
New Revision: 89499
URL: http://svn.digium.com/view/asterisk?view=rev&rev=89499
Log:
sync another 500 revisions ... up to 88000
Modified:
team/russell/chan_refcount/ (props changed)
team/russell/chan_refcount/CREDITS
team/russell/chan_refcount/Makefile
team/russell/chan_refcount/apps/app_chanspy.c
team/russell/chan_refcount/apps/app_exec.c
team/russell/chan_refcount/apps/app_meetme.c
team/russell/chan_refcount/apps/app_mixmonitor.c
team/russell/chan_refcount/channels/Makefile
team/russell/chan_refcount/channels/chan_gtalk.c
team/russell/chan_refcount/channels/chan_iax2.c
team/russell/chan_refcount/channels/chan_jingle.c
team/russell/chan_refcount/codecs/codec_a_mu.c
team/russell/chan_refcount/codecs/codec_adpcm.c
team/russell/chan_refcount/codecs/codec_alaw.c
team/russell/chan_refcount/codecs/codec_g722.c
team/russell/chan_refcount/codecs/codec_g726.c
team/russell/chan_refcount/codecs/codec_gsm.c
team/russell/chan_refcount/codecs/codec_ilbc.c
team/russell/chan_refcount/codecs/codec_lpc10.c
team/russell/chan_refcount/codecs/codec_speex.c
team/russell/chan_refcount/codecs/codec_ulaw.c
team/russell/chan_refcount/codecs/codec_zap.c
team/russell/chan_refcount/formats/format_g723.c
team/russell/chan_refcount/formats/format_g726.c
team/russell/chan_refcount/formats/format_g729.c
team/russell/chan_refcount/formats/format_gsm.c
team/russell/chan_refcount/formats/format_h263.c
team/russell/chan_refcount/formats/format_h264.c
team/russell/chan_refcount/formats/format_ilbc.c
team/russell/chan_refcount/formats/format_jpeg.c
team/russell/chan_refcount/formats/format_ogg_vorbis.c
team/russell/chan_refcount/formats/format_pcm.c
team/russell/chan_refcount/formats/format_sln.c
team/russell/chan_refcount/formats/format_vox.c
team/russell/chan_refcount/formats/format_wav.c
team/russell/chan_refcount/formats/format_wav_gsm.c
team/russell/chan_refcount/include/asterisk/channel.h
team/russell/chan_refcount/include/asterisk/lock.h
team/russell/chan_refcount/main/editline/np/vis.c
team/russell/chan_refcount/main/pbx.c
team/russell/chan_refcount/res/ael/pval.c
team/russell/chan_refcount/res/res_adsi.c
team/russell/chan_refcount/res/res_ael_share.c
team/russell/chan_refcount/res/res_clioriginate.c
team/russell/chan_refcount/res/res_convert.c
team/russell/chan_refcount/res/res_features.c
team/russell/chan_refcount/res/res_indications.c
team/russell/chan_refcount/res/res_jabber.c
team/russell/chan_refcount/res/res_musiconhold.c
team/russell/chan_refcount/res/res_smdi.c
team/russell/chan_refcount/res/res_speech.c
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/russell/chan_refcount/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Nov 21 13:36:16 2007
@@ -1,1 +1,1 @@
-/trunk:1-87500
+/trunk:1-88000
Modified: team/russell/chan_refcount/CREDITS
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/CREDITS?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/CREDITS (original)
+++ team/russell/chan_refcount/CREDITS Wed Nov 21 13:36:16 2007
@@ -37,40 +37,37 @@
Jim Dixon - Zapata Telephony and app_rpt
http://www.zapatatelephony.org/app_rpt.html
-Russell Bryant - Asterisk 1.0 maintainer and misc. enhancements
- russelb at clemson.edu
-
-Anthony Minessale II - Countless big and small fixes, and relentless forward push
- ChanSpy, ForkCDR, ControlPlayback, While/EndWhile, DumpChan, Dictate,
- MacroIf, ExecIf, ExecIfTime, RetryDial, MixMonitor applications; many realtime
- concepts and implementation pieces, including res_config_odbc; format_slin;
- cdr_custom; several features in Dial including L(), G() and enhancements to
- M() and D(); several CDR enhancements including CDR variables; attended
- transfer; one touch record; native MOH; manager eventmask; command line '-t'
- flag to allow recording/voicemail on nfs shares; #exec command and multiline
- comments in config files; setvar in iax and sip configs.
- anthmct at yahoo.com http://www.asterlink.com
+Russell Bryant - Asterisk release manager and countless enhancements and bug
+ fixes.
+ russell(AT)digium.com
+
+Anthony Minessale II - Countless big and small fixes, and relentless forward
+ push. ChanSpy, ForkCDR, ControlPlayback, While/EndWhile, DumpChan, Dictate,
+ MacroIf, ExecIf, ExecIfTime, RetryDial, MixMonitor applications; many
+ realtime concepts and implementation pieces, including res_config_odbc;
+ format_slin; cdr_custom; several features in Dial including L(), G() and
+ enhancements to M() and D(); several CDR enhancements including CDR
+ variables; attended transfer; one touch record; native MOH; manager
+ eventmask; command line '-t' flag to allow recording/voicemail on nfs
+ shares; #exec command and multiline comments in config files; setvar in iax
+ and sip configs.
+ anthmct(AT)yahoo.com http://www.asterlink.com
James Golovich - Innumerable contributions
You can find him and asterisk-perl at http://asterisk.gnuinter.net
Andre Bierwirth - Extension hints and status
-Oliver Daudey - ISDN4Linux fixes
-
-Pauline Middelink - ISDN4Linux patches and some general patches.
- She can be found at http://www.polyware.nl/~middelink/En/
-
Jean-Denis Girard - Various contributions from the South Pacific Islands
- jd-girard at esoft.pf http://www.esoft.pf
+ jd-girard(AT)esoft.pf http://www.esoft.pf
William Jordan / Vonage - MySQL enhancements to Voicemail
- wjordan at vonage.com
+ wjordan(AT)vonage.com
Jac Kersing - Various fixes
Steven Critchfield - Seek and Trunc functions for playback and recording
- critch at basesys.com
+ critch(AT)basesys.com
Jefferson Noxon - app_lookupcidname, app_db, and various other contributions
@@ -79,63 +76,65 @@
Ross Finlayson - Dynamic RTP payload support
Mahmut Fettahlioglu - Audio recording, music-on-hold changes, alaw file
- format, and various fixes. Can be contacted at mahmut at oa.com.au
+ format, and various fixes. Can be contacted at mahmut(AT)oa.com.au
James Dennis - Cisco SIP compatibility patches to work with SIP service
- providers. Can be contacted at asterisk at jdennis.net
+ providers. Can be contacted at asterisk(AT)jdennis.net
Tilghman Lesher - ast_localtime(); ast_say_date_with_format();
- GotoIfTime, Random, SayUnixTime, HasNewVoicemail applications;
- CUT, SORT, EVAL, CURL, FIELDQTY, STRFTIME, QUEUEAGENT* functions;
- and other innumerable bug fixes. http://asterisk.drunkcoder.com/
+ GotoIfTime, SayUnixTime, HasNewVoicemail applications;
+ CUT, SORT, EVAL, CURL, FIELDQTY, STRFTIME, some QUEUE* functions;
+ func_odbc, cdr_adaptive_odbc, and other innumerable bug fixes.
+ tilghman(AT)digium.com http://asterisk.drunkcoder.com/
Jayson Vantuyl - Manager protocol changes, various other bugs.
- jvantuyl at computingedge.net
+ jvantuyl(AT)computingedge.net
Thorsten Lockert - OpenBSD, FreeBSD ports, making MacOS X port run on 10.3,
dialplan include verification, route lookup on OpenBSD, SNMP agent
- support (res_snmp), various other bugs. tholo at sigmasoft.com
-
-Brian West - ODBC support and Bug Marshaling
-
-Josh Roberson - chan_zap reload support, Advanced Voicemail Features, other misc. patches,
- and Bug Marshalling. - josh at asteriasgi.com, http://www.asteriasgi.com
-
-William Waites - syslog support, SIP NAT traversal for SIP-UA. ww at styx.org
+ support (res_snmp), various other bugs. tholo(AT)sigmasoft.com
+
+Josh Roberson - chan_zap reload support, Advanced Voicemail Features, & other
+ misc. patches. - josh(AT)asteriasgi.com, http://www.asteriasgi.com
+
+William Waites - syslog support, SIP NAT traversal for SIP-UA. ww(AT)styx.org
Rich Murphey - Porting to FreeBSD, NetBSD, OpenBSD, and Darwin.
- rich at whiteoaklabs.com http://whiteoaklabs.com
+ rich(AT)whiteoaklabs.com http://whiteoaklabs.com
Simon Lockhart - Porting to Solaris (based on work of Logan ???)
- simon at slimey.org
-
-Olle E. Johansson - SIP RFC compliance, documentation and testing, testing, testing,
- - MiniVM - the small voicemail system, many documentation updates/corrections
- and many bug fixes.
- oej at edvina.net, http://edvina.net
+ simon(AT)slimey.org
+
+Olle E. Johansson - SIP RFC compliance, documentation and testing, testing,
+ testing; MiniVM - the small voicemail system, many documentation
+ updates/corrections, and many bug fixes.
+ oej(AT)edvina.net, http://edvina.net
Steve Kann - new jitter buffer for IAX2
- stevek at stevek.com
+ stevek(AT)stevek.com
Constantine Filin - major contributions to the Asterisk Realtime Architecture
-Steve Murphy - privacy support, $[ ] parser upgrade, AEL2 parser upgrade
+Steve Murphy - privacy support, $[ ] parser upgrade, AEL2 parser upgrade.
+ murf(AT)digium.com
Claude Patry - bug fixes, feature enhancements, and bug marshalling
- cpatry at gmail.com
-
-Miroslav Nachev, miro at space-comm.com COSMOS Software Enterprises, Ltd.
+ cpatry(AT)gmail.com
+
+Miroslav Nachev, miro(AT)space-comm.com COSMOS Software Enterprises, Ltd.
- for Variable for No Answer Timeout for Attended Transfer
Slav Klenov & Vanheuverzwijn Joachim - development of the generic jitterbuffer
- Securax Ltd. info at securax.be
+ Securax Ltd. info(AT)securax.be
Roy Sigurd Karlsbakk - providing funding for generic jitterbuffer development
- roy at karlsbakk.net, Briiz Telecom AS
-
-Voop AS, Nuvio Inc, Inotel S.A and Foniris Telecom A/S - funding for rewrite of SIP transfers
-
-Philippe Sultan - RADIUS CDR module, many fixes to res_jabber and gtalk/jingle channel drivers
+ roy(AT)karlsbakk.net, Briiz Telecom AS
+
+Voop AS, Nuvio Inc, Inotel S.A and Foniris Telecom A/S - funding for rewrite
+ of SIP transfers
+
+Philippe Sultan - RADIUS CDR module, many fixes to res_jabber and gtalk/jingle
+ channel drivers.
INRIA, http://www.inria.fr/
John Martin, Aupix - Improved video support in the SIP channel
@@ -143,19 +142,26 @@
Steve Underwood - Provided T.38 pass through support.
-George Konstantoulakis - Support for Greek in voicemail added by InAccess Networks (work funded by HOL, www.hol.gr) gkon at inaccessnetworks.com
-
-Daniel Nylander - Support for Swedish and Norwegian languages in voicemail. http://www.danielnylander.se/
-
-Stojan Sljivic - An option for maximum number of messsages per mailbox in voicemail. Also an issue with voicemail synchronization has been fixed. GDS Partners www.gdspartners.com . stojan.sljivic at gdspartners.com
-
-Bartosz Supczinski - Support for Polish added by DIR (www.dir.pl) Bartosz.Supczinski at dir.pl
-
-James Rothenberger - Support for IMAP storage integration added by OneBizTone LLC Work funded by University of Pennsylvania jar at onebiztone.com
+George Konstantoulakis - Support for Greek in voicemail added by InAccess
+ Networks (work funded by HOL, www.hol.gr) gkon(AT)inaccessnetworks.com
+
+Daniel Nylander - Support for Swedish and Norwegian languages in voicemail.
+ http://www.danielnylander.se/
+
+Stojan Sljivic - An option for maximum number of messsages per mailbox in
+ voicemail. Also an issue with voicemail synchronization has been fixed.
+ GDS Partners www.gdspartners.com . stojan.sljivic(AT)gdspartners.com
+
+Bartosz Supczinski - Support for Polish added by DIR (www.dir.pl)
+ Bartosz.Supczinski(AT)dir.pl
+
+James Rothenberger - Support for IMAP storage integration added by
+ OneBizTone LLC Work funded by University of Pennsylvania jar(AT)onebiztone.com
Paul Cadach - Bringing chan_h323 up to date, bug fixes, and more!
-Voop AS - Financial support for a lot of work with the SIP driver and the IAX trunk MTU patch
+Voop AS - Financial support for a lot of work with the SIP driver and the IAX
+ trunk MTU patch
=== OTHER CONTRIBUTIONS ===
John Todd - Monkey sounds and associated teletorture prompt
@@ -163,7 +169,7 @@
Leif Madsen, Jared Smith and Jim van Meggelen - the Asterisk book
available under a Creative Commons License at http://www.asteriskdocs.org
Brian M. Clapper - poll.c emulation
- This product includes software developed by Brian M. Clapper <bmc at clapper.org>
+ This product includes software developed by Brian M. Clapper <bmc(AT)clapper.org>
=== HOLD MUSIC ===
Music provided by www.freeplaymusic.com
Modified: team/russell/chan_refcount/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/Makefile?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/Makefile (original)
+++ team/russell/chan_refcount/Makefile Wed Nov 21 13:36:16 2007
@@ -578,6 +578,20 @@
echo "astlogdir => $(ASTLOGDIR)" ; \
echo "" ; \
echo ";[options]" ; \
+ echo ";verbose = 3" ; \
+ echo ";debug = 3" ; \
+ echo ";alwaysfork = yes ; same as -F at startup" ; \
+ echo ";nofork = yes ; same as -f at startup" ; \
+ echo ";quiet = yes ; same as -q at startup" ; \
+ echo ";timestamp = yes ; same as -T at startup" ; \
+ echo ";execincludes = yes ; support #exec in config files" ; \
+ echo ";console = yes ; Run as console (same as -c at startup)" ; \
+ echo ";highpriority = yes ; Run realtime priority (same as -p at startup)" ; \
+ echo ";initcrypto = yes ; Initialize crypto keys (same as -i at startup)" ; \
+ echo ";nocolor = yes ; Disable console colors" ; \
+ echo ";dontwarn = yes ; Disable some warnings" ; \
+ echo ";dumpcore = yes ; Dump core on crash (same as -g at startup)" ; \
+ echo ";languageprefix = yes ; Use the new sound prefix path syntax" ; \
echo ";internal_timing = yes" ; \
echo ";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \
echo ";autosystemname = yes ; automatically set systemname to hostname - uses 'localhost' on failure, or systemname if set" ; \
Modified: team/russell/chan_refcount/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_chanspy.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/apps/app_chanspy.c (original)
+++ team/russell/chan_refcount/apps/app_chanspy.c Wed Nov 21 13:36:16 2007
@@ -266,6 +266,15 @@
start_spying(spyee, chan, &csth.whisper_audiohook);
}
+ csth.volfactor = *volfactor;
+
+ if (csth.volfactor) {
+ csth.spy_audiohook.options.read_volume = csth.volfactor;
+ csth.spy_audiohook.options.write_volume = csth.volfactor;
+ }
+
+ csth.fd = fd;
+
if (ast_test_flag(flags, OPTION_PRIVATE))
silgen = ast_channel_start_silence_generator(chan);
else
@@ -341,6 +350,10 @@
if (*volfactor > 4)
*volfactor = -4;
ast_verb(3, "Setting spy volume on %s to %d\n", chan->name, *volfactor);
+
+ csth.volfactor = *volfactor;
+ csth.spy_audiohook.options.read_volume = csth.volfactor;
+ csth.spy_audiohook.options.write_volume = csth.volfactor;
}
}
Modified: team/russell/chan_refcount/apps/app_exec.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_exec.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/apps/app_exec.c (original)
+++ team/russell/chan_refcount/apps/app_exec.c Wed Nov 21 13:36:16 2007
@@ -166,6 +166,11 @@
char *parse = ast_strdupa(data);
AST_NONSTANDARD_APP_ARGS(expr, parse, '?');
+ if (ast_strlen_zero(expr.remainder)) {
+ ast_log(LOG_ERROR, "Usage: ExecIf(<cond>?<appiftrue>(<args>):<appiffalse>(<args))\n");
+ return -1;
+ }
+
AST_NONSTANDARD_APP_ARGS(apps, expr.remainder, ':');
if (apps.t && (truedata = strchr(apps.t, '('))) {
Modified: team/russell/chan_refcount/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_meetme.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/apps/app_meetme.c (original)
+++ team/russell/chan_refcount/apps/app_meetme.c Wed Nov 21 13:36:16 2007
@@ -1654,7 +1654,7 @@
goto outrun;
}
- retryzap = strcasecmp(chan->tech->type, "Zap");
+ retryzap = (strcasecmp(chan->tech->type, "Zap") || chan->audiohooks ? 1 : 0);
user->zapchannel = !retryzap;
zapretry:
@@ -2039,14 +2039,14 @@
break;
if (c) {
- if (c->fds[0] != origfd) {
+ if (c->fds[0] != origfd || (user->zapchannel && chan->audiohooks)) {
if (using_pseudo) {
/* Kill old pseudo */
close(fd);
using_pseudo = 0;
}
ast_debug(1, "Ooh, something swapped out under us, starting over\n");
- retryzap = strcasecmp(c->tech->type, "Zap");
+ retryzap = (strcasecmp(chan->tech->type, "Zap") || chan->audiohooks ? 1 : 0);
user->zapchannel = !retryzap;
goto zapretry;
}
Modified: team/russell/chan_refcount/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_mixmonitor.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/apps/app_mixmonitor.c (original)
+++ team/russell/chan_refcount/apps/app_mixmonitor.c Wed Nov 21 13:36:16 2007
@@ -98,6 +98,7 @@
char *post_process;
char *name;
unsigned int flags;
+ struct ast_channel *chan;
};
enum {
@@ -165,25 +166,27 @@
if (!(fr = ast_audiohook_read_frame(&mixmonitor->audiohook, SAMPLES_PER_FRAME, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR)))
continue;
- /* Initialize the file if not already done so */
- if (!fs && !errflag) {
- oflags = O_CREAT | O_WRONLY;
- oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
-
- if ((ext = strrchr(mixmonitor->filename, '.')))
- *(ext++) = '\0';
- else
- ext = "raw";
-
- if (!(fs = ast_writefile(mixmonitor->filename, ext, NULL, oflags, 0, 0644))) {
- ast_log(LOG_ERROR, "Cannot open %s.%s\n", mixmonitor->filename, ext);
- errflag = 1;
+ if (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED) || ast_bridged_channel(mixmonitor->chan)) {
+ /* Initialize the file if not already done so */
+ if (!fs && !errflag) {
+ oflags = O_CREAT | O_WRONLY;
+ oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
+
+ if ((ext = strrchr(mixmonitor->filename, '.')))
+ *(ext++) = '\0';
+ else
+ ext = "raw";
+
+ if (!(fs = ast_writefile(mixmonitor->filename, ext, NULL, oflags, 0, 0644))) {
+ ast_log(LOG_ERROR, "Cannot open %s.%s\n", mixmonitor->filename, ext);
+ errflag = 1;
+ }
}
+
+ /* Write out frame */
+ if (fs)
+ ast_writestream(fs, fr);
}
-
- /* Write out frame */
- if (fs)
- ast_writestream(fs, fr);
/* All done! free it. */
ast_frame_free(fr, 0);
@@ -245,6 +248,7 @@
/* Copy over flags and channel name */
mixmonitor->flags = flags;
+ mixmonitor->chan = chan;
mixmonitor->name = (char *) mixmonitor + sizeof(*mixmonitor);
strcpy(mixmonitor->name, chan->name);
if (!ast_strlen_zero(postprocess2)) {
@@ -262,6 +266,11 @@
}
ast_set_flag(&mixmonitor->audiohook, AST_AUDIOHOOK_TRIGGER_WRITE);
+
+ if (readvol)
+ mixmonitor->audiohook.options.read_volume = readvol;
+ if (writevol)
+ mixmonitor->audiohook.options.write_volume = writevol;
if (startmon(chan, &mixmonitor->audiohook)) {
ast_log(LOG_WARNING, "Unable to add '%s' spy to channel '%s'\n",
Modified: team/russell/chan_refcount/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/Makefile?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/channels/Makefile (original)
+++ team/russell/chan_refcount/channels/Makefile Wed Nov 21 13:36:16 2007
@@ -67,7 +67,7 @@
include h323/Makefile.ast
H323LDFLAGS+=-Wl,--version-script=h323/noexport.map
clean::
- $(MAKE) -C h323 clean
+ if [ -f h323/Makefile ]; then $(MAKE) -C h323 clean; fi
else
h323/libchanh323.a h323/Makefile.ast:
$(CMD_PREFIX) $(MAKE) -C h323
Modified: team/russell/chan_refcount/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_gtalk.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/channels/chan_gtalk.c (original)
+++ team/russell/chan_refcount/channels/chan_gtalk.c Wed Nov 21 13:36:16 2007
@@ -1215,9 +1215,6 @@
if(!from)
from = c->jid->full;
- newcandidate = ast_calloc(1, sizeof(*newcandidate));
- if (!newcandidate)
- return 0;
for (tmp = client->p; tmp; tmp = tmp->next) {
if (iks_find_with_attrib(pak->x, "session", "id", tmp->sid)) {
p = tmp;
Modified: team/russell/chan_refcount/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_iax2.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/channels/chan_iax2.c (original)
+++ team/russell/chan_refcount/channels/chan_iax2.c Wed Nov 21 13:36:16 2007
@@ -2288,7 +2288,7 @@
} else if ((peer = find_peer(a->argv[3], 0))) {
if(ast_test_flag(peer, IAX_RTCACHEFRIENDS)) {
ast_set_flag(peer, IAX_RTAUTOCLEAR);
- expire_registry((const void *) peer->name);
+ expire_registry(peer_ref(peer));
ast_cli(a->fd, "Peer %s was removed from the cache.\n", a->argv[3]);
} else {
ast_cli(a->fd, "Peer %s is not eligible for this operation.\n", a->argv[3]);
@@ -3006,8 +3006,15 @@
if (ast_test_flag((&globalflags), IAX_RTCACHEFRIENDS)) {
ast_copy_flags(peer, &globalflags, IAX_RTAUTOCLEAR|IAX_RTCACHEFRIENDS);
if (ast_test_flag(peer, IAX_RTAUTOCLEAR)) {
- peer->expire = iax2_sched_replace(peer->expire, sched,
- (global_rtautoclear) * 1000, expire_registry, (const void *)peer->name);
+ if (peer->expire > -1) {
+ if (!ast_sched_del(sched, peer->expire)) {
+ peer->expire = -1;
+ peer_unref(peer);
+ }
+ }
+ peer->expire = iax2_sched_add(sched, (global_rtautoclear) * 1000, expire_registry, peer_ref(peer));
+ if (peer->expire == -1)
+ peer_unref(peer);
}
ao2_link(peers, peer_ref(peer));
if (ast_test_flag(peer, IAX_DYNAMIC))
@@ -4818,8 +4825,19 @@
p = find_peer(a->argv[2], 1);
if (p) {
if (p->expire > 0) {
- expire_registry(a->argv[2]);
- ast_cli(a->fd, "Peer %s unregistered\n", a->argv[2]);
+ struct iax2_peer tmp_peer = {
+ .name = a->argv[2],
+ };
+ struct iax2_peer *peer;
+
+ peer = ao2_find(peers, &tmp_peer, OBJ_POINTER);
+ if (peer) {
+ expire_registry(peer_ref(peer)); /* will release its own reference when done */
+ peer_unref(peer); /* ref from ao2_find() */
+ ast_cli(a->fd, "Peer %s unregistered\n", a->argv[2]);
+ } else {
+ ast_cli(a->fd, "Peer %s not found\n", a->argv[2]);
+ }
} else {
ast_cli(a->fd, "Peer %s not registered\n", a->argv[2]);
}
@@ -6324,15 +6342,29 @@
}
static void prune_peers(void);
+static void unlink_peer(struct iax2_peer *peer)
+{
+ if (peer->expire > -1) {
+ if (!ast_sched_del(sched, peer->expire)) {
+ peer->expire = -1;
+ peer_unref(peer);
+ }
+ }
+
+ if (peer->pokeexpire > -1) {
+ if (!ast_sched_del(sched, peer->pokeexpire)) {
+ peer->pokeexpire = -1;
+ peer_unref(peer);
+ }
+ }
+
+ unlink_peer(peer);
+}
+
static void __expire_registry(const void *data)
{
- const char *name = data;
- struct iax2_peer *peer = NULL;
- struct iax2_peer tmp_peer = {
- .name = name,
- };
-
- peer = ao2_find(peers, &tmp_peer, OBJ_POINTER);
+ struct iax2_peer *peer = (struct iax2_peer *) data;
+
if (!peer)
return;
@@ -6354,7 +6386,7 @@
iax2_regfunk(peer->name, 0);
if (ast_test_flag(peer, IAX_RTAUTOCLEAR))
- ao2_unlink(peers, peer);
+ unlink_peer(peer);
peer_unref(peer);
}
@@ -6393,9 +6425,16 @@
p->addr.sin_family = AF_INET;
p->addr.sin_addr = in;
p->addr.sin_port = htons(atoi(c));
- ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
- p->expire = iax2_sched_replace(p->expire, sched,
- (p->expiry + 10) * 1000, expire_registry, (const void *)p->name);
+ if (p->expire > -1) {
+ if (!ast_sched_del(sched, p->expire)) {
+ p->expire = -1;
+ peer_unref(p);
+ }
+ }
+ ast_device_state_changed("IAX2/%s", p->name); /* Activate notification */
+ p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, peer_ref(p));
+ if (p->expire == -1)
+ peer_unref(p);
if (iax2_regfunk)
iax2_regfunk(p->name, 1);
register_peer_exten(p, 1);
@@ -6482,8 +6521,12 @@
/* Store socket fd */
p->sockfd = fd;
/* Setup the expiry */
- if (p->expire > -1)
- ast_sched_del(sched, p->expire);
+ if (p->expire > -1) {
+ if (!ast_sched_del(sched, p->expire)) {
+ p->expire = -1;
+ peer_unref(p);
+ }
+ }
/* treat an unspecified refresh interval as the minimum */
if (!refresh)
refresh = min_reg_expire;
@@ -6498,8 +6541,11 @@
} else {
p->expiry = refresh;
}
- if (p->expiry && sin->sin_addr.s_addr)
- p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, (const void *)p->name);
+ if (p->expiry && sin->sin_addr.s_addr) {
+ p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, peer_ref(p));
+ if (p->expire == -1)
+ peer_unref(p);
+ }
iax_ie_append_str(&ied, IAX_IE_USERNAME, p->name);
iax_ie_append_int(&ied, IAX_IE_DATETIME, iax2_datetime(p->zonetag));
if (sin->sin_addr.s_addr) {
@@ -6760,6 +6806,7 @@
{
struct iax2_peer *peer = (struct iax2_peer *)data;
iax2_poke_peer(peer, 0);
+ peer_unref(peer);
}
static int iax2_poke_peer_s(const void *data)
@@ -8301,13 +8348,19 @@
peer->historicms = iaxs[fr->callno]->pingtime;
/* Remove scheduled iax2_poke_noanswer */
- if (peer->pokeexpire > -1)
- ast_sched_del(sched, peer->pokeexpire);
+ if (peer->pokeexpire > -1) {
+ if (!ast_sched_del(sched, peer->pokeexpire)) {
+ peer_unref(peer);
+ peer->pokeexpire = -1;
+ }
+ }
/* Schedule the next cycle */
if ((peer->lastms < 0) || (peer->historicms > peer->maxms))
- peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqnotok, iax2_poke_peer_s, peer);
+ peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqnotok, iax2_poke_peer_s, peer_ref(peer));
else
- peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqok, iax2_poke_peer_s, peer);
+ peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqok, iax2_poke_peer_s, peer_ref(peer));
+ if (peer->pokeexpire == -1)
+ peer_unref(peer);
/* and finally send the ack */
send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
/* And wrap up the qualify call */
@@ -9245,7 +9298,9 @@
peer->callno = 0;
peer->lastms = -1;
/* Try again quickly */
- peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqnotok, iax2_poke_peer_s, peer);
+ peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqnotok, iax2_poke_peer_s, peer_ref(peer));
+ if (peer->pokeexpire == -1)
+ peer_unref(peer);
}
static int iax2_poke_noanswer(const void *data)
@@ -9256,6 +9311,7 @@
if (schedule_action(__iax2_poke_noanswer, data))
#endif
__iax2_poke_noanswer(data);
+ peer_unref(peer);
return 0;
}
@@ -9298,16 +9354,23 @@
/* Speed up retransmission times for this qualify call */
iaxs[peer->callno]->pingtime = peer->maxms / 4 + 1;
iaxs[peer->callno]->peerpoke = peer;
-
+
+ if (peer->pokeexpire > -1) {
+ if (!ast_sched_del(sched, peer->pokeexpire)) {
+ peer->pokeexpire = -1;
+ peer_unref(peer);
+ }
+ }
+
/* Queue up a new task to handle no reply */
/* If the host is already unreachable then use the unreachable interval instead */
- if (peer->lastms < 0) {
- peer->pokeexpire = iax2_sched_replace(peer->pokeexpire,
- sched, peer->pokefreqnotok, iax2_poke_noanswer, peer);
- } else {
- peer->pokeexpire = iax2_sched_replace(peer->pokeexpire,
- sched, DEFAULT_MAXMS * 2, iax2_poke_noanswer, peer);
- }
+ if (peer->lastms < 0)
+ peer->pokeexpire = iax2_sched_add(sched, peer->pokefreqnotok, iax2_poke_noanswer, peer_ref(peer));
+ else
+ peer->pokeexpire = iax2_sched_add(sched, DEFAULT_MAXMS * 2, iax2_poke_noanswer, peer_ref(peer));
+
+ if (peer->pokeexpire == -1)
+ peer_unref(peer);
/* And send the poke */
send_command(iaxs[peer->callno], AST_FRAME_IAX, IAX_COMMAND_POKE, 0, NULL, 0, -1);
@@ -9658,11 +9721,6 @@
ast_free_ha(peer->ha);
- /* Delete it, it needs to disappear */
- if (peer->expire > -1)
- ast_sched_del(sched, peer->expire);
- if (peer->pokeexpire > -1)
- ast_sched_del(sched, peer->pokeexpire);
if (peer->callno > 0) {
ast_mutex_lock(&iaxsl[peer->callno]);
iax2_destroy(peer->callno);
@@ -10209,7 +10267,7 @@
i = ao2_iterator_init(peers, 0);
while ((peer = ao2_iterator_next(&i))) {
if (ast_test_flag(peer, IAX_DELME))
- ao2_unlink(peers, peer);
+ unlink_peer(peer);
peer_unref(peer);
}
}
Modified: team/russell/chan_refcount/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/channels/chan_jingle.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/channels/chan_jingle.c (original)
+++ team/russell/chan_refcount/channels/chan_jingle.c Wed Nov 21 13:36:16 2007
@@ -1064,9 +1064,7 @@
struct aji_client *c = client->connection;
struct jingle_candidate *newcandidate = NULL;
iks *traversenodes = NULL, *receipt = NULL;
- newcandidate = ast_calloc(1, sizeof(*newcandidate));
- if (!newcandidate)
- return 0;
+
for (tmp = client->p; tmp; tmp = tmp->next) {
if (iks_find_with_attrib(pak->x, JINGLE_NODE, JINGLE_SID, tmp->sid)) {
p = tmp;
Modified: team/russell/chan_refcount/codecs/codec_a_mu.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/codecs/codec_a_mu.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/codecs/codec_a_mu.c (original)
+++ team/russell/chan_refcount/codecs/codec_a_mu.c Wed Nov 21 13:36:16 2007
@@ -161,8 +161,9 @@
res = ast_register_translator(&ulawtoalaw);
else
ast_unregister_translator(&alawtoulaw);
-
- return res;
+ if (res)
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "A-law and Mulaw direct Coder/Decoder");
Modified: team/russell/chan_refcount/codecs/codec_adpcm.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/codecs/codec_adpcm.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/codecs/codec_adpcm.c (original)
+++ team/russell/chan_refcount/codecs/codec_adpcm.c Wed Nov 21 13:36:16 2007
@@ -350,13 +350,15 @@
.buf_size = BUFFER_SAMPLES/ 2, /* 2 samples per byte */
};
-static void parse_config(int reload)
+static int parse_config(int reload)
{
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
struct ast_variable *var;
- if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
- return;
+ if (cfg == NULL)
+ return -1;
+ if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
adpcmtolin.useplc = ast_true(var->value) ? 1 : 0;
@@ -364,13 +366,15 @@
}
}
ast_config_destroy(cfg);
+ return 0;
}
/*! \brief standard module glue */
static int reload(void)
{
- parse_config(1);
- return 0;
+ if (parse_config(1))
+ return AST_MODULE_LOAD_DECLINE;
+ return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
@@ -387,14 +391,16 @@
{
int res;
- parse_config(0);
+ if (parse_config(0))
+ return AST_MODULE_LOAD_DECLINE;
res = ast_register_translator(&adpcmtolin);
if (!res)
res = ast_register_translator(&lintoadpcm);
else
ast_unregister_translator(&adpcmtolin);
-
- return res;
+ if (res)
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Adaptive Differential PCM Coder/Decoder",
Modified: team/russell/chan_refcount/codecs/codec_alaw.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/codecs/codec_alaw.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/codecs/codec_alaw.c (original)
+++ team/russell/chan_refcount/codecs/codec_alaw.c Wed Nov 21 13:36:16 2007
@@ -134,13 +134,15 @@
.buf_size = BUFFER_SAMPLES,
};
-static void parse_config(int reload)
+static int parse_config(int reload)
{
struct ast_variable *var;
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
- if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
- return;
+ if (cfg == NULL)
+ return -1;
+ if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
alawtolin.useplc = ast_true(var->value) ? 1 : 0;
@@ -148,14 +150,16 @@
}
}
ast_config_destroy(cfg);
+ return 0;
}
/*! \brief standard module stuff */
static int reload(void)
{
- parse_config(1);
- return 0;
+ if (parse_config(1))
+ return AST_MODULE_LOAD_DECLINE;
+ return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
@@ -172,14 +176,16 @@
{
int res;
- parse_config(0);
+ if (parse_config(0))
+ return AST_MODULE_LOAD_DECLINE;
res = ast_register_translator(&alawtolin);
if (!res)
res = ast_register_translator(&lintoalaw);
else
ast_unregister_translator(&alawtolin);
-
- return res;
+ if (res)
+ return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "A-law Coder/Decoder",
Modified: team/russell/chan_refcount/codecs/codec_g722.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/codecs/codec_g722.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/codecs/codec_g722.c (original)
+++ team/russell/chan_refcount/codecs/codec_g722.c Wed Nov 21 13:36:16 2007
@@ -164,14 +164,16 @@
.buf_size = BUFFER_SAMPLES,
};
-static void parse_config(int reload)
+static int parse_config(int reload)
{
struct ast_variable *var;
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
- if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
- return;
+ if (cfg == NULL)
+ return -1;
+ if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
g722tolin.useplc = ast_true(var->value) ? 1 : 0;
@@ -180,13 +182,14 @@
}
}
ast_config_destroy(cfg);
+ return 0;
}
static int reload(void)
{
- parse_config(1);
-
- return 0;
+ if (parse_config(1))
+ return AST_MODULE_LOAD_DECLINE;
+ return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
@@ -204,15 +207,18 @@
int res = 0;
- parse_config(0);
+ if (parse_config(0))
+ return AST_MODULE_LOAD_DECLINE;
res |= ast_register_translator(&g722tolin);
res |= ast_register_translator(&lintog722);
- if (res)
+ if (res) {
unload_module();
-
- return res;
+ return AST_MODULE_LOAD_FAILURE;
+ }
+
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ITU G.722-64kbps G722 Transcoder",
Modified: team/russell/chan_refcount/codecs/codec_g726.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/codecs/codec_g726.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/codecs/codec_g726.c (original)
+++ team/russell/chan_refcount/codecs/codec_g726.c Wed Nov 21 13:36:16 2007
@@ -894,14 +894,16 @@
.buf_size = BUFFER_SAMPLES,
};
-static void parse_config(int reload)
+static int parse_config(int reload)
{
struct ast_variable *var;
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
- if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
- return;
+ if (cfg == NULL)
+ return -1;
+ if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
g726tolin.useplc = ast_true(var->value) ? 1 : 0;
@@ -910,13 +912,14 @@
}
}
ast_config_destroy(cfg);
+ return 0;
}
static int reload(void)
{
- parse_config(1);
-
- return 0;
+ if (parse_config(1))
+ return AST_MODULE_LOAD_DECLINE;
+ return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
@@ -940,7 +943,8 @@
int res = 0;
- parse_config(0);
+ if (parse_config(0))
+ return AST_MODULE_LOAD_DECLINE;
res |= ast_register_translator(&g726tolin);
res |= ast_register_translator(&lintog726);
@@ -951,10 +955,12 @@
res |= ast_register_translator(&g726aal2tog726);
res |= ast_register_translator(&g726tog726aal2);
- if (res)
+ if (res) {
unload_module();
-
- return res;
+ return AST_MODULE_LOAD_FAILURE;
+ }
+
+ return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ITU G.726-32kbps G726 Transcoder",
Modified: team/russell/chan_refcount/codecs/codec_gsm.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/codecs/codec_gsm.c?view=diff&rev=89499&r1=89498&r2=89499
==============================================================================
--- team/russell/chan_refcount/codecs/codec_gsm.c (original)
+++ team/russell/chan_refcount/codecs/codec_gsm.c Wed Nov 21 13:36:16 2007
@@ -235,13 +235,15 @@
};
-static void parse_config(int reload)
+static int parse_config(int reload)
{
struct ast_variable *var;
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
- if (!cfg || cfg == CONFIG_STATUS_FILEUNCHANGED)
- return;
+ if (!cfg)
+ return -1;
+ if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ return 0;
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
gsmtolin.useplc = ast_true(var->value) ? 1 : 0;
@@ -249,13 +251,16 @@
}
}
ast_config_destroy(cfg);
+ return 0;
}
/*! \brief standard module glue */
static int reload(void)
{
- parse_config(1);
- return 0;
+ if (parse_config(1)) {
+ return AST_MODULE_LOAD_DECLINE;
+ }
+ return AST_MODULE_LOAD_SUCCESS;
}
static int unload_module(void)
@@ -273,14 +278,16 @@
{
int res;
- parse_config(0);
+ if (parse_config(0))
+ return AST_MODULE_LOAD_DECLINE;
res = ast_register_translator(&gsmtolin);
if (!res)
res=ast_register_translator(&lintogsm);
else
[... 1507 lines stripped ...]
More information about the asterisk-commits
mailing list