[-]
[+]
|
Changed |
asterisk.spec
|
|
|
Deleted |
asterisk-1.4.32.tar.bz2/sounds/asterisk-core-sounds-en-gsm-1.4.18.tar.gz
^
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/.version
^
|
@@ -1 +1 @@
-1.4.32
+1.4.36
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/ChangeLog
^
|
@@ -1,3 +1,1111 @@
+2010-09-13 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.36 Released.
+
+2010-08-23 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.36-rc1 Released.
+
+2010-08-20 16:46 +0000 [r283048-283123] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_dahdi.c: Merged revision 278274 from
+ https://origsvn.digium.com/svn/asterisk/trunk .......... r278274
+ | rmudgett | 2010-07-20 17:38:13 -0500 (Tue, 20 Jul 2010) | 1
+ line Reference correct struct member for unlikely event
+ PRI_EVENT_CONFIG_ERR. ..........
+
+ * channels/chan_dahdi.c: Q931 - Sending PROGRESS after sending
+ ALERTING is a protocol error The PRI layer in chan_dadhi will
+ check if a PROGRESS message has already been sent, and not allow
+ sending another (although that is technically allowed by the Q931
+ spec), however it does not protect against sending an ALERTING
+ and then sending a PROGRESS message, which is a violation of the
+ specification. Most switches don't seem to care too deeply about
+ this, but some do, and will disconnect the call when receiving
+ this invalid sequence. Protocol specification reference:
+ T-REC-Q.931-199805-I page 223, "Figure A.5/Q.931 -- Overview
+ protocol control (network side) point-point (sheet 3 of 8)"
+ (closes issue #17874) Reported by: nic_bellamy Patches:
+ asterisk-1.4-r282537_no-progress-after-alerting.patch uploaded by
+ nic bellamy (license 299)
+ asterisk-1.6.2-r282537_no-progress-after-alerting.patch uploaded
+ by nic bellamy (license 299)
+ asterisk-trunk-r282537_no-progress-after-alerting.patch uploaded
+ by nic bellamy (license 299)
+
+2010-08-19 21:03 +0000 [r282893] David Vossel <dvossel@digium.com>
+
+ * channels/chan_sip.c: tos_sip option was not being set correctly
+ When tos_sip is used, the tos of the sip socket is only set
+ correctly if the socket binding changes on a reload. If the
+ binding stays the same but the TOS changes, the new tos value
+ would not take into effect. This patch fixes that. (closes issue
+ #17712) Reported by: nickb
+
+2010-08-19 02:12 +0000 [r282729] Terry Wilson <twilson@digium.com>
+
+ * configs/sip.conf.sample: Add some documentation about codec
+ negotiation to sip.conf
+
+2010-08-16 17:06 +0000 [r282430] Terry Wilson <twilson@digium.com>
+
+ * main/channel.c: Send a SRCCHANGE indication when we masquerade
+ Masquerading a channel means that the src of the audio is
+ potentially changing, so send a SRCCHANGE so that RTP-based media
+ streams can get a new SSRC generated to reflect the change.
+ Original patch by addix (along with lots of testing--thanks!).
+ (closes issue #17007) Reported by: addix Patches:
+ 1001-reset-SSRC-original-channel.diff uploaded by addix (license
+ 1006) srcchange.diff uploaded by twilson (license 396) Tested by:
+ addix, twilson Review: https://reviewboard.asterisk.org/r/862/
+
+2010-08-12 22:49 +0000 [r282129] Jason Parker <jparker@digium.com>
+
+ * pbx/pbx_config.c: Register CLI commands before parsing config, in
+ case there is a config error.
+
+2010-08-12 03:00 +0000 [r281911] Jeff Peeler <jpeeler@digium.com>
+
+ * main/channel.c: Ensure SSRC is changed when media source is
+ changed to resolve audio delay. This change causes the SSRC to
+ change right before the channels are bridged, which is what used
+ to happen. It seems that fixes were made to attempt limiting SSRC
+ changes, targeted mainly at sending DTMF. DTMF is not affecting
+ the SSRC with this change. There are two other control frames
+ sent in ast_channel_bridge that probably should also be changed
+ to AST_CONTROL_SRCCHANGE as well, but I'm going to leave this
+ change up to the discretion of resolving issue #17007. For
+ reference - old review implementing new control frame SRCCHANGE:
+ https://reviewboard.asterisk.org/r/540 (closes issue #17404)
+ Reported by: sdolloff Patches: bug17404.patch uploaded by jpeeler
+ (license 325) Tested by: sdolloff
+
+2010-08-11 18:28 +0000 [r281762-281819] Leif Madsen <lmadsen@digium.com>
+
+ * configs/say.conf.sample: Add Danish support to say.conf.sample
+ (closes issue #17836) Reported by: RoadKill Patches:
+ say.conf.sample.patch.dk uploaded by RoadKill (license 933)
+
+ * configs/say.conf.sample: Allow say.conf to handle large numbers
+ ending with multiple zeros. (closes issue #17833) Reported by:
+ RoadKill Patches: say.conf.sample.patch.largenumbers uploaded by
+ RoadKill (license 933)
+
+2010-08-10 17:45 +0000 [r281566] Russell Bryant <russell@digium.com>
+
+ * apps/app_dial.c: Reset visible indication after answer. (closes
+ issue #17641) Reported by: klaus3000 Patches:
+ ast1.6.2.9-app_dial-visible_indication.patch.txt uploaded by
+ klaus3000 (license 65) Tested by: schmidts
+
+2010-08-09 20:04 +0000 [r281390] Jeff Peeler <jpeeler@digium.com>
+
+ * channels/chan_local.c: Prevent loss of Caller ID information set
+ on local channel after masquerade. Caller ID set on the channel
+ before a masquerade occurs when using a local channel would cause
+ the information to be lost. The problem was that the information
+ was set on a channel destined to be hung up. The somewhat
+ confusing fix is to detect if any Caller ID has been set on the
+ channel and if so preswap the Caller ID data so that basically
+ the masquerade puts the data back. (closes issue #17138) Reported
+ by: kobaz Review: https://reviewboard.asterisk.org/r/847/
+
+2010-08-06 21:34 +0000 [r281185] David Vossel <dvossel@digium.com>
+
+ * channels/chan_sip.c: chan_sip: fixes provisional keepalive
+ scheduled item crash There is a scheduler item in chan_sip that
+ keeps sending the last provisional message in response to an
+ INVITE Request for a period of time until a final response to
+ that INVITE is sent. Because of the way this scheduler item
+ works, it requires a reference to a sip_pvt pointer to work
+ properly. The problem with this is that it is currently possible
+ (but rare) for the sip_pvt to get destroyed and that scheduler
+ item to still exist. When this occurs, the scheduler event fires
+ and attempts to access a freed sip_pvt which causes a crash.
+ (closes issue #17497) Reported by: anonymouz666 Patches:
+ keepalive_diff_1.4_v2.diff uploaded by dvossel (license 671)
+ Review: https://reviewboard.asterisk.org/r/849/
+
+2010-08-05 07:28 +0000 [r280982] Tilghman Lesher <tlesher@digium.com>
+
+ * main/pbx.c: Change context lock back to a mutex, because
+ functionality depends upon the lock being recursive. (closes
+ issue #17643) Reported by: zerohalo Patches:
+ 20100726__issue17643.diff.txt uploaded by tilghman (license 14)
+ Tested by: zerohalo
+
+2010-08-04 18:54 +0000 [r280944] Russell Bryant <russell@digium.com>
+
+ * contrib/scripts/astcli (added): Copy astcli back to 1.4 so it's
+ available for automated testing purposes.
+
+2010-08-03 20:49 +0000 [r280811] Tilghman Lesher <tlesher@digium.com>
+
+ * funcs/func_callerid.c, channels/chan_dahdi.c: Prevent DAHDI
+ channels from overriding the callerid, once it's been set by the
+ user. (closes issue #16661) Reported by: jstapleton Patches:
+ 20100414__issue16661.diff.txt uploaded by tilghman (license 14)
+ 20100415__issue16661__1.6.2.diff.txt uploaded by tilghman
+ (license 14) Tested by: jstapleton
+
+2010-07-29 19:04 +0000 [r280448] David Vossel <dvossel@digium.com>
+
+ * main/channel.c: fixes issue with translator frame not getting
+ freed A translator frame even if it local storage so the
+ translation path can be freed. This issue prevented g729 licenses
+ from being freed up. (closes issue #17630) Reported by: manvirr
+ Patches: encoder_fix.diff uploaded by dvossel (license 671)
+ Tested by: manvirr, dvossel
+
+2010-07-29 15:52 +0000 [r280341] Jean Galarneau <jgalarneau@digium.com>
+
+ * apps/app_meetme.c: Fix a dsp structure leak occuring when a local
+ channel is put into a meetme conference, then masquaraded away.
+ ABE-2422
+
+2010-07-28 13:50 +0000 [r280088] Leif Madsen <lmadsen@digium.com>
+
+ * contrib/scripts/live_ast: Update help text to be less confusing.
+
+2010-07-27 20:33 +0000 [r279945] David Vossel <dvossel@digium.com>
+
+ * main/channel.c, include/asterisk/audiohook.h, main/audiohook.c:
+ remove empty audiohook write list on channel If a channel has an
+ audiohook write list created on it, that list stays on the
+ channel until the channel is destroyed. There is no reason to
+ keep that list on the channel if it becomes empty. If it is empty
+ that just means we are doing needless translating for every
+ ast_read and ast_write. This patch removes the audiohook list
+ from the channel once it is detected to be empty on either a read
+ or write. If a audiohook is added back to the channel after this
+ list is destroyed, the list just gets recreated as if it never
+ existed to begin with. (closes issue #17630) Reported by: manvirr
+ Review: https://reviewboard.asterisk.org/r/799/
+
+2010-07-24 23:57 +0000 [r279346] Bradley Latus <brad.latus@gmail.com>
+
+ * doc/asterisk.8: Minor update to man page
+
+2010-07-24 23:27 +0000 [r279344] Jeff Peeler <jpeeler@digium.com>
+
+ * configure, include/asterisk/autoconfig.h.in, configure.ac:
+ Provide a default value for DAHDI_TRANSCODE so when DAHDI is not
+ installed menuselect doesn't get confused: Unknown value '' found
+ in build_tools/menuselect-deps for DAHDI_TRANSCODE
+
+2010-07-23 21:56 +0000 [r279206] Richard Mudgett <rmudgett@digium.com>
+
+ * apps/app_dial.c, apps/app_queue.c: SIP promiscuous redirect could
+ fail to dial the redirect. The ast_channel was created with one
+ variable to ast_request() but the call to ast_call() that
+ initiates the outgoing call was using a different variable. The
+ two variables are not equivalent if the call_forward string
+ included a channel technology specifier. e.g., SIP/200
+
+2010-07-23 18:04 +0000 [r279053] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_sip.c: Backport fixes for sip_uri_params_cmp() from
+ trunk.
+
+2010-07-23 17:04 +0000 [r278981-278984] Tilghman Lesher <tlesher@digium.com>
+
+ * autoconf/ast_check_pwlib.m4, configure, configure.ac: Establish a
+ maximum version for openh323 (i.e. not opal), because chan_h323
+ will fail to load, even if it links. (issue #17679) Reported by:
+ am
+
+ * main/asterisk.c: Avoid race with consolethread on shutdown (on
+ parallel processors). (closes issue #17080) Reported by:
+ sybasesql Patches: 20100721__issue17080.diff.txt uploaded by
+ tilghman (license 14) Tested by: sybasesql
+
+2010-07-22 19:31 +0000 [r278701] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_dahdi.c: DNID does not get cleard on a new call
+ when using immediate=yes with ISDN signaling. When you are using
+ chan_dahdi ISDN signaling with immediate=yes and a call comes in
+ without a DNID then you get the DNID of a previous call.
+ Chan_dahdi does not touch the DNID field on a new call if it does
+ not have a DNID. Made always copy the DNID from the new call. The
+ patches backport the relevant changes from trunk -r210387.
+ (closes issue #17568) Reported by: wuwu Patches:
+ issue17568_v1.4.patch uploaded by rmudgett (license 664)
+ issue17568_v1.6.2.patch uploaded by rmudgett (license 664)
+
+2010-08-10 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.35 Released.
+
+2010-07-22 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.35-rc1 Released.
+
+2010-07-22 14:55 +0000 [r278618] Mark Michelson <mmichelson@digium.com>
+
+ * main/channel.c: Allow PLC to function properly when channels use
+ SLIN for audio. If a channel involved in a bridge was using SLIN
+ audio, then translation paths were not guaranteed to be set up
+ properly since in all likelihood the number of translation steps
+ was only 1. This patch enforces the transcode_via_slin behavior
+ if transcode_via_slin or generic_plc is enabled and one of the
+ formats to make compatible is SLIN. AST-352
+
+2010-07-20 22:23 +0000 [r278023-278261] Tilghman Lesher <tlesher@digium.com>
+
+ * apps/app_voicemail.c: Delete IMAP messages in reverse order, to
+ ensure reordering after each expunge does not cause deletion of
+ the wrong message. (closes issue #16350) Reported by: noahisaac
+ Patches: 20100623__issue16350.diff.txt uploaded by tilghman
+ (license 14)
+
+ * main/autoservice.c, res/res_features.c,
+ include/asterisk/channel.h: Do not queue up DTMF frames while a
+ call is on hold. (Fixes ABE-2110)
+
+ * main/manager.c: Off-by-one error (closes issue #16506) Reported
+ by: nik600 Patches: 20100629__issue16506.diff.txt uploaded by
+ tilghman (license 14)
+
+2010-07-19 20:56 +0000 [r277944] Paul Belanger <paul.belanger@polybeacon.com>
+
+ * channels/chan_sip.c: Regression with T.38 negotiation Prior to
+ 1.4.26.3 T.38 negotiation worked properly, in the case of the
+ reporter. (issue #16852) Reported by: cfc (closes issue #16705)
+ Reported by: mpiazzatnetbug Patches: issue16705_2.diff uploaded
+ by ebroad (license 878) Tested by: vrban, ebroad, c0rnoTa,
+ samdell3 Review: https://reviewboard.asterisk.org/r/754/
+
+2010-07-19 20:16 +0000 [r277906] Jean Galarneau <jgalarneau@digium.com>
+
+ * res/res_features.c: Avoid trying to pickup a parked extension
+ before the park operation is completed. A crash could occur if
+ the extension is picked up while the parking extension is being
+ announced. Testing pu->notquiteyet while searching for a parked
+ extension resolves this crash. (ABE-2418)
+
+2010-07-17 16:59 +0000 [r277738] Tilghman Lesher <tlesher@digium.com>
+
+ * autoconf/ast_func_fork.m4, configure: Remove uclibc cross-compile
+ triplet, as uclibc has a working fork()... it's only uclinux that
+ does not. (closes issue #17616) Reported by: pprindeville
+
+2010-07-16 22:43 +0000 [r277625] Tim Ringenbach <tim.ringenbach@gmail.com>
+
+ * res/res_features.c: Save and restore AST_FLAG_BRIDGE_HANGUP_DONT
+ on attended transfer. ast_bridge_call() clears
+ AST_FLAG_BRIDGE_HANGUP_DONT. But during an attended transfer,
+ ast_bridge_call() is called for a second bridge on the same
+ channel, and it clears that flag, which still needs to get set
+ for when the original ast_bridge_call() gets control back and
+ checks it. Review: https://reviewboard.asterisk.org/r/741
+
+2010-07-16 21:54 +0000 [r277568] Tilghman Lesher <tlesher@digium.com>
+
+ * res/res_config_pgsql.c, res/res_config_odbc.c: Since we split
+ values at the semicolon, we should store values with a semicolon
+ as an encoded value. (closes issue #17369) Reported by: gkservice
+ Patches: 20100625__issue17369.diff.txt uploaded by tilghman
+ (license 14) Tested by: tilghman
+
+2010-07-16 21:18 +0000 [r277497] Matthew Nicholson <mnicholson@digium.com>
+
+ * channels/chan_sip.c: Default to no udptl error correction so that
+ error correction will be disabled in the event that the remote
+ end indicates that they do not support the error correction mode
+ we requested. FAX-128
+
+2010-07-16 20:18 +0000 [r277419] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_dahdi.c: priexclusive in chan_dahdi.conf ignored
+ when reloading dahdi module During a reload, the priexclusive and
+ outsignalling parameters are not read in from the config file as
+ intended. Unfortunately, they get set to defaults as a result.
+ This patch makes sure that they do not get set to defaults during
+ a reload. (closes issue #17441) Reported by: mtryfoss Patches:
+ issue17441_v1.4.patch uploaded by rmudgett (license 664)
+ issue17441_v1.6.2.patch uploaded by rmudgett (license 664)
+ issue17441_trunk.patch uploaded by rmudgett (license 664) Tested
+ by: rmudgett
+
+2010-07-16 18:30 +0000 [r277327] Matthew Nicholson <mnicholson@digium.com>
+
+ * main/pbx.c: Interpret device state AST_DEVICE_UNKNOWN as
+ extension state AST_EXTENSION_NOT_INUSE. (closes issue #16035)
+ Reported by: francesco_r Patches: pbx.c.patch uploaded by
+ viniciusfontes (license 978) Tested by: francesco_r, agx, lawbar
+
+2010-07-16 18:04 +0000 [r277261] Tilghman Lesher <tlesher@digium.com>
+
+ * main/manager.c: If variable gotten is not set, will segfault on
+ Solaris. (closes issue #17636) Reported by: bklang
+
+2010-07-16 17:29 +0000 [r277247] Matthew Nicholson <mnicholson@digium.com>
+
+ * main/channel.c: For pass through DTMF tones, measure the actual
+ duration between the begin and end packets on the wire. If it is
+ detected to be less than AST_MIN_DTMF_DURATION, trigger dtmf
+ emulation. AST-362
+
+2010-07-16 17:10 +0000 [r277182] Paul Belanger <paul.belanger@polybeacon.com>
+
+ * apps/app_amd.c: Total analysis time error with SIP and silence
+ suppression When using app_amd with SIP providers that have
+ silence suppression on, the iTotalTime count increases
+ exponentially. (closes issue #17656) Reported by: juls
+
+2010-07-15 13:48 +0000 [r276652] Jeff Peeler <jpeeler@digium.com>
+
+ * main/channel.c: In a perfect world, the frame source would never
+ be NULL. In the meantime, don't crash when it is.
+
+2010-07-14 11:49 +0000 [r276267] Leif Madsen <lmadsen@digium.com>
+
+ * configs/voicemail.conf.sample: Update documentation for
+ voicemail.conf externpass option.
+
+2010-07-13 19:14 +0000 [r275994-276126] Russell Bryant <russell@digium.com>
+
+ * res/res_features.c: Only reset a CDR that exists.
+
+ * res/res_features.c: Use chan->cdr instead of chan_cdr (just like
+ peer->cdr instead of peer_cdr in the last commit).
+
+ * res/res_features.c: Access peer->cdr directly instead of through
+ a saved off reference. At this point in the code, it is possible
+ that peer_cdr may be invalid. Specifically, in the blind transfer
+ code, CDRs are swapped between channels. So, peer_cdr is no
+ longer == peer->cdr. The scenario that exposed a crash in this
+ code was a blind transfer that hit the system call limit, causing
+ the transferee channel to get destroyed after the transfer
+ attempt failed. Even if it succeeds and this code doesn't crash,
+ this code was still trying to reset a CDR on a channel that was
+ now owned by a different thread, which is a BadThing(tm).
+ (ABE-2417)
+
+2010-07-13 14:47 +0000 [r275909] Tilghman Lesher <tlesher@digium.com>
+
+ * contrib/realtime/mysql/sipfriends.sql,
+ contrib/realtime/mysql/voicemail.sql,
+ contrib/scripts/realtime_pgsql.sql (removed),
+ contrib/scripts/vmdb.sql (removed),
+ contrib/scripts/iax-friends.sql (removed),
+ contrib/realtime/mysql/iaxfriends.sql,
+ contrib/realtime/mysql/meetme.sql, contrib/scripts/meetme.sql
+ (removed), contrib/realtime (added), contrib/realtime/postgresql,
+ contrib/realtime/postgresql/realtime.sql, contrib/realtime/mysql,
+ contrib/realtime/oracle, contrib/realtime/sqlserver,
+ contrib/scripts/sip-friends.sql (removed): Move SQL scripts into
+ their own database-specific directories.
+
+2010-07-12 20:34 +0000 [r275665-275773] Jeff Peeler <jpeeler@digium.com>
+
+ * apps/app_meetme.c: Make user removals and traversals thread safe
+ in meetme. Race conditions present in meetme involving the user
+ list where a lack of locking has the potential for a user to be
+ removed during a traversal or as in the case of the reporter
+ after checking if the list is empty could cause a crash. Fixing
+ this was done by convering the userlist to an ao2 container.
+ (closes issue #17390) Reported by: Vince Review:
+ https://reviewboard.asterisk.org/r/746/
+
+ * main/channel.c: Change ast_write to not stop generator when
+ called from ast_prod. For SIP channels configured with the
+ progressinband option on, the ringback was being immediately
+ stopped. This problem was due to ast_prod being moved for a
+ deadlock fix in 259858. Prodding the channel after setting up the
+ generator triggered the check in ast_write to stop the generator.
+ The fix here should write the frame the same as was done before
+ the call to ast_prod was moved. (closes issue #17372) Reported
+ by: tech_admin
+
+2010-07-09 19:28 +0000 [r275241-275290] Paul Belanger <paul.belanger@polybeacon.com>
+
+ * main/cli.c: fix tab-completion for unload command. (closes issue
+ #17536) Reported by: junky Patches: unload_vs_mod_unload.diff
+ uploaded by junky (license 177) Tested by: pabelanger
+
+ * channels/chan_sip.c: Fix logging message for stale nonce. (closes
+ issue #17582) Reported by: kenner Patches: chan_sip.c.diff
+ uploaded by kenner (license 1040) Tested by: lmadsen
+
+2010-07-09 18:23 +0000 [r275027-275182] Matthew Nicholson <mnicholson@digium.com>
+
+ * main/loader.c: give a better error message when attempting to
+ unload a module that is not loaded
+
+ * main/loader.c: don't unload modules that returned
+ AST_MODULE_LOAD_DECLINE when they were loaded
+
+ * apps/app_dial.c: Clear the AST_CDR_FLAG_DIALED flag for channels
+ going into the pbx via the G option in app_dial (closes issue
+ #17592) Reported by: jamicque Patches: G-flag-cdr-fix1.diff
+ uploaded by mnicholson (license 96) Tested by: jamicque,
+ mnicholson
+
+2010-07-09 15:33 +0000 [r275021] Russell Bryant <russell@digium.com>
+
+ * include/asterisk/test.h, main/test.c: Document that a leading and
+ trailing slash is expected for test categories. Also, emit a
+ warning if a test is registered without one of these.
+
+2010-07-07 18:12 +0000 [r274579] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_dahdi.c: Close the DAHDI FD on error when
+ processing chan_dahdi toneduration config parameter.
+
+2010-07-07 06:13 +0000 [r274417] Tilghman Lesher <tlesher@digium.com>
+
+ * configs/say.conf.sample: Correct how 100, 200, 300, etc. is said.
+ Also add the crazy British numbers. (closes issue #16102)
+ Reported by: Delvar Patches: say.conf.fix.patch uploaded by
+ Delvar (license 908) (plus a few additional fixes and
+ simplifications by me)
+
+2010-07-06 22:46 +0000 [r274283-274359] Jeff Peeler <jpeeler@digium.com>
+
+ * main/Makefile: Ensure file.o is built correctly. (related to
+ issue #15250)
+
+ * configs/sip.conf.sample: Correct sip.conf.sample comments for
+ prematuremedia option. (closes issue #17513) Reported by: festr
+ Patches: patch uploaded by festr (license 443)
+
+2010-07-06 22:08 +0000 [r274280] Terry Wilson <twilson@digium.com>
+
+ * channels/chan_sip.c, configs/sip.conf.sample: Add option to not
+ do a call forward on 482 Loop Detected Asterisk has always set up
+ a forwarded call when receiving a 482 Loop Detected. This
+ prevents handling the call failure by just continuing on in the
+ dialplan. Since this would be a change in behavior, the new
+ option to disable this behavior is forwardloopdetected which
+ defaults to 'yes'. Review:
+ https://reviewboard.asterisk.org/r/764/
+
+2010-07-06 14:29 +0000 [r274157] Mark Michelson <mmichelson@digium.com>
+
+ * main/rtp.c: Fix problem with RFC 2833 DTMF not being accepted. A
+ recent check was added to ensure that we did not erroneously
+ detect duplicate DTMF when we received packets out of order. The
+ problem was that the check did not account for the fact that the
+ seqno of an RTP stream will roll over back to 0 after hitting
+ 65535. Now, we have a secondary check that will ensure that the
+ seqno rolling over will not cause us to stop accepting DTMF.
+ (closes issue #17571) Reported by: mdeneen Patches:
+ rtp_seqno_rollover.patch uploaded by mmichelson (license 60)
+ Tested by: richardf, maxochoa, JJCinAZ
+
+2010-07-06 13:52 +0000 [r274093] Matthew Nicholson <mnicholson@digium.com>
+
+ * apps/app_queue.c: Make get_member_status return QUEUE_NO_MEMBERS
+ instead of QUEUE_NO_REACHABLE_MEMBERS to make joinempty=no work
+ again. This regression was introduced in 273639. Also fixed
+ whitespace.
+
+2010-07-05 19:48 +0000 [r273981] Tilghman Lesher <tlesher@digium.com>
+
+ * channels/chan_oss.c, channels/chan_iax2.c: Command 'stop
+ gracefully' doesn't.
+
+2010-07-05 13:51 +0000 [r273884] Paul Belanger <paul.belanger@polybeacon.com>
+
+ * main/config.c: Remove extra line breaks from 'core show config
+ mappings' (closes issue #17583) Reported by: pabelanger Patches:
+ issue17583.patch uploaded by pabelanger (license 224) Tested by:
+ lmadsen
+
+2010-07-02 21:36 +0000 [r273717-273793] Tilghman Lesher <tlesher@digium.com>
+
+ * channels/chan_dahdi.c, channels/chan_local.c, configure,
+ include/asterisk/autoconfig.h.in, channels/chan_agent.c,
+ configure.ac, channels/chan_h323.c, include/asterisk/lock.h,
+ include/asterisk/compiler.h: Have the DEADLOCK_AVOIDANCE macro
+ warn when an unlock fails, to help catch potentially large
+ software bugs. (closes issue #17407) Reported by: pdf Patches:
+ 20100527__issue17407.diff.txt uploaded by tilghman (license 14)
+ Review: https://reviewboard.asterisk.org/r/751/
+
+ * main/autoservice.c: Autoservice loop optimization causes a busy
+ loop, when channels are serviced while in hangup. (closes issue
+ #17564) Reported by: ramonpeek Patches:
+ 20100630__issue17564.diff.txt uploaded by tilghman (license 14)
+ Tested by: ramonpeek
+
+2010-07-02 15:54 +0000 [r273640] Tzafrir Cohen <tzafrir.cohen@xorcom.com>
+
+ * apps/app_voicemail.c, channels/chan_dahdi.c,
+ channels/chan_misdn.c, channels/chan_sip.c, res/res_agi.c,
+ res/res_jabber.c: Fix various typos, reported by Lintian
+
+2010-07-02 15:46 +0000 [r273639] Tilghman Lesher <tlesher@digium.com>
+
+ * apps/app_queue.c: If all members are paused, the wrong status is
+ indicated. (closes issue #17576) Reported by: ramonpeek Patches:
+ diff.txt uploaded by ramonpeek (license 266) Tested by: ramonpeek
+
+2010-07-01 22:09 +0000 [r273565] Russell Bryant <russell@digium.com>
+
+ * main/channel.c: Don't return a partially initialized datastore.
+ If memory allocation fails in ast_strdup(), don't return a
+ partially initialized datastore. Bad things may happen. (related
+ to ABE-2415)
+
+2010-07-01 20:19 +0000 [r273354-273474] Jeff Peeler <jpeeler@digium.com>
+
+ * apps/app_meetme.c: Allow admin user to join conference without
+ using admin mode and no user pin. Configuring the conference in
+ meetme.conf like the following: conf => 2345,,6666 did not prompt
+ for pin when used without admin mode. This meant that the
+ conference could not be joined as an admin even if the user knew
+ the correct pin. The original bug report was submitted claiming
+ that the blank user pin should deny entry into the conference. I
+ think a better way to handle this would be with a feature
+ enhancement that used the following syntax: conf => 2345,X,6666 -
+ where X denotes no acceptable pin allowed (closes issue #15704)
+ Reported by: modelnine
+
+ * apps/app_meetme.c: Ensure channel placed in meetme in ringing
+ state is properly hung up. An outgoing channel placed in meetme
+ while still ringing which was then hung up would not exit meetme
+ and the channel was not properly destroyed. Specifically checking
+ for this scenario by looking at the appropriate control frames
+ resolves the issue. (closes issue #15871) Reported by: Ivan
+ Patches: meetme_congestion_trunk_v2.patch uploaded by Ivan
+ (license 229)
+
+2010-06-29 23:15 +0000 [r273057-273060] Tilghman Lesher <tlesher@digium.com>
+
+ * channels/chan_sip.c: Allow the "useragent" value to be restored
+ into memory from the realtime backend. This value is purely
+ informational. It does not alter configuration at all. (closes
+ issue #16029) Reported by: Guggemand Patches:
+ realtime-useragent.patch uploaded by Guggemand (license 897)
+ Tested by: Guggemand
+
+ * main/channel.c: _Really_ skip the channel... don't just retry for
+ another 200 cycles. (Closes issue SWP-1652, ABE-2240)
+
+2010-06-29 21:36 +0000 [r273017] Russell Bryant <russell@digium.com>
+
+ * /: Remove properties that were erroneously merged to 1.4 from one
+ of my branches.
+
+2010-07-22 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.34 Released.
+
+2010-07-07 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.34-rc2 Released.
+
+ * Fix problem with RFC 2833 DTMF not being accepted.
+
+ A recent check was added to ensure that we did not erroneously
+ detect duplicate DTMF when we received packets out of order.
+ The problem was that the check did not account for the fact that
+ the seqno of an RTP stream will roll over back to 0 after hitting
+ 65535. Now, we have a secondary check that will ensure that the
+ seqno rolling over will not cause us to stop accepting DTMF.
+
+ (closes issue 0017571)
+ Reported by: mdeneen
+ Patches:
+ rtp_seqno_rollover.patch uploaded by mmichelson (license 60)
+ Tested by: richardf, maxochoa, JJCinAZ
+
+ * Clear the AST_CDR_FLAG_DIALED flag for channels going into the pbx
+ via the G option in app_dial
+
+ (closes issue 0017592)
+ Reported by: jamicque
+ Patches:
+ G-flag-cdr-fix1.diff uploaded by mnicholson (license 96)
+ Tested by: jamicque, mnicholson
+
+2010-06-29 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.34-rc1 Released.
+
+2010-06-28 21:50 +0000 [r272921-272925] Tilghman Lesher <tlesher@digium.com>
+
+ * main/asterisk.c: Don't change ownership/group/permissions on run
+ directory, if it already exists. (closes issue #17076) Reported
+ by: stuarth Patches: 20100324__issue17076.diff.txt uploaded by
+ tilghman (license 14) Tested by: stuarth
+
+ * main/config.c: Also trim trailing blanks on #includes
+
+ * main/config.c: Change the way that we read include files, to
+ accommodate for changes in GCC 4.4. (closes issue #17472)
+ Reported by: seandarcy Patches: config2.patch uploaded by nivan
+ (license 1066) Tested by: nivan
+
+2010-06-28 18:47 +0000 [r272878-272881] Russell Bryant <russell@digium.com>
+
+ * tests/test_astobj2.c (added): Backport applicable parts of
+ test_astobj2.
+
+ * main/asterisk.c, Makefile, include/asterisk/test.h (added),
+ build_tools/cflags-devmode.xml, include/asterisk.h,
+ tests/Makefile, tests/test_skel.c, /, main/Makefile, tests
+ (added), include/asterisk/linkedlists.h, main/test.c (added):
+ Backport unit test API to 1.4. Review:
+ https://reviewboard.asterisk.org/r/750/
+
+2010-06-28 17:31 +0000 [r272804] Mark Michelson <mmichelson@digium.com>
+
+ * channels/chan_sip.c: Decode URI in contact header of 302
+ response. ABE-2352
+
+2010-06-28 17:11 +0000 [r272688-272763] Russell Bryant <russell@digium.com>
+
+ * Makefile: Force SILENTMAKE where it is needed.
+
+ * Makefile: Backport method of setting SUBMAKE from trunk. By
+ setting the PRINT_DIR variable, SUBMAKE will print out the
+ directories it descends into, which is important for editors
+ (like vim) that watch the build output so that they can take you
+ to the file where an error occurred.
+
+2010-06-25 20:17 +0000 [r272562] Tilghman Lesher <tlesher@digium.com>
+
+ * doc/voicemail_odbc_postgresql.txt: Make the structure of the
+ table specified before match the queries and results. (closes
+ issue #17557) Reported by: cmaj
+
+2010-06-24 21:58 +0000 [r272446] Richard Mudgett <rmudgett@digium.com>
+
+ * channels/chan_dahdi.c: ss_thread calls pri_grab without lock
+ during overlap dial Recent changes to chan_dahdi with relation to
+ overlap dialing call pri_grab without first obtaining a lock.
+ (closes issue #17414) Reported by: pdf Patches: bug17414.patch
+ uploaded by jpeeler (license 325)
+
+2010-06-23 22:33 +0000 [r272367] Matthew Nicholson <mnicholson@digium.com>
+
+ * apps/app_queue.c: Send AgentComplete manager events in the event
+ of blind and attended transfers. (closes issue #16819) Reported
+ by: elbriga Patches: app_queue.diff uploaded by elbriga (license
+ 482)
+
+2010-06-23 20:57 +0000 [r272255] Paul Belanger <paul.belanger@polybeacon.com>
+
+ * apps/app_meetme.c: First caller into a dynamic conference now
+ enter pin once. If MeetMe is configured to use dynamic conference
+ numbers, then the first caller (which creates the conference) had
+ to enter the PIN number twice. (closes issue #15878) Reported by:
+ shawkris Patches: issue15878.patch uploaded by pabelanger
+ (license 224) Tested by: pabelanger
+
+2010-06-23 18:40 +0000 [r272147] Tilghman Lesher <tlesher@digium.com>
+
+ * apps/app_voicemail.c: Backport part of revision 136715 to fix
+ callerid in voicemail text files (IMAP only). (closes issue
+ #16945) Reported by: mneuhauser
+
+2010-06-22 17:31 +0000 [r271689-271902] Matthew Nicholson <mnicholson@digium.com>
+
+ * channels/chan_sip.c: Decrease the module ref count in sip_hangup
+ when SIP_DEFER_BYE_ON_TRANSFER is set. This is necessary to keep
+ the ref count correct. (closes issue #16815) Reported by: rain
+ Patches: chan_sip-unref-fix.diff uploaded by rain (license 327)
+ (modified) Tested by: rain
+
+ * pbx/pbx_dundi.c: Allow users to specify a port for dundi peers.
+ (closes issue #17056) Reported by: klaus3000 Patches:
+ dundi-peerport-patch-trunk.txt uploaded by klaus3000 (license 65)
+ Tested by: klaus3000
+
+ * configs/sip_notify.conf.sample, channels/chan_sip.c: Modify
+ chan_sip's packet generation api to automatically calculate the
+ Content-Length. This is done by storing packet content in a
+ buffer until it is actually time to send the packet, at which
+ time the size of the packet is calculated. This change was made
+ to ensure that the Content-Length is always correct. (closes
+ issue #17326) Reported by: kenner Tested by: mnicholson, kenner
+ Review: https://reviewboard.asterisk.org/r/693/
+
+2010-06-21 20:37 +0000 [r271552] Jeff Peeler <jpeeler@digium.com>
+
+ * pbx/pbx_ael.c: Do not use sizeof to calculate size of a heap
+ allocated character array. Change left out from 271399. (closes
+ issue #16053) Reported by: diLLec
+
+2010-06-18 20:52 +0000 [r271399-271444] Jeff Peeler <jpeeler@digium.com>
+
+ * pbx/pbx_ael.c: Check for newly added memory allocation failures
+ gracefully during AEL2 parsing.
+
+ * pbx/pbx_ael.c: Fix crash when parsing some heavily nested
+ statements in AEL on reload. Due to the recursion used when
+ compiling AEL in gen_prios, all the stack space was being
+ consumed when parsing some AEL that contained nesting 13 levels
+ deep. Changing a few large buffers to be heap allocated fixed the
+ crash, although I did not test how many more levels can now be
+ safely used. (closes issue #16053) Reported by: diLLec Tested by:
+ jpeeler
+
+2010-06-18 18:54 +0000 [r271339-271340] Russell Bryant <russell@digium.com>
+
+ * include/asterisk/lock.h: Remove an unnecessary assignment that
+ causes a DEBUG_THREADS build failure on mac os x.
+
+ * configure, include/asterisk/autoconfig.h.in, configure.ac,
+ include/asterisk/lock.h: Fix a build problem on Mac OS X with
+ DEBUG_THREADS enabled. This set of changes was already in trunk.
+
+2010-06-18 18:33 +0000 [r271335] Jeff Peeler <jpeeler@digium.com>
+
+ * channels/chan_dahdi.c: Eliminate deadlock potential in
+ dahdi_fixup(). (This is a backport of 269307, committed to trunk
+ by rmudgett.) Calling dahdi_indicate() when the channel private
+ lock is already held can cause a deadlock if the PRI lock is
+ needed because dahdi_indicate() will also get the channel private
+ lock. The pri_grab() function assumes that the channel private
+ lock is held once to avoid deadlock. (closes issue #17261)
+ Reported by: aragon
+
+2010-06-22 Russell Bryant <russell@digium.com>
+
+ * Asterisk 1.4.33.1 Released.
+
+ * channels/chan_dahdi.c: Merge revision 270404 from the 1.4 branch.
+
+ fixes FXS port still ringing when answered, as reported by Tzafrir
+ on dev-list.
+
+ (issue #17067)
+ Reported by: tzafrir
+ Tested by: alecdavis
+
+2010-06-17 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.33 Released.
+
+2010-06-10 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.33-rc2 Released.
+
+2010-06-10 Tilghman Lesher <tlesher@digium.com>
+
+ * Ensure signals are not blocked inside other signal handlers.
+
+ This eliminates the annoying <beep> on the console.
+
+ (closes issue 0017477)
+ Reported by: jvandal
+ Patches:
+ 20100610__issue17477.diff.txt uploaded by tilghman (license 14)
+
+2010-06-09 Paul Belanger <paul.belanger@polybeacon.com>
+
+ * Fix Debian init script to not use -c.
+
+ When using the init script as-is currently, it could cause issues on Debian
+ such as high CPU usage. This fix has worked for several people so I'm
+ implementing the change. We now handle color displays properly.
+
+ (closes issue 0016784)
+ Reported by: pabelanger
+ Patches:
+ 20100530__issue16784__2.diff.txt uploaded by tilghman (license 14)
+ Tested by: pabelanger, tilghman
+
+2010-06-01 Leif Madsen <lmadsen@digium.com>
+
+ * Asterisk 1.4.33-rc1 Released.
+
+2010-06-01 15:17 +0000 [r266585] Tilghman Lesher <tlesher@digium.com>
+
+ * main/asterisk.c: Prevent CLI prompt from distorting output of
+ lines shorter than the prompt. Uses the VT100 method of clearing
+ the line from the cursor position to the end of the line: Esc-0K
+ (closes issue #17160) Reported by: coolmig Patches:
+ 20100531__issue17160.diff.txt uploaded by tilghman (license 14)
+ Tested by: coolmig
+
+2010-06-01 14:57 +0000 [r266579-266580] Paul Belanger <paul.belanger@polybeacon.com>
+
+ * channels/chan_sip.c: Fix formatting issue with previous patch.
+
+ * channels/chan_sip.c: Missing fallback to audio fax feature when
+ T.38 re-INVITE failed When a T.38 re-INVITE failed with an 488 or
+ 606 answer, we should fallback to audio fax by send a
+ re-re-INVITE without T.38. The function is backported from 1.6
+ asterisk. (closes issue #16795) Reported by: vrban (closes issue
+ #16692) Reported by: vrban Patches:
+ t38_fallback_to_audio_v3.patch uploaded by vrban (license 756)
+ Tested by: lmadsen, vrban, haggard
+ https://reviewboard.asterisk.org/r/514/
+
+2010-05-30 04:43 +0000 [r266437] Tilghman Lesher <tlesher@digium.com>
+
+ * contrib/init.d/rc.debian.asterisk: Reverting patch and reopening
+ issue #16784, as patch breaks color display.
+
+2010-05-26 21:11 +0000 [r266142] Tilghman Lesher <tlesher@digium.com>
+
+ * main/asterisk.c, main/logger.c: Use sigaction for signals which
+ should persist past the initial trigger, not signal. If you call
+ signal() in a Solaris signal handler, instead of just resetting
+ the signal handler, it causes the signal to refire, because the
+ signal is not marked as handled prior to the signal handler being
+ called. This effectively causes Solaris to immediately exceed the
+ threadstack in recursive signal handlers and crash. (closes issue
+ #17000) Reported by: rmcgilvr Patches:
+ 20100526__issue17000.diff.txt uploaded by tilghman (license 14)
+ Tested by: rmcgilvr
+
+2010-05-26 20:33 +0000 [r266140] David Vossel <dvossel@digium.com>
+
+ * channels/chan_dahdi.c: add dahdi_func_write to zap_tech structure
+ This was supposed to be committed with r263292, the back-port of
+ teh DAHDI buffer policy dial string option
+
+2010-05-26 18:21 +0000 [r266004] Mark Michelson <mmichelson@digium.com>
+
+ * apps/app_queue.c: Make AgentComplete message more consistent. At
+ times, the "Member" field was not specified during the event.
+ It's there now. (closes issue #15638) Reported by: elbriga
+ Patches: patchAppQueueAgentComplete.diff uploaded by elbriga
+ (license 482)
+
+2010-05-26 16:21 +0000 [r265910] Tilghman Lesher <tlesher@digium.com>
+
+ * res/res_config_pgsql.c: Not finding rows in the DB does not rise
+ to the level of a warning. (closes issue #17062) Reported by:
+ drookie Patches: 20100525__issue17062.diff.txt uploaded by
+ tilghman (license 14)
+
+2010-05-25 17:11 +0000 [r265613] David Vossel <dvossel@digium.com>
+
+ * channels/chan_dahdi.c: fixes build issue with zaptel (closes
+ issue #17394) Reported by: aragon Patches: half_buffer_fix.diff
+ uploaded by dvossel (license 671) Tested by: aragon
+
+2010-05-25 16:48 +0000 [r265610] Matthew Nicholson <mnicholson@digium.com>
+
+ * apps/app_queue.c: Don't mark the cdr records of unanswered queue
+ calls with "NOANSWER". This restores the behavior prior to
+ r258670. (closes issue #17334) Reported by: jvandal Patches:
+ queue-cdr-fixes1.diff uploaded by mnicholson (license 96) Tested
+ by: aragon, jvandal
+
+2010-05-25 13:33 +0000 [r265570] Terry Wilson <twilson@digium.com>
+
+ * include/asterisk/options.h, main/asterisk.c, Makefile,
+ doc/manager.txt, main/manager.c: Merged revisions 265320,265467
+ via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk
+ ........ r265320 | twilson | 2010-05-24 14:06:40 -0500 (Mon, 24
+ May 2010) | 14 lines Add the FullyBooted AMI event It is possible
+ to connect to the manager interface before all Asterisk modules
+ are loaded. To ensure that an application does not send AMI
+ actions that might require a module that has not yet loaded, the
+ application can listen for the FullyBooted manager event. It will
+ be sent upon connection if all modules have been loaded, or as
+ soon as loading is complete. The event: Event: FullyBooted
+ Privilege: system,all Status: Fully Booted Review:
+ https://reviewboard.asterisk.org/r/639/ ........ r265467 |
+ twilson | 2010-05-24 17:21:58 -0500 (Mon, 24 May 2010) | 1 line
+ Merge the rest of the FullyBooted patch ........
+
+2010-05-24 19:37 +0000 [r265365] David Vossel <dvossel@digium.com>
+
+ * main/channel.c: fixes segfault when using generic plc
+
+2010-05-21 20:59 +0000 [r264996-265089] Mark Michelson <mmichelson@digium.com>
+
+ * include/asterisk/file.h, apps/app_queue.c: Don't hang up on a
+ queue caller if the file we attempt to play does not exist. This
+ also fixes a documentation mistake in file.h that made my
+ original attempt to correct this problem not work correctly.
+ (closes issue #17061) Reported by: RoadKill
+
+ * include/asterisk/channel.h: Fix grammatical error in comment.
+
+ * main/channel.c, main/autoservice.c, include/asterisk/channel.h:
+ Allow ast_safe_sleep to defer specific frames until after the
+ sleep has concluded. From reviewboard Background: A Digium
+ customer discovered a somewhat odd bug. The setup is that parties
+ A and B are bridged, and party A places party B on hold. While
+ party B is listening to hold music, he mashes a bunch of DTMF.
+ Party A takes party B off hold while this is happening, but party
+ B continues to hear hold music. I could reproduce this about 1 in
+ 5 times. The issue: When DTMF features are enabled and a user
+ presses keys, the channel that the DTMF is streamed to is placed
+ in an ast_safe_sleep for 100 ms, the duration of the emulated
+ tone. If an AST_CONTROL_UNHOLD frame is read from the channel
+ during the sleep, the frame is dropped. Thus the unhold
+ indication is never made to the channel that was originally
+ placed on hold. The fix: Originally, I discussed with Kevin
+ possible ways of fixing the specific problem reported. However,
+ we determined that the same type of problem could happen in other
+ situations where ast_safe_sleep() is used. Using autoservice as a
+ model, I modified ast_safe_sleep_conditional() to defer specific
+ frame types so they can be re-queued once the sleep has finished.
+ I made a common function for determining if a frame should be
+ deferred so that there are not two identical switch blocks to
+ maintain. Review: https://reviewboard.asterisk.org/r/674/
+
+2010-05-20 23:23 +0000 [r264820] Richard Mudgett <rmudgett@digium.com>
+
+ * main/callerid.c: ast_callerid_parse() had a path that left name
+ uninitialized. Several callers of ast_callerid_parse() do not
+ initialize the name parameter before calling thus there is the
+ potential to use an uninitialized pointer.
+
+2010-05-20 15:59 +0000 [r264541] Mark Michelson <mmichelson@digium.com>
+
+ * include/asterisk/options.h, main/loader.c, main/channel.c,
+ include/asterisk/channel.h: 1.4 version of PLC fix. Analogous to
+ trunk revision 264452, but without the change to chan_sip since
+ it is not necessary in this branch.
+
+2010-05-19 20:01 +0000 [r264334] Matthew Nicholson <mnicholson@digium.com>
+
+ * apps/app_speech_utils.c: Set quieted flag when receiving a dtmf
+ tone during playback in speechbackground. (closes issue #16966)
+ Reported by: asackheim
+
+2010-05-19 17:41 +0000 [r264248] Tilghman Lesher <tlesher@digium.com>
+
+ * include/asterisk/options.h, configure, configure.ac: Internal
+ timing is now on by default, if you're using DAHDI 2.3 or above.
+ The reason for ensuring DAHDI 2.3 or above is that this version
+ ensures that a timer is always available, whereas in previous
+ versions, it was possible for DAHDI to be loaded, but have no
+ drivers to actually generate timing. If internal_timing was
+ turned on in this circumstance, a complete lack of audio would
+ result. This is the reason why internal_timing was not on by
+ default. However, now that DAHDI ensures the availability of a
+ timer, there is no reason for this setting to be off (and in
+ fact, it solves a great many initial user problems). (closes
+ issue #15932) Reported by: dimas Patches:
+ 20100519__issue15932.diff.txt uploaded by tilghman (license 14)
+ Tested by: tilghman
+
+2010-05-19 08:23 +0000 [r264056] Alec L Davis <sivad.a@paradise.net.nz>
+
+ * configs/indications.conf.sample: fix incorrectly typed
+ indications for [nz] stutter and dialrecall (closes issue #17359)
+ Reported by: alecdavis Patches: bug17359.diff.txt uploaded by
+ alecdavis (license 585)
+
+2010-05-19 06:32 +0000 [r263949] Tilghman Lesher <tlesher@digium.com>
+
+ * main/dsp.c: Because progress is called multiple times, across
+ several frames, we must persist states when detecting multitone
+ sequences. (closes issue #16749) Reported by: dant Patches:
+ dsp.c-bug16749-1.patch uploaded by dant (license 670) Tested by:
+ dant
+
+2010-05-18 18:54 +0000 [r263769] Jeff Peeler <jpeeler@digium.com>
+
+ * apps/app_directory.c: Modify directory name reading to be
+ interrupted with operator or pound escape. In the case of
+ accidentally entering the wrong first three letters for the
+ reading, users could be very frustrated if the name listing is
+ very long. This allows interrupting the reading by pressing 0 or
+ #. 0 will attempt to execute a configured operator (o) extension
+ and # will exit and proceed in the dialplan. ABE-2200
+
+2010-05-17 22:00 +0000 [r263637-263639] Mark Michelson <mmichelson@digium.com>
+
+ * main/devicestate.c: Fix logic error when checking for a devstate
+ provider. When using strsep, if one of the list of specified
+ separators is not found, it is the first parameter to strsep
+ which is now NULL, not the pointer returned by strsep. This issue
+ isn't especially severe in that the worst it is likely to do is
+ waste some cycles when a device with no '/' and no ':' is passed
+ to ast_device_state.
+
+ * main/pbx.c: Remove arbitrary size limitation for hints. (closes
+ issue #17257) Reported by: tim_ringenbach Patches:
+ hints_crash_fix.diff uploaded by tim ringenbach (license 540)
+
+2010-05-17 14:35 +0000 [r263374-263456] Leif Madsen <lmadsen@digium.com>
+
+ * main/http.c: Manager cookies are not compatible with RFC2109. The
+ Version field in the cookies we're setting contain quotes around
+ the version number which is not compatible with RFC2109 and
+ breaks some implementations. (closes issue #17231) Reported by:
+ ecarruda Patches: manager_rfc2109-trunk-v1.patch uploaded by
+ ecarruda (license 559) manager_rfc2109-1.6.2-v1.patch uploaded by
+ ecarruda (license 559) Tested by: ecarruda, russell
+
+ * sounds/Makefile: Update link to new version of core sounds. The
+ latest version of the core sounds files 1.4.19 now includes the
+ missing queue-minute sound file which is called by app_queue but
+ which has been missing. (closes issue #17123) Reported by:
+ n8ideas
+
+2010-05-17 13:01 +0000 [r263292] David Vossel <dvossel@digium.com>
+
+ * channels/chan_dahdi.c: backport of DAHDI buffer policy dial
+ string option
+
+2010-05-13 23:08 +0000 [r263112] Jeff Peeler <jpeeler@digium.com>
+
+ * main/channel.c, main/file.c: Fix internal timing not working with
+ Zaptel dahdi_compat.h was not being included in channel.c when
+ used with Zaptel and wasn't in file.c at all. (closes issue
+ #15250) Reported by: mneuhauser Patches: dahdi_compat.patch
+ uploaded by mneuhauser (license 425) Tested by: IgorG
+
+2010-05-12 17:00 +0000 [r262662] David Vossel <dvossel@digium.com>
+
+ * apps/app_meetme.c: fixes app_meetme dsp error We attempted to
+ detect silence after translating a frame from signed linear. This
+ caused a flooding of errors. To resolve this the code to detect
+ silence was moved before the translation. (closes issue #17133)
+ Reported by: jsdyer
+
+2010-05-11 19:55 +0000 [r262421] Jason Parker <jparker@digium.com>
+
+ * pbx/Makefile: Use a less silly method for modifying a
+ flex-generated file. The sed syntax that was used wasn't actually
+ valid, causing some versions to choke. This is the method that is
+ used in 1.6.x+ for similar changes. (closes issue #16696)
+ Reported by: bklang Patches: 16696-sedfix.diff uploaded by qwell
+ (license 4) Tested by: qwell
+
+2010-05-11 17:22 +0000 [r262321] Tilghman Lesher <tlesher@digium.com>
+
+ * apps/app_voicemail.c, Makefile.rules: Fix issue #17302 a slightly
+ different way (mad props to Qwell)
+
+2010-05-10 16:34 +0000 [r262151] Tilghman Lesher <tlesher@digium.com>
+
+ * Makefile.rules: Allow compilation on Mac OS X 10.4 (Tiger)
+ (closes issue #17297) Reported by: jcovert Patches:
+ 20100506__issue17297.diff.txt uploaded by tilghman (license 14)
+ (closes issue #17302) Reported by: jcovert
+
+2010-05-06 20:10 +0000 [r261698-261735] Jeff Peeler <jpeeler@digium.com>
+
+ * apps/app_voicemail.c: Only allow the operator key to be accepted
+ after leaving a voicemail. Or rather disallow the operator key
+ from being accepted when not offered, such as after finishing a
+ recording from within the mailbox options menu. ABE-2121 SWP-1267
+
+ * apps/app_voicemail.c: Revert 261698, code in trunk leads me to
+ believe unadvertised options are supported.
+
+ * apps/app_voicemail.c: Remove some hidden broken code in the
+ voicemail mailbox options menu. After finishing a recording from
+ within the mailbox options menu, pressing 0 exhibited strange
+ behavior with operator=yes turned on. Pressing 0 was not even
+ advertised as an option and the options from the vm-saveoper
+ prompt: "Press 1 to accept this recording. Otherwise, please
+ continue to hold" did not function correctly. While this of
+ course could be fixed, it didn't really seem to make sense even
+ if it was working properly. ABE-2121 SWP-1267
+
+2010-05-06 16:56 +0000 [r261608] Jason Parker <jparker@digium.com>
+
+ * sounds/Makefile: Use the versioned MOH tarballs, now that we have
+ them. This makes for more reproducibility. Prompted by a
+ discussion in #asterisk-dev
+
2010-06-01 Leif Madsen <lmadsen@digium.com>
* Asterisk 1.4.32 Released
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/Makefile
^
|
@@ -57,6 +57,7 @@
export AR
export RANLIB
export HOST_CC
+export BUILD_CC
export STATIC_BUILD
export INSTALL
export DESTDIR
@@ -264,7 +265,7 @@
_ASTCFLAGS+=$(BUSYDETECT)$(OPTIONS)
-MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs main
+MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs tests main
OTHER_SUBDIRS:=utils agi
SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
@@ -292,7 +293,12 @@
SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
endif
-SUBMAKE=$(MAKE) --quiet --no-print-directory
+SILENTMAKE:=$(MAKE) --quiet --no-print-directory
+ifneq ($(PRINT_DIR)$(NOISY_BUILD),)
+SUBMAKE:=$(MAKE)
+else
+SUBMAKE:=$(MAKE) --quiet --no-print-directory
+endif
# This is used when generating the doxygen documentation
ifneq ($(DOT),:)
@@ -329,13 +335,13 @@
endif
$(MOD_SUBDIRS_EMBED_LDSCRIPT):
- +@echo "EMBED_LDSCRIPTS+="`$(SUBMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
+ +@echo "EMBED_LDSCRIPTS+="`$(SILENTMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
$(MOD_SUBDIRS_EMBED_LDFLAGS):
- +@echo "EMBED_LDFLAGS+="`$(SUBMAKE) -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
+ +@echo "EMBED_LDFLAGS+="`$(SILENTMAKE) -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
$(MOD_SUBDIRS_EMBED_LIBS):
- +@echo "EMBED_LIBS+="`$(SUBMAKE) -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
+ +@echo "EMBED_LIBS+="`$(SILENTMAKE) -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
$(MOD_SUBDIRS_MENUSELECT_TREE):
+@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
@@ -624,6 +630,7 @@
echo " ; to the device. It is for this reason that this is optional, as it may result in requiring a" ; \
echo " ; temporary codec translation path for a channel that may not otherwise require one." ; \
echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
+ echo ";sendfullybooted = yes ; Send the FullyBooted AMI event on AMI login and when all modules are finished loading" ; \
echo ";runuser = asterisk ; The user to run as" ; \
echo ";rungroup = asterisk ; The group to run as" ; \
echo ";dahdichanname = yes ; Channels created by chan_dahdi will be called 'DAHDI', otherwise 'Zap'" ; \
@@ -782,7 +789,7 @@
-@menuselect/nmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
# options for make in menuselect/
-MAKE_MENUSELECT=CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
+MAKE_MENUSELECT=CC="$(BUILD_CC)" CXX="" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
menuselect/menuselect: menuselect/makeopts
+$(MAKE_MENUSELECT) menuselect
@@ -804,8 +811,8 @@
@echo "<?xml version=\"1.0\"?>" > $@
@echo >> $@
@echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
- +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
- +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
+ +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
+ +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
@cat build_tools/cflags.xml >> $@
@if [ "${AST_DEVMODE}" = "yes" ]; then \
cat build_tools/cflags-devmode.xml >> $@; \
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/apps/app_amd.c
^
|
@@ -21,7 +21,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 232355 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 277182 $")
#include <stdio.h>
#include <stdlib.h>
@@ -215,10 +215,11 @@
if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_NULL || f->frametype == AST_FRAME_CNG) {
/* If the total time exceeds the analysis time then give up as we are not too sure */
- if (f->frametype == AST_FRAME_VOICE)
+ if (f->frametype == AST_FRAME_VOICE) {
framelength = (ast_codec_get_samples(f) / DEFAULT_SAMPLES_PER_MS);
- else
- framelength += 2 * maxWaitTimeForFrame;
+ } else {
+ framelength = 2 * maxWaitTimeForFrame;
+ }
iTotalTime += framelength;
if (iTotalTime >= totalAnalysisTime) {
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/apps/app_dial.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 255503 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 281566 $")
#include <stdlib.h>
#include <errno.h>
@@ -534,7 +534,9 @@
ast_channel_inherit_variables(in, o->chan);
ast_channel_datastore_inherit(in, o->chan);
} else
- ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
+ ast_log(LOG_NOTICE,
+ "Forwarding failed to create channel to dial '%s/%s' (cause = %d)\n",
+ tech, stuff, cause);
}
if (!c) {
ast_clear_flag(o, DIAL_STILLGOING);
@@ -569,8 +571,9 @@
if (c->cid.cid_rdnis)
free(c->cid.cid_rdnis);
c->cid.cid_rdnis = ast_strdup(S_OR(in->macroexten, in->exten));
- if (ast_call(c, tmpchan, 0)) {
- ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
+ if (ast_call(c, stuff, 0)) {
+ ast_log(LOG_NOTICE, "Forwarding failed to dial '%s/%s'\n",
+ tech, stuff);
ast_clear_flag(o, DIAL_STILLGOING);
ast_hangup(c);
c = o->chan = NULL;
@@ -1707,6 +1710,11 @@
}
if (chan && peer && ast_test_flag(&opts, OPT_GOTO) && !ast_strlen_zero(opt_args[OPT_ARG_GOTO])) {
+ /* chan and peer are going into the PBX, they both
+ * should probably get CDR records. */
+ ast_clear_flag(chan->cdr, AST_CDR_FLAG_DIALED);
+ ast_clear_flag(peer->cdr, AST_CDR_FLAG_DIALED);
+
replace_macro_delimiter(opt_args[OPT_ARG_GOTO]);
ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]);
/* peer goes to the same context and extension as chan, so just copy info from chan*/
@@ -1848,8 +1856,9 @@
sentringing = 0;
ast_indicate(chan, -1);
}
- /* Be sure no generators are left on it */
+ /* Be sure no generators are left on it and reset the visible indication */
ast_deactivate_generator(chan);
+ chan->visible_indication = 0;
/* Make sure channels are compatible */
res = ast_channel_make_compatible(chan, peer);
if (res < 0) {
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/apps/app_directory.c
^
|
@@ -27,7 +27,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 165255 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 263769 $")
#include <string.h>
#include <ctype.h>
@@ -329,6 +329,14 @@
if (res < 0) /* User hungup, so jump out now */
break;
+ if (res == '0') {
+ if (!ast_goto_if_exists(chan, dialcontext, "o", 1) ||
+ (!ast_strlen_zero(chan->macrocontext) &&
+ !ast_goto_if_exists(chan, chan->macrocontext, "o", 1))) {
+ /* return 1 to indicate goto has been performed */
+ return '1';
+ }
+ }
if (res == '1') { /* Name selected */
if (fromappvm) {
/* We still want to set the exten though */
@@ -346,6 +354,8 @@
}
if (res == '*') /* Skip to next match in list */
break;
+ if (res == '#')
+ break;
/* Not '1', or '*', so decrement number of tries */
res = 0;
@@ -516,6 +526,9 @@
lastuserchoice = res;
res = 0;
break;
+ case '#':
+ lastuserchoice = res;
+ return 0;
default:
break;
}
@@ -645,6 +658,8 @@
dirintro = ast_variable_retrieve(cfg, "general", "directoryintro");
if (ast_strlen_zero(dirintro))
dirintro = last ? "dir-intro" : "dir-intro-fn";
+ /* the above prompts probably should be modified to include 0 for dialing operator
+ and # for exiting (continues in dialplan) */
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/apps/app_meetme.c
^
|
@@ -35,7 +35,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 248268 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 280341 $")
#include <stdlib.h>
#include <stdio.h>
@@ -362,7 +362,7 @@
struct ast_frame *transframe[32];
struct ast_frame *origframe;
struct ast_trans_pvt *transpath[32];
- AST_LIST_HEAD_NOLOCK(, ast_conf_user) userlist;
+ struct ao2_container *usercontainer;
AST_LIST_ENTRY(ast_conference) list;
/* announce_thread related data */
pthread_t announcethread;
@@ -752,6 +752,30 @@
ast_autoservice_stop(chan);
}
+static int user_no_cmp(void *obj, void *arg, int flags)
+{
+ struct ast_conf_user *user = obj;
+ int *user_no = arg;
+
+ if (user->user_no == *user_no) {
+ return (CMP_MATCH | CMP_STOP);
+ }
+
+ return 0;
+}
+
+static int user_max_cmp(void *obj, void *arg, int flags)
+{
+ struct ast_conf_user *user = obj;
+ int *max_no = arg;
+
+ if (user->user_no > *max_no) {
+ *max_no = user->user_no;
+ }
+
+ return 0;
+}
+
/*!
* \brief Find or create a conference
*
@@ -782,8 +806,10 @@
goto cnfout;
/* Make a new one */
- if (!(cnf = ast_calloc(1, sizeof(*cnf))))
+ if (!(cnf = ast_calloc(1, sizeof(*cnf))) ||
+ !(cnf->usercontainer = ao2_container_alloc(1, NULL, user_no_cmp))) {
goto cnfout;
+ }
ast_mutex_init(&cnf->playlock);
ast_mutex_init(&cnf->listenlock);
@@ -939,6 +965,7 @@
strncat(cmdline, argv[3], sizeof(cmdline) - strlen(cmdline) - 1);
}
} else if(strcmp(argv[1], "list") == 0) {
+ struct ao2_iterator user_iter;
int concise = ( 4 == argc && ( !strcasecmp(argv[3], "concise") ) );
/* List all the users in a conference */
if (AST_LIST_EMPTY(&confs)) {
@@ -960,11 +987,12 @@
}
/* Show all the users */
time(&now);
- AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
+ user_iter = ao2_iterator_init(cnf->usercontainer, 0);
+ while((user = ao2_iterator_next(&user_iter))) {
hr = (now - user->jointime) / 3600;
min = ((now - user->jointime) % 3600) / 60;
sec = (now - user->jointime) % 60;
- if ( !concise )
+ if (!concise) {
ast_cli(fd, "User #: %-2.2d %12.12s %-20.20s Channel: %s %s %s %s %s %02d:%02d:%02d\n",
user->user_no,
S_OR(user->chan->cid.cid_num, "<unknown>"),
@@ -974,7 +1002,7 @@
user->userflags & CONFFLAG_MONITOR ? "(Listen only)" : "",
user->adminflags & ADMINFLAG_MUTED ? "(Admin Muted)" : user->adminflags & ADMINFLAG_SELFMUTED ? "(Muted)" : "",
istalking(user->talking), hr, min, sec);
- else
+ } else {
ast_cli(fd, "%d!%s!%s!%s!%s!%s!%s!%d!%02d:%02d:%02d\n",
user->user_no,
S_OR(user->chan->cid.cid_num, ""),
@@ -984,8 +1012,10 @@
user->userflags & CONFFLAG_MONITOR ? "1" : "",
user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED) ? "1" : "",
user->talking, hr, min, sec);
-
+ }
+ ao2_ref(user, -1);
}
+ ao2_iterator_destroy(&user_iter);
if ( !concise )
ast_cli(fd,"%d users in that conference.\n",cnf->users);
AST_LIST_UNLOCK(&confs);
@@ -1044,15 +1074,21 @@
}
if (cnf) {
+ struct ao2_iterator user_iter;
+ user_iter = ao2_iterator_init(cnf->usercontainer, 0);
/* Search for the user */
- AST_LIST_TRAVERSE(&cnf->userlist, usr, list) {
+ while((usr = ao2_iterator_next(&user_iter))) {
snprintf(usrno, sizeof(usrno), "%d", usr->user_no);
- if (!strncasecmp(word, usrno, len) && ++which > state)
+ if (!strncasecmp(word, usrno, len) && ++which > state) {
+ ao2_ref(usr, -1);
break;
+ }
+ ao2_ref(usr, -1);
}
+ ao2_iterator_destroy(&user_iter);
+ AST_LIST_UNLOCK(&confs);
+ return usr ? strdup(usrno) : NULL;
}
- AST_LIST_UNLOCK(&confs);
- return usr ? strdup(usrno) : NULL;
} else if ( strstr(line, "list") && ( 0 == state ) )
return strdup("concise");
}
@@ -1302,6 +1338,9 @@
ast_hangup(conf->chan);
if (conf->fd >= 0)
close(conf->fd);
+ if (conf->usercontainer) {
+ ao2_ref(conf->usercontainer, -1);
+ }
ast_mutex_destroy(&conf->playlock);
ast_mutex_destroy(&conf->listenlock);
@@ -1317,13 +1356,19 @@
const struct ast_conf_user *sender, struct ast_frame *f)
{
struct ast_conf_user *user;
+ struct ao2_iterator user_iter;
- AST_LIST_TRAVERSE(&conf->userlist, user, list) {
- if (user == sender)
+ user_iter = ao2_iterator_init(conf->usercontainer, 0);
+ while ((user = ao2_iterator_next(&user_iter))) {
+ if (user == sender) {
+ ao2_ref(user, -1);
continue;
+ }
if (ast_write(user->chan, f) < 0)
ast_log(LOG_WARNING, "Error writing frame to channel %s\n", user->chan->name);
+ ao2_ref(user, -1);
}
+ ao2_iterator_destroy(&user_iter);
}
static void sla_queue_event_full(enum sla_event_type type,
@@ -1564,8 +1609,9 @@
int setusercount = 0;
int confsilence = 0, totalsilence = 0;
- if (!(user = ast_calloc(1, sizeof(*user))))
+ if (!(user = ao2_alloc(sizeof(*user), NULL))) {
return ret;
+ }
/* Possible timeout waiting for marked user */
if ((confflags & CONFFLAG_WAITMARKED) &&
@@ -1630,13 +1676,11 @@
}
ast_mutex_lock(&conf->playlock);
-
- if (AST_LIST_EMPTY(&conf->userlist))
- user->user_no = 1;
- else
- user->user_no = AST_LIST_LAST(&conf->userlist)->user_no + 1;
-
- AST_LIST_INSERT_TAIL(&conf->userlist, user, list);
+ ao2_lock(conf->usercontainer);
+ ao2_callback(conf->usercontainer, OBJ_NODATA, user_max_cmp, &user->user_no);
+ user->user_no++;
+ ao2_link(conf->usercontainer, user);
+ ao2_unlock(conf->usercontainer);
user->chan = chan;
user->userflags = confflags;
@@ -1870,6 +1914,9 @@
conf_flush(fd, chan);
+ if (dsp)
+ ast_dsp_free(dsp);
+
if (!(dsp = ast_dsp_new())) {
ast_log(LOG_WARNING, "Unable to allocate DSP!\n");
res = -1;
@@ -2202,15 +2249,21 @@
}
break;
case '3': /* Eject last user */
+ {
+ int max_no = 0;
+ ao2_callback(conf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
menu_active = 0;
- usr = AST_LIST_LAST(&conf->userlist);
+ usr = ao2_find(conf->usercontainer, &max_no, 0);
if ((usr->chan->name == chan->name)||(usr->userflags & CONFFLAG_ADMIN)) {
if(!ast_streamfile(chan, "conf-errormenu", chan->language))
ast_waitstream(chan, "");
- } else
+ } else {
usr->adminflags |= ADMINFLAG_KICKME;
+ }
+ ao2_ref(user, -1);
ast_stopstream(chan);
break;
+ }
case '4':
tweak_listen_volume(user, VOL_DOWN);
break;
@@ -2322,6 +2375,20 @@
}
} else if (f->frametype == AST_FRAME_NULL) {
/* Ignore NULL frames. It is perfectly normal to get these if the person is muted. */
+ } else if (f->frametype == AST_FRAME_CONTROL) {
+ switch (f->subclass) {
+ case AST_CONTROL_BUSY:
+ case AST_CONTROL_CONGESTION:
+ ast_frfree(f);
+ goto outrun;
+ break;
+ default:
+ if (option_debug) {
+ ast_log(LOG_DEBUG,
+ "Got ignored control frame on channel %s, f->frametype=%d,f->subclass=%d\n",
+ chan->name, f->frametype, f->subclass);
+ }
+ }
} else if (option_debug) {
ast_log(LOG_DEBUG,
"Got unrecognized frame on channel %s, f->frametype=%d,f->subclass=%d\n",
@@ -2352,6 +2419,10 @@
ast_mutex_lock(&conf->listenlock);
if (!conf->transframe[index]) {
if (conf->origframe) {
+ if (musiconhold && !ast_dsp_silence(dsp, conf->origframe, &confsilence) && confsilence < MEETME_DELAYDETECTTALK) {
+ ast_moh_stop(chan);
+ mohtempstopped = 1;
+ }
if (!conf->transpath[index])
conf->transpath[index] = ast_translator_build_path((1 << index), AST_FORMAT_SLINEAR);
if (conf->transpath[index]) {
@@ -2365,11 +2436,6 @@
if ((conf->transframe[index]->frametype != AST_FRAME_NULL) &&
can_write(chan, confflags)) {
struct ast_frame *cur;
- if (musiconhold && !ast_dsp_silence(dsp, conf->transframe[index], &confsilence) && confsilence < MEETME_DELAYDETECTTALK) {
- ast_moh_stop(chan);
- mohtempstopped = 1;
- }
-
/* the translator may have returned a list of frames, so
write each one onto the channel
*/
@@ -2457,7 +2523,9 @@
if (dsp)
ast_dsp_free(dsp);
- if (user->user_no) { /* Only cleanup users who really joined! */
+ if (!user->user_no) {
+ ao2_ref(user, -1);
+ } else { /* Only cleanup users who really joined! */
now = time(NULL);
hr = (now - user->jointime) / 3600;
min = ((now - user->jointime) % 3600) / 60;
@@ -2487,8 +2555,8 @@
if (confflags & CONFFLAG_MARKEDUSER)
conf->markedusers--;
}
- /* Remove ourselves from the list */
- AST_LIST_REMOVE(&conf->userlist, user, list);
+ /* Remove ourselves from the container */
+ ao2_unlink(conf->usercontainer, user);
/* Change any states */
if (!conf->users)
@@ -2498,7 +2566,6 @@
snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
}
- free(user);
AST_LIST_UNLOCK(&confs);
return ret;
@@ -2874,10 +2941,10 @@
if (allowretry)
confno[0] = '\0';
} else {
- if ((!ast_strlen_zero(cnf->pin) &&
- !ast_test_flag(&confflags, CONFFLAG_ADMIN)) ||
- (!ast_strlen_zero(cnf->pinadmin) &&
- ast_test_flag(&confflags, CONFFLAG_ADMIN))) {
+ if (((!ast_strlen_zero(cnf->pin) &&
+ !ast_test_flag(&confflags, CONFFLAG_ADMIN)) ||
+ !ast_strlen_zero(cnf->pinadmin)) &&
+ (!(cnf->users == 0 && cnf->isdynamic))) {
char pin[MAX_PIN] = "";
int j;
@@ -2960,14 +3027,71 @@
sscanf(callerident, "%30i", &cid);
if (conf && callerident) {
- AST_LIST_TRAVERSE(&conf->userlist, user, list) {
- if (cid == user->user_no)
- return user;
- }
+ user = ao2_find(conf->usercontainer, &cid, 0);
+ /* reference decremented later in admin_exec */
+ return user;
}
return NULL;
}
+static int user_set_kickme_cb(void *obj, void *unused, int flags)
+{
+ struct ast_conf_user *user = obj;
+ user->adminflags |= ADMINFLAG_KICKME;
+ return 0;
+}
+
+static int user_set_muted_cb(void *obj, void *unused, int flags)
+{
+ struct ast_conf_user *user = obj;
+ if (!(user->userflags & CONFFLAG_ADMIN)) {
+ user->adminflags |= ADMINFLAG_MUTED;
+ }
+ return 0;
+}
+
+static int user_set_unmuted_cb(void *obj, void *unused, int flags)
+{
+ struct ast_conf_user *user = obj;
+ user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
+ return 0;
+}
+
+static int user_listen_volup_cb(void *obj, void *unused, int flags)
+{
+ struct ast_conf_user *user = obj;
+ tweak_listen_volume(user, VOL_UP);
+ return 0;
+}
+
+static int user_listen_voldown_cb(void *obj, void *unused, int flags)
+{
+ struct ast_conf_user *user = obj;
+ tweak_listen_volume(user, VOL_DOWN);
+ return 0;
+}
+
+static int user_talk_volup_cb(void *obj, void *unused, int flags)
+{
+ struct ast_conf_user *user = obj;
+ tweak_talk_volume(user, VOL_UP);
+ return 0;
+}
+
+static int user_talk_voldown_cb(void *obj, void *unused, int flags)
+{
+ struct ast_conf_user *user = obj;
+ tweak_talk_volume(user, VOL_DOWN);
+ return 0;
+}
+
+static int user_reset_vol_cb(void *obj, void *unused, int flags)
+{
+ struct ast_conf_user *user = obj;
+ reset_volumes(user);
+ return 0;
+}
+
/*! \brief The MeetMeadmin application */
/* MeetMeAdmin(confno, command, caller) */
static int admin_exec(struct ast_channel *chan, void *data) {
@@ -3013,8 +3137,13 @@
ast_atomic_fetchadd_int(&cnf->refcount, 1);
- if (args.user)
+ if (args.user) {
user = find_user(cnf, args.user);
+ if (!user) {
+ ast_log(LOG_NOTICE, "Specified User not found!\n");
+ goto usernotfound;
+ }
+ }
switch (*args.command) {
case 76: /* L: Lock */
@@ -3024,96 +3153,72 @@
cnf->locked = 0;
break;
case 75: /* K: kick all users */
- AST_LIST_TRAVERSE(&cnf->userlist, user, list)
- user->adminflags |= ADMINFLAG_KICKME;
+ ao2_callback(cnf->usercontainer, 0, user_set_kickme_cb, NULL);
break;
case 101: /* e: Eject last user*/
- user = AST_LIST_LAST(&cnf->userlist);
+ {
+ int max_no = 0;
+ ao2_callback(cnf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
+ user = ao2_find(cnf->usercontainer, &max_no, 0);
if (!(user->userflags & CONFFLAG_ADMIN))
user->adminflags |= ADMINFLAG_KICKME;
else
ast_log(LOG_NOTICE, "Not kicking last user, is an Admin!\n");
+ ao2_ref(user, -1);
break;
+ }
case 77: /* M: Mute */
- if (user) {
- user->adminflags |= ADMINFLAG_MUTED;
- } else
- ast_log(LOG_NOTICE, "Specified User not found!\n");
+ user->adminflags |= ADMINFLAG_MUTED;
break;
case 78: /* N: Mute all (non-admin) users */
- AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
- if (!(user->userflags & CONFFLAG_ADMIN))
- user->adminflags |= ADMINFLAG_MUTED;
- }
+ ao2_callback(cnf->usercontainer, 0, user_set_muted_cb, NULL);
break;
case 109: /* m: Unmute */
- if (user) {
- user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
- } else
- ast_log(LOG_NOTICE, "Specified User not found!\n");
+ user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
break;
case 110: /* n: Unmute all users */
- AST_LIST_TRAVERSE(&cnf->userlist, user, list)
- user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
+ ao2_callback(cnf->usercontainer, 0, user_set_unmuted_cb, NULL);
break;
case 107: /* k: Kick user */
- if (user)
- user->adminflags |= ADMINFLAG_KICKME;
- else
- ast_log(LOG_NOTICE, "Specified User not found!\n");
+ user->adminflags |= ADMINFLAG_KICKME;
break;
case 118: /* v: Lower all users listen volume */
- AST_LIST_TRAVERSE(&cnf->userlist, user, list)
- tweak_listen_volume(user, VOL_DOWN);
+ ao2_callback(cnf->usercontainer, 0, user_listen_voldown_cb, NULL);
break;
case 86: /* V: Raise all users listen volume */
- AST_LIST_TRAVERSE(&cnf->userlist, user, list)
- tweak_listen_volume(user, VOL_UP);
+ ao2_callback(cnf->usercontainer, 0, user_listen_volup_cb, NULL);
break;
case 115: /* s: Lower all users speaking volume */
- AST_LIST_TRAVERSE(&cnf->userlist, user, list)
- tweak_talk_volume(user, VOL_DOWN);
+ ao2_callback(cnf->usercontainer, 0, user_talk_voldown_cb, NULL);
break;
case 83: /* S: Raise all users speaking volume */
- AST_LIST_TRAVERSE(&cnf->userlist, user, list)
- tweak_talk_volume(user, VOL_UP);
+ ao2_callback(cnf->usercontainer, 0, user_talk_volup_cb, NULL);
break;
case 82: /* R: Reset all volume levels */
- AST_LIST_TRAVERSE(&cnf->userlist, user, list)
- reset_volumes(user);
+ ao2_callback(cnf->usercontainer, 0, user_reset_vol_cb, NULL);
break;
case 114: /* r: Reset user's volume level */
- if (user)
- reset_volumes(user);
- else
- ast_log(LOG_NOTICE, "Specified User not found!\n");
+ reset_volumes(user);
break;
case 85: /* U: Raise user's listen volume */
- if (user)
- tweak_listen_volume(user, VOL_UP);
- else
- ast_log(LOG_NOTICE, "Specified User not found!\n");
+ tweak_listen_volume(user, VOL_UP);
break;
case 117: /* u: Lower user's listen volume */
- if (user)
- tweak_listen_volume(user, VOL_DOWN);
- else
- ast_log(LOG_NOTICE, "Specified User not found!\n");
+ tweak_listen_volume(user, VOL_DOWN);
break;
case 84: /* T: Raise user's talk volume */
- if (user)
- tweak_talk_volume(user, VOL_UP);
- else
- ast_log(LOG_NOTICE, "Specified User not found!\n");
+ tweak_talk_volume(user, VOL_UP);
break;
case 116: /* t: Lower user's talk volume */
- if (user)
- tweak_talk_volume(user, VOL_DOWN);
- else
- ast_log(LOG_NOTICE, "Specified User not found!\n");
+ tweak_talk_volume(user, VOL_DOWN);
break;
}
+ if (args.user) {
+ /* decrement reference from find_user */
+ ao2_ref(user, -1);
+ }
+usernotfound:
AST_LIST_UNLOCK(&confs);
dispose_conf(cnf);
@@ -3161,9 +3266,7 @@
return 0;
}
- AST_LIST_TRAVERSE(&conf->userlist, user, list)
- if (user->user_no == userno)
- break;
+ user = ao2_find(conf->usercontainer, &userno, 0);
if (!user) {
AST_LIST_UNLOCK(&confs);
@@ -3180,6 +3283,7 @@
ast_log(LOG_NOTICE, "Requested to %smute conf %s user %d userchan %s uniqueid %s\n", mute ? "" : "un", conf->confno, user->user_no, user->chan->name, user->chan->uniqueid);
+ ao2_ref(user, -1);
astman_send_ack(s, m, mute ? "User muted" : "User unmuted");
return 0;
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/apps/app_queue.c
^
|
@@ -62,7 +62,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 265891 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 279206 $")
#include <stdlib.h>
#include <errno.h>
@@ -574,10 +574,13 @@
struct member *member;
struct ao2_iterator mem_iter;
enum queue_member_status result = QUEUE_NO_MEMBERS;
+ int allpaused = 1, empty = 1;
ao2_lock(q);
mem_iter = ao2_iterator_init(q->members, 0);
while ((member = ao2_iterator_next(&mem_iter))) {
+ empty = 0;
+
if (max_penalty && (member->penalty > max_penalty)) {
ao2_ref(member, -1);
continue;
@@ -586,6 +589,8 @@
if (member->paused) {
ao2_ref(member, -1);
continue;
+ } else {
+ allpaused = 0;
}
switch (member->status) {
@@ -605,6 +610,10 @@
}
ao2_iterator_destroy(&mem_iter);
ao2_unlock(q);
+
+ if (!empty && allpaused) {
+ result = QUEUE_NO_REACHABLE_MEMBERS;
+ }
return result;
}
@@ -1532,6 +1541,10 @@
return 0;
}
+ if (!ast_fileexists(filename, NULL, chan->language)) {
+ return 0;
+ }
+
ast_stopstream(chan);
res = ast_streamfile(chan, filename, chan->language);
@@ -2308,7 +2321,9 @@
/* Setup parameters */
o->chan = ast_request(tech, in->nativeformats, stuff, &status);
if (!o->chan) {
- ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s'\n", tech, stuff);
+ ast_log(LOG_NOTICE,
+ "Forwarding failed to create channel to dial '%s/%s'\n",
+ tech, stuff);
o->stillgoing = 0;
numnochan++;
} else {
@@ -2333,8 +2348,9 @@
if (o->chan->cid.cid_rdnis)
free(o->chan->cid.cid_rdnis);
o->chan->cid.cid_rdnis = ast_strdup(S_OR(in->macroexten, in->exten));
- if (ast_call(o->chan, tmpchan, 0)) {
- ast_log(LOG_NOTICE, "Failed to dial on local channel for call forward to '%s'\n", tmpchan);
+ if (ast_call(o->chan, stuff, 0)) {
+ ast_log(LOG_NOTICE, "Forwarding failed to dial '%s/%s'\n",
+ tech, stuff);
do_hang(o);
numnochan++;
}
@@ -3282,6 +3298,20 @@
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld",
qe->chan->exten, qe->chan->context, (long) (callstart - qe->start),
(long) (time(NULL) - callstart));
+ if (qe->parent->eventwhencalled)
+ manager_event(EVENT_FLAG_AGENT, "AgentComplete",
+ "Queue: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Channel: %s\r\n"
+ "Member: %s\r\n"
+ "MemberName: %s\r\n"
+ "HoldTime: %ld\r\n"
+ "TalkTime: %ld\r\n"
+ "Reason: transfer\r\n"
+ "%s",
+ queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername,
+ (long)(callstart - qe->start), (long)(time(NULL) - callstart),
+ qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
} else if (qe->chan->_softhangup) {
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETECALLER", "%ld|%ld|%d",
(long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos);
@@ -3307,12 +3337,13 @@
"Queue: %s\r\n"
"Uniqueid: %s\r\n"
"Channel: %s\r\n"
+ "Member: %s\r\n"
"MemberName: %s\r\n"
"HoldTime: %ld\r\n"
"TalkTime: %ld\r\n"
"Reason: agent\r\n"
"%s",
- queuename, qe->chan->uniqueid, peer->name, member->membername, (long)(callstart - qe->start),
+ queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername, (long)(callstart - qe->start),
(long)(time(NULL) - callstart),
qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
}
@@ -3320,6 +3351,21 @@
ast_channel_datastore_remove(qe->chan, tds);
}
update_queue(qe->parent, member, callcompletedinsl);
+ } else {
+ if (qe->parent->eventwhencalled)
+ manager_event(EVENT_FLAG_AGENT, "AgentComplete",
+ "Queue: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "Channel: %s\r\n"
+ "Member: %s\r\n"
+ "MemberName: %s\r\n"
+ "HoldTime: %ld\r\n"
+ "TalkTime: %ld\r\n"
+ "Reason: transfer\r\n"
+ "%s",
+ queuename, qe->chan->uniqueid, peer->name, member->interface, member->membername, (long)(callstart - qe->start),
+ (long)(time(NULL) - callstart),
+ qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
}
if (transfer_ds) {
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/apps/app_speech_utils.c
^
|
@@ -27,7 +27,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 177383 $");
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 264334 $");
#include <stdio.h>
#include <stdlib.h>
@@ -735,6 +735,7 @@
if (dtmf_terminator != '\0' && f->subclass == dtmf_terminator) {
done = 1;
} else {
+ quieted = 1;
if (chan->stream != NULL) {
ast_stopstream(chan);
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/apps/app_voicemail.c
^
|
@@ -52,7 +52,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 260923 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 278261 $")
#include <stdlib.h>
#include <errno.h>
@@ -1193,9 +1193,10 @@
fprintf(text_file_ptr, "%s\n", "[message]");
- cid_num = get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Num:");
cid_name = get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Name:");
- fprintf(text_file_ptr, "callerid=\"%s\" <%s>\n", S_OR(cid_name, ""), S_OR(cid_num, ""));
+ fprintf(text_file_ptr, "callerid=\"%s\" ", S_OR(cid_name, ""));
+ cid_num = get_header_by_tag(header_content, "X-Asterisk-VM-Caller-ID-Num:");
+ fprintf(text_file_ptr, "<%s>\n", S_OR(cid_num, ""));
context = get_header_by_tag(header_content, "X-Asterisk-VM-Context:");
fprintf(text_file_ptr, "context=%s\n", S_OR(context, ""));
origtime = get_header_by_tag(header_content, "X-Asterisk-VM-Orig-time:");
@@ -3543,7 +3544,7 @@
ast_log(LOG_DEBUG, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", attach, format, vmu->volgain, mailbox);
}
} else {
- ast_log(LOG_WARNING, "Sox failed to reencode %s.%s: %s (have you installed support for all sox file formats?)\n", attach, format,
+ ast_log(LOG_WARNING, "Sox failed to re-encode %s.%s: %s (have you installed support for all sox file formats?)\n", attach, format,
soxstatus == 1 ? "Problem with command line options" : "An error occurred during file processing");
ast_log(LOG_WARNING, "Voicemail attachment will have no volume gain.\n");
}
@@ -5954,12 +5955,15 @@
DELETE(vms->curdir, x, vms->fn, vmu);
}
ast_unlock_path(vms->curdir);
-#else
+#else /* defined(IMAP_STORAGE) */
if (vms->deleted) {
- for (x=0;x < vmu->maxmsg;x++) {
- if (vms->deleted[x]) {
- if (option_debug > 2)
- ast_log(LOG_DEBUG,"IMAP delete of %d\n",x);
+ /* Since we now expunge after each delete, deleting in reverse order
+ * ensures that no reordering occurs between each step. */
+ for (x = vmu->maxmsg - 1; x >= 0; x--) {
+ if (vms->deleted[x]) {
+ if (option_debug > 2) {
+ ast_log(LOG_DEBUG, "IMAP delete of %d\n", x);
+ }
DELETE(vms->curdir, x, vms->fn, vmu);
}
}
@@ -6886,6 +6890,7 @@
/* Play voicemail intro - syntax is different for different languages */
if (0) {
+ return 0;
} else if (!strncasecmp(chan->language, "cs", 2)) { /* CZECH syntax */
return vm_intro_cs(chan, vms);
} else if (!strncasecmp(chan->language, "cz", 2)) { /* deprecated CZECH syntax */
@@ -8146,6 +8151,9 @@
}
res = leave_voicemail(chan, args.argv0, &leave_options);
+ if (res == OPERATOR_EXIT) {
+ res = 0;
+ }
if (res == ERROR_LOCK_PATH) {
ast_log(LOG_ERROR, "Could not leave voicemail. The path is already locked.\n");
@@ -9487,7 +9495,7 @@
return 1;
#endif
case '0':
- if (!ast_test_flag(vmu, VM_OPERATOR)) {
+ if (!ast_test_flag(vmu, VM_OPERATOR) || !outsidecaller) {
cmd = ast_play_and_wait(chan, "vm-sorry");
break;
}
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/asterisk-1.4.36-summary.html
^
|
@@ -0,0 +1,218 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.4.36</title></head>
+<body>
+<h1 align="center"><a name="top">Release Summary</a></h1>
+<h3 align="center">asterisk-1.4.36</h3>
+<h3 align="center">Date: 2010-09-13</h3>
+<h3 align="center"><asteriskteam@digium.com></h3>
+<hr/>
+<h2 align="center">Table of Contents</h2>
+<ol>
+ <li><a href="#summary">Summary</a></li>
+ <li><a href="#contributors">Contributors</a></li>
+ <li><a href="#issues">Closed Issues</a></li>
+ <li><a href="#commits">Other Changes</a></li>
+ <li><a href="#diffstat">Diffstat</a></li>
+</ol>
+<hr/>
+<a name="summary"><h2 align="center">Summary</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This release includes only bug fixes. The changes included were made only to address problems that have been identified in this release series. Users should be able to safely upgrade to this version if this release series is already in use. Users considering upgrading from a previous release series are strongly encouraged to review the UPGRADE.txt document as well as the CHANGES document for information about upgrading to this release series.</p>
+<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.4.35.</p>
+<hr/>
+<a name="contributors"><h2 align="center">Contributors</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
+<table width="100%" border="0">
+<tr>
+<td width="33%"><h3>Coders</h3></td>
+<td width="33%"><h3>Testers</h3></td>
+<td width="33%"><h3>Reporters</h3></td>
+</tr>
+<tr valign="top">
+<td>
+4 dvossel<br/>
+4 tilghman<br/>
+3 jpeeler<br/>
+3 rmudgett<br/>
+2 RoadKill<br/>
+2 twilson<br/>
+1 addix<br/>
+1 jeang<br/>
+1 klaus3000<br/>
+1 lmadsen<br/>
+1 mmichelson<br/>
+1 nic<br/>
+1 qwell<br/>
+1 russell<br/>
+1 snuffy<br/>
+</td>
+<td>
+1 addix<br/>
+1 dvossel<br/>
+1 jstapleton<br/>
+1 manvirr<br/>
+1 schmidts<br/>
+1 sdolloff<br/>
+1 sybasesql<br/>
+1 twilson<br/>
+1 zerohalo<br/>
+</td>
+<td>
+2 manvirr<br/>
+2 RoadKill<br/>
+1 addix<br/>
+1 anonymouz666<br/>
+1 jstapleton<br/>
+1 klaus3000<br/>
+1 kobaz<br/>
+1 nic_bellamy<br/>
+1 nickb<br/>
+1 sdolloff<br/>
+1 sybasesql<br/>
+1 wuwu<br/>
+1 zerohalo<br/>
+</td>
+</tr>
+</table>
+<hr/>
+<a name="issues"><h2 align="center">Closed Issues</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all issues from the issue tracker that were closed by changes that went into this release.</p>
+<h3>Category: Applications/General</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17080">#17080</a>: [patch] Asterisk crashes while core restart (#0 0x000000000050683c in term_beep (el=0x16cdd9b0) at term.c:865)<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=278981">278981</a><br/>
+Reporter: sybasesql<br/>
+Testers: sybasesql<br/>
+Coders: tilghman<br/>
+<br/>
+<h3>Category: Applications/app_chanspy</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17630">#17630</a>: [patch] Chanspy Keeps using G729 Encoder licenses even after the spying channel hangs up.<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=279945">279945</a><br/>
+Reporter: manvirr<br/>
+Coders: dvossel<br/>
+<br/>
+<a href="https://issues.asterisk.org/view.php?id=17630">#17630</a>: [patch] Chanspy Keeps using G729 Encoder licenses even after the spying channel hangs up.<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=280448">280448</a><br/>
+Reporter: manvirr<br/>
+Testers: manvirr, dvossel<br/>
+Coders: dvossel<br/>
+<br/>
+<h3>Category: Applications/app_dial</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17641">#17641</a>: [patch] reset visible_indication after call answering<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=281566">281566</a><br/>
+Reporter: klaus3000<br/>
+Testers: schmidts<br/>
+Coders: klaus3000<br/>
+<br/>
+<h3>Category: Applications/app_disa</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=16661">#16661</a>: [patch] DISA doesn't honor caller ID on the channel<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=280811">280811</a><br/>
+Reporter: jstapleton<br/>
+Testers: jstapleton<br/>
+Coders: tilghman<br/>
+<br/>
+<h3>Category: Channels/chan_dahdi</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17874">#17874</a>: [patch] Q931 - Sending PROGRESS after sending ALERTING is a protocol error<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=283048">283048</a><br/>
+Reporter: nic_bellamy<br/>
+Coders: nic<br/>
+<br/>
+<h3>Category: Channels/chan_iax2</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17138">#17138</a>: [patch] CallerID not properly set when using Originate and AGI<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=281390">281390</a><br/>
+Reporter: kobaz<br/>
+Coders: jpeeler<br/>
+<br/>
+<h3>Category: Channels/chan_sip/General</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17497">#17497</a>: [patch] [regression] Segmentation fault in scheduled event<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=281185">281185</a><br/>
+Reporter: anonymouz666<br/>
+Coders: dvossel<br/>
+<br/>
+<a href="https://issues.asterisk.org/view.php?id=17643">#17643</a>: [patch] dialplan reload deadlocks in ast_rdlock_contexts when calling ast_hint_state_changed<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=280982">280982</a><br/>
+Reporter: zerohalo<br/>
+Testers: zerohalo<br/>
+Coders: tilghman<br/>
+<br/>
+<a href="https://issues.asterisk.org/view.php?id=17712">#17712</a>: TOS_SIP does not get set<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=282893">282893</a><br/>
+Reporter: nickb<br/>
+Coders: dvossel<br/>
+<br/>
+<h3>Category: Channels/chan_sip/Transfers</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17007">#17007</a>: [patch] RTP Timestamp changes after transfer, but SSRC not and the markerbit ist not set.<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=282430">282430</a><br/>
+Reporter: addix<br/>
+Testers: addix, twilson<br/>
+Coders: addix, twilson<br/>
+<br/>
+<h3>Category: Core/Configuration</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17833">#17833</a>: [patch] say.conf has problem with large numbers<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=281762">281762</a><br/>
+Reporter: RoadKill<br/>
+Coders: RoadKill<br/>
+<br/>
+<a href="https://issues.asterisk.org/view.php?id=17836">#17836</a>: [patch] say.conf added support for Danish<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=281819">281819</a><br/>
+Reporter: RoadKill<br/>
+Coders: RoadKill<br/>
+<br/>
+<h3>Category: Core/RTP</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17404">#17404</a>: [patch] [regression] audio delay when bridging calls related to timestamp mismatch<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=281911">281911</a><br/>
+Reporter: sdolloff<br/>
+Testers: sdolloff<br/>
+Coders: jpeeler<br/>
+<br/>
+<h3>Category: General</h3><br/>
+<a href="https://issues.asterisk.org/view.php?id=17568">#17568</a>: [patch] DNID does not get cleard on new call<br/>
+Revision: <a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=278701">278701</a><br/>
+Reporter: wuwu<br/>
+Coders: rmudgett<br/>
+<br/>
+<hr/>
+<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
+<table width="100%" border="1">
+<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=278984">278984</a></td><td>tilghman</td><td>Establish a maximum version for openh323 (i.e. not opal), because chan_h323 will fail to load, even if it links.</td>
+<td><a href="https://issues.asterisk.org/view.php?id=17679">#17679</a></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=279053">279053</a></td><td>mmichelson</td><td>Backport fixes for sip_uri_params_cmp() from trunk.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=279206">279206</a></td><td>rmudgett</td><td>SIP promiscuous redirect could fail to dial the redirect.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=279344">279344</a></td><td>jpeeler</td><td>Provide a default value for DAHDI_TRANSCODE so when DAHDI is not installed</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=279346">279346</a></td><td>snuffy</td><td>Minor update to man page</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=280088">280088</a></td><td>lmadsen</td><td>Update help text to be less confusing.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=280341">280341</a></td><td>jeang</td><td>Fix a dsp structure leak occuring when a local channel is put into a meetme</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=280944">280944</a></td><td>russell</td><td>Copy astcli back to 1.4 so it's available for automated testing purposes.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=282129">282129</a></td><td>qwell</td><td>Register CLI commands before parsing config, in case there is a config error.</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=282729">282729</a></td><td>twilson</td><td>Add some documentation about codec negotiation to sip.conf</td>
+<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/branches/1.4?view=revision&revision=283123">283123</a></td><td>rmudgett</td><td>Merged revision 278274 from</td>
+<td></td></tr></table>
+<hr/>
+<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
+<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
+<pre>
+apps/app_dial.c | 12 +-
+apps/app_meetme.c | 3
+apps/app_queue.c | 9 +
+autoconf/ast_check_pwlib.m4 | 12 ++
+channels/chan_dahdi.c | 18 +--
+channels/chan_local.c | 20 +++
+channels/chan_sip.c | 204 +++++++++++++++++++++++++++------------
+configs/say.conf.sample | 96 +++++++++++++++++-
+configs/sip.conf.sample | 13 ++
+configure.ac | 3
+contrib/scripts/astcli | 167 +++++++++++++++++++++++++++++++
+contrib/scripts/live_ast | 2
+doc/asterisk.8 | 4
+funcs/func_callerid.c | 6 +
+include/asterisk/audiohook.h | 7 +
+include/asterisk/autoconfig.h.in | 51 ++++-----
+main/asterisk.c | 19 ++-
+main/audiohook.c | 12 ++
+main/channel.c | 27 ++++-
+main/pbx.c | 14 +-
+pbx/pbx_config.c | 7 -
+21 files changed, 572 insertions(+), 134 deletions(-)
+</pre><br/>
+<hr/>
+</body>
+</html>
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/asterisk-1.4.36-summary.txt
^
|
@@ -0,0 +1,273 @@
+ Release Summary
+
+ asterisk-1.4.36
+
+ Date: 2010-09-13
+
+ <asteriskteam@digium.com>
+
+ ----------------------------------------------------------------------
+
+ Table of Contents
+
+ 1. Summary
+ 2. Contributors
+ 3. Closed Issues
+ 4. Other Changes
+ 5. Diffstat
+
+ ----------------------------------------------------------------------
+
+ Summary
+
+ [Back to Top]
+
+ This release includes only bug fixes. The changes included were made only
+ to address problems that have been identified in this release series.
+ Users should be able to safely upgrade to this version if this release
+ series is already in use. Users considering upgrading from a previous
+ release series are strongly encouraged to review the UPGRADE.txt document
+ as well as the CHANGES document for information about upgrading to this
+ release series.
+
+ The data in this summary reflects changes that have been made since the
+ previous release, asterisk-1.4.35.
+
+ ----------------------------------------------------------------------
+
+ Contributors
+
+ [Back to Top]
+
+ This table lists the people who have submitted code, those that have
+ tested patches, as well as those that reported issues on the issue tracker
+ that were resolved in this release. For coders, the number is how many of
+ their patches (of any size) were committed into this release. For testers,
+ the number is the number of times their name was listed as assisting with
+ testing a patch. Finally, for reporters, the number is the number of
+ issues that they reported that were closed by commits that went into this
+ release.
+
+ Coders Testers Reporters
+ 4 dvossel 1 addix 2 manvirr
+ 4 tilghman 1 dvossel 2 RoadKill
+ 3 jpeeler 1 jstapleton 1 addix
+ 3 rmudgett 1 manvirr 1 anonymouz666
+ 2 RoadKill 1 schmidts 1 jstapleton
+ 2 twilson 1 sdolloff 1 klaus3000
+ 1 addix 1 sybasesql 1 kobaz
+ 1 jeang 1 twilson 1 nic_bellamy
+ 1 klaus3000 1 zerohalo 1 nickb
+ 1 lmadsen 1 sdolloff
+ 1 mmichelson 1 sybasesql
+ 1 nic 1 wuwu
+ 1 qwell 1 zerohalo
+ 1 russell
+ 1 snuffy
+
+ ----------------------------------------------------------------------
+
+ Closed Issues
+
+ [Back to Top]
+
+ This is a list of all issues from the issue tracker that were closed by
+ changes that went into this release.
+
+ Category: Applications/General
+
+ #17080: [patch] Asterisk crashes while core restart (#0 0x000000000050683c
+ in term_beep (el=0x16cdd9b0) at term.c:865)
+ Revision: 278981
+ Reporter: sybasesql
+ Testers: sybasesql
+ Coders: tilghman
+
+ Category: Applications/app_chanspy
+
+ #17630: [patch] Chanspy Keeps using G729 Encoder licenses even after the
+ spying channel hangs up.
+ Revision: 279945
+ Reporter: manvirr
+ Coders: dvossel
+
+ #17630: [patch] Chanspy Keeps using G729 Encoder licenses even after the
+ spying channel hangs up.
+ Revision: 280448
+ Reporter: manvirr
+ Testers: manvirr, dvossel
+ Coders: dvossel
+
+ Category: Applications/app_dial
+
+ #17641: [patch] reset visible_indication after call answering
+ Revision: 281566
+ Reporter: klaus3000
+ Testers: schmidts
+ Coders: klaus3000
+
+ Category: Applications/app_disa
+
+ #16661: [patch] DISA doesn't honor caller ID on the channel
+ Revision: 280811
+ Reporter: jstapleton
+ Testers: jstapleton
+ Coders: tilghman
+
+ Category: Channels/chan_dahdi
+
+ #17874: [patch] Q931 - Sending PROGRESS after sending ALERTING is a
+ protocol error
+ Revision: 283048
+ Reporter: nic_bellamy
+ Coders: nic
+
+ Category: Channels/chan_iax2
+
+ #17138: [patch] CallerID not properly set when using Originate and AGI
+ Revision: 281390
+ Reporter: kobaz
+ Coders: jpeeler
+
+ Category: Channels/chan_sip/General
+
+ #17497: [patch] [regression] Segmentation fault in scheduled event
+ Revision: 281185
+ Reporter: anonymouz666
+ Coders: dvossel
+
+ #17643: [patch] dialplan reload deadlocks in ast_rdlock_contexts when
+ calling ast_hint_state_changed
+ Revision: 280982
+ Reporter: zerohalo
+ Testers: zerohalo
+ Coders: tilghman
+
+ #17712: TOS_SIP does not get set
+ Revision: 282893
+ Reporter: nickb
+ Coders: dvossel
+
+ Category: Channels/chan_sip/Transfers
+
+ #17007: [patch] RTP Timestamp changes after transfer, but SSRC not and the
+ markerbit ist not set.
+ Revision: 282430
+ Reporter: addix
+ Testers: addix, twilson
+ Coders: addix, twilson
+
+ Category: Core/Configuration
+
+ #17833: [patch] say.conf has problem with large numbers
+ Revision: 281762
+ Reporter: RoadKill
+ Coders: RoadKill
+
+ #17836: [patch] say.conf added support for Danish
+ Revision: 281819
+ Reporter: RoadKill
+ Coders: RoadKill
+
+ Category: Core/RTP
+
+ #17404: [patch] [regression] audio delay when bridging calls related to
+ timestamp mismatch
+ Revision: 281911
+ Reporter: sdolloff
+ Testers: sdolloff
+ Coders: jpeeler
+
+ Category: General
+
+ #17568: [patch] DNID does not get cleard on new call
+ Revision: 278701
+ Reporter: wuwu
+ Coders: rmudgett
+
+ ----------------------------------------------------------------------
+
+ Commits Not Associated with an Issue
+
+ [Back to Top]
+
+ This is a list of all changes that went into this release that did not
+ directly close an issue from the issue tracker. The commits may have been
+ marked as being related to an issue. If that is the case, the issue
+ numbers are listed here, as well.
+
+ +------------------------------------------------------------------------+
+ | Revision | Author | Summary | Issues |
+ | | | | Referenced |
+ |----------+------------+-----------------------------------+------------|
+ | | | Establish a maximum version for | |
+ | 278984 | tilghman | openh323 (i.e. not opal), because | #17679 |
+ | | | chan_h323 will fail to load, even | |
+ | | | if it links. | |
+ |----------+------------+-----------------------------------+------------|
+ | 279053 | mmichelson | Backport fixes for | |
+ | | | sip_uri_params_cmp() from trunk. | |
+ |----------+------------+-----------------------------------+------------|
+ | 279206 | rmudgett | SIP promiscuous redirect could | |
+ | | | fail to dial the redirect. | |
+ |----------+------------+-----------------------------------+------------|
+ | | | Provide a default value for | |
+ | 279344 | jpeeler | DAHDI_TRANSCODE so when DAHDI is | |
+ | | | not installed | |
+ |----------+------------+-----------------------------------+------------|
+ | 279346 | snuffy | Minor update to man page | |
+ |----------+------------+-----------------------------------+------------|
+ | 280088 | lmadsen | Update help text to be less | |
+ | | | confusing. | |
+ |----------+------------+-----------------------------------+------------|
+ | | | Fix a dsp structure leak occuring | |
+ | 280341 | jeang | when a local channel is put into | |
+ | | | a meetme | |
+ |----------+------------+-----------------------------------+------------|
+ | | | Copy astcli back to 1.4 so it's | |
+ | 280944 | russell | available for automated testing | |
+ | | | purposes. | |
+ |----------+------------+-----------------------------------+------------|
+ | | | Register CLI commands before | |
+ | 282129 | qwell | parsing config, in case there is | |
+ | | | a config error. | |
+ |----------+------------+-----------------------------------+------------|
+ | 282729 | twilson | Add some documentation about | |
+ | | | codec negotiation to sip.conf | |
+ |----------+------------+-----------------------------------+------------|
+ | 283123 | rmudgett | Merged revision 278274 from | |
+ +------------------------------------------------------------------------+
+
+ ----------------------------------------------------------------------
+
+ Diffstat Results
+
+ [Back to Top]
+
+ This is a summary of the changes to the source code that went into this
+ release that was generated using the diffstat utility.
+
+ apps/app_dial.c | 12 +-
+ apps/app_meetme.c | 3
+ apps/app_queue.c | 9 +
+ autoconf/ast_check_pwlib.m4 | 12 ++
+ channels/chan_dahdi.c | 18 +--
+ channels/chan_local.c | 20 +++
+ channels/chan_sip.c | 204 +++++++++++++++++++++++++++------------
+ configs/say.conf.sample | 96 +++++++++++++++++-
+ configs/sip.conf.sample | 13 ++
+ configure.ac | 3
+ contrib/scripts/astcli | 167 +++++++++++++++++++++++++++++++
+ contrib/scripts/live_ast | 2
+ doc/asterisk.8 | 4
+ funcs/func_callerid.c | 6 +
+ include/asterisk/audiohook.h | 7 +
+ include/asterisk/autoconfig.h.in | 51 ++++-----
+ main/asterisk.c | 19 ++-
+ main/audiohook.c | 12 ++
+ main/channel.c | 27 ++++-
+ main/pbx.c | 14 +-
+ pbx/pbx_config.c | 7 -
+ 21 files changed, 572 insertions(+), 134 deletions(-)
+
+ ----------------------------------------------------------------------
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/autoconf/ast_check_pwlib.m4
^
|
@@ -204,13 +204,23 @@
$2_BUILD_NUMBER=`echo ${$2_VERSION} | cut -f3 -d.`
let $2_VER=${$2_MAJOR_VERSION}*10000+${$2_MINOR_VERSION}*100+${$2_BUILD_NUMBER}
let $2_REQ=$4*10000+$5*100+$6
+ if test "x$10" = "x"; then
+ let $2_MAX=9999999
+ else
+ let $2_MAX=$8*10000+$9*100+$10
+ fi
AC_MSG_CHECKING(if $1 version ${$2_VERSION} is compatible with chan_h323)
if test ${$2_VER} -lt ${$2_REQ}; then
AC_MSG_RESULT(no)
unset HAS_$2
else
- AC_MSG_RESULT(yes)
+ if test ${$2_VER} -gt ${$2_MAX}; then
+ AC_MSG_RESULT(no)
+ unset HAS_$2
+ else
+ AC_MSG_RESULT(yes)
+ fi
fi
fi
])
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/autoconf/ast_func_fork.m4
^
|
@@ -13,7 +13,7 @@
fi
if test "x$ac_cv_func_fork_works" = xcross; then
case $host in
- *-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* | *-*-linux-uclibc* )
+ *-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* )
# Override, as these systems have only a dummy fork() stub
ac_cv_func_fork_works=no
;;
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/autoconf/libcurl.m4
^
|
@@ -55,6 +55,7 @@
AH_TEMPLATE([LIBCURL_PROTOCOL_LDAP],[Defined if libcurl supports LDAP])
AH_TEMPLATE([LIBCURL_PROTOCOL_DICT],[Defined if libcurl supports DICT])
AH_TEMPLATE([LIBCURL_PROTOCOL_TFTP],[Defined if libcurl supports TFTP])
+ AC_SUBST(PBX_CURL)
AC_ARG_WITH(libcurl,
AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/build_tools/cflags-devmode.xml
^
|
@@ -12,4 +12,6 @@
</member>
<member name="MTX_PROFILE" displayname="Enable Code Profiling Using TSC Counters">
</member>
+ <member name="TEST_FRAMEWORK" displayname="Enable Test Framework API">
+ </member>
</category>
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/cdr/cdr_tds.c
^
|
@@ -62,7 +62,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 137348 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 269006 $")
#include <sys/types.h>
#include <stdio.h>
@@ -477,7 +477,7 @@
goto connect_fail;
}
- snprintf(query, sizeof(query), "SELECT 1 FROM %s", table);
+ snprintf(query, sizeof(query), "SELECT 1 FROM %s WHERE 1 = 0", table);
#ifdef FREETDS_PRE_0_62
if ((tds_submit_query(tds, query) != TDS_SUCCEED) || (tds_process_simple_query(tds, &result_type) != TDS_SUCCEED || result_type != TDS_CMD_SUCCEED))
#else
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/chan_agent.c
^
|
@@ -36,7 +36,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 241227 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 273793 $")
#include <stdio.h>
#include <string.h>
@@ -707,7 +707,12 @@
ast_mutex_lock(&p->lock);
if (p->chan && !ast_check_hangup(p->chan)) {
while (ast_channel_trylock(p->chan)) {
- ast_channel_unlock(ast);
+ int res;
+ if ((res = ast_channel_unlock(ast))) {
+ ast_log(LOG_ERROR, "chan_agent bug! Channel was not locked upon entry to agent_indicate: %s\n", strerror(res));
+ ast_mutex_unlock(&p->lock);
+ return -1;
+ }
usleep(1);
ast_channel_lock(ast);
}
@@ -2790,7 +2795,9 @@
ast_copy_string(buf, agent->moh, len);
else if (!strcasecmp(args.item, "channel")) {
if (agent->chan) {
+ ast_channel_lock(agent->chan);
ast_copy_string(buf, agent->chan->name, len);
+ ast_channel_unlock(agent->chan);
tmp = strrchr(buf, '-');
if (tmp)
*tmp = '\0';
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/chan_dahdi.c
^
|
@@ -47,7 +47,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 260434 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 283123 $")
#include <stdio.h>
#include <string.h>
@@ -439,6 +439,7 @@
struct dahdi_pvt *master; /*!< Master to us (we follow their conferencing) */
int inconference; /*!< If our real should be in the conference */
+ int bufsize; /*!< Size of the buffers */
int buf_no; /*!< Number of buffers */
int buf_policy; /*!< Buffer policy */
int sig; /*!< Signalling style */
@@ -535,6 +536,8 @@
unsigned int echocanon:1;
/*! \brief TRUE if a fax tone has already been handled. */
unsigned int faxhandled:1;
+ /*!< TRUE while buffer configuration override is in use. */
+ unsigned int bufferoverrideinuse:1;
/*! \brief TRUE if over a radio and dahdi_read() has been called. */
unsigned int firstradio:1;
/*!
@@ -968,7 +971,7 @@
.sendcalleridafter = DEFAULT_CIDRINGS,
.buf_policy = DAHDI_POLICY_IMMEDIATE,
- .buf_no = numbufs
+ .buf_no = numbufs,
},
.timing = {
.prewinktime = -1,
@@ -1001,6 +1004,7 @@
static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static int dahdi_setoption(struct ast_channel *chan, int option, void *data, int datalen);
static int dahdi_func_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len);
+static int dahdi_func_write(struct ast_channel *chan, char *function, char *data, const char *value);
static const struct ast_channel_tech dahdi_tech = {
.type = "DAHDI",
@@ -1021,6 +1025,7 @@
.fixup = dahdi_fixup,
.setoption = dahdi_setoption,
.func_channel_read = dahdi_func_read,
+ .func_channel_write = dahdi_func_write,
};
static const struct ast_channel_tech zap_tech = {
@@ -1042,6 +1047,7 @@
.fixup = dahdi_fixup,
.setoption = dahdi_setoption,
.func_channel_read = dahdi_func_read,
+ .func_channel_write = dahdi_func_write,
};
static const struct ast_channel_tech *chan_tech;
@@ -2971,6 +2977,22 @@
p->dsp = NULL;
}
+ if (p->bufferoverrideinuse) {
+ /* faxbuffers are in use, revert them */
+ struct dahdi_bufferinfo bi = {
+ .txbufpolicy = p->buf_policy,
+ .rxbufpolicy = p->buf_policy,
+ .bufsize = p->bufsize,
+ .numbufs = p->buf_no
+ };
+ int bpres;
+
+ if ((bpres = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SET_BUFINFO, &bi)) < 0) {
+ ast_log(LOG_WARNING, "Channel '%s' unable to revert faxbuffer policy: %s\n", ast->name, strerror(errno));
+ }
+ p->bufferoverrideinuse = 0;
+ }
+
law = DAHDI_LAW_DEFAULT;
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETLAW, &law);
if (res < 0)
@@ -3394,10 +3416,10 @@
case AST_OPTION_ECHOCAN:
cp = (char *) data;
if (*cp) {
- ast_log(LOG_DEBUG, "Enabling echo cancelation on %s\n", chan->name);
+ ast_log(LOG_DEBUG, "Enabling echo cancellation on %s\n", chan->name);
dahdi_enable_ec(p);
} else {
- ast_log(LOG_DEBUG, "Disabling echo cancelation on %s\n", chan->name);
+ ast_log(LOG_DEBUG, "Disabling echo cancellation on %s\n", chan->name);
dahdi_disable_ec(p);
}
break;
@@ -3410,6 +3432,7 @@
static int dahdi_func_read(struct ast_channel *chan, char *function, char *data, char *buf, size_t len)
{
struct dahdi_pvt *p = chan->tech_pvt;
+ int res = 0;
if (!strcasecmp(data, "rxgain")) {
ast_mutex_lock(&p->lock);
@@ -3421,10 +3444,74 @@
ast_mutex_unlock(&p->lock);
} else {
ast_copy_string(buf, "", len);
+ res = -1;
+ }
+
+ return res;
+}
+
+
+static int parse_buffers_policy(const char *parse, int *num_buffers, int *policy)
+{
+ int res;
+ char policy_str[21] = "";
+
+ if (((res = sscanf(parse, "%d,%20s", num_buffers, policy_str)) != 2) &&
+ ((res = sscanf(parse, "%d|%20s", num_buffers, policy_str)) != 2)) {
+ ast_log(LOG_WARNING, "Parsing buffer string '%s' failed.\n", parse);
+ return 1;
+ }
+ if (*num_buffers < 0) {
+ ast_log(LOG_WARNING, "Invalid buffer count given '%d'.\n", *num_buffers);
+ return -1;
}
+ if (!strcasecmp(policy_str, "full")) {
+ *policy = DAHDI_POLICY_WHEN_FULL;
+ } else if (!strcasecmp(policy_str, "immediate")) {
+ *policy = DAHDI_POLICY_IMMEDIATE;
+#ifdef DAHDI_POLICY_HALF_FULL
+ } else if (!strcasecmp(policy_str, "half")) {
+ *policy = DAHDI_POLICY_HALF_FULL;
+#endif
+ } else {
+ ast_log(LOG_WARNING, "Invalid policy name given '%s'.\n", policy_str);
+ return -1;
+ }
+
return 0;
}
+static int dahdi_func_write(struct ast_channel *chan, char *function, char *data, const char *value)
+{
+ struct dahdi_pvt *p = chan->tech_pvt;
+ int res = 0;
+
+ if (!strcasecmp(data, "buffers")) {
+ int num_bufs, policy;
+
+ if (!(parse_buffers_policy(value, &num_bufs, &policy))) {
+ struct dahdi_bufferinfo bi = {
+ .txbufpolicy = policy,
+ .rxbufpolicy = policy,
+ .bufsize = p->bufsize,
+ .numbufs = num_bufs,
+ };
+ int bpres;
+
+ if ((bpres = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SET_BUFINFO, &bi)) < 0) {
+ ast_log(LOG_WARNING, "Channel '%d' unable to override buffer policy: %s\n", p->channel, strerror(errno));
+ } else {
+ p->bufferoverrideinuse = 1;
+ }
+ } else {
+ res = -1;
+ }
+ } else {
+ res = -1;
+ }
+
+ return res;
+}
static void dahdi_unlink(struct dahdi_pvt *slave, struct dahdi_pvt *master, int needlock)
{
@@ -3851,10 +3938,10 @@
dahdi_unlink(NULL, p, 0);
p->subs[x].owner = newchan;
}
- if (newchan->_state == AST_STATE_RINGING)
- dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
update_conf(p);
ast_mutex_unlock(&p->lock);
+ if (newchan->_state == AST_STATE_RINGING)
+ dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
return 0;
}
@@ -4312,8 +4399,12 @@
/* Here we have to retain the lock on both the main channel, the 3-way channel, and
the private structure -- not especially easy or clean */
while (p->subs[SUB_THREEWAY].owner && ast_mutex_trylock(&p->subs[SUB_THREEWAY].owner->lock)) {
+ int res;
/* Yuck, didn't get the lock on the 3-way, gotta release everything and re-grab! */
- ast_mutex_unlock(&p->lock);
+ if ((res = ast_mutex_unlock(&p->lock))) {
+ ast_log(LOG_ERROR, "chan_dahdi bug! '&p->lock' was not locked upon entry to 'dahdi_handle_dtmfup': %s\n", strerror(res));
+ return NULL;
+ }
DEADLOCK_AVOIDANCE(&ast->lock);
/* We can grab ast and p in that order, without worry. We should make sure
nothing seriously bad has happened though like some sort of bizarre double
@@ -4445,6 +4536,7 @@
p->subs[index].f.frametype = AST_FRAME_CONTROL;
p->subs[index].f.subclass = AST_CONTROL_ANSWER;
/* Make sure it stops ringing */
+ dahdi_set_hook(p->subs[index].dfd, DAHDI_OFFHOOK);
p->subs[SUB_REAL].needringing = 0;
ast_log(LOG_DEBUG, "channel %d answered\n", p->channel);
if (p->cidspill) {
@@ -5079,7 +5171,7 @@
/* Hang up if we don't really exist */
if (index < 0) {
- ast_log(LOG_WARNING, "We dont exist?\n");
+ ast_log(LOG_WARNING, "We don't exist?\n");
ast_mutex_unlock(&p->lock);
return NULL;
}
@@ -5158,7 +5250,7 @@
return &p->subs[index].f;
}
- if (p->subs[index].needcallerid) {
+ if (p->subs[index].needcallerid && !ast->cid.cid_tns) {
ast_set_callerid(ast, S_OR(p->lastcid_num, NULL),
S_OR(p->lastcid_name, NULL),
S_OR(p->lastcid_num, NULL)
@@ -5544,7 +5636,7 @@
ast_log(LOG_DEBUG,"Received AST_CONTROL_PROGRESS on %s\n",chan->name);
#ifdef HAVE_PRI
p->digital = 0; /* Digital-only calls isn't allows any inband progress messages */
- if (!p->progress && p->sig==SIG_PRI && p->pri && !p->outgoing) {
+ if (!p->progress && !p->alerting && p->sig==SIG_PRI && p->pri && !p->outgoing) {
if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
@@ -5960,6 +6052,7 @@
ast_dsp_digitreset(p->dsp);
}
if (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) {
+ ast_mutex_lock(&p->lock);
if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
pri_proceeding(p->pri->pri, p->call, PVT_TO_CHANNEL(p), 0);
@@ -5969,6 +6062,7 @@
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
}
}
+ ast_mutex_unlock(&p->lock);
}
dahdi_enable_ec(p);
ast_setstate(chan, AST_STATE_RING);
@@ -7762,6 +7856,8 @@
return NULL;
}
}
+ tmp->outsigmod = conf->chan.outsigmod;
+
#ifdef HAVE_PRI
if ((chan_sig == SIG_PRI) || (chan_sig == SIG_GR303FXOKS) || (chan_sig == SIG_GR303FXSKS)) {
int offset;
@@ -7876,6 +7972,8 @@
tmp->pri = &pris[span];
tmp->prioffset = offset;
tmp->call = NULL;
+
+ tmp->priexclusive = conf->chan.priexclusive;
} else {
ast_log(LOG_ERROR, "Channel %d is reserved for D-channel.\n", offset);
destroy_dahdi_pvt(&tmp);
@@ -7967,14 +8065,21 @@
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set buffer policy on channel %d: %s\n", channel, strerror(errno));
}
- } else
+ } else {
ast_log(LOG_WARNING, "Unable to check buffer policy on channel %d: %s\n", channel, strerror(errno));
+ }
+ tmp->buf_policy = conf->chan.buf_policy;
+ tmp->buf_no = conf->chan.buf_no;
+ /* This is not as gnarly as it may first appear. If the ioctl above failed, we'd be setting
+ * tmp->bufsize to zero which would cause subsequent faxbuffer-related ioctl calls to fail.
+ * The reason the ioctl call above failed should to be determined before worrying about the
+ * faxbuffer-related ioctl calls */
+ tmp->bufsize = bi.bufsize;
}
#endif
tmp->immediate = conf->chan.immediate;
tmp->transfertobusy = conf->chan.transfertobusy;
tmp->sig = chan_sig;
- tmp->outsigmod = conf->chan.outsigmod;
tmp->ringt_base = ringt_base;
tmp->firstradio = 0;
if ((chan_sig == SIG_FXOKS) || (chan_sig == SIG_FXOLS) || (chan_sig == SIG_FXOGS))
@@ -8019,7 +8124,6 @@
tmp->dahditrcallerid = conf->chan.dahditrcallerid;
tmp->restrictcid = conf->chan.restrictcid;
tmp->use_callingpres = conf->chan.use_callingpres;
- tmp->priexclusive = conf->chan.priexclusive;
if (tmp->usedistinctiveringdetection) {
if (!tmp->use_callerid) {
ast_log(LOG_NOTICE, "Distinctive Ring detect requires 'usecallerid' be on\n");
@@ -9381,6 +9485,10 @@
}
apply_plan_to_number(pri->pvts[chanpos]->rdnis, sizeof(pri->pvts[chanpos]->rdnis), pri,
e->ring.redirectingnum, e->ring.callingplanrdnis);
+
+ /* Set DNID on all incoming calls -- even immediate */
+ ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
+
/* If immediate=yes go to s|1 */
if (pri->pvts[chanpos]->immediate) {
if (option_verbose > 2)
@@ -9391,7 +9499,6 @@
/* Get called number */
else if (!ast_strlen_zero(e->ring.callednum)) {
ast_copy_string(pri->pvts[chanpos]->exten, e->ring.callednum, sizeof(pri->pvts[chanpos]->exten));
- ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
} else if (pri->overlapdial)
pri->pvts[chanpos]->exten[0] = '\0';
else {
@@ -9399,9 +9506,6 @@
pri->pvts[chanpos]->exten[0] = 's';
pri->pvts[chanpos]->exten[1] = '\0';
}
- /* Set DNID on all incoming calls -- even immediate */
- if (!ast_strlen_zero(e->ring.callednum))
- ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
/* No number yet, but received "sending complete"? */
if (e->ring.complete && (ast_strlen_zero(e->ring.callednum))) {
if (option_verbose > 2)
@@ -9711,12 +9815,12 @@
if (chanpos < 0) {
ast_log(LOG_WARNING, "Facility Name requested on channel %d/%d not in use on span %d\n",
PRI_SPAN(e->facname.channel), PRI_CHANNEL(e->facname.channel), pri->span);
- } else {
+ } else if (pri->pvts[chanpos]->use_callerid) {
/* Re-use *69 field for PRI */
ast_mutex_lock(&pri->pvts[chanpos]->lock);
ast_copy_string(pri->pvts[chanpos]->lastcid_num, e->facname.callingnum, sizeof(pri->pvts[chanpos]->lastcid_num));
ast_copy_string(pri->pvts[chanpos]->lastcid_name, e->facname.callingname, sizeof(pri->pvts[chanpos]->lastcid_name));
- pri->pvts[chanpos]->subs[SUB_REAL].needcallerid =1;
+ pri->pvts[chanpos]->subs[SUB_REAL].needcallerid = 1;
dahdi_enable_ec(pri->pvts[chanpos]);
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
}
@@ -9962,7 +10066,7 @@
}
break;
case PRI_EVENT_CONFIG_ERR:
- ast_log(LOG_WARNING, "PRI Error on span %d: %s\n", pri->trunkgroup, e->err.err);
+ ast_log(LOG_WARNING, "PRI Error on span %d: %s\n", pri->span, e->err.err);
break;
case PRI_EVENT_RESTART_ACK:
chanpos = pri_find_principle(pri, e->restartack.channel);
@@ -11430,30 +11534,17 @@
iscrv = !strcasecmp(v->name, "crv");
if (build_channels(confp, iscrv, v->value, reload, v->lineno, &found_pseudo))
return -1;
- } else if (!strcasecmp(v->name, "buffers")) {
- int res;
- char policy[21] = "";
-
- res = sscanf(v->value, "%30d,%20s", &confp->chan.buf_no, policy);
- if (res != 2) {
- ast_log(LOG_WARNING, "Parsing buffers option data failed, using defaults.\n");
- confp->chan.buf_no = numbufs;
- continue;
- }
- if (confp->chan.buf_no < 0)
- confp->chan.buf_no = numbufs;
- if (!strcasecmp(policy, "full")) {
- confp->chan.buf_policy = DAHDI_POLICY_WHEN_FULL;
- } else if (!strcasecmp(policy, "immediate")) {
- confp->chan.buf_policy = DAHDI_POLICY_IMMEDIATE;
- } else {
- ast_log(LOG_WARNING, "Invalid policy name given (%s).\n", policy);
- }
} else if (!strcasecmp(v->name, "zapchan") || !strcasecmp(v->name, "dahdichan")) {
ast_copy_string(dahdichan, v->value, sizeof(dahdichan));
if (v->name[0] == 'z' || v->name[0] == 'Z') {
ast_log(LOG_WARNING, "Option zapchan has been deprecated in favor of dahdichan (found in [%s])\n", cat);
}
+ } else if (!strcasecmp(v->name, "buffers")) {
+ if (parse_buffers_policy(v->value, &confp->chan.buf_no, &confp->chan.buf_policy)) {
+ ast_log(LOG_WARNING, "Using default buffer policy.\n");
+ confp->chan.buf_no = numbufs;
+ confp->chan.buf_policy = DAHDI_POLICY_IMMEDIATE;
+ }
} else if (!strcasecmp(v->name, "usedistinctiveringdetection")) {
if (ast_true(v->value))
confp->chan.usedistinctiveringdetection = 1;
@@ -12086,6 +12177,7 @@
res = ioctl(ctlfd, DAHDI_SET_DIALPARAMS, &dps);
if (res < 0) {
ast_log(LOG_ERROR, "Invalid tone duration: %d ms: %s\n", toneduration, strerror(errno));
+ close(ctlfd);
return -1;
}
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/chan_h323.c
^
|
@@ -44,7 +44,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 255409 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 273793 $")
#ifdef __cplusplus
}
@@ -313,10 +313,8 @@
if (pvt) {
ast_mutex_lock(&pvt->lock);
/* Don't hold pvt lock while trying to lock the channel */
- while(pvt->owner && ast_channel_trylock(pvt->owner)) {
- ast_mutex_unlock(&pvt->lock);
- usleep(1);
- ast_mutex_lock(&pvt->lock);
+ while (pvt->owner && ast_channel_trylock(pvt->owner)) {
+ DEADLOCK_AVOIDANCE(&pvt->lock);
}
if (pvt->owner) {
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/chan_iax2.c
^
|
@@ -36,7 +36,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 250394 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 273981 $")
#include <stdlib.h>
#include <stdio.h>
@@ -172,6 +172,7 @@
static struct ast_netsock_list *netsock;
static struct ast_netsock_list *outsock; /*!< used if sourceaddress specified and bindaddr == INADDR_ANY */
static int defaultsockfd = -1;
+static int unloading;
int (*iax2_regfunk)(const char *username, int onoff) = NULL;
@@ -2324,6 +2325,12 @@
};
if ((peercnt = ao2_find(peercnts, &tmp, OBJ_POINTER))) {
+ if (unloading) {
+ peercnt_remove_cb(peercnt);
+ replace_callno(callno_entry);
+ return;
+ }
+
/* refcount is incremented with ao2_find. keep that ref for the scheduler */
if (option_debug) {
ast_log(LOG_DEBUG, "schedule decrement of callno used for %s in %d seconds\n", ast_inet_ntoa(sin->sin_addr), MIN_REUSE_TIME);
@@ -8299,6 +8306,7 @@
memcpy(&thread->ffinfo.sin, &thread->iosin, sizeof(thread->ffinfo.sin));
thread->ffinfo.type = fh->type;
thread->ffinfo.csub = fh->csub;
+ AST_LIST_INSERT_HEAD(&active_list, thread, list);
}
AST_LIST_UNLOCK(&active_list);
}
@@ -9975,12 +9983,14 @@
ast_atomic_fetchadd_int(&iaxactivethreadcount,1);
pthread_cleanup_push(iax2_process_thread_cleanup, data);
for(;;) {
+ pthread_testcancel();
+
/* Wait for something to signal us to be awake */
ast_mutex_lock(&thread->lock);
/* Flag that we're ready to accept signals */
thread->ready_for_signal = 1;
-
+
/* Put into idle list if applicable */
if (put_into_idle)
insert_idle_thread(thread);
@@ -10034,11 +10044,6 @@
if (thread->iostate == IAX_IOSTATE_IDLE)
continue;
- /* Add ourselves to the active list now */
- AST_LIST_LOCK(&active_list);
- AST_LIST_INSERT_HEAD(&active_list, thread, list);
- AST_LIST_UNLOCK(&active_list);
-
/* See what we need to do */
switch(thread->iostate) {
case IAX_IOSTATE_READY:
@@ -10061,7 +10066,9 @@
thread->curfunc[0]='\0';
#endif
- /* Now... remove ourselves from the active list, and return to the idle list */
+ /* The network thread added us to the active_thread list when we were given
+ * frames to process, Now that we are done, we must remove ourselves from
+ * the active list, and return to the idle list */
AST_LIST_LOCK(&active_list);
AST_LIST_REMOVE(&active_list, thread, list);
AST_LIST_UNLOCK(&active_list);
@@ -12493,8 +12500,10 @@
struct iax2_thread *thread = NULL;
int x;
+ unloading = 1;
+
/* Make sure threads do not hold shared resources when they are canceled */
-
+
/* Grab the sched lock resource to keep it away from threads about to die */
/* Cancel the network thread, close the net socket */
if (netthreadid != AST_PTHREADT_NULL) {
@@ -12507,13 +12516,13 @@
pthread_join(netthreadid, NULL);
}
if (schedthreadid != AST_PTHREADT_NULL) {
- ast_mutex_lock(&sched_lock);
+ ast_mutex_lock(&sched_lock);
pthread_cancel(schedthreadid);
ast_cond_signal(&sched_cond);
- ast_mutex_unlock(&sched_lock);
+ ast_mutex_unlock(&sched_lock);
pthread_join(schedthreadid, NULL);
}
-
+
/* Call for all threads to halt */
AST_LIST_LOCK(&idle_list);
AST_LIST_TRAVERSE_SAFE_BEGIN(&idle_list, thread, list) {
@@ -12532,19 +12541,20 @@
AST_LIST_UNLOCK(&active_list);
AST_LIST_LOCK(&dynamic_list);
- AST_LIST_TRAVERSE_SAFE_BEGIN(&dynamic_list, thread, list) {
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&dynamic_list, thread, list) {
AST_LIST_REMOVE_CURRENT(&dynamic_list, list);
pthread_cancel(thread->threadid);
- }
+ }
AST_LIST_TRAVERSE_SAFE_END
- AST_LIST_UNLOCK(&dynamic_list);
+ AST_LIST_UNLOCK(&dynamic_list);
AST_LIST_HEAD_DESTROY(&iaxq.queue);
/* Wait for threads to exit */
- while(0 < iaxactivethreadcount)
+ while (0 < iaxactivethreadcount) {
usleep(10000);
-
+ }
+
ast_netsock_release(netsock);
ast_netsock_release(outsock);
for (x = 0; x < ARRAY_LEN(iaxs); x++) {
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/chan_local.c
^
|
@@ -27,7 +27,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 259858 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 281390 $")
#include <stdio.h>
#include <string.h>
@@ -183,10 +183,18 @@
/* Ensure that we have both channels locked */
while (other && ast_channel_trylock(other)) {
- ast_mutex_unlock(&p->lock);
+ int res;
+ if ((res = ast_mutex_unlock(&p->lock))) {
+ ast_log(LOG_ERROR, "chan_local bug! '&p->lock' was not locked when entering local_queue_frame! (%s)\n", strerror(res));
+ return -1;
+ }
if (us && us_locked) {
do {
- ast_channel_unlock(us);
+ if (ast_channel_unlock(us)) {
+ ast_log(LOG_ERROR, "chan_local bug! Our channel was not locked, yet arguments indicated that it was!!\n");
+ ast_mutex_lock(&p->lock);
+ return -1;
+ }
usleep(1);
ast_channel_lock(us);
} while (ast_mutex_trylock(&p->lock));
@@ -286,6 +294,26 @@
p->chan->audiohooks = p->owner->audiohooks;
p->owner->audiohooks = audiohooks_swapper;
}
+
+ /* If any Caller ID was set, preserve it after masquerade like above. We must check
+ * to see if Caller ID was set because otherwise we'll mistakingly copy info not
+ * set from the dialplan and will overwrite the real channel Caller ID. The reason
+ * for this whole preswapping action is because the Caller ID is set on the channel
+ * thread (which is the to be masqueraded away local channel) before both local
+ * channels are optimized away.
+ */
+ if (p->owner->cid.cid_dnid || p->owner->cid.cid_num ||
+ p->owner->cid.cid_name || p->owner->cid.cid_ani ||
+ p->owner->cid.cid_rdnis || p->owner->cid.cid_pres ||
+ p->owner->cid.cid_ani2 || p->owner->cid.cid_ton ||
+ p->owner->cid.cid_tns) {
+
+ struct ast_callerid tmpcid;
+ tmpcid = p->owner->cid;
+ p->owner->cid = p->chan->_bridge->cid;
+ p->chan->_bridge->cid = tmpcid;
+ }
+
ast_app_group_update(p->chan, p->owner);
ast_channel_masquerade(p->owner, p->chan->_bridge);
ast_set_flag(p, LOCAL_ALREADY_MASQED);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/chan_misdn.c
^
|
@@ -36,7 +36,7 @@
***/
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 247910 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 273640 $")
#include <stdio.h>
#include <pthread.h>
@@ -5276,9 +5276,9 @@
" a - Have Asterisk detect DTMF tones on called channel\n"
" c - Make crypted outgoing call, optarg is keyindex\n"
" d - Send display text to called phone, text is the optarg\n"
- " e - Perform echo cancelation on this channel,\n"
+ " e - Perform echo cancellation on this channel,\n"
" takes taps as optarg (32,64,128,256)\n"
- " e! - Disable echo cancelation on this channel\n"
+ " e! - Disable echo cancellation on this channel\n"
" f - Enable fax detection\n"
" h - Make digital outgoing call\n"
" h1 - Make HDLC mode digital outgoing call\n"
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/chan_oss.c
^
|
@@ -38,7 +38,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 211528 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 273981 $")
#include <stdio.h>
#include <ctype.h>
@@ -50,6 +50,7 @@
#include <sys/time.h>
#include <stdlib.h>
#include <errno.h>
+#include <signal.h> /* for pthread_kill(3) */
#ifdef __linux
#include <linux/soundcard.h>
@@ -606,6 +607,8 @@
fd_set rfds, wfds;
int maxfd, res;
+ pthread_testcancel();
+
FD_ZERO(&rfds);
FD_ZERO(&wfds);
FD_SET(o->sndcmd[0], &rfds);
@@ -626,6 +629,7 @@
}
/* ast_select emulates linux behaviour in terms of timeout handling */
res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
+ pthread_testcancel();
if (res < 1) {
ast_log(LOG_WARNING, "select failed: %s\n", strerror(errno));
sleep(1);
@@ -636,6 +640,7 @@
int i, what = -1;
if (read(o->sndcmd[0], &what, sizeof(what)) != sizeof(what)) {
+ pthread_testcancel();
ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
continue;
}
@@ -1863,7 +1868,7 @@
if (ast_channel_register(&oss_tech)) {
ast_log(LOG_ERROR, "Unable to register channel type 'OSS'\n");
- return AST_MODULE_LOAD_FAILURE;
+ return AST_MODULE_LOAD_DECLINE;
}
ast_cli_register_multiple(cli_oss, sizeof(cli_oss) / sizeof(struct ast_cli_entry));
@@ -1880,17 +1885,28 @@
ast_cli_unregister_multiple(cli_oss, sizeof(cli_oss) / sizeof(struct ast_cli_entry));
for (o = oss_default.next; o; o = o->next) {
+ if (o->owner) {
+ ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
+ /* Give the channel a chance to go away */
+ sched_yield();
+ }
+ if (o->owner) {
+ return -1;
+ }
+ oss_default.next = o->next;
+ if (o->sthread > 0) {
+ pthread_cancel(o->sthread);
+ pthread_kill(o->sthread, SIGURG);
+ pthread_join(o->sthread, NULL);
+ }
close(o->sounddev);
if (o->sndcmd[0] > 0) {
close(o->sndcmd[0]);
close(o->sndcmd[1]);
}
- if (o->owner)
- ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
- if (o->owner)
- return -1;
- /* XXX what about the thread ? */
- /* XXX what about the memory allocated ? */
+ if (o->sthread > 0) {
+ free(o);
+ }
}
return 0;
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/chan_sip.c
^
|
@@ -94,7 +94,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 261274 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 282893 $")
#include <stdio.h>
#include <ctype.h>
@@ -149,6 +149,7 @@
#include "asterisk/compiler.h"
#include "asterisk/threadstorage.h"
#include "asterisk/translate.h"
+#include "asterisk/astobj2.h"
#ifndef FALSE
#define FALSE 0
@@ -635,6 +636,7 @@
char *header[SIP_MAX_HEADERS];
char *line[SIP_MAX_LINES];
char data[SIP_MAX_PACKET];
+ char content[SIP_MAX_PACKET];
unsigned int sdp_start; /*!< the line number where the SDP begins */
unsigned int sdp_count; /*!< the number of lines of SDP */
AST_LIST_ENTRY(sip_request) next;
@@ -811,11 +813,12 @@
#define SIP_PAGE2_UDPTL_DESTINATION (1 << 28) /*!< 28: Use source IP of RTP as destination if NAT is enabled */
#define SIP_PAGE2_DIALOG_ESTABLISHED (1 << 29) /*!< 29: Has a dialog been established? */
#define SIP_PAGE2_RPORT_PRESENT (1 << 30) /*!< 30: Was rport received in the Via header? */
+#define SIP_PAGE2_FORWARD_LOOP_DETECTED (1 << 31) /*!< 31: Do call forward when receiving 482 Loop Detected */
#define SIP_PAGE2_FLAGS_TO_COPY \
(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_VIDEOSUPPORT | \
SIP_PAGE2_T38SUPPORT | SIP_PAGE2_RFC2833_COMPENSATE | SIP_PAGE2_BUGGY_MWI | \
- SIP_PAGE2_UDPTL_DESTINATION)
+ SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_FORWARD_LOOP_DETECTED)
/* SIP packet flags */
#define SIP_PKT_DEBUG (1 << 0) /*!< Debug this packet */
@@ -853,6 +856,12 @@
#define sipdebug_config ast_test_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONFIG)
#define sipdebug_console ast_test_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONSOLE)
+/*! \brief provisional keep alive scheduler item data */
+struct provisional_keepalive_data {
+ struct sip_pvt *pvt;
+ int sched_id;
+};
+
/*! \brief T38 States for a call */
enum t38state {
T38_DISABLED = 0, /*!< Not enabled */
@@ -1042,7 +1051,7 @@
struct ast_variable *chanvars; /*!< Channel variables to set for inbound call */
AST_LIST_HEAD_NOLOCK(request_queue, sip_request) request_queue; /*!< Requests that arrived but could not be processed immediately */
int request_queue_sched_id; /*!< Scheduler ID of any scheduled action to process queued requests */
- int provisional_keepalive_sched_id; /*!< Scheduler ID for provisional responses that need to be sent out to avoid cancellation */
+ struct provisional_keepalive_data *provisional_keepalive_data; /*!< Scheduler data for provisional responses that need to be sent out to avoid cancellation */
const char *last_provisional; /*!< The last successfully transmitted provisonal response message */
struct sip_pvt *next; /*!< Next dialog in chain */
struct sip_invite_param *options; /*!< Options for INVITE */
@@ -1211,7 +1220,7 @@
struct sip_pvt *call; /*!< create a sip_pvt structure for each outbound "registration dialog" in progress */
enum sipregistrystate regstate; /*!< Registration state (see above) */
unsigned int needdns:1; /*!< Set if we need a new dns lookup before we try to transmit */
- time_t regtime; /*!< Last succesful registration time */
+ time_t regtime; /*!< Last successful registration time */
int callid_valid; /*!< 0 means we haven't chosen callid for this registry yet. */
unsigned int ocseq; /*!< Sequence number we got to for REGISTERs for this registry */
struct sockaddr_in us; /*!< Who the server thinks we are */
@@ -1561,8 +1570,8 @@
static void build_callid_registry(struct sip_registry *reg, struct in_addr ourip, const char *fromdomain);
static void make_our_tag(char *tagbuf, size_t len);
static int add_header(struct sip_request *req, const char *var, const char *value);
-static int add_header_contentLength(struct sip_request *req, int len);
-static int add_line(struct sip_request *req, const char *line);
+static int add_content(struct sip_request *req, const char *line);
+static int finalize_content(struct sip_request *req);
static int add_text(struct sip_request *req, const char *text);
static int add_digit(struct sip_request *req, char digit, unsigned int duration);
static int add_vidupdate(struct sip_request *req);
@@ -2333,44 +2342,124 @@
}
}
-static int send_provisional_keepalive_full(struct sip_pvt *pvt, int with_sdp)
+/*! \brief This is called by the scheduler to resend the last provisional message in a dialog */
+static int send_provisional_keepalive_full(struct provisional_keepalive_data *data, int with_sdp)
{
const char *msg = NULL;
+ int res = 0;
+ struct sip_pvt *pvt = data->pvt;
- if (!pvt->last_provisional || !strncasecmp(pvt->last_provisional, "100", 3)) {
- msg = "183 Session Progress";
+ if (!pvt) {
+ ao2_ref(data, -1); /* not rescheduling so drop ref. in this case the dialog has already dropped this ref */
+ return res;
}
- if (pvt->invitestate < INV_COMPLETED) {
- if (with_sdp) {
- transmit_response_with_sdp(pvt, S_OR(msg, pvt->last_provisional), &pvt->initreq, XMIT_UNRELIABLE);
+ ast_mutex_lock(&pvt->lock);
+ while (pvt->owner && ast_channel_trylock(pvt->owner)) {
+ ast_mutex_unlock(&pvt->lock);
+ sched_yield();
+ if ((pvt = data->pvt)) {
+ ast_mutex_lock(&pvt->lock);
} else {
- transmit_response(pvt, S_OR(msg, pvt->last_provisional), &pvt->initreq);
+ ao2_ref(data, -1);
+ return res;
}
- return PROVIS_KEEPALIVE_TIMEOUT;
}
- return 0;
+ if (data->sched_id == -1 || pvt->invitestate >= INV_COMPLETED) {
+ goto provisional_keepalive_cleanup;
+ }
+
+ if (!pvt->last_provisional || !strncasecmp(pvt->last_provisional, "100", 3)) {
+ msg = "183 Session Progress";
+ }
+
+ if (with_sdp) {
+ transmit_response_with_sdp(pvt, S_OR(msg, pvt->last_provisional), &pvt->initreq, XMIT_UNRELIABLE);
+ } else {
+ transmit_response(pvt, S_OR(msg, pvt->last_provisional), &pvt->initreq);
+ }
+
+ res = PROVIS_KEEPALIVE_TIMEOUT; /* reschedule the keepalive event */
+
+provisional_keepalive_cleanup:
+ if (!res) { /* not rescheduling, so drop ref */
+ data->sched_id = -1; /* if we don't re-schedule, make sure to remove the sched id */
+ ao2_ref(data, -1); /* release the scheduler's reference to this data */
+ }
+
+ if (pvt->owner) {
+ ast_channel_unlock(pvt->owner);
+ }
+ ast_mutex_unlock(&pvt->lock);
+
+ return res;
}
-static int send_provisional_keepalive(const void *data) {
- struct sip_pvt *pvt = (struct sip_pvt *) data;
+static int send_provisional_keepalive(const void *data)
+{
+ struct provisional_keepalive_data *d = (struct provisional_keepalive_data *) data;
- return send_provisional_keepalive_full(pvt, 0);
+ return send_provisional_keepalive_full(d, 0);
}
-static int send_provisional_keepalive_with_sdp(const void *data) {
- struct sip_pvt *pvt = (void *)data;
+static int send_provisional_keepalive_with_sdp(const void *data)
+{
+ struct provisional_keepalive_data *d = (struct provisional_keepalive_data *) data;
- return send_provisional_keepalive_full(pvt, 1);
+ return send_provisional_keepalive_full(d, 1);
+}
+
+static void *unref_provisional_keepalive(struct provisional_keepalive_data *data)
+{
+ if (data) {
+ data->sched_id = -1;
+ data->pvt = NULL;
+ ao2_ref(data, -1);
+ }
+ return NULL;
+}
+
+static void remove_provisional_keepalive_sched(struct sip_pvt *pvt)
+{
+ int res;
+ if (!pvt->provisional_keepalive_data) {
+ return;
+ }
+ res = AST_SCHED_DEL(sched, pvt->provisional_keepalive_data->sched_id);
+ /* If we could not remove this item. remove pvt's reference this data and mark it for removal
+ * for the next time the scheduler uses it. The scheduler has it's own ref to this data
+ * and will detect it should not reschedule the event since the sched_id is -1 and pvt == NULL */
+ if (res == -1) {
+ pvt->provisional_keepalive_data = unref_provisional_keepalive(pvt->provisional_keepalive_data);
+ }
}
static void update_provisional_keepalive(struct sip_pvt *pvt, int with_sdp)
{
- AST_SCHED_DEL(sched, pvt->provisional_keepalive_sched_id);
+ remove_provisional_keepalive_sched(pvt);
+
+ if (!pvt->provisional_keepalive_data) {
+ if (!(pvt->provisional_keepalive_data = ao2_alloc(sizeof(*pvt->provisional_keepalive_data), NULL))) {
+ return; /* alloc error, can not recover */
+ }
+ pvt->provisional_keepalive_data->sched_id = -1;
+ pvt->provisional_keepalive_data->pvt = pvt;
+ }
+
+ /* give the scheduler a ref */
+ ao2_ref(pvt->provisional_keepalive_data, +1);
- pvt->provisional_keepalive_sched_id = ast_sched_add(sched, PROVIS_KEEPALIVE_TIMEOUT,
- with_sdp ? send_provisional_keepalive_with_sdp : send_provisional_keepalive, pvt);
+ /* schedule the provisional keepalive */
+ pvt->provisional_keepalive_data->sched_id = ast_sched_add(sched,
+ PROVIS_KEEPALIVE_TIMEOUT,
+ with_sdp ? send_provisional_keepalive_with_sdp : send_provisional_keepalive,
+ pvt->provisional_keepalive_data);
+
+ /* if schedule was unsuccessful, remove the scheduler's ref */
+ if (pvt->provisional_keepalive_data->sched_id == -1) {
+ ao2_ref(pvt->provisional_keepalive_data, -1);
+ }
}
/*! \brief Transmit response on SIP request*/
@@ -2378,6 +2467,7 @@
{
int res;
+ finalize_content(req);
add_blank(req);
if (sip_debug_test_pvt(p)) {
const struct sockaddr_in *dst = sip_real_dst(p);
@@ -2396,7 +2486,7 @@
/* If we are sending a final response to an INVITE, stop retransmitting provisional responses */
if (p->initreq.method == SIP_INVITE && reliable == XMIT_CRITICAL) {
- AST_SCHED_DEL(sched, p->provisional_keepalive_sched_id);
+ remove_provisional_keepalive_sched(p);
}
res = (reliable) ?
@@ -2412,6 +2502,7 @@
{
int res;
+ finalize_content(req);
add_blank(req);
if (sip_debug_test_pvt(p)) {
if (ast_test_flag(&p->flags[0], SIP_NAT_ROUTE))
@@ -3293,7 +3384,13 @@
AST_SCHED_DEL(sched, p->waitid);
AST_SCHED_DEL(sched, p->autokillid);
AST_SCHED_DEL(sched, p->request_queue_sched_id);
- AST_SCHED_DEL(sched, p->provisional_keepalive_sched_id);
+
+ remove_provisional_keepalive_sched(p);
+ if (p->provisional_keepalive_data) {
+ ast_mutex_lock(&p->lock);
+ p->provisional_keepalive_data = unref_provisional_keepalive(p->provisional_keepalive_data);
+ ast_mutex_unlock(&p->lock);
+ }
if (p->rtp) {
ast_rtp_destroy(p->rtp);
@@ -3692,6 +3789,7 @@
ast_clear_flag(&p->flags[0], SIP_NEEDDESTROY);
p->owner->tech_pvt = NULL;
p->owner = NULL; /* Owner will be gone after we return, so take it away */
+ ast_module_unref(ast_module_info->self);
return 0;
}
if (option_debug) {
@@ -3778,7 +3876,7 @@
}
} else { /* Incoming call, not up */
const char *res;
- AST_SCHED_DEL(sched, p->provisional_keepalive_sched_id);
+ remove_provisional_keepalive_sched(p);
if (p->hangupcause && (res = hangup_cause2sip(p->hangupcause)))
transmit_response_reliable(p, res, &p->initreq);
else
@@ -4676,7 +4774,6 @@
p->waitid = -1;
p->autokillid = -1;
p->request_queue_sched_id = -1;
- p->provisional_keepalive_sched_id = -1;
p->subscribed = NONE;
p->stateid = -1;
p->prefs = default_prefs; /* Set default codecs for this call */
@@ -5337,9 +5434,9 @@
int portno = -1; /*!< RTP Audio port number */
int vportno = -1; /*!< RTP Video port number */
int udptlportno = -1; /*!< UDPTL Image port number */
- struct sockaddr_in sin; /*!< media socket address */
- struct sockaddr_in vsin; /*!< video socket address */
- struct sockaddr_in isin; /*!< image socket address */
+ struct sockaddr_in sin = { 0, }; /*!< media socket address */
+ struct sockaddr_in vsin = { 0, }; /*!< video socket address */
+ struct sockaddr_in isin = { 0, }; /*!< image socket address */
/* Peer capability is the capability in the SDP, non codec is RFC2833 DTMF (101) */
int peercapability = 0, peernoncodeccapability = 0;
@@ -5510,6 +5607,11 @@
if (option_debug > 1)
ast_log(LOG_DEBUG, "T38 state changed to %d on channel %s\n", p->t38.state, p->owner ? p->owner->name : "<none>");
}
+
+ /* default EC to none, the remote end should respond
+ * with the EC they want to use */
+ p->t38.peercapability &= ~T38FAX_UDP_EC_NONE;
+ ast_udptl_set_error_correction_scheme(p->udptl, UDPTL_ERROR_CORRECTION_NONE);
} else {
ast_log(LOG_WARNING, "Unsupported SDP media type in offer: %s\n", m);
continue;
@@ -5744,11 +5846,11 @@
}
/* sendonly processing */
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && (sin.sin_addr.s_addr || vsin.sin_addr.s_addr || isin.sin_addr.s_addr) && (!sendonly || sendonly == -1)) {
ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
/* Activate a re-invite */
ast_queue_frame(p->owner, &ast_null_frame);
- } else if (!sin.sin_addr.s_addr || (sendonly && sendonly != -1)) {
+ } else if (!(sin.sin_addr.s_addr || vsin.sin_addr.s_addr || isin.sin_addr.s_addr) || (sendonly && sendonly != -1)) {
ast_queue_control_data(p->owner, AST_CONTROL_HOLD,
S_OR(p->mohsuggest, NULL),
!ast_strlen_zero(p->mohsuggest) ? strlen(p->mohsuggest) + 1 : 0);
@@ -5760,9 +5862,9 @@
}
/* Manager Hold and Unhold events must be generated, if necessary */
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1))
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && (sin.sin_addr.s_addr || vsin.sin_addr.s_addr || isin.sin_addr.s_addr) && (!sendonly || sendonly == -1))
change_hold_state(p, req, FALSE, sendonly);
- else if (!sin.sin_addr.s_addr || (sendonly && sendonly != -1))
+ else if (!(sin.sin_addr.s_addr || vsin.sin_addr.s_addr || isin.sin_addr.s_addr) || (sendonly && sendonly != -1))
change_hold_state(p, req, TRUE, sendonly);
return 0;
@@ -6034,7 +6136,7 @@
/*! \brief Add header to SIP message */
static int add_header(struct sip_request *req, const char *var, const char *value)
{
- int maxlen = sizeof(req->data) - 4 - req->len; /* 4 bytes are for two \r\n ? */
+ int maxlen = sizeof(req->data) - 4 - req->len - strlen(req->content); /* 4 bytes are for two \r\n ? */
if (req->headers == SIP_MAX_HEADERS) {
ast_log(LOG_WARNING, "Out of SIP header space\n");
@@ -6064,35 +6166,42 @@
}
/*! \brief Add 'Content-Length' header to SIP message */
-static int add_header_contentLength(struct sip_request *req, int len)
+static int finalize_content(struct sip_request *req)
{
char clen[10];
- snprintf(clen, sizeof(clen), "%d", len);
- return add_header(req, "Content-Length", clen);
+ if (req->lines) {
+ ast_log(LOG_WARNING, "finalize_content() called on a message that has already been finalized\n");
+ return -1;
+ }
+
+ snprintf(clen, sizeof(clen), "%zd", strlen(req->content));
+ add_header(req, "Content-Length", clen);
+
+ if (!ast_strlen_zero(req->content)) {
+ snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n%s", req->content);
+ req->len += strlen(req->data + req->len);
+ }
+
+ req->lines = !ast_strlen_zero(req->content);
+ return 0;
}
/*! \brief Add content (not header) to SIP message */
-static int add_line(struct sip_request *req, const char *line)
+static int add_content(struct sip_request *req, const char *line)
{
- if (req->lines == SIP_MAX_LINES) {
- ast_log(LOG_WARNING, "Out of SIP line space\n");
+ if (req->lines) {
+ ast_log(LOG_WARNING, "Can't add more content when the content has been finalized\n");
return -1;
}
- if (!req->lines) {
- /* Add extra empty return */
- snprintf(req->data + req->len, sizeof(req->data) - req->len, "\r\n");
- req->len += strlen(req->data + req->len);
- }
- if (req->len >= sizeof(req->data) - 4) {
+
+ if (req->len + strlen(req->content) + strlen(line) >= sizeof(req->data) - 4) {
ast_log(LOG_WARNING, "Out of space, can't add anymore\n");
return -1;
}
- req->line[req->lines] = req->data + req->len;
- snprintf(req->line[req->lines], sizeof(req->data) - req->len, "%s", line);
- req->len += strlen(req->line[req->lines]);
- req->lines++;
- return 0;
+
+ snprintf(req->content + strlen(req->content), sizeof(req->content) - strlen(req->content), "%s", line);
+ return 0;
}
/*! \brief Copy one header field from one request to another */
@@ -6545,7 +6654,6 @@
return -1;
}
respprep(&resp, p, msg, req);
- add_header_contentLength(&resp, 0);
/* If we are cancelling an incoming invite for some reason, add information
about the reason why we are doing this in clear text */
if (p->method == SIP_INVITE && msg[0] != '1' && p->owner && p->owner->hangupcause) {
@@ -6631,7 +6739,6 @@
respprep(&resp, p, msg, req);
append_date(&resp);
add_header(&resp, "Unsupported", unsupported);
- add_header_contentLength(&resp, 0);
return send_response(p, &resp, XMIT_UNRELIABLE, 0);
}
@@ -6661,7 +6768,6 @@
struct sip_request resp;
respprep(&resp, p, msg, req);
append_date(&resp);
- add_header_contentLength(&resp, 0);
return send_response(p, &resp, XMIT_UNRELIABLE, 0);
}
@@ -6671,7 +6777,6 @@
struct sip_request resp;
respprep(&resp, p, msg, req);
add_header(&resp, "Accept", "application/sdp");
- add_header_contentLength(&resp, 0);
return send_response(p, &resp, reliable, 0);
}
@@ -6691,7 +6796,6 @@
snprintf(tmp, sizeof(tmp), "Digest algorithm=MD5, realm=\"%s\", nonce=\"%s\"%s", global_realm, randdata, stale ? ", stale=true" : "");
respprep(&resp, p, msg, req);
add_header(&resp, header, tmp);
- add_header_contentLength(&resp, 0);
append_history(p, "AuthChal", "Auth challenge sent for %s - nc %d", p->username, p->noncecount);
return send_response(p, &resp, reliable, seqno);
}
@@ -6714,8 +6818,7 @@
{
/* XXX Convert \n's to \r\n's XXX */
add_header(req, "Content-Type", "text/plain");
- add_header_contentLength(req, strlen(text));
- add_line(req, text);
+ add_content(req, text);
return 0;
}
@@ -6727,8 +6830,7 @@
snprintf(tmp, sizeof(tmp), "Signal=%c\r\nDuration=%u\r\n", digit, duration);
add_header(req, "Content-Type", "application/dtmf-relay");
- add_header_contentLength(req, strlen(tmp));
- add_line(req, tmp);
+ add_content(req, tmp);
return 0;
}
@@ -6747,8 +6849,7 @@
" </vc_primitive>\r\n"
" </media_control>\r\n";
add_header(req, "Content-Type", "application/media_control+xml");
- add_header_contentLength(req, strlen(xml_is_a_huge_waste_of_space));
- add_line(req, xml_is_a_huge_waste_of_space);
+ add_content(req, xml_is_a_huge_waste_of_space);
return 0;
}
@@ -6862,7 +6963,6 @@
/*! \brief Add Session Description Protocol message */
static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int add_audio, int add_t38)
{
- int len = 0;
int alreadysent = 0;
struct sockaddr_in sin;
@@ -7131,45 +7231,35 @@
ast_build_string(&a_modem_next, &a_modem_left, "a=T38FaxUdpEC:%s\r\n", (p->t38.jointcapability & T38FAX_UDP_EC_REDUNDANCY) ? "t38UDPRedundancy" : "t38UDPFEC");
}
- len = strlen(version) + strlen(subject) + strlen(owner) + strlen(connection) + strlen(stime);
- if (add_audio)
- len += strlen(m_audio) + strlen(a_audio) + strlen(hold);
- if (needvideo) /* only if video response is appropriate */
- len += strlen(m_video) + strlen(a_video) + strlen(bandwidth) + strlen(hold);
- if (add_t38) {
- len += strlen(m_modem) + strlen(a_modem);
- }
-
add_header(resp, "Content-Type", "application/sdp");
- add_header_contentLength(resp, len);
- add_line(resp, version);
- add_line(resp, owner);
- add_line(resp, subject);
- add_line(resp, connection);
+ add_content(resp, version);
+ add_content(resp, owner);
+ add_content(resp, subject);
+ add_content(resp, connection);
if (needvideo) /* only if video response is appropriate */
- add_line(resp, bandwidth);
- add_line(resp, stime);
+ add_content(resp, bandwidth);
+ add_content(resp, stime);
if (add_audio) {
- add_line(resp, m_audio);
- add_line(resp, a_audio);
- add_line(resp, hold);
+ add_content(resp, m_audio);
+ add_content(resp, a_audio);
+ add_content(resp, hold);
} else if (p->offered_media[SDP_AUDIO].offered) {
snprintf(dummy_answer, sizeof(dummy_answer), "m=audio 0 RTP/AVP %s\r\n", p->offered_media[SDP_AUDIO].text);
- add_line(resp, dummy_answer);
+ add_content(resp, dummy_answer);
}
if (needvideo) { /* only if video response is appropriate */
- add_line(resp, m_video);
- add_line(resp, a_video);
- add_line(resp, hold); /* Repeat hold for the video stream */
+ add_content(resp, m_video);
+ add_content(resp, a_video);
+ add_content(resp, hold); /* Repeat hold for the video stream */
} else if (p->offered_media[SDP_VIDEO].offered) {
snprintf(dummy_answer, sizeof(dummy_answer), "m=video 0 RTP/AVP %s\r\n", p->offered_media[SDP_VIDEO].text);
- add_line(resp, dummy_answer);
+ add_content(resp, dummy_answer);
}
if (add_t38) {
- add_line(resp, m_modem);
- add_line(resp, a_modem);
+ add_content(resp, m_modem);
+ add_content(resp, a_modem);
} else if (p->offered_media[SDP_IMAGE].offered) {
- add_line(resp, "m=image 0 udptl t38\r\n");
+ add_content(resp, "m=image 0 udptl t38\r\n");
}
/* Update lastrtprx when we send our SDP */
@@ -7675,8 +7765,6 @@
add_sdp(&req, p, 0, 1);
} else if (p->rtp)
add_sdp(&req, p, 1, 0);
- } else {
- add_header_contentLength(&req, 0);
}
if (!p->initreq.headers || init > 2)
@@ -7861,8 +7949,7 @@
if (t > tmp + sizeof(tmp))
ast_log(LOG_WARNING, "Buffer overflow detected!! (Please file a bug report)\n");
- add_header_contentLength(&req, strlen(tmp));
- add_line(&req, tmp);
+ add_content(&req, tmp);
p->pendinginvite = p->ocseq; /* Remember that we have a pending NOTIFY in order not to confuse the NOTIFY subsystem */
return send_request(p, &req, XMIT_RELIABLE, p->ocseq);
@@ -7911,8 +7998,7 @@
if (t > tmp + sizeof(tmp))
ast_log(LOG_WARNING, "Buffer overflow detected!! (Please file a bug report)\n");
- add_header_contentLength(&req, strlen(tmp));
- add_line(&req, tmp);
+ add_content(&req, tmp);
if (!p->initreq.headers)
initialize_initreq(p, &req);
@@ -7942,8 +8028,7 @@
add_header(&req, "Supported", SUPPORTED_EXTENSIONS);
snprintf(tmp, sizeof(tmp), "SIP/2.0 %s\r\n", message);
- add_header_contentLength(&req, strlen(tmp));
- add_line(&req, tmp);
+ add_content(&req, tmp);
if (!p->initreq.headers)
initialize_initreq(p, &req);
@@ -8249,7 +8334,6 @@
add_header(&req, "Expires", tmp);
add_header(&req, "Contact", p->our_contact);
add_header(&req, "Event", "registration");
- add_header_contentLength(&req, 0);
initialize_initreq(p, &req);
if (sip_debug_test_pvt(p))
@@ -8383,7 +8467,6 @@
p->invitestate = INV_CONFIRMED;
reqprep(&resp, p, sipmethod, seqno, newbranch);
- add_header_contentLength(&resp, 0);
return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);
}
@@ -8417,7 +8500,6 @@
add_header(&resp, "X-Asterisk-HangupCauseCode", buf);
}
- add_header_contentLength(&resp, 0);
return send_request(p, &resp, reliable, seqno ? seqno : p->ocseq);
}
@@ -8743,25 +8825,17 @@
}
oldsin = peer->addr;
- /* Check that they're allowed to register at this IP */
- /* XXX This could block for a long time XXX */
- hp = ast_gethostbyname(n, &ahp);
- if (!hp) {
- ast_log(LOG_WARNING, "Invalid host '%s'\n", n);
- *peer->fullcontact = '\0';
- ast_string_field_set(pvt, our_contact, "");
- return PARSE_REGISTER_FAILED;
- }
- memcpy(&testsin.sin_addr, hp->h_addr, sizeof(testsin.sin_addr));
- if ( ast_apply_ha(global_contact_ha, &testsin) != AST_SENSE_ALLOW ||
- ast_apply_ha(peer->contactha, &testsin) != AST_SENSE_ALLOW) {
- ast_log(LOG_WARNING, "Host '%s' disallowed by contact ACL (violating IP %s)\n", n, ast_inet_ntoa(testsin.sin_addr));
- *peer->fullcontact = '\0';
- ast_string_field_set(pvt, our_contact, "");
- return PARSE_REGISTER_DENIED;
- }
-
if (!ast_test_flag(&peer->flags[0], SIP_NAT_ROUTE)) {
+ /* use the data provided in the Contact header for call routing */
+ /* XXX This could block for a long time XXX */
+ hp = ast_gethostbyname(n, &ahp);
+ if (!hp) {
+ ast_log(LOG_WARNING, "Invalid host '%s'\n", n);
+ *peer->fullcontact = '\0';
+ ast_string_field_set(pvt, our_contact, "");
+ return PARSE_REGISTER_FAILED;
+ }
+
peer->addr.sin_family = AF_INET;
memcpy(&peer->addr.sin_addr, hp->h_addr, sizeof(peer->addr.sin_addr));
peer->addr.sin_port = htons(port);
@@ -8771,6 +8845,16 @@
peer->addr = pvt->recv;
}
+ /* Check that they're allowed to register at this IP */
+ memcpy(&testsin.sin_addr, &peer->addr.sin_addr, sizeof(testsin.sin_addr));
+ if (ast_apply_ha(global_contact_ha, &testsin) != AST_SENSE_ALLOW ||
+ ast_apply_ha(peer->contactha, &testsin) != AST_SENSE_ALLOW) {
+ ast_log(LOG_WARNING, "Host '%s' disallowed by contact ACL (violating IP %s)\n", n, ast_inet_ntoa(testsin.sin_addr));
+ *peer->fullcontact = '\0';
+ ast_string_field_set(pvt, our_contact, "");
+ return PARSE_REGISTER_DENIED;
+ }
+
/* Save SIP options profile */
peer->sipoptions = pvt->sipoptions;
@@ -9109,7 +9193,7 @@
if (wrongnonce) {
if (good_response) {
if (sipdebug)
- ast_log(LOG_NOTICE, "Correct auth, but based on stale nonce received from '%s'\n", get_header(req, "To"));
+ ast_log(LOG_NOTICE, "Correct auth, but based on stale nonce received from '%s'\n", get_header(req, "From"));
/* We got working auth token, based on stale nonce . */
set_nonce_randdata(p, 0);
transmit_response_with_auth(p, response, req, p->randdata, reliable, respheader, TRUE);
@@ -9131,7 +9215,7 @@
return AUTH_CHALLENGE_SENT;
}
if (good_response) {
- append_history(p, "AuthOK", "Auth challenge succesful for %s", username);
+ append_history(p, "AuthOK", "Auth challenge successful for %s", username);
return AUTH_SUCCESSFUL;
}
@@ -11214,6 +11298,7 @@
ast_cli(fd, " Send RPID : %s\n", ast_test_flag(&peer->flags[0], SIP_SENDRPID) ? "Yes" : "No");
ast_cli(fd, " Subscriptions: %s\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_ALLOWSUBSCRIBE) ? "Yes" : "No");
ast_cli(fd, " Overlap dial : %s\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_ALLOWOVERLAP) ? "Yes" : "No");
+ ast_cli(fd, " Forward Loop : %s\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_FORWARD_LOOP_DETECTED) ? "Yes" : "No");
/* - is enumerated */
ast_cli(fd, " DTMFmode : %s\n", dtmfmode2str(ast_test_flag(&peer->flags[0], SIP_DTMF)));
@@ -11517,7 +11602,7 @@
ast_cli(fd, " MOH Interpret: %s\n", default_mohinterpret);
ast_cli(fd, " MOH Suggest: %s\n", default_mohsuggest);
ast_cli(fd, " Voice Mail Extension: %s\n", default_vmexten);
-
+ ast_cli(fd, " Forward Detected Loops: %s\n", (ast_test_flag(&global_flags[1], SIP_PAGE2_FORWARD_LOOP_DETECTED) ? "Yes" : "No"));
if (realtimepeers || realtimeusers) {
ast_cli(fd, "\nRealtime SIP Settings:\n");
@@ -12145,8 +12230,15 @@
initreqprep(&req, p, SIP_NOTIFY);
- for (var = varlist; var; var = var->next)
+ for (var = varlist; var; var = var->next) {
+ if (!strcasecmp(var->name, "Content-Length")) {
+ if (option_debug >= 2) {
+ ast_log(LOG_DEBUG, "Ignoring pair %s=%s\n", var->name, var->value);
+ }
+ continue; /* ignore content-length, it is calculated automatically */
+ }
add_header(&req, var->name, ast_unescape_semicolon(var->value));
+ }
/* Recalculate our side, and recalculate Call ID */
if (ast_sip_ouraddrfor(&p->sa.sin_addr, &p->ourip))
@@ -12788,6 +12880,7 @@
if (!strncasecmp(s, "sip:", 4))
s += 4;
+ ast_uri_decode(s);
if (option_debug > 1)
ast_log(LOG_DEBUG, "Received 302 Redirect to extension '%s' (domain %s)\n", s, domain);
if (p->owner) {
@@ -13107,23 +13200,21 @@
case 606: /* Not Acceptable */
xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
if (reinvite && p->udptl) {
- /* If this is a T.38 call, we should go back to
- audio. If this is an audio call - something went
- terribly wrong since we don't renegotiate codecs,
- only IP/port .
- */
p->t38.state = T38_DISABLED;
/* Try to reset RTP timers */
ast_rtp_set_rtptimers_onhold(p->rtp);
- ast_log(LOG_ERROR, "Got error on T.38 re-invite. Bad configuration. Peer needs to have T.38 disabled.\n");
+ /* Trigger a reinvite back to audio */
+ transmit_reinvite_with_sdp(p);
- /*! \bug Is there any way we can go back to the audio call on both
- sides here?
- */
- /* While figuring that out, hangup the call */
- if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))
- ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
- ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
+ if (p->owner && (p->owner->_state == AST_STATE_UP) && (bridgepeer = ast_bridged_channel(p->owner))) { /* if this is a re-invite */
+ struct sip_pvt *bridgepvt = NULL;
+ if (bridgepeer->tech == &sip_tech || bridgepeer->tech == &sip_tech_info) {
+ bridgepvt = (struct sip_pvt*)(bridgepeer->tech_pvt);
+ if (bridgepvt->udptl) {
+ sip_handle_t38_reinvite(bridgepeer, p, 0);
+ }
+ }
+ }
} else {
/* We can't set up this call, so give up */
if (p->owner && !ast_test_flag(req, SIP_PKT_IGNORE))
@@ -13709,16 +13800,19 @@
if (p->owner)
ast_queue_control(p->owner, AST_CONTROL_BUSY);
break;
- case 482: /*
- \note SIP is incapable of performing a hairpin call, which
- is yet another failure of not having a layer 2 (again, YAY
- IETF for thinking ahead). So we treat this as a call
- forward and hope we end up at the right place... */
- if (option_debug)
- ast_log(LOG_DEBUG, "Hairpin detected, setting up call forward for what it's worth\n");
- if (p->owner)
+ case 482: /* Loop Detected */
+ /*
+ \note Asterisk has historically tried to do a call forward when it
+ gets a 482, but that behavior isn't necessarily the best course of
+ action. Go ahead and do it anyway by default, but allow the option
+ to immediately pass to the next line in the dialplan. */
+ if (p->owner && ast_test_flag(&p->flags[1], SIP_PAGE2_FORWARD_LOOP_DETECTED)) {
+ if (option_debug) {
+ ast_log(LOG_DEBUG, "Hairpin detected, setting up call forward for what it's worth\n");
+ }
ast_string_field_build(p->owner, call_forward,
"Local/%s@%s", p->username, p->context);
+ }
/* Fall through */
case 480: /* Temporarily Unavailable */
case 404: /* Not Found */
@@ -13761,7 +13855,7 @@
}
}
} else
- ast_log(LOG_NOTICE, "Dont know how to handle a %d %s response from %s\n", resp, rest, p->owner ? p->owner->name : ast_inet_ntoa(p->sa.sin_addr));
+ ast_log(LOG_NOTICE, "Don't know how to handle a %d %s response from %s\n", resp, rest, p->owner ? p->owner->name : ast_inet_ntoa(p->sa.sin_addr));
}
} else {
/* Responses to OUTGOING SIP requests on INCOMING calls
@@ -14480,7 +14574,7 @@
return 0;
}
-/*! \brief helper routine for sip_uri_cmp
+/*! \brief helper routine for sip_uri_cmp to compare URI parameters
*
* This takes the parameters from two SIP URIs and determines
* if the URIs match. The rules for parameters *suck*. Here's a breakdown
@@ -14494,9 +14588,10 @@
*
* \param input1 Parameters from URI 1
* \param input2 Parameters from URI 2
- * \return Return 0 if the URIs' parameters match, 1 if they do not
+ * \retval 0 URIs' parameters match
+ * \retval nonzero URIs' parameters do not match
*/
-static int sip_uri_params_cmp(const char *input1, const char *input2)
+static int sip_uri_params_cmp(const char *input1, const char *input2)
{
char *params1 = NULL;
char *params2 = NULL;
@@ -14520,43 +14615,36 @@
params2 = ast_strdupa(input2);
}
- /*Quick optimization. If both params are zero-length, then
+ /* Quick optimization. If both params are zero-length, then
* they match
*/
if (zerolength1 && zerolength2) {
return 0;
}
- pos1 = params1;
- while (!ast_strlen_zero(pos1)) {
- char *name1 = pos1;
- char *value1 = strchr(pos1, '=');
- char *semicolon1 = strchr(pos1, ';');
+ for (pos1 = strsep(¶ms1, ";"); pos1; pos1 = strsep(¶ms1, ";")) {
+ char *value1 = pos1;
+ char *name1 = strsep(&value1, "=");
+ char *params2dup = NULL;
int matched = 0;
- if (semicolon1) {
- *semicolon1++ = '\0';
- }
if (!value1) {
- goto fail;
+ value1 = "";
}
- *value1++ = '\0';
- /* Checkpoint reached. We have the name and value parsed for param1
- * We have to duplicate params2 each time through the second loop
- * or else we can't search and replace the semicolons with \0 each
- * time
+ /* Checkpoint reached. We have the name and value parsed for param1
+ * We have to duplicate params2 each time through this loop
+ * or else the inner loop below will not work properly.
*/
- pos2 = ast_strdupa(params2);
- while (!ast_strlen_zero(pos2)) {
+ if (!zerolength2) {
+ params2dup = ast_strdupa(params2);
+ }
+ for (pos2 = strsep(¶ms2dup, ";"); pos2; pos2 = strsep(¶ms2dup, ";")) {
char *name2 = pos2;
char *value2 = strchr(pos2, '=');
- char *semicolon2 = strchr(pos2, ';');
- if (semicolon2) {
- *semicolon2++ = '\0';
- }
if (!value2) {
- goto fail;
+ value2 = "";
+ } else {
+ *value2++ = '\0';
}
- *value2++ = '\0';
if (!strcasecmp(name1, name2)) {
if (strcasecmp(value1, value2)) {
goto fail;
@@ -14565,9 +14653,8 @@
break;
}
}
- pos2 = semicolon2;
}
- /* Need to see if the parameter we're looking at is one of the 'must-match' parameters */
+ /* Check to see if the parameter is one of the 'must-match' parameters */
if (!strcasecmp(name1, "maddr")) {
if (matched) {
maddrmatch = 1;
@@ -14593,25 +14680,18 @@
goto fail;
}
}
- pos1 = semicolon1;
}
/* We've made it out of that horrible O(m*n) construct and there are no
* failures yet. We're not done yet, though, because params2 could have
* an maddr, ttl, user, or method header and params1 did not.
*/
- pos2 = params2;
- while (!ast_strlen_zero(pos2)) {
- char *name2 = pos2;
- char *value2 = strchr(pos2, '=');
- char *semicolon2 = strchr(pos2, ';');
- if (semicolon2) {
- *semicolon2++ = '\0';
- }
+ for (pos2 = strsep(¶ms2, ";"); pos2; pos2 = strsep(¶ms2, ";")) {
+ char *value2 = pos2;
+ char *name2 = strsep(&value2, "=");
if (!value2) {
- goto fail;
+ value2 = "";
}
- *value2++ = '\0';
if ((!strcasecmp(name2, "maddr") && !maddrmatch) ||
(!strcasecmp(name2, "ttl") && !ttlmatch) ||
(!strcasecmp(name2, "user") && !usermatch) ||
@@ -16471,7 +16551,7 @@
}
if (!p->initreq.headers) {
if (option_debug)
- ast_log(LOG_DEBUG, "That's odd... Got a response on a call we dont know about. Cseq %d Cmd %s\n", seqno, cmd);
+ ast_log(LOG_DEBUG, "That's odd... Got a response on a call we don't know about. Cseq %d Cmd %s\n", seqno, cmd);
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
return 0;
}
@@ -17578,6 +17658,9 @@
} else if (!strcasecmp(v->name, "t38pt_usertpsource")) {
ast_set_flag(&mask[1], SIP_PAGE2_UDPTL_DESTINATION);
ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_UDPTL_DESTINATION);
+ } else if (!strcasecmp(v->name, "forwardloopdetected")) {
+ ast_set_flag(&mask[1], SIP_PAGE2_FORWARD_LOOP_DETECTED);
+ ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_FORWARD_LOOP_DETECTED);
} else
res = 0;
@@ -17987,9 +18070,11 @@
}
if (realtime && !strcasecmp(v->name, "regseconds")) {
ast_get_time_t(v->value, ®seconds, 0, NULL);
- } else if (realtime && !strcasecmp(v->name, "name"))
+ } else if (realtime && !strcasecmp(v->name, "name")) {
ast_copy_string(peer->name, v->value, sizeof(peer->name));
- else if (realtime && !strcasecmp(v->name, "fullcontact")) {
+ } else if (realtime && !strcasecmp(v->name, "useragent")) {
+ ast_copy_string(peer->useragent, v->value, sizeof(peer->useragent));
+ } else if (realtime && !strcasecmp(v->name, "fullcontact")) {
if (alt_fullcontact && !alt) {
/* Reset, because the alternate also has a fullcontact and we
* do NOT want the field value to be doubled. It might be
@@ -18007,13 +18092,13 @@
ast_copy_string(fullcontact, v->value, sizeof(fullcontact));
ast_set_flag(&peer->flags[1], SIP_PAGE2_RT_FROMCONTACT);
}
- } else if (!strcasecmp(v->name, "secret"))
+ } else if (!strcasecmp(v->name, "secret")) {
ast_copy_string(peer->secret, v->value, sizeof(peer->secret));
- else if (!strcasecmp(v->name, "md5secret"))
+ } else if (!strcasecmp(v->name, "md5secret")) {
ast_copy_string(peer->md5secret, v->value, sizeof(peer->md5secret));
- else if (!strcasecmp(v->name, "auth"))
+ } else if (!strcasecmp(v->name, "auth")) {
peer->auth = add_realm_authentication(peer->auth, v->value, v->lineno);
- else if (!strcasecmp(v->name, "callerid")) {
+ } else if (!strcasecmp(v->name, "callerid")) {
ast_callerid_split(v->value, peer->cid_name, sizeof(peer->cid_name), peer->cid_num, sizeof(peer->cid_num));
} else if (!strcasecmp(v->name, "fullname")) {
ast_copy_string(peer->cid_name, v->value, sizeof(peer->cid_name));
@@ -18392,6 +18477,7 @@
ast_set_flag(&global_flags[0], SIP_DTMF_RFC2833); /*!< Default DTMF setting: RFC2833 */
ast_set_flag(&global_flags[0], SIP_NAT_RFC3581); /*!< NAT support if requested by device with rport */
ast_set_flag(&global_flags[0], SIP_CAN_REINVITE); /*!< Allow re-invites */
+ ast_set_flag(&global_flags[1], SIP_PAGE2_FORWARD_LOOP_DETECTED); /*!< Set up call forward on 482 Loop Detected */
/* Debugging settings, always default to off */
dumphistory = FALSE;
@@ -18830,6 +18916,8 @@
ast_log(LOG_WARNING, "Unable to set SIP TOS to %s\n", ast_tos2str(global_tos_sip));
}
}
+ } else if (setsockopt(sipsock, IPPROTO_IP, IP_TOS, &global_tos_sip, sizeof(global_tos_sip))) {
+ ast_log(LOG_WARNING, "Unable to set SIP TOS to %s\n", ast_tos2str(global_tos_sip));
}
ast_mutex_unlock(&netlock);
@@ -18980,7 +19068,7 @@
p->lastrtprx = p->lastrtptx = time(NULL);
ast_mutex_unlock(&p->lock);
return 0;
- } else { /* If we are handling sending 200 OK to the other side of the bridge */
+ } else if (pvt->t38.state != T38_DISABLED) { /* If we are handling sending 200 OK to the other side of the bridge */
if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE) && ast_test_flag(&pvt->flags[0], SIP_CAN_REINVITE)) {
ast_udptl_get_peer(pvt->udptl, &p->udptlredirip);
flag = 1;
@@ -19003,10 +19091,23 @@
p->lastrtprx = p->lastrtptx = time(NULL);
ast_mutex_unlock(&p->lock);
return 0;
+ } else if (pvt->t38.state == T38_DISABLED) { /* The other side can not talk T.38 with us. We tell it to the the originating T.38 party with a 488 */
+ p->t38.state = T38_DISABLED;
+ if (option_debug > 1) {
+ ast_log(LOG_DEBUG, "T38 changed state to %d on channel %s\n", pvt->t38.state, pvt->owner ? pvt->owner->name : "<none>");
+ ast_log(LOG_DEBUG, "T38 changed state to %d on channel %s\n", p->t38.state, chan ? chan->name : "<none>");
+ }
+ transmit_response_reliable(p, "488 Not acceptable here", &p->initreq);
+ p->lastrtprx = p->lastrtptx = time(NULL);
+ ast_mutex_unlock(&p->lock);
+ return 0;
+ } else {
+ ast_log(LOG_ERROR, "Something went wrong with T.38. State is:%d on channel %s and %d on channel %s\n", pvt->t38.state, pvt->owner ? pvt->owner->name : "<none>", p->t38.state, chan ? chan->name : "<none>");
+ ast_mutex_unlock(&p->lock);
+ return 0;
}
}
-
/*! \brief Returns null if we can't reinvite audio (part of RTP interface) */
static enum ast_rtp_get_result sip_get_rtp_peer(struct ast_channel *chan, struct ast_rtp **rtp)
{
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/channels/h323/Makefile.in
^
|
@@ -35,8 +35,12 @@
libchanh323.a: $(OBJS)
ar crv $@ $(OBJS)
-cisco-h225.cxx:: cisco-h225.asn
- asnparser -m CISCO_H225 -c $<
+#
+# We have this file in svn, so this is commented out to ensure it doesn't try
+# to run implicitly. However, it's still here for reference.
+#
+#cisco-h225.cxx:: cisco-h225.asn
+# asnparser -m CISCO_H225 -c $<
Makefile.ast:
@echo H323CFLAGS = $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) >$@.tmp
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/codecs/codec_adpcm.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 40722 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267539 $")
#include <fcntl.h>
#include <netinet/in.h>
@@ -335,7 +335,6 @@
.desc_size = sizeof(struct adpcm_decoder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
- .plc_samples = 160,
};
static struct ast_translator lintoadpcm = {
@@ -350,26 +349,9 @@
.buf_size = BUFFER_SAMPLES/ 2, /* 2 samples per byte */
};
-static void parse_config(void)
-{
- struct ast_config *cfg = ast_config_load("codecs.conf");
- struct ast_variable *var;
- if (cfg == NULL)
- return;
- for (var = ast_variable_browse(cfg, "plc"); var ; var = var->next) {
- if (!strcasecmp(var->name, "genericplc")) {
- adpcmtolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_adpcm: %susing generic PLC\n", adpcmtolin.useplc ? "" : "not ");
- }
- }
- ast_config_destroy(cfg);
-}
-
/*! \brief standard module glue */
static int reload(void)
{
- parse_config();
return 0;
}
@@ -387,7 +369,6 @@
{
int res;
- parse_config();
res = ast_register_translator(&adpcmtolin);
if (!res)
res = ast_register_translator(&lintoadpcm);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/codecs/codec_alaw.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 40722 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267539 $")
#include <fcntl.h>
#include <netinet/in.h>
@@ -121,7 +121,6 @@
.sample = alawtolin_sample,
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
- .plc_samples = 160,
};
static struct ast_translator lintoalaw = {
@@ -134,27 +133,10 @@
.buf_size = BUFFER_SAMPLES,
};
-static void parse_config(void)
-{
- struct ast_variable *var;
- struct ast_config *cfg = ast_config_load("codecs.conf");
- if (!cfg)
- return;
- for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
- if (!strcasecmp(var->name, "genericplc")) {
- alawtolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_alaw: %susing generic PLC\n", alawtolin.useplc ? "" : "not ");
- }
- }
- ast_config_destroy(cfg);
-}
-
/*! \brief standard module stuff */
static int reload(void)
{
- parse_config();
return 0;
}
@@ -172,7 +154,6 @@
{
int res;
- parse_config();
res = ast_register_translator(&alawtolin);
if (!res)
res = ast_register_translator(&lintoalaw);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/codecs/codec_dahdi.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 224931 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267539 $")
#include <fcntl.h>
#include <stdlib.h>
@@ -65,8 +65,6 @@
#define G723_SAMPLES 240
#define G729_SAMPLES 160
-static unsigned int global_useplc = 0;
-
static struct channel_usage {
int total;
int encoders;
@@ -513,29 +511,14 @@
if (is_encoder(zt)) {
zt->t.framein = dahdi_encoder_framein;
zt->t.frameout = dahdi_encoder_frameout;
-#if 0
- zt->t.buffer_samples = 0;
-#endif
} else {
zt->t.framein = dahdi_decoder_framein;
zt->t.frameout = dahdi_decoder_frameout;
-#if 0
- if (AST_FORMAT_G723_1 == zt->t.srcfmt) {
- zt->t.plc_samples = G723_SAMPLES;
- } else {
- zt->t.plc_samples = G729_SAMPLES;
- }
- zt->t.buffer_samples = zt->t.plc_samples * 8;
-#endif
}
zt->t.destroy = dahdi_destroy;
zt->t.buffer_samples = 0;
zt->t.newpvt = dahdi_new;
zt->t.sample = fakesrc_sample;
-#if 0
- zt->t.useplc = global_useplc;
-#endif
- zt->t.useplc = 0;
zt->t.native_plc = 0;
zt->t.desc_size = sizeof(struct codec_dahdi_pvt);
@@ -587,26 +570,6 @@
AST_LIST_UNLOCK(&translators);
}
-static void parse_config(void)
-{
- struct ast_variable *var;
- struct ast_config *cfg = ast_config_load("codecs.conf");
-
- if (!cfg)
- return;
-
- for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
- if (!strcasecmp(var->name, "genericplc")) {
- global_useplc = ast_true(var->value);
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_zap: %susing generic PLC\n",
- global_useplc ? "" : "not ");
- }
- }
-
- ast_config_destroy(cfg);
-}
-
static void build_translators(struct format_map *map, unsigned int dstfmts, unsigned int srcfmts)
{
unsigned int src, dst;
@@ -681,15 +644,6 @@
static int reload(void)
{
- struct translator *cur;
-
- parse_config();
-
- AST_LIST_LOCK(&translators);
- AST_LIST_TRAVERSE(&translators, cur, entry)
- cur->t.useplc = global_useplc;
- AST_LIST_UNLOCK(&translators);
-
return 0;
}
@@ -704,7 +658,6 @@
static int load_module(void)
{
ast_ulaw_init();
- parse_config();
find_transcoders();
ast_cli_register_multiple(cli, sizeof(cli) / sizeof(cli[0]));
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/codecs/codec_g726.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 229281 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267539 $")
#include <fcntl.h>
#include <netinet/in.h>
@@ -818,7 +818,6 @@
.desc_size = sizeof(struct g726_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
- .plc_samples = 160,
};
static struct ast_translator lintog726 = {
@@ -843,7 +842,6 @@
.desc_size = sizeof(struct g726_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
- .plc_samples = 160,
};
static struct ast_translator lintog726aal2 = {
@@ -858,28 +856,8 @@
.buf_size = BUFFER_SAMPLES / 2,
};
-static void parse_config(void)
-{
- struct ast_variable *var;
- struct ast_config *cfg = ast_config_load("codecs.conf");
-
- if (!cfg)
- return;
- for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
- if (!strcasecmp(var->name, "genericplc")) {
- g726tolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_g726: %susing generic PLC\n",
- g726tolin.useplc ? "" : "not ");
- }
- }
- ast_config_destroy(cfg);
-}
-
static int reload(void)
{
- parse_config();
-
return 0;
}
@@ -900,9 +878,6 @@
{
int res = 0;
-
- parse_config();
-
res |= ast_register_translator(&g726tolin);
res |= ast_register_translator(&lintog726);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/codecs/codec_gsm.c
^
|
@@ -32,7 +32,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 52997 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267539 $")
#include <fcntl.h>
#include <stdlib.h>
@@ -218,7 +218,6 @@
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
.desc_size = sizeof (struct gsm_translator_pvt ),
- .plc_samples = GSM_SAMPLES,
};
static struct ast_translator lintogsm = {
@@ -234,27 +233,9 @@
.buf_size = (BUFFER_SAMPLES * GSM_FRAME_LEN + GSM_SAMPLES - 1)/GSM_SAMPLES,
};
-
-static void parse_config(void)
-{
- struct ast_variable *var;
- struct ast_config *cfg = ast_config_load("codecs.conf");
- if (!cfg)
- return;
- for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
- if (!strcasecmp(var->name, "genericplc")) {
- gsmtolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_gsm: %susing generic PLC\n", gsmtolin.useplc ? "" : "not ");
- }
- }
- ast_config_destroy(cfg);
-}
-
/*! \brief standard module glue */
static int reload(void)
{
- parse_config();
return 0;
}
@@ -273,7 +254,6 @@
{
int res;
- parse_config();
res = ast_register_translator(&gsmtolin);
if (!res)
res=ast_register_translator(&lintogsm);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/codecs/codec_lpc10.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 42477 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267539 $")
#include <fcntl.h>
#include <stdlib.h>
@@ -243,7 +243,6 @@
.sample = lpc10tolin_sample,
.desc_size = sizeof(struct lpc10_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
- .plc_samples = LPC10_SAMPLES_PER_FRAME,
.buf_size = BUFFER_SAMPLES * 2,
};
@@ -261,27 +260,8 @@
.buf_size = LPC10_BYTES_IN_COMPRESSED_FRAME * (1 + BUFFER_SAMPLES / LPC10_SAMPLES_PER_FRAME),
};
-static void parse_config(void)
-{
- struct ast_variable *var;
- struct ast_config *cfg = ast_config_load("codecs.conf");
- if (!cfg)
- return;
- for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
- if (!strcasecmp(var->name, "genericplc")) {
- lpc10tolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_lpc10: %susing generic PLC\n",
- lpc10tolin.useplc ? "" : "not ");
- }
- }
- ast_config_destroy(cfg);
-}
-
static int reload(void)
{
- parse_config();
-
return 0;
}
@@ -300,7 +280,6 @@
{
int res;
- parse_config();
res=ast_register_translator(&lpc10tolin);
if (!res)
res=ast_register_translator(&lintolpc10);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/codecs/codec_ulaw.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 40722 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267539 $")
#include <fcntl.h>
#include <netinet/in.h>
@@ -130,7 +130,6 @@
.sample = ulawtolin_sample,
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
- .plc_samples = 160,
};
/*!
@@ -147,26 +146,8 @@
.buffer_samples = BUFFER_SAMPLES,
};
-static void parse_config(void)
-{
- struct ast_variable *var;
- struct ast_config *cfg = ast_config_load("codecs.conf");
- if (!cfg)
- return;
- for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
- if (!strcasecmp(var->name, "genericplc")) {
- ulawtolin.useplc = ast_true(var->value) ? 1 : 0;
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "codec_ulaw: %susing generic PLC\n", ulawtolin.useplc ? "" : "not ");
- }
- }
- ast_config_destroy(cfg);
-}
-
static int reload(void)
{
- parse_config();
-
return 0;
}
@@ -184,7 +165,6 @@
{
int res;
- parse_config();
res = ast_register_translator(&ulawtolin);
if (!res)
res = ast_register_translator(&lintoulaw);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/configs/extensions.conf.sample
^
|
@@ -449,7 +449,7 @@
; ${ARG1} - Device to page
exten => s,1,ChanIsAvail(${ARG1}|js) ; j is for Jump and s is for ANY call
-exten => s,n,GoToIf([${AVAILORIGCHAN} = ""]?fail:autoanswer)
+exten => s,n,GoToIf($[${AVAILORIGCHAN} = ""]?fail:autoanswer)
exten => s,n(autoanswer),Set(_ALERT_INFO="RA") ; This is for the PolyComs
exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others
exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!!
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/configs/indications.conf.sample
^
|
@@ -479,10 +479,10 @@
ring = 400+450/400,0/200,400+450/400,0/2000
congestion = 400/375,0/375
callwaiting = !400/200,!0/3000,!400/200,!0/3000,!400/200,!0/3000,!400/200
-dialrecall = !400/100!0/100,!400/100,!0/100,!400/100,!0/100,400
+dialrecall = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
record = 1400/425,0/15000
info = 400/750,0/100,400/750,0/100,400/750,0/100,400/750,0/400
-stutter = !400/100!0/100,!400/100,!0/100,!400/100,!0/100,!400/100!0/100,!400/100,!0/100,!400/100,!0/100,400
+stutter = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
unobtainable = 400/75,0/100,400/75,0/100,400/75,0/100,400/75,0/400
[ph]
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/configs/say.conf.sample
^
|
@@ -98,18 +98,28 @@
_[n]um:1X => digits/${SAY}
_[n]um:[2-9]0 => digits/${SAY}
_[n]um:[2-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1}
+ _[n]um:X00 => num:${SAY:0:1}, digits/hundred
_[n]um:XXX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
+ _[n]um:X000 => num:${SAY:0:1}, digits/thousand
_[n]um:XXXX => num:${SAY:0:1}, digits/thousand, num:${SAY:1}
+ _[n]um:XX000 => num:${SAY:0:2}, digits/thousand
_[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
+ _[n]um:XXX000 => num:${SAY:0:3}, digits/thousand
_[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3}
+ _[n]um:X000000 => num:${SAY:0:1}, digits/million
_[n]um:XXXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
+ _[n]um:XX000000 => num:${SAY:0:2}, digits/million
_[n]um:XXXXXXXX => num:${SAY:0:2}, digits/million, num:${SAY:2}
+ _[n]um:XXX000000 => num:${SAY:0:3}, digits/million
_[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/million, num:${SAY:3}
+ _[n]um:X000000000 => num:${SAY:0:1}, digits/billion
_[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1}
+ _[n]um:XX000000000 => num:${SAY:0:2}, digits/billion
_[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2}
+ _[n]um:XXX000000000 => num:${SAY:0:3}, digits/billion
_[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3}
; enumeration
@@ -117,7 +127,11 @@
_e[n]um:1X => digits/h-${SAY}
_e[n]um:[2-9]0 => digits/h-${SAY}
_e[n]um:[2-9][1-9] => num:${SAY:0:1}0, digits/h-${SAY:1}
- _e[n]um:[1-9]XX => num:${SAY:0:1}, digits/hundred, enum:${SAY:1}
+ _e[n]um:[1-9]00 => num:${SAY:0:1}, digits/h-hundred
+ _e[n]um:[1-9]XX => num:${SAY:0:1}, digits/h-hundred, enum:${SAY:1}
+
+[en_GB](date-base,digit-base,en-base)
+ _[n]um:XXX => num:${SAY:0:1}, digits/hundred, vm-and, num:${SAY:1}
[it](digit-base,date-base)
_[n]um:0. => num:${SAY:1}
@@ -125,19 +139,36 @@
_[n]um:1X => digits/${SAY}
_[n]um:[2-9]0 => digits/${SAY}
_[n]um:[2-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1}
+ _[n]um:100 => digits/hundred
_[n]um:1XX => digits/hundred, num:${SAY:1}
+ _[n]um:[2-9]00 => num:${SAY:0:1}, digits/hundred
_[n]um:[2-9]XX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
+ _[n]um:1000 => digits/thousand
_[n]um:1XXX => digits/thousand, num:${SAY:1}
+ _[n]um:[2-9]000 => num:${SAY:0:1}, digits/thousands
_[n]um:[2-9]XXX => num:${SAY:0:1}, digits/thousands, num:${SAY:1}
+ _[n]um:XX000 => num:${SAY:0:2}, digits/thousands
_[n]um:XXXXX => num:${SAY:0:2}, digits/thousands, num:${SAY:2}
+ _[n]um:XXX000 => num:${SAY:0:3}, digits/thousands
_[n]um:XXXXXX => num:${SAY:0:3}, digits/thousands, num:${SAY:3}
+ _[n]um:1000000 => num:${SAY:0:1}, digits/million
_[n]um:1XXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
+ _[n]um:[2-9]000000 => num:${SAY:0:1}, digits/millions
_[n]um:[2-9]XXXXXX => num:${SAY:0:1}, digits/millions, num:${SAY:1}
+ _[n]um:XX000000 => num:${SAY:0:2}, digits/millions
_[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2}
+ _[n]um:XXX000000 => num:${SAY:0:3}, digits/millions
_[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3}
+ _[n]um:X000000000 => num:${SAY:0:1}, digits/billion
+ _[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1}
+ _[n]um:XX000000000 => num:${SAY:0:2}, digits/billion
+ _[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2}
+ _[n]um:XXX000000000 => num:${SAY:0:3}, digits/billion
+ _[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3}
+
_datetime::. => date:AdBY 'digits/at' IMp:${SAY}
_date::. => date:AdBY:${SAY}
_time::. => date:IMp:${SAY}
@@ -153,16 +184,27 @@
_[n]um:1X => digits/${SAY}
_[n]um:[2-9]0 => digits/${SAY}
_[n]um:[2-9][1-9] => digits/${SAY:1}-and, digits/${SAY:0:1}0
+ _[n]um:100 => digits/ein, digits/hundred
_[n]um:1XX => digits/ein, digits/hundred, num:${SAY:1}
+ _[n]um:[2-9]00 => digits/${SAY:0:1}, digits/hundred
_[n]um:[2-9]XX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1}
+
+ _[n]um:1000 => digits/ein, digits/thousand
_[n]um:1XXX => digits/ein, digits/thousand, num:${SAY:1}
+ _[n]um:[2-9]000 => digits/${SAY:0:1}, digits/thousand
_[n]um:[2-9]XXX => digits/${SAY:0:1}, digits/thousand, num:${SAY:1}
+ _[n]um:XX000 => num:${SAY:0:2}, digits/thousand
_[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
- _[n]um:X00XXX => digits/${SAY:0:1}, digits/hundred, digits/thousand, num:${SAY:3}
- _[n]um:XXXXXX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1}
+ _[n]um:XXX000 => num:${SAY:0:3}, digits/thousand
+ _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:1}
+
+ _[n]um:1000000 => digits/eine, digits/million
_[n]um:1XXXXXX => digits/eine, digits/million, num:${SAY:1}
+ _[n]um:[2-9]000000 => digits/${SAY:0:1}, digits/millions
_[n]um:[2-9]XXXXXX => digits/${SAY:0:1}, digits/millions, num:${SAY:1}
+ _[n]um:XX000000 => num:${SAY:0:2}, digits/millions
_[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2}
+ _[n]um:XXX000000 => num:${SAY:0:3}, digits/millions
_[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3}
_datetime::. => date:AdBY 'digits/at' IMp:${SAY}
@@ -181,16 +223,25 @@
_[n]um:[2-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1}
_[n]um:100 => digits/hundred
_[n]um:1XX => digits/hundred, num:${SAY:1}
+ _[n]um:[2-9]00 => num:${SAY:0:1}, digits/hundred
_[n]um:[2-9]XX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
+ _[n]um:1000 => digits/thousand
_[n]um:1XXX => digits/thousand, num:${SAY:1}
+ _[n]um:[2-9]000 => num:${SAY:0:1}, digits/thousand
_[n]um:[2-9]XXX => num:${SAY:0:1}, digits/thousand, num:${SAY:1}
+ _[n]um:XX000 => num:${SAY:0:2}, digits/thousand
_[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
+ _[n]um:XXX000 => num:${SAY:0:3}, digits/thousand
_[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3}
+ _[n]um:1000000 => num:${SAY:0:1}, digits/million
_[n]um:1XXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
+ _[n]um:[2-9]000000 => num:${SAY:0:1}, digits/million
_[n]um:[2-9]XXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
+ _[n]um:XX000000 => num:${SAY:0:2}, digits/million
_[n]um:XXXXXXXX => num:${SAY:0:2}, digits/million, num:${SAY:2}
+ _[n]um:XXX000000 => num:${SAY:0:3}, digits/million
_[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/million, num:${SAY:3}
_datetime::. => date:AdBY 'digits/at' H 'hours' M 'perc':${SAY}
@@ -200,3 +251,51 @@
_pho[n]e:XXXX => num:${SAY:0:2}, num:${SAY:2:2}
_pho[n]e:0[1-9]XXXXXXXX => num:${SAY:0:1}, num:${SAY:1:1}, num:${SAY:2:2}, num:${SAY:4:2}, num:${SAY:6:2}, num:${SAY:8:2}
_pho[n]e:. => digit:${SAY}
+
+[da](date-base,digit-base)
+ _[n]um:0. => num:${SAY:1}
+ _[n]um:X => digits/${SAY}
+ _[n]um:1X => digits/${SAY}
+ _[n]um:[2-9]0 => digits/${SAY}
+ _[n]um:[2-9][1-9] => digits/${SAY:1}-and, digits/${SAY:0:1}0
+ _[n]um:100 => digits/1N, digits/hundred
+ _[n]um:1XX => digits/1N, digits/hundred, num:${SAY:1}
+ _[n]um:[2-9]00 => digits/${SAY:0:1}, digits/hundred
+ _[n]um:[2-9]XX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1}
+
+ _[n]um:1000 => digits/1N, digits/thousand
+ _[n]um:1XXX => digits/1N, digits/thousand, num:${SAY:1}
+ _[n]um:[2-9]000 => digits/${SAY:0:1}, digits/thousand
+ _[n]um:[2-9]XXX => digits/${SAY:0:1}, digits/thousand, num:${SAY:1}
+ _[n]um:XX000 => num:${SAY:0:2}, digits/thousand
+ _[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
+ _[n]um:XXX000 => num:${SAY:0:3}, digits/thousand
+ _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3}
+
+ _[n]um:X000000 => digits/${SAY:0:1}, digits/million
+ _[n]um:XXXXXXX => digits/${SAY:0:1}, digits/million, num:${SAY:1}
+ _[n]um:XX000000 => num:${SAY:0:2}, digits/millions
+ _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2}
+ _[n]um:XXX000000 => num:${SAY:0:3}, digits/millions
+ _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3}
+
+ _[n]um:X000000000 => num:${SAY:0:1}, digits/billion
+ _[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1}
+ _[n]um:XX000000000 => num:${SAY:0:2}, digits/billion
+ _[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2}
+ _[n]um:XXX000000000 => num:${SAY:0:3}, digits/billion
+ _[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3}
+
+ _datetime::. => date:AdBY 'digits/at' kM:${SAY}
+ _date::. => date:AdBY:${SAY}
+ _time::. => date:HM:${SAY}
+
+ ; enumeration
+ _e[n]um:X => digits/h-${SAY}
+ _e[n]um:1X => digits/h-${SAY}
+ _e[n]um:[2-9]0 => digits/h-${SAY}
+ _e[n]um:[2-9][1-9] => digits/${SAY:1}-and, digits/h-${SAY:0:1}0
+ _e[n]um:100 => digits/1N, digits/h-hundred
+ _e[n]um:1XX => digits/1N, digits/h-hundred, enum:${SAY:1}
+ _e[n]um:[2-9]00 => num:${SAY:0:1}, digits/h-hundred
+ _e[n]um:[2-9]XX => num:${SAY:0:1}, digits/h-hundred, enum:${SAY:1}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/configs/sip.conf.sample
^
|
@@ -91,6 +91,19 @@
;vmexten=voicemail ; dialplan extension to reach mailbox sets the
; Message-Account in the MWI notify message
; defaults to "asterisk"
+
+; Codec negotiation
+;
+; When Asterisk is receiving a call, the codec will initially be set to the
+; first codec in the allowed codecs defined for the user receiving the call
+; that the caller also indicates that it supports. But, after the caller
+; starts sending RTP, Asterisk will switch to using whatever codec the caller
+; is sending.
+;
+; When Asterisk is placing a call, the codec used will be the first codec in
+; the allowed codecs that the callee indicates that it supports. Asterisk will
+; *not* switch to whatever codec the callee is sending.
+;
;disallow=all ; First disallow all codecs
;allow=ulaw ; Allow codecs in order of preference
;allow=ilbc ; see doc/rtp-packetization for framing options
@@ -119,12 +132,14 @@
; use 'never' to never use in-band signalling, even in cases
; where some buggy devices might not render it
; Valid values: yes, no, never Default: never
-;prematuremedia=no ; Some ISDN links send empty media frames before
- ; the call is in ringing or progress state. The SIP
- ; channel will then send 183 indicating early media
- ; which will be empty - thus users get no ring signal.
- ; Setting this to "no" will stop any media before we have
- ; call progress. Default is "yes".
+;prematuremedia=no ; Some ISDN links send empty media frames before
+ ; the call is in ringing or progress state. The SIP
+ ; channel will then send 183 indicating early media
+ ; which will be empty - thus users get no ring signal.
+ ; Setting this to "yes" will stop any media before we have
+ ; call progress (meaning the SIP channel will not send 183 Session
+ ; Progress for early media). Default is "no". Also make sure that
+ ; the SIP peer is configured with progressinband=never.
;useragent=Asterisk PBX ; Allows you to change the user agent string
;promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address
; Note that promiscredir when redirects are made to the
@@ -176,6 +191,9 @@
;contactdeny=0.0.0.0/0.0.0.0 ; Use contactpermit and contactdeny to
;contactpermit=172.16.0.0/255.255.0.0 ; restrict at what IPs your users may
; register their phones.
+;forwardloopdetected=no ; Attempt to forward a call locally if the
+ ; destination replies with 482 Loop Detected
+ ; default = yes
;
; If regcontext is specified, Asterisk will dynamically create and destroy a
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/configs/sip_notify.conf.sample
^
|
@@ -1,11 +1,9 @@
[polycom-check-cfg]
Event=>check-sync
-Content-Length=>0
; Untested
[sipura-check-cfg]
Event=>resync
-Content-Length=>0
; Untested
[grandstream-check-cfg]
@@ -14,9 +12,7 @@
; Untested
[cisco-check-cfg]
Event=>check-sync
-Content-Length=>0
; Tested
[snom-check-cfg]
Event=>check-sync\;reboot=false
-Content-Length=>0
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/configs/voicemail.conf.sample
^
|
@@ -67,7 +67,8 @@
;smdiport=/dev/ttyS0
; If you need to have an external program, i.e. /usr/bin/myapp
-; called when a voicemail password is changed, uncomment this:
+; called when a voicemail password is changed, uncomment this. The
+; arguments passed to the application are: <context> <mailbox> <newpassword>
;externpass=/usr/bin/myapp
; For the directory, you can override the intro file if you want
;directoryintro=dir-intro
@@ -131,39 +132,6 @@
;
;mailcmd=/usr/sbin/sendmail -t
;
-; Users may be located in different timezones, or may have different
-; message announcements for their introductory message when they enter
-; the voicemail system. Set the message and the timezone each user
-; hears here. Set the user into one of these zones with the tz= attribute
-; in the options field of the mailbox. Of course, language substitution
-; still applies here so you may have several directory trees that have
-; alternate language choices.
-;
-; Look in /usr/share/zoneinfo/ for names of timezones.
-; Look at the manual page for strftime for a quick tutorial on how the
-; variable substitution is done on the values below.
-;
-; Supported values:
-; 'filename' filename of a soundfile (single ticks around the filename
-; required)
-; ${VAR} variable substitution
-; A or a Day of week (Saturday, Sunday, ...)
-; B or b or h Month name (January, February, ...)
-; d or e numeric day of month (first, second, ..., thirty-first)
-; Y Year
-; I or l Hour, 12 hour clock
-; H Hour, 24 hour clock (single digit hours preceded by "oh")
-; k Hour, 24 hour clock (single digit hours NOT preceded by "oh")
-; M Minute, with 00 pronounced as "o'clock"
-; N Minute, with 00 pronounced as "hundred" (US military time)
-; P or p AM or PM
-; Q "today", "yesterday" or ABdY
-; (*note: not standard strftime value)
-; q "" (for today), "yesterday", weekday, or ABdY
-; (*note: not standard strftime value)
-; R 24 hour time, including minute
-;
-;
;
; Each mailbox is listed in the form <mailbox>=<password>,<name>,<email>,<pager_email>,<options>
; if the e-mail is specified, a message will be sent when a message is
@@ -231,6 +199,38 @@
;tempgreetwarn=yes ; Remind the user that their temporary greeting is set
[zonemessages]
+; Users may be located in different timezones, or may have different
+; message announcements for their introductory message when they enter
+; the voicemail system. Set the message and the timezone each user
+; hears here. Set the user into one of these zones with the tz= attribute
+; in the options field of the mailbox. Of course, language substitution
+; still applies here so you may have several directory trees that have
+; alternate language choices.
+;
+; Look in /usr/share/zoneinfo/ for names of timezones.
+; Look at the manual page for strftime for a quick tutorial on how the
+; variable substitution is done on the values below.
+;
+; Supported values:
+; 'filename' filename of a soundfile (single ticks around the filename
+; required)
+; ${VAR} variable substitution
+; A or a Day of week (Saturday, Sunday, ...)
+; B or b or h Month name (January, February, ...)
+; d or e numeric day of month (first, second, ..., thirty-first)
+; Y Year
+; I or l Hour, 12 hour clock
+; H Hour, 24 hour clock (single digit hours preceded by "oh")
+; k Hour, 24 hour clock (single digit hours NOT preceded by "oh")
+; M Minute, with 00 pronounced as "o'clock"
+; N Minute, with 00 pronounced as "hundred" (US military time)
+; P or p AM or PM
+; Q "today", "yesterday" or ABdY
+; (*note: not standard strftime value)
+; q "" (for today), "yesterday", weekday, or ABdY
+; (*note: not standard strftime value)
+; R 24 hour time, including minute
+;
eastern=America/New_York|'vm-received' Q 'digits/at' IMp
central=America/Chicago|'vm-received' Q 'digits/at' IMp
central24=America/Chicago|'vm-received' q 'digits/at' H N 'hours'
@@ -246,7 +246,7 @@
;4300 => 3456,Ben Rigas,ben@american-computer.net
;4310 => -5432,Sales,sales@marko.net
;4069 => 6522,Matt Brooks,matt@marko.net,,|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes|envelope=yes|sayduration=yes|saydurationm=1
-;4073 => 1099,Bianca Paige,bianca@biancapaige.com,,delete=1
+;4073 => 1099,Bianca Paige,bianca@biancapaige.com,,delete=1|rip=2010-06-04
;4110 => 3443,Rob Flynn,rflynn@blueridge.net
;4235 => 1234,Jim Holmes,jim@astricon.ips,,Tz=european
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/configure
^
|
@@ -1,9 +1,9 @@
#! /bin/sh
-# From configure.ac Revision: 259748 .
+# From configure.ac Revision: 278984 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.65 for asterisk 1.4.
#
-# Report bugs to <www.asterisk.org>.
+# Report bugs to <https://issues.asterisk.org>.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -233,11 +233,11 @@
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and www.asterisk.org
-$0: about your system, including any error possibly output
-$0: before this message. Then install a modern shell, or
-$0: manually run the script under such a shell if you do
-$0: have one."
+ $as_echo "$0: Please tell bug-autoconf@gnu.org and
+$0: https://issues.asterisk.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
fi
exit 1
fi
@@ -557,7 +557,7 @@
PACKAGE_TARNAME='asterisk'
PACKAGE_VERSION='1.4'
PACKAGE_STRING='asterisk 1.4'
-PACKAGE_BUGREPORT='www.asterisk.org'
+PACKAGE_BUGREPORT='https://issues.asterisk.org'
PACKAGE_URL=''
ac_unique_file="main/asterisk.c"
@@ -597,9 +597,11 @@
# include <unistd.h>
#endif"
+ac_default_prefix=/usr/local
+ac_default_prefix=/usr/local
+ac_default_prefix=/usr
ac_header_list=
ac_subst_vars='LTLIBOBJS
-_libcurl_config
GTK2_LIB
GTK2_INCLUDE
PBX_GTK2
@@ -673,14 +675,14 @@
FREETDS_DIR
FREETDS_INCLUDE
FREETDS_LIB
-PBX_OPENSSL
-OPENSSL_DIR
-OPENSSL_INCLUDE
-OPENSSL_LIB
PBX_SUPPSERV
SUPPSERV_DIR
SUPPSERV_INCLUDE
SUPPSERV_LIB
+PBX_OPENSSL
+OPENSSL_DIR
+OPENSSL_INCLUDE
+OPENSSL_LIB
PBX_SQLITE
SQLITE_DIR
SQLITE_INCLUDE
@@ -701,10 +703,6 @@
RADIUS_DIR
RADIUS_INCLUDE
RADIUS_LIB
-PBX_OPENH323
-OPENH323_DIR
-OPENH323_INCLUDE
-OPENH323_LIB
PBX_PWLIB
PWLIB_DIR
PWLIB_INCLUDE
@@ -737,6 +735,14 @@
OSPTK_DIR
OSPTK_INCLUDE
OSPTK_LIB
+PBX_OPENR2
+OPENR2_DIR
+OPENR2_INCLUDE
+OPENR2_LIB
+PBX_OPENAIS
+OPENAIS_DIR
+OPENAIS_INCLUDE
+OPENAIS_LIB
PBX_OGG
OGG_DIR
OGG_INCLUDE
@@ -769,6 +775,10 @@
LTDL_DIR
LTDL_INCLUDE
LTDL_LIB
+CURL_LIB
+CURL_INCLUDE
+_libcurl_config
+PBX_CURL
PBX_KDE
KDE_DIR
KDE_INCLUDE
@@ -785,6 +795,10 @@
IKSEMEL_DIR
IKSEMEL_INCLUDE
IKSEMEL_LIB
+PBX_OPENH323
+OPENH323_DIR
+OPENH323_INCLUDE
+OPENH323_LIB
PBX_GSM
GSM_DIR
GSM_INCLUDE
@@ -805,10 +819,6 @@
CAP_DIR
CAP_INCLUDE
CAP_LIB
-PBX_CURL
-CURL_DIR
-CURL_INCLUDE
-CURL_LIB
PBX_ALSA
ALSA_DIR
ALSA_INCLUDE
@@ -923,16 +933,17 @@
with_gnu_ld
enable_dev_mode
with_asound
-with_curl
with_cap
with_curses
with_dahdi
with_gnutls
with_gsm
+with_h323
with_iksemel
with_imap
with_isdnnet
with_kde
+with_libcurl
with_ltdl
with_misdn
with_nbs
@@ -941,19 +952,20 @@
with_newt
with_odbc
with_ogg
+with_openais
+with_openr2
with_osptk
with_oss
with_popt
with_postgres
with_pri
with_pwlib
-with_h323
with_radius
with_speex
with_speexdsp
with_sqlite
-with_suppserv
with_ssl
+with_suppserv
with_tds
with_termcap
with_tinfo
@@ -964,7 +976,6 @@
with_z
with_zaptel
enable_largefile
-with_libcurl
'
ac_precious_vars='build_alias
host_alias
@@ -1601,17 +1612,18 @@
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-asound=PATH use Advanced Linux Sound Architecture files in PATH
- --with-curl=PATH use cURL files in PATH
--with-cap=PATH use POSIX 1.e capabilities files in PATH
--with-curses=PATH use curses files in PATH
--with-dahdi=PATH use DAHDI files in PATH
--with-gnutls=PATH use GNU TLS support (used for iksemel only) files in
PATH
--with-gsm=PATH use GSM files in PATH , or 'internal'
+ --with-h323=PATH use OpenH323 files in PATH
--with-iksemel=PATH use Iksemel Jabber Library files in PATH
--with-imap=PATH use UW IMAP Toolkit files in PATH
--with-isdnnet=PATH use ISDN4Linux Library files in PATH
--with-kde=PATH use KDE files in PATH
+ --with-libcurl=DIR look for the curl library in DIR
--with-ltdl=PATH use libtool files in PATH
--with-misdn=PATH use mISDN User Library files in PATH
--with-nbs=PATH use Network Broadcast Sound files in PATH
@@ -1620,19 +1632,20 @@
--with-newt=PATH use newt files in PATH
--with-odbc=PATH use unixODBC files in PATH
--with-ogg=PATH use OGG files in PATH
+ --with-openais=PATH use OpenAIS files in PATH
+ --with-openr2=PATH use MFR2 files in PATH
--with-osptk=PATH use OSP Toolkit files in PATH
--with-oss=PATH use Open Sound System files in PATH
--with-popt=PATH use popt files in PATH
--with-postgres=PATH use PostgreSQL files in PATH
--with-pri=PATH use ISDN PRI files in PATH
--with-pwlib=PATH use PWlib files in PATH
- --with-h323=PATH use OpenH323 files in PATH
--with-radius=PATH use Radius Client files in PATH
--with-speex=PATH use Speex files in PATH
--with-speexdsp=PATH use Speexdsp files in PATH
--with-sqlite=PATH use SQLite files in PATH
- --with-suppserv=PATH use mISDN Supplemental Services files in PATH
--with-ssl=PATH use OpenSSL files in PATH
+ --with-suppserv=PATH use mISDN Supplemental Services files in PATH
--with-tds=PATH use FreeTDS files in PATH
--with-termcap=PATH use Termcap files in PATH
--with-tinfo=PATH use Term Info files in PATH
@@ -1642,7 +1655,6 @@
--with-vpb=PATH use Voicetronix API files in PATH
--with-z=PATH use zlib files in PATH
--with-zaptel=PATH use Zaptel files in PATH
- --with-libcurl=DIR look for the curl library in DIR
Some influential environment variables:
CC C compiler command
@@ -1660,7 +1672,7 @@
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <www.asterisk.org>.
+Report bugs to <https://issues.asterisk.org>.
_ACEOF
ac_status=$?
fi
@@ -1885,9 +1897,9 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
+## ------------------------------------------ ##
+## Report this to https://issues.asterisk.org ##
+## ------------------------------------------ ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
@@ -2574,9 +2586,9 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
+## ------------------------------------------ ##
+## Report this to https://issues.asterisk.org ##
+## ------------------------------------------ ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
@@ -4366,17 +4378,18 @@
case "${host_os}" in
freebsd*)
- ac_default_prefix=/usr/local
+
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
;;
darwin*)
+
$as_echo "#define AST_POLL_COMPAT 1" >>confdefs.h
;;
*)
- ac_default_prefix=/usr
+
if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
if test ${sysconfdir} = '${prefix}/etc'; then
sysconfdir=/etc
@@ -7738,35 +7751,6 @@
-CURL_DESCRIP="cURL"
-CURL_OPTION="curl"
-
-# Check whether --with-curl was given.
-if test "${with_curl+set}" = set; then :
- withval=$with_curl;
-case ${withval} in
- n|no)
- USE_CURL=no
- ;;
- y|ye|yes)
- CURL_MANDATORY="yes"
- ;;
- *)
- CURL_DIR="${withval}"
- CURL_MANDATORY="yes"
- ;;
-esac
-
-fi
-
-PBX_CURL=0
-
-
-
-
-
-
-
CAP_DESCRIP="POSIX 1.e capabilities"
CAP_OPTION="cap"
@@ -7912,6 +7896,35 @@
+OPENH323_DESCRIP="OpenH323"
+OPENH323_OPTION="h323"
+
+# Check whether --with-h323 was given.
+if test "${with_h323+set}" = set; then :
+ withval=$with_h323;
+case ${withval} in
+ n|no)
+ USE_OPENH323=no
+ ;;
+ y|ye|yes)
+ OPENH323_MANDATORY="yes"
+ ;;
+ *)
+ OPENH323_DIR="${withval}"
+ OPENH323_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_OPENH323=0
+
+
+
+
+
+
+
IKSEMEL_DESCRIP="Iksemel Jabber Library"
IKSEMEL_OPTION="iksemel"
@@ -8028,28 +8041,8 @@
-LTDL_DESCRIP="libtool"
-LTDL_OPTION="ltdl"
-
-# Check whether --with-ltdl was given.
-if test "${with_ltdl+set}" = set; then :
- withval=$with_ltdl;
-case ${withval} in
- n|no)
- USE_LTDL=no
- ;;
- y|ye|yes)
- LTDL_MANDATORY="yes"
- ;;
- *)
- LTDL_DIR="${withval}"
- LTDL_MANDATORY="yes"
- ;;
-esac
-fi
-PBX_LTDL=0
@@ -8057,28 +8050,9 @@
-MISDN_DESCRIP="mISDN User Library"
-MISDN_OPTION="misdn"
-# Check whether --with-misdn was given.
-if test "${with_misdn+set}" = set; then :
- withval=$with_misdn;
-case ${withval} in
- n|no)
- USE_MISDN=no
- ;;
- y|ye|yes)
- MISDN_MANDATORY="yes"
- ;;
- *)
- MISDN_DIR="${withval}"
- MISDN_MANDATORY="yes"
- ;;
-esac
-fi
-PBX_MISDN=0
@@ -8086,231 +8060,386 @@
-NBS_DESCRIP="Network Broadcast Sound"
-NBS_OPTION="nbs"
-# Check whether --with-nbs was given.
-if test "${with_nbs+set}" = set; then :
- withval=$with_nbs;
-case ${withval} in
- n|no)
- USE_NBS=no
- ;;
- y|ye|yes)
- NBS_MANDATORY="yes"
- ;;
- *)
- NBS_DIR="${withval}"
- NBS_MANDATORY="yes"
- ;;
-esac
+# Check whether --with-libcurl was given.
+if test "${with_libcurl+set}" = set; then :
+ withval=$with_libcurl; _libcurl_with=$withval
+else
+ _libcurl_with=yes
fi
-PBX_NBS=0
-
+ if test "$_libcurl_with" != "no" ; then
+ for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
-
-
-
-NCURSES_DESCRIP="ncurses"
-NCURSES_OPTION="ncurses"
-
-# Check whether --with-ncurses was given.
-if test "${with_ncurses+set}" = set; then :
- withval=$with_ncurses;
-case ${withval} in
- n|no)
- USE_NCURSES=no
- ;;
- y|ye|yes)
- NCURSES_MANDATORY="yes"
- ;;
- *)
- NCURSES_DIR="${withval}"
- NCURSES_MANDATORY="yes"
- ;;
-esac
-
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-PBX_NCURSES=0
+ test -n "$AWK" && break
+done
+ _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
+ _libcurl_try_link=yes
+ if test -d "$_libcurl_with" ; then
+ CURL_INCLUDE="-I$withval/include"
+ _libcurl_ldflags="-L$withval/lib"
+ # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path__libcurl_config+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $_libcurl_config in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in "$withval/bin"
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+ test -z "$ac_cv_path__libcurl_config" && ac_cv_path__libcurl_config=""$withval/bin""
+ ;;
+esac
+fi
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
+$as_echo "$_libcurl_config" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
-NETSNMP_DESCRIP="Net-SNMP"
-NETSNMP_OPTION="netsnmp"
-# Check whether --with-netsnmp was given.
-if test "${with_netsnmp+set}" = set; then :
- withval=$with_netsnmp;
-case ${withval} in
- n|no)
- USE_NETSNMP=no
- ;;
- y|ye|yes)
- NETSNMP_MANDATORY="yes"
- ;;
- *)
- NETSNMP_DIR="${withval}"
- NETSNMP_MANDATORY="yes"
- ;;
-esac
+ else
+ # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path__libcurl_config+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $_libcurl_config in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+ ;;
+esac
+fi
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
+$as_echo "$_libcurl_config" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-
-PBX_NETSNMP=0
+ fi
+ if test x$_libcurl_config != "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of libcurl" >&5
+$as_echo_n "checking for the version of libcurl... " >&6; }
+if test "${libcurl_cv_lib_curl_version+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_version" >&5
+$as_echo "$libcurl_cv_lib_curl_version" >&6; }
+ _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
+ _libcurl_wanted=`echo 7.10.1 | $_libcurl_version_parse`
+ if test $_libcurl_wanted -gt 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl >= version 7.10.1" >&5
+$as_echo_n "checking for libcurl >= version 7.10.1... " >&6; }
+if test "${libcurl_cv_lib_version_ok+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test $_libcurl_version -ge $_libcurl_wanted ; then
+ libcurl_cv_lib_version_ok=yes
+ else
+ libcurl_cv_lib_version_ok=no
+ fi
-NEWT_DESCRIP="newt"
-NEWT_OPTION="newt"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_version_ok" >&5
+$as_echo "$libcurl_cv_lib_version_ok" >&6; }
+ fi
-# Check whether --with-newt was given.
-if test "${with_newt+set}" = set; then :
- withval=$with_newt;
-case ${withval} in
- n|no)
- USE_NEWT=no
- ;;
- y|ye|yes)
- NEWT_MANDATORY="yes"
- ;;
- *)
- NEWT_DIR="${withval}"
- NEWT_MANDATORY="yes"
- ;;
-esac
+ if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
+ if test x"$CURL_INCLUDE" = "x" ; then
+ CURL_INCLUDE=`$_libcurl_config --cflags`
+ fi
+ if test x"$CURL_LIB" = "x" ; then
+ CURL_LIB=`$_libcurl_config --libs`
-fi
+ # This is so silly, but Apple actually has a bug in their
+ # curl-config script. Fixed in Tiger, but there are still
+ # lots of Panther installs around.
+ case "${host}" in
+ powerpc-apple-darwin7*)
+ CURL_LIB=`echo $CURL_LIB | sed -e 's|-arch i386||g'`
+ ;;
+ esac
+ fi
-PBX_NEWT=0
+ # All curl-config scripts support --feature
+ _libcurl_features=`$_libcurl_config --feature`
+ # Is it modern enough to have --protocols? (7.12.4)
+ if test $_libcurl_version -ge 461828 ; then
+ _libcurl_protocols=`$_libcurl_config --protocols`
+ fi
+ else
+ _libcurl_try_link=no
+ fi
+ unset _libcurl_wanted
+ fi
+ if test $_libcurl_try_link = yes ; then
+ # we didn't find curl-config, so let's see if the user-supplied
+ # link line (or failing that, "-lcurl") is enough.
+ CURL_LIB=${CURL_LIB-"$_libcurl_ldflags -lcurl"}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcurl is usable" >&5
+$as_echo_n "checking whether libcurl is usable... " >&6; }
+if test "${libcurl_cv_lib_curl_usable+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ _libcurl_save_cppflags=$CPPFLAGS
+ CPPFLAGS="$CURL_INCLUDE $CPPFLAGS"
+ _libcurl_save_libs=$LIBS
+ LIBS="$CURL_LIB $LIBS"
-UNIXODBC_DESCRIP="unixODBC"
-UNIXODBC_OPTION="odbc"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <curl/curl.h>
+int
+main ()
+{
-# Check whether --with-odbc was given.
-if test "${with_odbc+set}" = set; then :
- withval=$with_odbc;
-case ${withval} in
- n|no)
- USE_UNIXODBC=no
- ;;
- y|ye|yes)
- UNIXODBC_MANDATORY="yes"
- ;;
- *)
- UNIXODBC_DIR="${withval}"
- UNIXODBC_MANDATORY="yes"
- ;;
-esac
+/* Try and use a few common options to force a failure if we are
+ missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_FILE;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ libcurl_cv_lib_curl_usable=yes
+else
+ libcurl_cv_lib_curl_usable=no
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
-PBX_UNIXODBC=0
-
+ CPPFLAGS=$_libcurl_save_cppflags
+ LIBS=$_libcurl_save_libs
+ unset _libcurl_save_cppflags
+ unset _libcurl_save_libs
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_usable" >&5
+$as_echo "$libcurl_cv_lib_curl_usable" >&6; }
+ if test $libcurl_cv_lib_curl_usable = yes ; then
+ # Does curl_free() exist in this version of libcurl?
+ # If not, fake it with free()
+ _libcurl_save_cppflags=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $CURL_INCLUDE"
+ _libcurl_save_libs=$LIBS
+ LIBS="$LIBS $CURL_LIB"
+ ac_fn_c_check_func "$LINENO" "curl_free" "ac_cv_func_curl_free"
+if test "x$ac_cv_func_curl_free" = x""yes; then :
-OGG_DESCRIP="OGG"
-OGG_OPTION="ogg"
+else
-# Check whether --with-ogg was given.
-if test "${with_ogg+set}" = set; then :
- withval=$with_ogg;
-case ${withval} in
- n|no)
- USE_OGG=no
- ;;
- y|ye|yes)
- OGG_MANDATORY="yes"
- ;;
- *)
- OGG_DIR="${withval}"
- OGG_MANDATORY="yes"
- ;;
-esac
+$as_echo "#define curl_free free" >>confdefs.h
fi
-PBX_OGG=0
-
+ CPPFLAGS=$_libcurl_save_cppflags
+ LIBS=$_libcurl_save_libs
+ unset _libcurl_save_cppflags
+ unset _libcurl_save_libs
+$as_echo "#define HAVE_CURL 1" >>confdefs.h
-OSPTK_DESCRIP="OSP Toolkit"
-OSPTK_OPTION="osptk"
+ PBX_CURL=1
-# Check whether --with-osptk was given.
-if test "${with_osptk+set}" = set; then :
- withval=$with_osptk;
-case ${withval} in
- n|no)
- USE_OSPTK=no
- ;;
- y|ye|yes)
- OSPTK_MANDATORY="yes"
- ;;
- *)
- OSPTK_DIR="${withval}"
- OSPTK_MANDATORY="yes"
- ;;
-esac
+ for _libcurl_feature in $_libcurl_features ; do
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
+_ACEOF
-fi
+ eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
+ done
-PBX_OSPTK=0
+ if test "x$_libcurl_protocols" = "x" ; then
+ # We don't have --protocols, so just assume that all
+ # protocols are available
+ _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
+
+ if test x$libcurl_feature_SSL = xyes ; then
+ _libcurl_protocols="$_libcurl_protocols HTTPS"
+
+ # FTPS wasn't standards-compliant until version
+ # 7.11.0
+ if test $_libcurl_version -ge 461568; then
+ _libcurl_protocols="$_libcurl_protocols FTPS"
+ fi
+ fi
+ fi
+
+ for _libcurl_protocol in $_libcurl_protocols ; do
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
+_ACEOF
+ eval `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes
+ done
+ else
+ unset CURL_LIB
+ unset CURL_INCLUDE
+ PBX_CURL=0
+ fi
+ fi
+ unset _libcurl_try_link
+ unset _libcurl_version_parse
+ unset _libcurl_config
+ unset _libcurl_feature
+ unset _libcurl_features
+ unset _libcurl_protocol
+ unset _libcurl_protocols
+ unset _libcurl_version
+ unset _libcurl_ldflags
+ fi
+ if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
+ # This is the IF-NO path
+ :
+ else
+ # This is the IF-YES path
+ :
+ fi
+ unset _libcurl_with
-OSS_DESCRIP="Open Sound System"
-OSS_OPTION="oss"
+LTDL_DESCRIP="libtool"
+LTDL_OPTION="ltdl"
-# Check whether --with-oss was given.
-if test "${with_oss+set}" = set; then :
- withval=$with_oss;
+# Check whether --with-ltdl was given.
+if test "${with_ltdl+set}" = set; then :
+ withval=$with_ltdl;
case ${withval} in
n|no)
- USE_OSS=no
+ USE_LTDL=no
;;
y|ye|yes)
- OSS_MANDATORY="yes"
+ LTDL_MANDATORY="yes"
;;
*)
- OSS_DIR="${withval}"
- OSS_MANDATORY="yes"
+ LTDL_DIR="${withval}"
+ LTDL_MANDATORY="yes"
;;
esac
fi
-PBX_OSS=0
+PBX_LTDL=0
@@ -8318,28 +8447,28 @@
-POPT_DESCRIP="popt"
-POPT_OPTION="popt"
+MISDN_DESCRIP="mISDN User Library"
+MISDN_OPTION="misdn"
-# Check whether --with-popt was given.
-if test "${with_popt+set}" = set; then :
- withval=$with_popt;
+# Check whether --with-misdn was given.
+if test "${with_misdn+set}" = set; then :
+ withval=$with_misdn;
case ${withval} in
n|no)
- USE_POPT=no
+ USE_MISDN=no
;;
y|ye|yes)
- POPT_MANDATORY="yes"
+ MISDN_MANDATORY="yes"
;;
*)
- POPT_DIR="${withval}"
- POPT_MANDATORY="yes"
+ MISDN_DIR="${withval}"
+ MISDN_MANDATORY="yes"
;;
esac
fi
-PBX_POPT=0
+PBX_MISDN=0
@@ -8347,28 +8476,28 @@
-PGSQL_DESCRIP="PostgreSQL"
-PGSQL_OPTION="postgres"
+NBS_DESCRIP="Network Broadcast Sound"
+NBS_OPTION="nbs"
-# Check whether --with-postgres was given.
-if test "${with_postgres+set}" = set; then :
- withval=$with_postgres;
+# Check whether --with-nbs was given.
+if test "${with_nbs+set}" = set; then :
+ withval=$with_nbs;
case ${withval} in
n|no)
- USE_PGSQL=no
+ USE_NBS=no
;;
y|ye|yes)
- PGSQL_MANDATORY="yes"
+ NBS_MANDATORY="yes"
;;
*)
- PGSQL_DIR="${withval}"
- PGSQL_MANDATORY="yes"
+ NBS_DIR="${withval}"
+ NBS_MANDATORY="yes"
;;
esac
fi
-PBX_PGSQL=0
+PBX_NBS=0
@@ -8376,28 +8505,28 @@
-PRI_DESCRIP="ISDN PRI"
-PRI_OPTION="pri"
+NCURSES_DESCRIP="ncurses"
+NCURSES_OPTION="ncurses"
-# Check whether --with-pri was given.
-if test "${with_pri+set}" = set; then :
- withval=$with_pri;
+# Check whether --with-ncurses was given.
+if test "${with_ncurses+set}" = set; then :
+ withval=$with_ncurses;
case ${withval} in
n|no)
- USE_PRI=no
+ USE_NCURSES=no
;;
y|ye|yes)
- PRI_MANDATORY="yes"
+ NCURSES_MANDATORY="yes"
;;
*)
- PRI_DIR="${withval}"
- PRI_MANDATORY="yes"
+ NCURSES_DIR="${withval}"
+ NCURSES_MANDATORY="yes"
;;
esac
fi
-PBX_PRI=0
+PBX_NCURSES=0
@@ -8405,14 +8534,28 @@
-PRI_VERSION_DESCRIP="ISDN PRI get_version"
-PRI_VERSION_OPTION=pri
+NETSNMP_DESCRIP="Net-SNMP"
+NETSNMP_OPTION="netsnmp"
+
+# Check whether --with-netsnmp was given.
+if test "${with_netsnmp+set}" = set; then :
+ withval=$with_netsnmp;
+case ${withval} in
+ n|no)
+ USE_NETSNMP=no
+ ;;
+ y|ye|yes)
+ NETSNMP_MANDATORY="yes"
+ ;;
+ *)
+ NETSNMP_DIR="${withval}"
+ NETSNMP_MANDATORY="yes"
+ ;;
+esac
-if test "x${PRI_MANDATORY}" = "xyes" ; then
- PRI_VERSION_MANDATORY="yes"
fi
-PBX_PRI_VERSION=0
+PBX_NETSNMP=0
@@ -8420,14 +8563,28 @@
-PRI_INBANDDISCONNECT_DESCRIP="ISDN PRI set_inbanddisconnect"
-PRI_INBANDDISCONNECT_OPTION=pri
+NEWT_DESCRIP="newt"
+NEWT_OPTION="newt"
+
+# Check whether --with-newt was given.
+if test "${with_newt+set}" = set; then :
+ withval=$with_newt;
+case ${withval} in
+ n|no)
+ USE_NEWT=no
+ ;;
+ y|ye|yes)
+ NEWT_MANDATORY="yes"
+ ;;
+ *)
+ NEWT_DIR="${withval}"
+ NEWT_MANDATORY="yes"
+ ;;
+esac
-if test "x${PRI_MANDATORY}" = "xyes" ; then
- PRI_INBANDDISCONNECT_MANDATORY="yes"
fi
-PBX_PRI_INBANDDISCONNECT=0
+PBX_NEWT=0
@@ -8435,28 +8592,28 @@
-PWLIB_DESCRIP="PWlib"
-PWLIB_OPTION="pwlib"
+UNIXODBC_DESCRIP="unixODBC"
+UNIXODBC_OPTION="odbc"
-# Check whether --with-pwlib was given.
-if test "${with_pwlib+set}" = set; then :
- withval=$with_pwlib;
+# Check whether --with-odbc was given.
+if test "${with_odbc+set}" = set; then :
+ withval=$with_odbc;
case ${withval} in
n|no)
- USE_PWLIB=no
+ USE_UNIXODBC=no
;;
y|ye|yes)
- PWLIB_MANDATORY="yes"
+ UNIXODBC_MANDATORY="yes"
;;
*)
- PWLIB_DIR="${withval}"
- PWLIB_MANDATORY="yes"
+ UNIXODBC_DIR="${withval}"
+ UNIXODBC_MANDATORY="yes"
;;
esac
fi
-PBX_PWLIB=0
+PBX_UNIXODBC=0
@@ -8464,28 +8621,28 @@
-OPENH323_DESCRIP="OpenH323"
-OPENH323_OPTION="h323"
+OGG_DESCRIP="OGG"
+OGG_OPTION="ogg"
-# Check whether --with-h323 was given.
-if test "${with_h323+set}" = set; then :
- withval=$with_h323;
+# Check whether --with-ogg was given.
+if test "${with_ogg+set}" = set; then :
+ withval=$with_ogg;
case ${withval} in
n|no)
- USE_OPENH323=no
+ USE_OGG=no
;;
y|ye|yes)
- OPENH323_MANDATORY="yes"
+ OGG_MANDATORY="yes"
;;
*)
- OPENH323_DIR="${withval}"
- OPENH323_MANDATORY="yes"
+ OGG_DIR="${withval}"
+ OGG_MANDATORY="yes"
;;
esac
fi
-PBX_OPENH323=0
+PBX_OGG=0
@@ -8493,28 +8650,28 @@
-RADIUS_DESCRIP="Radius Client"
-RADIUS_OPTION="radius"
+OPENAIS_DESCRIP="OpenAIS"
+OPENAIS_OPTION="openais"
-# Check whether --with-radius was given.
-if test "${with_radius+set}" = set; then :
- withval=$with_radius;
+# Check whether --with-openais was given.
+if test "${with_openais+set}" = set; then :
+ withval=$with_openais;
case ${withval} in
n|no)
- USE_RADIUS=no
+ USE_OPENAIS=no
;;
y|ye|yes)
- RADIUS_MANDATORY="yes"
+ OPENAIS_MANDATORY="yes"
;;
*)
- RADIUS_DIR="${withval}"
- RADIUS_MANDATORY="yes"
+ OPENAIS_DIR="${withval}"
+ OPENAIS_MANDATORY="yes"
;;
esac
fi
-PBX_RADIUS=0
+PBX_OPENAIS=0
@@ -8522,28 +8679,28 @@
-SPEEX_DESCRIP="Speex"
-SPEEX_OPTION="speex"
+OPENR2_DESCRIP="MFR2"
+OPENR2_OPTION="openr2"
-# Check whether --with-speex was given.
-if test "${with_speex+set}" = set; then :
- withval=$with_speex;
+# Check whether --with-openr2 was given.
+if test "${with_openr2+set}" = set; then :
+ withval=$with_openr2;
case ${withval} in
n|no)
- USE_SPEEX=no
+ USE_OPENR2=no
;;
y|ye|yes)
- SPEEX_MANDATORY="yes"
+ OPENR2_MANDATORY="yes"
;;
*)
- SPEEX_DIR="${withval}"
- SPEEX_MANDATORY="yes"
+ OPENR2_DIR="${withval}"
+ OPENR2_MANDATORY="yes"
;;
esac
fi
-PBX_SPEEX=0
+PBX_OPENR2=0
@@ -8551,68 +8708,57 @@
-SPEEXDSP_DESCRIP="Speexdsp"
-SPEEXDSP_OPTION="speexdsp"
+OSPTK_DESCRIP="OSP Toolkit"
+OSPTK_OPTION="osptk"
-# Check whether --with-speexdsp was given.
-if test "${with_speexdsp+set}" = set; then :
- withval=$with_speexdsp;
+# Check whether --with-osptk was given.
+if test "${with_osptk+set}" = set; then :
+ withval=$with_osptk;
case ${withval} in
n|no)
- USE_SPEEXDSP=no
+ USE_OSPTK=no
;;
y|ye|yes)
- SPEEXDSP_MANDATORY="yes"
+ OSPTK_MANDATORY="yes"
;;
*)
- SPEEXDSP_DIR="${withval}"
- SPEEXDSP_MANDATORY="yes"
+ OSPTK_DIR="${withval}"
+ OSPTK_MANDATORY="yes"
;;
esac
fi
-PBX_SPEEXDSP=0
-
+PBX_OSPTK=0
-SPEEX_PREPROCESS_DESCRIP="speex_preprocess_ctl"
-SPEEX_PREPROCESS_OPTION=speex
-PBX_SPEEX_PREPROCESS=0
-
-
-
-
-
-
-
-SQLITE_DESCRIP="SQLite"
-SQLITE_OPTION="sqlite"
+OSS_DESCRIP="Open Sound System"
+OSS_OPTION="oss"
-# Check whether --with-sqlite was given.
-if test "${with_sqlite+set}" = set; then :
- withval=$with_sqlite;
+# Check whether --with-oss was given.
+if test "${with_oss+set}" = set; then :
+ withval=$with_oss;
case ${withval} in
n|no)
- USE_SQLITE=no
+ USE_OSS=no
;;
y|ye|yes)
- SQLITE_MANDATORY="yes"
+ OSS_MANDATORY="yes"
;;
*)
- SQLITE_DIR="${withval}"
- SQLITE_MANDATORY="yes"
+ OSS_DIR="${withval}"
+ OSS_MANDATORY="yes"
;;
esac
fi
-PBX_SQLITE=0
+PBX_OSS=0
@@ -8620,28 +8766,28 @@
-SUPPSERV_DESCRIP="mISDN Supplemental Services"
-SUPPSERV_OPTION="suppserv"
+POPT_DESCRIP="popt"
+POPT_OPTION="popt"
-# Check whether --with-suppserv was given.
-if test "${with_suppserv+set}" = set; then :
- withval=$with_suppserv;
+# Check whether --with-popt was given.
+if test "${with_popt+set}" = set; then :
+ withval=$with_popt;
case ${withval} in
n|no)
- USE_SUPPSERV=no
+ USE_POPT=no
;;
y|ye|yes)
- SUPPSERV_MANDATORY="yes"
+ POPT_MANDATORY="yes"
;;
*)
- SUPPSERV_DIR="${withval}"
- SUPPSERV_MANDATORY="yes"
+ POPT_DIR="${withval}"
+ POPT_MANDATORY="yes"
;;
esac
fi
-PBX_SUPPSERV=0
+PBX_POPT=0
@@ -8649,28 +8795,28 @@
-OPENSSL_DESCRIP="OpenSSL"
-OPENSSL_OPTION="ssl"
+PGSQL_DESCRIP="PostgreSQL"
+PGSQL_OPTION="postgres"
-# Check whether --with-ssl was given.
-if test "${with_ssl+set}" = set; then :
- withval=$with_ssl;
+# Check whether --with-postgres was given.
+if test "${with_postgres+set}" = set; then :
+ withval=$with_postgres;
case ${withval} in
n|no)
- USE_OPENSSL=no
+ USE_PGSQL=no
;;
y|ye|yes)
- OPENSSL_MANDATORY="yes"
+ PGSQL_MANDATORY="yes"
;;
*)
- OPENSSL_DIR="${withval}"
- OPENSSL_MANDATORY="yes"
+ PGSQL_DIR="${withval}"
+ PGSQL_MANDATORY="yes"
;;
esac
fi
-PBX_OPENSSL=0
+PBX_PGSQL=0
@@ -8678,28 +8824,28 @@
-FREETDS_DESCRIP="FreeTDS"
-FREETDS_OPTION="tds"
+PRI_DESCRIP="ISDN PRI"
+PRI_OPTION="pri"
-# Check whether --with-tds was given.
-if test "${with_tds+set}" = set; then :
- withval=$with_tds;
+# Check whether --with-pri was given.
+if test "${with_pri+set}" = set; then :
+ withval=$with_pri;
case ${withval} in
n|no)
- USE_FREETDS=no
+ USE_PRI=no
;;
y|ye|yes)
- FREETDS_MANDATORY="yes"
+ PRI_MANDATORY="yes"
;;
*)
- FREETDS_DIR="${withval}"
- FREETDS_MANDATORY="yes"
+ PRI_DIR="${withval}"
+ PRI_MANDATORY="yes"
;;
esac
fi
-PBX_FREETDS=0
+PBX_PRI=0
@@ -8707,28 +8853,29 @@
-TERMCAP_DESCRIP="Termcap"
-TERMCAP_OPTION="termcap"
+PRI_VERSION_DESCRIP="ISDN PRI get_version"
+PRI_VERSION_OPTION=pri
-# Check whether --with-termcap was given.
-if test "${with_termcap+set}" = set; then :
- withval=$with_termcap;
-case ${withval} in
- n|no)
- USE_TERMCAP=no
- ;;
- y|ye|yes)
- TERMCAP_MANDATORY="yes"
- ;;
- *)
- TERMCAP_DIR="${withval}"
- TERMCAP_MANDATORY="yes"
- ;;
-esac
+if test "x${PRI_MANDATORY}" = "xyes" ; then
+ PRI_VERSION_MANDATORY="yes"
+fi
+
+PBX_PRI_VERSION=0
+
+
+
+
+
+
+PRI_INBANDDISCONNECT_DESCRIP="ISDN PRI set_inbanddisconnect"
+PRI_INBANDDISCONNECT_OPTION=pri
+
+if test "x${PRI_MANDATORY}" = "xyes" ; then
+ PRI_INBANDDISCONNECT_MANDATORY="yes"
fi
-PBX_TERMCAP=0
+PBX_PRI_INBANDDISCONNECT=0
@@ -8736,28 +8883,28 @@
-TINFO_DESCRIP="Term Info"
-TINFO_OPTION="tinfo"
+PWLIB_DESCRIP="PWlib"
+PWLIB_OPTION="pwlib"
-# Check whether --with-tinfo was given.
-if test "${with_tinfo+set}" = set; then :
- withval=$with_tinfo;
+# Check whether --with-pwlib was given.
+if test "${with_pwlib+set}" = set; then :
+ withval=$with_pwlib;
case ${withval} in
n|no)
- USE_TINFO=no
+ USE_PWLIB=no
;;
y|ye|yes)
- TINFO_MANDATORY="yes"
+ PWLIB_MANDATORY="yes"
;;
*)
- TINFO_DIR="${withval}"
- TINFO_MANDATORY="yes"
+ PWLIB_DIR="${withval}"
+ PWLIB_MANDATORY="yes"
;;
esac
fi
-PBX_TINFO=0
+PBX_PWLIB=0
@@ -8765,28 +8912,28 @@
-TONEZONE_DESCRIP="tonezone"
-TONEZONE_OPTION="tonezone"
+RADIUS_DESCRIP="Radius Client"
+RADIUS_OPTION="radius"
-# Check whether --with-tonezone was given.
-if test "${with_tonezone+set}" = set; then :
- withval=$with_tonezone;
+# Check whether --with-radius was given.
+if test "${with_radius+set}" = set; then :
+ withval=$with_radius;
case ${withval} in
n|no)
- USE_TONEZONE=no
+ USE_RADIUS=no
;;
y|ye|yes)
- TONEZONE_MANDATORY="yes"
+ RADIUS_MANDATORY="yes"
;;
*)
- TONEZONE_DIR="${withval}"
- TONEZONE_MANDATORY="yes"
+ RADIUS_DIR="${withval}"
+ RADIUS_MANDATORY="yes"
;;
esac
fi
-PBX_TONEZONE=0
+PBX_RADIUS=0
@@ -8794,28 +8941,28 @@
-USB_DESCRIP="usb"
-USB_OPTION="usb"
+SPEEX_DESCRIP="Speex"
+SPEEX_OPTION="speex"
-# Check whether --with-usb was given.
-if test "${with_usb+set}" = set; then :
- withval=$with_usb;
+# Check whether --with-speex was given.
+if test "${with_speex+set}" = set; then :
+ withval=$with_speex;
case ${withval} in
n|no)
- USE_USB=no
+ USE_SPEEX=no
;;
y|ye|yes)
- USB_MANDATORY="yes"
+ SPEEX_MANDATORY="yes"
;;
*)
- USB_DIR="${withval}"
- USB_MANDATORY="yes"
+ SPEEX_DIR="${withval}"
+ SPEEX_MANDATORY="yes"
;;
esac
fi
-PBX_USB=0
+PBX_SPEEX=0
@@ -8823,28 +8970,28 @@
-VORBIS_DESCRIP="Vorbis"
-VORBIS_OPTION="vorbis"
+SPEEXDSP_DESCRIP="Speexdsp"
+SPEEXDSP_OPTION="speexdsp"
-# Check whether --with-vorbis was given.
-if test "${with_vorbis+set}" = set; then :
- withval=$with_vorbis;
+# Check whether --with-speexdsp was given.
+if test "${with_speexdsp+set}" = set; then :
+ withval=$with_speexdsp;
case ${withval} in
n|no)
- USE_VORBIS=no
+ USE_SPEEXDSP=no
;;
y|ye|yes)
- VORBIS_MANDATORY="yes"
+ SPEEXDSP_MANDATORY="yes"
;;
*)
- VORBIS_DIR="${withval}"
- VORBIS_MANDATORY="yes"
+ SPEEXDSP_DIR="${withval}"
+ SPEEXDSP_MANDATORY="yes"
;;
esac
fi
-PBX_VORBIS=0
+PBX_SPEEXDSP=0
@@ -8852,28 +8999,39 @@
-VPB_DESCRIP="Voicetronix API"
-VPB_OPTION="vpb"
+SPEEX_PREPROCESS_DESCRIP="speex_preprocess_ctl"
+SPEEX_PREPROCESS_OPTION=speex
-# Check whether --with-vpb was given.
-if test "${with_vpb+set}" = set; then :
- withval=$with_vpb;
+PBX_SPEEX_PREPROCESS=0
+
+
+
+
+
+
+
+SQLITE_DESCRIP="SQLite"
+SQLITE_OPTION="sqlite"
+
+# Check whether --with-sqlite was given.
+if test "${with_sqlite+set}" = set; then :
+ withval=$with_sqlite;
case ${withval} in
n|no)
- USE_VPB=no
+ USE_SQLITE=no
;;
y|ye|yes)
- VPB_MANDATORY="yes"
+ SQLITE_MANDATORY="yes"
;;
*)
- VPB_DIR="${withval}"
- VPB_MANDATORY="yes"
+ SQLITE_DIR="${withval}"
+ SQLITE_MANDATORY="yes"
;;
esac
fi
-PBX_VPB=0
+PBX_SQLITE=0
@@ -8881,28 +9039,28 @@
-ZLIB_DESCRIP="zlib"
-ZLIB_OPTION="z"
+OPENSSL_DESCRIP="OpenSSL"
+OPENSSL_OPTION="ssl"
-# Check whether --with-z was given.
-if test "${with_z+set}" = set; then :
- withval=$with_z;
+# Check whether --with-ssl was given.
+if test "${with_ssl+set}" = set; then :
+ withval=$with_ssl;
case ${withval} in
n|no)
- USE_ZLIB=no
+ USE_OPENSSL=no
;;
y|ye|yes)
- ZLIB_MANDATORY="yes"
+ OPENSSL_MANDATORY="yes"
;;
*)
- ZLIB_DIR="${withval}"
- ZLIB_MANDATORY="yes"
+ OPENSSL_DIR="${withval}"
+ OPENSSL_MANDATORY="yes"
;;
esac
fi
-PBX_ZLIB=0
+PBX_OPENSSL=0
@@ -8910,242 +9068,503 @@
-ZAPTEL_DESCRIP="Zaptel"
-ZAPTEL_OPTION="zaptel"
+SUPPSERV_DESCRIP="mISDN Supplemental Services"
+SUPPSERV_OPTION="suppserv"
-# Check whether --with-zaptel was given.
-if test "${with_zaptel+set}" = set; then :
- withval=$with_zaptel;
+# Check whether --with-suppserv was given.
+if test "${with_suppserv+set}" = set; then :
+ withval=$with_suppserv;
case ${withval} in
n|no)
- USE_ZAPTEL=no
+ USE_SUPPSERV=no
;;
y|ye|yes)
- ZAPTEL_MANDATORY="yes"
+ SUPPSERV_MANDATORY="yes"
;;
*)
- ZAPTEL_DIR="${withval}"
- ZAPTEL_MANDATORY="yes"
+ SUPPSERV_DIR="${withval}"
+ SUPPSERV_MANDATORY="yes"
;;
esac
fi
-PBX_ZAPTEL=0
-
+PBX_SUPPSERV=0
-# check for basic system features and functionality before
-# checking for package libraries
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments. Useless!
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <alloca.h>
-int
-main ()
-{
-char *p = (char *) alloca (2 * sizeof (int));
- if (p) return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_working_alloca_h=yes
-else
- ac_cv_working_alloca_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
+FREETDS_DESCRIP="FreeTDS"
+FREETDS_OPTION="tds"
-$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+# Check whether --with-tds was given.
+if test "${with_tds+set}" = set; then :
+ withval=$with_tds;
+case ${withval} in
+ n|no)
+ USE_FREETDS=no
+ ;;
+ y|ye|yes)
+ FREETDS_MANDATORY="yes"
+ ;;
+ *)
+ FREETDS_DIR="${withval}"
+ FREETDS_MANDATORY="yes"
+ ;;
+esac
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-# else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-# endif
-#endif
+PBX_FREETDS=0
-int
-main ()
-{
-char *p = (char *) alloca (1);
- if (p) return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_func_alloca_works=yes
-else
- ac_cv_func_alloca_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
-if test $ac_cv_func_alloca_works = yes; then
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
-else
- # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble. Some versions do not even contain alloca or
-# contain a buggy version. If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
+TERMCAP_DESCRIP="Termcap"
+TERMCAP_OPTION="termcap"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
+# Check whether --with-termcap was given.
+if test "${with_termcap+set}" = set; then :
+ withval=$with_termcap;
+case ${withval} in
+ n|no)
+ USE_TERMCAP=no
+ ;;
+ y|ye|yes)
+ TERMCAP_MANDATORY="yes"
+ ;;
+ *)
+ TERMCAP_DIR="${withval}"
+ TERMCAP_MANDATORY="yes"
+ ;;
+esac
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "webecray" >/dev/null 2>&1; then :
- ac_cv_os_cray=yes
-else
- ac_cv_os_cray=no
fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
- for ac_func in _getb67 GETB67 getb67; do
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
+PBX_TERMCAP=0
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
- break
-fi
- done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_c_stack_direction=0
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-find_stack_direction ()
-{
- static char *addr = 0;
- auto char dummy;
- if (addr == 0)
- {
- addr = &dummy;
- return find_stack_direction ();
- }
- else
- return (&dummy > addr) ? 1 : -1;
-}
-int
-main ()
-{
- return find_stack_direction () < 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_stack_direction=1
-else
- ac_cv_c_stack_direction=-1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
+TINFO_DESCRIP="Term Info"
+TINFO_OPTION="tinfo"
+
+# Check whether --with-tinfo was given.
+if test "${with_tinfo+set}" = set; then :
+ withval=$with_tinfo;
+case ${withval} in
+ n|no)
+ USE_TINFO=no
+ ;;
+ y|ye|yes)
+ TINFO_MANDATORY="yes"
+ ;;
+ *)
+ TINFO_DIR="${withval}"
+ TINFO_MANDATORY="yes"
+ ;;
+esac
fi
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
- as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
-$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <$ac_hdr>
+PBX_TINFO=0
-int
+
+
+
+
+
+
+TONEZONE_DESCRIP="tonezone"
+TONEZONE_OPTION="tonezone"
+
+# Check whether --with-tonezone was given.
+if test "${with_tonezone+set}" = set; then :
+ withval=$with_tonezone;
+case ${withval} in
+ n|no)
+ USE_TONEZONE=no
+ ;;
+ y|ye|yes)
+ TONEZONE_MANDATORY="yes"
+ ;;
+ *)
+ TONEZONE_DIR="${withval}"
+ TONEZONE_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_TONEZONE=0
+
+
+
+
+
+
+
+USB_DESCRIP="usb"
+USB_OPTION="usb"
+
+# Check whether --with-usb was given.
+if test "${with_usb+set}" = set; then :
+ withval=$with_usb;
+case ${withval} in
+ n|no)
+ USE_USB=no
+ ;;
+ y|ye|yes)
+ USB_MANDATORY="yes"
+ ;;
+ *)
+ USB_DIR="${withval}"
+ USB_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_USB=0
+
+
+
+
+
+
+
+VORBIS_DESCRIP="Vorbis"
+VORBIS_OPTION="vorbis"
+
+# Check whether --with-vorbis was given.
+if test "${with_vorbis+set}" = set; then :
+ withval=$with_vorbis;
+case ${withval} in
+ n|no)
+ USE_VORBIS=no
+ ;;
+ y|ye|yes)
+ VORBIS_MANDATORY="yes"
+ ;;
+ *)
+ VORBIS_DIR="${withval}"
+ VORBIS_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_VORBIS=0
+
+
+
+
+
+
+
+VPB_DESCRIP="Voicetronix API"
+VPB_OPTION="vpb"
+
+# Check whether --with-vpb was given.
+if test "${with_vpb+set}" = set; then :
+ withval=$with_vpb;
+case ${withval} in
+ n|no)
+ USE_VPB=no
+ ;;
+ y|ye|yes)
+ VPB_MANDATORY="yes"
+ ;;
+ *)
+ VPB_DIR="${withval}"
+ VPB_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_VPB=0
+
+
+
+
+
+
+
+ZLIB_DESCRIP="zlib"
+ZLIB_OPTION="z"
+
+# Check whether --with-z was given.
+if test "${with_z+set}" = set; then :
+ withval=$with_z;
+case ${withval} in
+ n|no)
+ USE_ZLIB=no
+ ;;
+ y|ye|yes)
+ ZLIB_MANDATORY="yes"
+ ;;
+ *)
+ ZLIB_DIR="${withval}"
+ ZLIB_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_ZLIB=0
+
+
+
+
+
+
+
+ZAPTEL_DESCRIP="Zaptel"
+ZAPTEL_OPTION="zaptel"
+
+# Check whether --with-zaptel was given.
+if test "${with_zaptel+set}" = set; then :
+ withval=$with_zaptel;
+case ${withval} in
+ n|no)
+ USE_ZAPTEL=no
+ ;;
+ y|ye|yes)
+ ZAPTEL_MANDATORY="yes"
+ ;;
+ *)
+ ZAPTEL_DIR="${withval}"
+ ZAPTEL_MANDATORY="yes"
+ ;;
+esac
+
+fi
+
+PBX_ZAPTEL=0
+
+
+
+
+
+
+
+# check for basic system features and functionality before
+# checking for package libraries
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if test "${ac_cv_working_alloca_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_working_alloca_h=yes
+else
+ ac_cv_working_alloca_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if test "${ac_cv_func_alloca_works+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ if (p) return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_alloca_works=yes
+else
+ ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+else
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if test "${ac_cv_os_cray+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "webecray" >/dev/null 2>&1; then :
+ ac_cv_os_cray=yes
+else
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+ break
+fi
+
+ done
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if test "${ac_cv_c_stack_direction+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_c_stack_direction=0
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+ return find_stack_direction () < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_stack_direction=1
+else
+ ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
main ()
{
if ((DIR *) 0)
@@ -10310,7 +10729,7 @@
fi
if test "x$ac_cv_func_fork_works" = xcross; then
case $host in
- *-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* | *-*-linux-uclibc* )
+ *-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* )
# Override, as these systems have only a dummy fork() stub
ac_cv_func_fork_works=no
;;
@@ -11681,6 +12100,39 @@
fi
+# Can we compare a mutex to its initial value?
+# Generally yes on OpenBSD/FreeBSD and no on Mac OS X.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can compare a mutex to its initial value" >&5
+$as_echo_n "checking whether we can compare a mutex to its initial value... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+int
+main ()
+{
+pthread_mutex_t lock;
+ if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
+ return 0;
+ }
+ return 0
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define CAN_COMPARE_MUTEX_TO_INIT_VALUE 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler atomic operations" >&5
$as_echo_n "checking for compiler atomic operations... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11901,6 +12353,38 @@
CFLAGS="$saved_CFLAGS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute warn_unused_result' support" >&5
+$as_echo_n "checking for compiler 'attribute warn_unused_result' support... " >&6; }
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Werror"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+static void __attribute__((warn_unused_result)) *test(void *muffin, ...) {}
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATTRIBUTE_warn_unused_result 1
+_ACEOF
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+CFLAGS="$saved_CFLAGS"
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ffunction-sections support" >&5
$as_echo_n "checking for -ffunction-sections support... " >&6; }
saved_CFLAGS="${CFLAGS}"
@@ -12625,57 +13109,154 @@
fi
- fi
- CPPFLAGS="${saved_cppflags}"
- if test "x${CAP_HEADER_FOUND}" = "x0" ; then
- if test -n "${CAP_MANDATORY}" ;
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5
-$as_echo "$as_me: ***" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: *** It appears that you do not have the cap development package installed." >&5
-$as_echo "$as_me: *** It appears that you do not have the cap development package installed." >&6;}
- if test "x${CAP_OPTION}" = "x" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please install it to include ${CAP_DESCRIP} support" >&5
-$as_echo "$as_me: *** Please install it to include ${CAP_DESCRIP} support" >&6;}
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please install it to include ${CAP_DESCRIP} support, or re-run configure" >&5
-$as_echo "$as_me: *** Please install it to include ${CAP_DESCRIP} support, or re-run configure" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: *** without explicitly specifying --with-${CAP_OPTION}" >&5
-$as_echo "$as_me: *** without explicitly specifying --with-${CAP_OPTION}" >&6;}
- fi
- exit 1
- fi
- CAP_LIB=""
- CAP_INCLUDE=""
- PBX_CAP=0
- else
- PBX_CAP=1
- cat >>confdefs.h <<_ACEOF
-#define HAVE_CAP 1
-_ACEOF
- fi
- elif test -n "${CAP_MANDATORY}";
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5
-$as_echo "$as_me: ***" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: *** The ${CAP_DESCRIP} installation on this system appears to be broken." >&5
-$as_echo "$as_me: *** The ${CAP_DESCRIP} installation on this system appears to be broken." >&6;}
- if test "x${CAP_OPTION}" = "x" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please correct the installation" >&5
-$as_echo "$as_me: *** Please correct the installation" >&6;}
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5
-$as_echo "$as_me: *** Either correct the installation, or run configure" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: *** without explicitly specifying --with-${CAP_OPTION}" >&5
-$as_echo "$as_me: *** without explicitly specifying --with-${CAP_OPTION}" >&6;}
- fi
- exit 1
- fi
-fi
+ fi
+ CPPFLAGS="${saved_cppflags}"
+ if test "x${CAP_HEADER_FOUND}" = "x0" ; then
+ if test -n "${CAP_MANDATORY}" ;
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5
+$as_echo "$as_me: ***" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: *** It appears that you do not have the cap development package installed." >&5
+$as_echo "$as_me: *** It appears that you do not have the cap development package installed." >&6;}
+ if test "x${CAP_OPTION}" = "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please install it to include ${CAP_DESCRIP} support" >&5
+$as_echo "$as_me: *** Please install it to include ${CAP_DESCRIP} support" >&6;}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please install it to include ${CAP_DESCRIP} support, or re-run configure" >&5
+$as_echo "$as_me: *** Please install it to include ${CAP_DESCRIP} support, or re-run configure" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: *** without explicitly specifying --with-${CAP_OPTION}" >&5
+$as_echo "$as_me: *** without explicitly specifying --with-${CAP_OPTION}" >&6;}
+ fi
+ exit 1
+ fi
+ CAP_LIB=""
+ CAP_INCLUDE=""
+ PBX_CAP=0
+ else
+ PBX_CAP=1
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_CAP 1
+_ACEOF
+ fi
+ elif test -n "${CAP_MANDATORY}";
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ***" >&5
+$as_echo "$as_me: ***" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: *** The ${CAP_DESCRIP} installation on this system appears to be broken." >&5
+$as_echo "$as_me: *** The ${CAP_DESCRIP} installation on this system appears to be broken." >&6;}
+ if test "x${CAP_OPTION}" = "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: *** Please correct the installation" >&5
+$as_echo "$as_me: *** Please correct the installation" >&6;}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: *** Either correct the installation, or run configure" >&5
+$as_echo "$as_me: *** Either correct the installation, or run configure" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: *** without explicitly specifying --with-${CAP_OPTION}" >&5
+$as_echo "$as_me: *** without explicitly specifying --with-${CAP_OPTION}" >&6;}
+ fi
+ exit 1
+ fi
+fi
+
+fi
+
+PBX_DAHDI_TRANSCODE=0
+if test "${USE_DAHDI}" != "no" ; then
+
+ if test "x${PBX_DAHDI}" != "x1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_RESET_COUNTERS in dahdi/user.h" >&5
+$as_echo_n "checking for DAHDI_RESET_COUNTERS in dahdi/user.h... " >&6; }
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${DAHDI_DIR}" != "x"; then
+ DAHDI_INCLUDE="-I${DAHDI_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+ #include <dahdi/user.h>
+int
+main ()
+{
+#if defined(DAHDI_RESET_COUNTERS)
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ PBX_DAHDI=1
+
+$as_echo "#define HAVE_DAHDI 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_DAHDI_VERSION 230" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="${saved_cppflags}"
+ fi
+
+
+
+ if test "x${PBX_DAHDI}" != "x1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h" >&5
+$as_echo_n "checking for DAHDI_DEFAULT_MTU_MRU in dahdi/user.h... " >&6; }
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${DAHDI_DIR}" != "x"; then
+ DAHDI_INCLUDE="-I${DAHDI_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+ #include <dahdi/user.h>
+int
+main ()
+{
+#if defined(DAHDI_DEFAULT_MTU_MRU)
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ PBX_DAHDI=1
+
+$as_echo "#define HAVE_DAHDI 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_DAHDI_VERSION 220" >>confdefs.h
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="${saved_cppflags}"
+ fi
+
-if test "${USE_DAHDI}" != "no" ; then
if test "x${PBX_DAHDI}" != "x1"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_CODE in dahdi/user.h" >&5
@@ -12711,7 +13292,7 @@
$as_echo "#define HAVE_DAHDI 1" >>confdefs.h
-$as_echo "#define HAVE_DAHDI_VERSION /**/" >>confdefs.h
+$as_echo "#define HAVE_DAHDI_VERSION 200" >>confdefs.h
else
@@ -16585,6 +17166,11 @@
PWLIB_BUILD_NUMBER=`echo ${PWLIB_VERSION} | cut -f3 -d.`
let PWLIB_VER=${PWLIB_MAJOR_VERSION}*10000+${PWLIB_MINOR_VERSION}*100+${PWLIB_BUILD_NUMBER}
let PWLIB_REQ=1*10000+9*100+2
+ if test "x" = "x"; then
+ let PWLIB_MAX=9999999
+ else
+ let PWLIB_MAX=*10000+*100+
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if PWLib version ${PWLIB_VERSION} is compatible with chan_h323" >&5
$as_echo_n "checking if PWLib version ${PWLIB_VERSION} is compatible with chan_h323... " >&6; }
@@ -16593,8 +17179,14 @@
$as_echo "no" >&6; }
unset HAS_PWLIB
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ if test ${PWLIB_VER} -gt ${PWLIB_MAX}; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ unset HAS_PWLIB
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+ fi
fi
fi
@@ -16923,6 +17515,11 @@
OPENH323_BUILD_NUMBER=`echo ${OPENH323_VERSION} | cut -f3 -d.`
let OPENH323_VER=${OPENH323_MAJOR_VERSION}*10000+${OPENH323_MINOR_VERSION}*100+${OPENH323_BUILD_NUMBER}
let OPENH323_REQ=1*10000+17*100+3
+ if test "x0" = "x"; then
+ let OPENH323_MAX=9999999
+ else
+ let OPENH323_MAX=1*10000+19*100+0
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if OpenH323 version ${OPENH323_VERSION} is compatible with chan_h323" >&5
$as_echo_n "checking if OpenH323 version ${OPENH323_VERSION} is compatible with chan_h323... " >&6; }
@@ -16931,8 +17528,14 @@
$as_echo "no" >&6; }
unset HAS_OPENH323
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ if test ${OPENH323_VER} -gt ${OPENH323_MAX}; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ unset HAS_OPENH323
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+ fi
fi
fi
@@ -19287,222 +19890,34 @@
PKGCONFIG=$ac_cv_prog_PKGCONFIG
if test -n "$PKGCONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5
-$as_echo "$PKGCONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_PKGCONFIG"; then
- ac_ct_PKGCONFIG=$PKGCONFIG
- # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_PKGCONFIG+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_PKGCONFIG"; then
- ac_cv_prog_ac_ct_PKGCONFIG="$ac_ct_PKGCONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_ac_ct_PKGCONFIG="pkg-config"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_PKGCONFIG=$ac_cv_prog_ac_ct_PKGCONFIG
-if test -n "$ac_ct_PKGCONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKGCONFIG" >&5
-$as_echo "$ac_ct_PKGCONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_PKGCONFIG" = x; then
- PKGCONFIG="No"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- PKGCONFIG=$ac_ct_PKGCONFIG
- fi
-else
- PKGCONFIG="$ac_cv_prog_PKGCONFIG"
-fi
-
-if test ! "x${PKGCONFIG}" = xNo; then
- GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null)
- GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
- PBX_GTK2=1
-
-$as_echo "#define HAVE_GTK2 1" >>confdefs.h
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-libcurl was given.
-if test "${with_libcurl+set}" = set; then :
- withval=$with_libcurl; _libcurl_with=$withval
-else
- _libcurl_with=yes
-fi
-
-
- if test "$_libcurl_with" != "no" ; then
-
- for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-
- _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
-
- _libcurl_try_link=yes
-
- if test -d "$_libcurl_with" ; then
- CURL_INCLUDE="-I$withval/include"
- _libcurl_ldflags="-L$withval/lib"
- # Extract the first word of "curl-config", so it can be a program name with args.
-set dummy curl-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path__libcurl_config+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- case $_libcurl_config in
- [\\/]* | ?:[\\/]*)
- ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in "$withval/bin"
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path__libcurl_config" && ac_cv_path__libcurl_config=""$withval/bin""
- ;;
-esac
-fi
-_libcurl_config=$ac_cv_path__libcurl_config
-if test -n "$_libcurl_config"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
-$as_echo "$_libcurl_config" >&6; }
+$as_echo "$PKGCONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
- else
- # Extract the first word of "curl-config", so it can be a program name with args.
-set dummy curl-config; ac_word=$2
+fi
+if test -z "$ac_cv_prog_PKGCONFIG"; then
+ ac_ct_PKGCONFIG=$PKGCONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path__libcurl_config+set}" = set; then :
+if test "${ac_cv_prog_ac_ct_PKGCONFIG+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- case $_libcurl_config in
- [\\/]* | ?:[\\/]*)
- ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ if test -n "$ac_ct_PKGCONFIG"; then
+ ac_cv_prog_ac_ct_PKGCONFIG="$ac_ct_PKGCONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+ ac_cv_prog_ac_ct_PKGCONFIG="pkg-config"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -19510,231 +19925,42 @@
done
IFS=$as_save_IFS
- ;;
-esac
fi
-_libcurl_config=$ac_cv_path__libcurl_config
-if test -n "$_libcurl_config"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
-$as_echo "$_libcurl_config" >&6; }
+fi
+ac_ct_PKGCONFIG=$ac_cv_prog_ac_ct_PKGCONFIG
+if test -n "$ac_ct_PKGCONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKGCONFIG" >&5
+$as_echo "$ac_ct_PKGCONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-
- fi
-
- if test x$_libcurl_config != "x" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of libcurl" >&5
-$as_echo_n "checking for the version of libcurl... " >&6; }
-if test "${libcurl_cv_lib_curl_version+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_version" >&5
-$as_echo "$libcurl_cv_lib_curl_version" >&6; }
-
- _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
- _libcurl_wanted=`echo 7.10.1 | $_libcurl_version_parse`
-
- if test $_libcurl_wanted -gt 0 ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl >= version 7.10.1" >&5
-$as_echo_n "checking for libcurl >= version 7.10.1... " >&6; }
-if test "${libcurl_cv_lib_version_ok+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
-
- if test $_libcurl_version -ge $_libcurl_wanted ; then
- libcurl_cv_lib_version_ok=yes
- else
- libcurl_cv_lib_version_ok=no
- fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_version_ok" >&5
-$as_echo "$libcurl_cv_lib_version_ok" >&6; }
- fi
-
- if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
- if test x"$CURL_INCLUDE" = "x" ; then
- CURL_INCLUDE=`$_libcurl_config --cflags`
- fi
- if test x"$CURL_LIB" = "x" ; then
- CURL_LIB=`$_libcurl_config --libs`
-
- # This is so silly, but Apple actually has a bug in their
- # curl-config script. Fixed in Tiger, but there are still
- # lots of Panther installs around.
- case "${host}" in
- powerpc-apple-darwin7*)
- CURL_LIB=`echo $CURL_LIB | sed -e 's|-arch i386||g'`
- ;;
- esac
- fi
-
- # All curl-config scripts support --feature
- _libcurl_features=`$_libcurl_config --feature`
-
- # Is it modern enough to have --protocols? (7.12.4)
- if test $_libcurl_version -ge 461828 ; then
- _libcurl_protocols=`$_libcurl_config --protocols`
- fi
- else
- _libcurl_try_link=no
- fi
-
- unset _libcurl_wanted
- fi
-
- if test $_libcurl_try_link = yes ; then
-
- # we didn't find curl-config, so let's see if the user-supplied
- # link line (or failing that, "-lcurl") is enough.
- CURL_LIB=${CURL_LIB-"$_libcurl_ldflags -lcurl"}
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcurl is usable" >&5
-$as_echo_n "checking whether libcurl is usable... " >&6; }
-if test "${libcurl_cv_lib_curl_usable+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
-
- _libcurl_save_cppflags=$CPPFLAGS
- CPPFLAGS="$CURL_INCLUDE $CPPFLAGS"
- _libcurl_save_libs=$LIBS
- LIBS="$CURL_LIB $LIBS"
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <curl/curl.h>
-int
-main ()
-{
-
-/* Try and use a few common options to force a failure if we are
- missing symbols or can't link. */
-int x;
-curl_easy_setopt(NULL,CURLOPT_URL,NULL);
-x=CURL_ERROR_SIZE;
-x=CURLOPT_WRITEFUNCTION;
-x=CURLOPT_FILE;
-x=CURLOPT_ERRORBUFFER;
-x=CURLOPT_STDERR;
-x=CURLOPT_VERBOSE;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- libcurl_cv_lib_curl_usable=yes
+ if test "x$ac_ct_PKGCONFIG" = x; then
+ PKGCONFIG="No"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKGCONFIG=$ac_ct_PKGCONFIG
+ fi
else
- libcurl_cv_lib_curl_usable=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
- CPPFLAGS=$_libcurl_save_cppflags
- LIBS=$_libcurl_save_libs
- unset _libcurl_save_cppflags
- unset _libcurl_save_libs
-
+ PKGCONFIG="$ac_cv_prog_PKGCONFIG"
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_usable" >&5
-$as_echo "$libcurl_cv_lib_curl_usable" >&6; }
-
- if test $libcurl_cv_lib_curl_usable = yes ; then
-
- # Does curl_free() exist in this version of libcurl?
- # If not, fake it with free()
-
- _libcurl_save_cppflags=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS $CURL_INCLUDE"
- _libcurl_save_libs=$LIBS
- LIBS="$LIBS $CURL_LIB"
-
- ac_fn_c_check_func "$LINENO" "curl_free" "ac_cv_func_curl_free"
-if test "x$ac_cv_func_curl_free" = x""yes; then :
-else
+if test ! "x${PKGCONFIG}" = xNo; then
+ GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null)
+ GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
+ PBX_GTK2=1
-$as_echo "#define curl_free free" >>confdefs.h
+$as_echo "#define HAVE_GTK2 1" >>confdefs.h
fi
- CPPFLAGS=$_libcurl_save_cppflags
- LIBS=$_libcurl_save_libs
- unset _libcurl_save_cppflags
- unset _libcurl_save_libs
-
-
-$as_echo "#define HAVE_CURL 1" >>confdefs.h
-
-
-
- PBX_CURL=1
-
- for _libcurl_feature in $_libcurl_features ; do
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
-_ACEOF
-
- eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
- done
-
- if test "x$_libcurl_protocols" = "x" ; then
-
- # We don't have --protocols, so just assume that all
- # protocols are available
- _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
-
- if test x$libcurl_feature_SSL = xyes ; then
- _libcurl_protocols="$_libcurl_protocols HTTPS"
-
- # FTPS wasn't standards-compliant until version
- # 7.11.0
- if test $_libcurl_version -ge 461568; then
- _libcurl_protocols="$_libcurl_protocols FTPS"
- fi
- fi
- fi
-
- for _libcurl_protocol in $_libcurl_protocols ; do
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
-_ACEOF
-
- eval `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes
- done
- else
- unset CURL_LIB
- unset CURL_INCLUDE
- PBX_CURL=0
- fi
- fi
-
- unset _libcurl_try_link
- unset _libcurl_version_parse
- unset _libcurl_config
- unset _libcurl_feature
- unset _libcurl_features
- unset _libcurl_protocol
- unset _libcurl_protocols
- unset _libcurl_version
- unset _libcurl_ldflags
- fi
-
- if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
- # This is the IF-NO path
- :
- else
- # This is the IF-YES path
- :
- fi
-
- unset _libcurl_with
ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts channels/h323/Makefile"
@@ -20300,7 +20526,7 @@
Configuration headers:
$config_headers
-Report bugs to <www.asterisk.org>."
+Report bugs to <https://issues.asterisk.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/configure.ac
^
|
@@ -2,7 +2,7 @@
AC_PREREQ(2.60)
-AC_INIT(asterisk, 1.4, www.asterisk.org)
+AC_INIT([asterisk], [1.4], [https://issues.asterisk.org])
# cross-compile macros
AC_CANONICAL_BUILD
@@ -17,21 +17,22 @@
AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
AC_COPYRIGHT("Asterisk")
-AC_REVISION($Revision: 259847 $)
+AC_REVISION($Revision: 279344 $)
AC_USE_SYSTEM_EXTENSIONS # note- does not work on FreeBSD
case "${host_os}" in
freebsd*)
- ac_default_prefix=/usr/local
+ AC_PREFIX_DEFAULT([/usr/local])
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
;;
darwin*)
+ AC_PREFIX_DEFAULT([/usr/local])
AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.])
;;
*)
- ac_default_prefix=/usr
+ AC_PREFIX_DEFAULT([/usr])
if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
if test ${sysconfdir} = '${prefix}/etc'; then
sysconfdir=/etc
@@ -228,16 +229,17 @@
# by the --with option name, to make things easier for the users :-)
AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
-AST_EXT_LIB_SETUP([CURL], [cURL], [curl])
AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls])
AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal'])
+AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
AST_EXT_LIB_SETUP([KDE], [KDE], [kde])
+AST_LIBCURL_CHECK_CONFIG([], [7.10.1])
AST_EXT_LIB_SETUP([LTDL], [libtool], [ltdl])
AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn])
AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
@@ -246,6 +248,8 @@
AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [odbc])
AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
+AST_EXT_LIB_SETUP([OPENAIS], [OpenAIS], [openais])
+AST_EXT_LIB_SETUP([OPENR2], [MFR2], [openr2])
AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
AST_EXT_LIB_SETUP([POPT], [popt], [popt])
@@ -254,14 +258,13 @@
AST_EXT_LIB_SETUP_DEPENDENT([PRI_VERSION], [ISDN PRI get_version], [PRI], [pri])
AST_EXT_LIB_SETUP_DEPENDENT([PRI_INBANDDISCONNECT], [ISDN PRI set_inbanddisconnect], [PRI], [pri])
AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
-AST_EXT_LIB_SETUP([OPENH323], [OpenH323], [h323])
AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
AST_EXT_LIB_SETUP([SPEEXDSP], [Speexdsp], [speexdsp])
AST_EXT_LIB_SETUP_DEPENDENT([SPEEX_PREPROCESS], [speex_preprocess_ctl], [], [speex])
AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
-AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl])
+AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap])
AST_EXT_LIB_SETUP([TINFO], [Term Info], [tinfo])
@@ -419,6 +422,20 @@
AC_DEFINE([PTHREAD_ONCE_INIT_NEEDS_BRACES], 1, [Define if your system needs braces around PTHREAD_ONCE_INIT])
fi
+# Can we compare a mutex to its initial value?
+# Generally yes on OpenBSD/FreeBSD and no on Mac OS X.
+AC_MSG_CHECKING(whether we can compare a mutex to its initial value)
+AC_LINK_IFELSE(
+ AC_LANG_PROGRAM([#include <pthread.h>], [pthread_mutex_t lock;
+ if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
+ return 0;
+ }
+ return 0]),
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([CAN_COMPARE_MUTEX_TO_INIT_VALUE], 1, [Define to 1 if the implementation of mutexes supports comparison of a mutex to its initializer.]),
+ AC_MSG_RESULT(no)
+)
+
AC_MSG_CHECKING(for compiler atomic operations)
AC_LINK_IFELSE(
AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]),
@@ -433,6 +450,7 @@
AST_GCC_ATTRIBUTE(unused)
AST_GCC_ATTRIBUTE(always_inline)
AST_GCC_ATTRIBUTE(deprecated)
+AST_GCC_ATTRIBUTE(warn_unused_result)
AC_MSG_CHECKING(for -ffunction-sections support)
saved_CFLAGS="${CFLAGS}"
@@ -568,8 +586,11 @@
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
fi
+PBX_DAHDI_TRANSCODE=0
if test "${USE_DAHDI}" != "no" ; then
- AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
+ AST_C_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230])
+ AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220])
+ AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h], [200])
if test "x${PBX_DAHDI}" = "x1" ; then
PBX_DAHDI_TRANSCODE=1
AC_SUBST(PBX_DAHDI_TRANSCODE)
@@ -1411,7 +1432,7 @@
OPENH323DIR="${OPENH323_DIR}"
fi
AST_CHECK_OPENH323()
- AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3])
+ AST_CHECK_PWLIB_VERSION([OpenH323], [OPENH323], [openh323buildopts.h], [1], [17], [3], [], [1], [19], [0])
AST_CHECK_OPENH323_BUILD()
PLATFORM_OPENH323="h323_${PWLIB_PLATFORM}_${OPENH323_SUFFIX}"
AST_CHECK_PWLIB_BUILD([OpenH323], [OPENH323],
@@ -1720,8 +1741,6 @@
AC_SUBST(GTK2_INCLUDE)
AC_SUBST(GTK2_LIB)
-AST_LIBCURL_CHECK_CONFIG([], [7.10.1])
-
AC_CONFIG_FILES([build_tools/menuselect-deps makeopts channels/h323/Makefile])
AC_OUTPUT
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/init.d/rc.debian.asterisk
^
|
@@ -1,5 +1,5 @@
#! /bin/sh
-# $Id: rc.debian.asterisk 251309 2010-03-08 18:07:44Z lmadsen $
+# $Id: rc.debian.asterisk 269334 2010-06-09 17:24:53Z pabelanger $
#
# Mon Jun 04 2007 Iñaki Baz Castillo <ibc@in.ilimit.es>
# - Eliminated SAFE_ASTERISK since it doesn't work as LSB script (it could require a independent "safe_asterisk" init script).
@@ -51,7 +51,7 @@
exit 0
fi
-# Use the LSB standar functions for services management
+# Use the LSB standard functions for services management
. /lib/lsb/init-functions
case "$1" in
@@ -65,19 +65,17 @@
fi
log_begin_msg "Starting $DESC: $NAME"
- if [ $AST_USER ] ; then
- ASTARGS="-U $AST_USER"
- fi
- if [ $AST_GROUP ] ; then
- ASTARGS="$ASTARGS -G $AST_GROUP"
- fi
- # "start-stop-daemon --oknodo" returns 0 even if Asterisk was already running (as LSB expects):
- if test "x$COLOR" = "xyes" ; then
- export TERM=linux
- start-stop-daemon --start --oknodo --background --exec $DAEMON -- $ASTARGS
- else
- start-stop-daemon --start --oknodo --exec $DAEMON -- $ASTARGS
+ if [ $AST_USER ] ; then
+ ASTARGS="-U $AST_USER"
+ fi
+ if [ $AST_GROUP ] ; then
+ ASTARGS="$ASTARGS -G $AST_GROUP"
fi
+ if test "x$COLOR" = "xno" ; then
+ ASTARGS="$ASTARGS -n"
+ fi
+ # "start-stop-daemon --oknodo" returns 0 even if Asterisk was already running (as LSB expects):
+ start-stop-daemon --start --oknodo --exec $DAEMON -- $ASTARGS
log_end_msg $?
;;
stop)
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/contrib/realtime
^
|
+(directory)
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql
^
|
+(directory)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql/iaxfriends.sql
^
|
(renamed to contrib/realtime/mysql/iaxfriends.sql)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql/iaxfriends.sql
^
|
(renamed to contrib/realtime/mysql/iaxfriends.sql)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql/meetme.sql
^
|
(renamed to contrib/realtime/mysql/meetme.sql)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql/meetme.sql
^
|
(renamed to contrib/realtime/mysql/meetme.sql)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql/sipfriends.sql
^
|
(renamed to contrib/realtime/mysql/sipfriends.sql)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql/sipfriends.sql
^
|
(renamed to contrib/realtime/mysql/sipfriends.sql)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql/voicemail.sql
^
|
(renamed to contrib/realtime/mysql/voicemail.sql)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/mysql/voicemail.sql
^
|
(renamed to contrib/realtime/mysql/voicemail.sql)
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/contrib/realtime/oracle
^
|
+(directory)
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/contrib/realtime/postgresql
^
|
+(directory)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/postgresql/realtime.sql
^
|
(renamed to contrib/realtime/postgresql/realtime.sql)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/contrib/realtime/postgresql/realtime.sql
^
|
(renamed to contrib/realtime/postgresql/realtime.sql)
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/contrib/realtime/sqlserver
^
|
+(directory)
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/contrib/scripts/astcli
^
|
@@ -0,0 +1,167 @@
+#!/usr/bin/perl -w
+
+use strict;
+use IO::Socket;
+use Getopt::Long;
+
+# Created by: David Van Ginneken
+# Bird's the Word Technologies
+# davevg@btwtech.com
+#
+# And distributed under the terms of the GPL
+#
+my ($user, $pw, $host, $port, $interactive, $save) = (undef, undef, 'localhost', 5038, 0, 0);
+my $EOL = "\r\n"; # Standard End of Line
+my @commands;
+process_credentials('/etc/astcli.conf');
+process_credentials("$ENV{HOME}/.astcli") if defined $ENV{HOME};
+GetOptions("username=s" => \$user, "secret=s" => \$pw, "host=s" => \$host, "port=s" => \$port, "readline" => \$interactive, "write" => \$save);
+
+$|++; # Auto Flush Output
+my $action = join(" ", @ARGV);
+
+&usage if (!defined $user || !defined $pw);
+my $tc = new IO::Socket::INET(
+ PeerAddr => $host,
+ PeerPort => $port,
+ Timeout => 30,
+ Proto => 'tcp'
+) or die "Could not connect to Host: $host on port $port\n";
+if (my $error = login()) {
+ print STDERR $error;
+ exit 1;
+};
+
+if ($save) {
+ if (-d $ENV{HOME}) {
+ open DEFAULT, ">$ENV{HOME}/.astcli";
+ print DEFAULT "username=$user\n" if $user;
+ print DEFAULT "password=$pw\n" if $pw;
+ print DEFAULT "hostname=$host\n" if $host;
+ print DEFAULT "portno=$port\n" if $port;
+ close DEFAULT;
+ }
+}
+
+# Send a single command to the manager connection handle (global $tc).
+# Assumes things always work well :-)
+sub send_command($) {
+ my $command = shift;
+ $tc->send('Action: Command' . $EOL);
+ $tc->send("Command: $command" . $EOL);
+ $tc->send($EOL);
+ my $response = '';
+ while (<$tc>) {
+ if ($_ =~ /--END COMMAND--/) {
+ $_ =~ s/--END COMMAND--\s*//;
+ $response .= $_;
+ last;
+ }
+ $response .= $_;
+ }
+ $response =~ s/Privilege: Command$EOL//;
+ $response =~ s/Response: Follows$EOL//;
+ return $response;
+}
+
+sub login {
+ my ($response, $message);
+ $tc->send("Action: Login" . $EOL);
+ $tc->send("Username: $user" . $EOL);
+ $tc->send("Secret: $pw" . $EOL);
+ $tc->send("Events: off" . $EOL);
+ $tc->send($EOL);
+ while (<$tc>) {
+ last if $_ eq $EOL;
+ $_ =~ s/$EOL//g;
+ ($response) = $_ =~ /^Response: (.*?)$/ if $_ =~ /^Response:/;
+ ($message) = $_ =~ /^Message: (.*?)$/ if $_ =~ /^Message:/;
+ }
+ return 0 if $response eq 'Success';
+ return $message;
+}
+
+sub logoff {
+ my ($response, $message);
+ $tc->send("Action: Logoff" . $EOL . $EOL);
+ return 1;
+}
+
+# If the user asked to send commands from standard input:
+if ($action eq '-' || !defined $action || $action eq '') {
+ if ($interactive) {
+ eval { require Term::ReadLine;};
+ $interactive = scalar($@) ? 0 : 1;
+ print STDERR "Falling back to standard mode, Unable to load Term::Readline for readline mode\n" unless $interactive;
+ }
+ if ($interactive) {
+ my $term = new Term::ReadLine 'Command Line Interface';
+ my $prompt = "$host*CLI> ";
+ my $attribs = $term->Attribs;
+ $attribs->{completion_function} = \&tab_completion;
+ while (defined($_ = $term->readline($prompt))) {
+ (logoff() and exit) if $_ =~ /exit|quit/; # Give them a way to exit the "terminal"
+ print send_command($_) if $_ !~ m/^\s*$/;
+ }
+ } else {
+ while (<>) {
+ chomp;
+ (logoff() and exit) if $_ =~ /exit|quit/; # If someone accidentally ends up here, let them exit
+ print send_command($_);
+ }
+ }
+ exit 0;
+}
+
+# Otherwise just send the command:
+print send_command($action);
+
+# parses a configuration file into the global $user and $pw.
+sub process_credentials {
+ # Process the credentials found..
+ my $file = shift;
+ # silently fail if we can't read the file:
+ return unless (-r $file);
+ open (my $fh, "<$file") or return;
+ while (<$fh>) {
+ chomp;
+ (undef,$user) = split(/[,=]/, $_) if $_ =~ /user(name)?[,=]/i;
+ (undef,$pw) = split(/[,=]/, $_) if $_ =~ /(secret|passw(or)?d|pwd?)[,=]/i;
+ (undef,$host) = split(/[,=]/, $_) if $_ =~ /host(name)?[,=]/i;
+ (undef,$port) = split(/[,=]/, $_) if $_ =~ /port(num|no)?[,=]/i;
+ }
+ close ($fh);
+}
+
+sub usage {
+ print STDERR "astcli [<options>] [<cli-command>|-]\n";
+ print STDERR " -u <name> - Connect as username <name>\n";
+ print STDERR " -s <pw> - Connect with secret <pw>\n";
+ print STDERR " -h <host> - Connect to host <host> [localhost]\n";
+ print STDERR " -p <port> - Connect on TCP port <port> [5038]\n";
+ print STDERR " -r - Start a readline session for interactivity\n";
+ print STDERR " -w - Save connection options in a configuration file\n";
+ print STDERR " You may specify the command as '-' to take commands from stdin.\n";
+ exit;
+}
+
+sub tab_completion {
+ my ($word, $buffer, $offset) = @_;
+ my %items;
+ my $lastword = '';
+ if ($word eq '') {
+ $buffer =~ m/(\S+)\s?$/;
+ $lastword = $1;
+ #print STDERR "\n\nlastword=\"$lastword\"\n";
+ }
+
+ my $res = send_command("_command matchesarray \"$buffer\" \"$word\"");
+ foreach my $item (split /\s+/, $res) {
+ $items{$item}++ unless ($item eq '_EOF_' or $item eq '' or $item eq $lastword);
+ }
+
+ #print STDERR "\nword=\"$word\" buffer=\"$buffer\" offset=\"$offset\" res=\"$res\"\n";
+
+ return sort keys %items;
+}
+
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/contrib/scripts/live_ast
^
|
@@ -0,0 +1,261 @@
+#!/bin/sh
+
+# live_ast: run asterisk from a newly-built copy with minimal changes.
+
+# Copyright (C) 2007 Tzafrir Cohen <tzafrir.cohen@xorcom.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+
+# This script allows you to install Asterisk into a subdirectory of
+# your source distribution and run it from there.
+#
+# Example usage:
+#
+# contrib/scripts/live_ast conf-file # optionally. and now edit live/live.conf
+# # edit live/live.conf
+# contrib/scripts/live_ast configure
+# make
+# contrib/scripts/live_ast install
+# contrib/scripts/live_ast samples
+# contrib/scripts/live_ast run
+# contrib/scripts/live_ast run -r
+# ./live/asterisk -r # Same as run -r
+#
+# A standard debugging cycle of a code in a module:
+#
+# # edit apps/app_skel.c
+# contrib/scripts/live_ast install
+# contrib/scripts/live_ast run -r
+# # and in the CLI:
+# module unload app_skel.so
+# module load app_skel.so
+#
+# If you have external scripts that run asterisk, use the script
+# live/asterisk that is generated by the 'samples' command. In this case you
+# should probably also rem-out the line 'astvarrundir' and maybe also
+# 'astetcdir' in live/etc/asterisk.conf .
+#
+####################### Begin Samples
+# optional environment variables. Set those in live/live.conf or in
+# your envirnment.
+#
+# LIVE_AST_LIBPRI_PATH:
+# To use a libpri SVN directory (without running 'make install': make include
+# a symlink to the current directory:
+# ln -s . /path/to/checkout/of/libpri/include
+# Be sure to run there 'make'. Then set in live.conf:
+#LIVE_AST_LIBPRI_PATH="/path/to/checkout/of/libpri"
+#
+# LIVE_AST_ZAPTEL_PATH:
+# Likewise, the same trick can be used to build vs. a local copy of zaptel:
+# ln -s /path/to/checkout/of/zaptel/include .
+# ln -s /path/to/checkout/of/zaptel/zaptel .
+#LIVE_AST_ZPATEL_PATH="/path/to/checkout/of/zaptel"
+#
+#LIVE_AST_DAHDI_PATH="/path/to/dahdi-linux/dir"
+#LIVE_AST_DAHDITOOLS_PATH="/path/to/dahdi-tools/dir"
+#
+# Another alternative for Zaptel is to use the live_zap script included
+# with the Zaptel distribution. The following should work after you used
+# './live_zap install' or even with a copy generated with
+# './live_zap rsync' . '/apth/to/zaptel' is the directory containing the
+# live/ subdirectory:
+#
+#LIVE_AST_ZAPLIVE_PATH="/path/to/zaptel"
+#
+# LIVE_AST_LD_PATH_EXTRA:
+# space-separated or colon-separated directories to add to
+# LD_LIBRARY_PATH. It is added before any existing components of
+# LD_LIBRARY_PATH.
+#LIVE_AST_LD_PATH_EXTRA="$HOME/lib:$HOME/libtest /opt/testapp"
+#
+# LIVE_AST_CONFIGURE_PARAMS:
+# Extra parameters to pass to ./configure.
+#LIVE_AST_CONFIGURE_PARAMS="--enable-dev-mode"
+#
+# LIVE_AST_FORCE_DEF_CONF:
+# If set to a non-empty value, always regenerate menuselect config.
+# This avoids emenselect's nag about "configuration has changed" that
+# happens occasionally after an svn update.
+#LIVE_AST_FORCE_DEF_CONF=yes
+#
+# LIVE_AST_BRISTUFFED_LIBPRI
+# A hack to use the second, "bristuffed" copy of libpri that exists
+# e.g. in the Debian libpri-dev package. If set to a non-empty value,
+# live_ast will edit makeopts to use that second copy after ./configure
+# is run.
+#LIVE_AST_BRISTUFFED_LIBPRI=yes
+#
+# LIVE_AST_FOR_SYSTEM
+# When generating asterisk.conf, use most components from the installed
+# system. Also provide a sane var-run directory for those of us who want
+# to do the right thing and run asterisk as non-root.
+#LIVE_AST_FOR_SYSTEM=yes
+####################### End Samples
+
+BASE_DIR="$PWD/live"
+AST_CONF_DIR="$BASE_DIR/etc/asterisk"
+AST_CONF="$AST_CONF_DIR/asterisk.conf"
+AST_BIN="$BASE_DIR/usr/sbin/asterisk"
+GDB_INIT="$BASE_DIR/gdbinit"
+LIVE_CONF="$BASE_DIR/live.conf"
+DISABLED_MODS="chan_h323 pbx_dundi"
+DISABLED_MODS_FILE="modules-disabled.conf"
+
+if [ -r "$LIVE_CONF" ]; then . "$LIVE_CONF"; fi
+
+if [ "$LIVE_AST_LIBPRI_PATH" != '' ]; then
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-pri=$LIVE_AST_LIBPRI_PATH"
+ LIVE_AST_LD_PATH_EXTRA="$LIVE_AST_LD_PATH_EXTRA $LIVE_AST_LIBPRI_PATH"
+fi
+
+if [ "$LIVE_AST_ZAPTEL_PATH" != '' ]; then
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-tonezone=$LIVE_AST_ZAPTEL_PATH"
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-zaptel=$LIVE_AST_ZAPTEL_PATH"
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-zaptel_transcode=$LIVE_AST_ZAPTEL_PATH"
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-zaptel_vldtmf=$LIVE_AST_ZAPTEL_PATH"
+ LIVE_AST_LD_PATH_EXTRA="$LIVE_AST_LD_PATH_EXTRA $LIVE_AST_ZAPTEL_PATH"
+fi
+
+if [ "$LIVE_AST_DAHDI_PATH" != '' ]; then
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-dahdi=$LIVE_AST_DAHDI_PATH"
+fi
+
+if [ "$LIVE_AST_DAHDITOOLS_PATH" != '' ]; then
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-tonezone=$LIVE_AST_DAHDITOOLS_PATH"
+ LIVE_AST_LD_PATH_EXTRA="$LIVE_AST_LD_PATH_EXTRA $LIVE_AST_DAHDITOOLS_PATH"
+fi
+
+if [ "$LIVE_AST_ZPALIVE_PATH" != '' ]; then
+ ZAPLIVE_USR_DIR="$LIVE_AST_ZPALIVE_PATH/live/usr"
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-tonezone=$ZAPLIVE_USR_DIR"
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-zaptel=$ZAPALIVE_USR_DIR"
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-zaptel_transcode=$ZAPALIVE_USR_DIR"
+ LIVE_AST_CONFIGURE_PARAMS="$LIVE_AST_CONFIGURE_PARAMS --with-zaptel_vldtmf=$ZAPALIVE_USR_DIR"
+ LIVE_AST_LD_PATH_EXTRA="$LIVE_AST_LD_PATH_EXTRA $ZAPLIVE_USR_DIR/lib"
+fi
+
+# gets rid of excessive spaces. Leves nothing if there were only white spaces:
+LIVE_AST_LD_PATH_EXTRA=`echo $LIVE_AST_LD_PATH_EXTRA | tr ' ' :`
+
+set_ld_env() {
+ if [ "$LIVE_AST_LD_PATH_EXTRA$LD_LIBRARY_PATH" = '' ]; then return; fi
+
+ LD_LIBRARY_PATH=`echo $LIVE_AST_LD_PATH_EXTRA $LD_LIBRARY_PATH | tr ' ' :`
+ export LD_LIBRARY_PATH
+}
+
+# if live.conf does not exist, generate it from the sample
+gen_live_conf() {
+ if [ -r $LIVE_CONF ]; then return; fi
+ # TODO: `dirname $LIVE_CONF` in case someone redefines it?
+ mkdir -p $BASE_DIR
+ sed -n -e '/^#* Begin Samples/,/^#* End Samples/p' "$0" \
+ | sed -e '/^#* \(Begin\|End\) Samples/d' >"$LIVE_CONF"
+}
+
+case "$1" in
+configure)
+ shift
+ ./configure $LIVE_AST_CONFIGURE_PARAMS "$@"
+ if [ "$LIVE_AST_FORCE_DEF_CONF" != '' ]; then
+ rm -f menuselect.makeopts
+ fi
+ if [ "$LIVE_AST_BRISTUFFED_LIBPRI" != '' ]; then
+ sed -i \
+ -e 's|^\(PRI_INCLUDE=\).*|\1-I/usr/include/bristuffed|' \
+ -e 's|^\(PRI_LIB=\).*|\1-lpri-bristuffed|' \
+ makeopts
+ fi
+ ;;
+install)
+ make install DESTDIR="$BASE_DIR"
+ ;;
+samples)
+ make samples DESTDIR="$BASE_DIR"
+ if [ "$LIVE_AST_FOR_SYSTEM" != '' ]; then
+ cat <<EOF >"$AST_CONF"
+[directories]
+; rem-out any of the following to use Asterisk's defaults:
+;astetcdir => $BASE_DIR/etc/asterisk
+astmoddir => $BASE_DIR/usr/lib/asterisk/modules
+;astvarlibdir => $BASE_DIR/var/lib/asterisk
+;astdatadir => $BASE_DIR/var/lib/asterisk
+;astagidir => $BASE_DIR/var/lib/asterisk/agi
+;astrundir => $BASE_DIR/var/run
+astrundir => /var/run/asterisk
+;astspooldir => $BASE_DIR/var/spool/asterisk
+;astlogdir => $BASE_DIR/var/log/asterisk
+EOF
+ else
+ cat <<EOF >"$AST_CONF"
+[directories]
+; rem-out any of the following to use Asterisk's defaults:
+astetcdir => $BASE_DIR/etc/asterisk
+astmoddir => $BASE_DIR/usr/lib/asterisk/modules
+astvarlibdir => $BASE_DIR/var/lib/asterisk
+astdatadir => $BASE_DIR/var/lib/asterisk
+astagidir => $BASE_DIR/var/lib/asterisk/agi
+astrundir => $BASE_DIR/var/run
+astspooldir => $BASE_DIR/var/spool/asterisk
+astlogdir => $BASE_DIR/var/log/asterisk
+EOF
+ fi
+ # disable some modules that bind on a port that is already in use by a
+ # main Asterisk copy, and would crash asterisk in failing:
+ rm -f "$AST_CONF_DIR/$DISABLED_MODS_FILE"
+ for mod in $DISABLED_MODS; do
+ echo "noload => $mod.so" >> "$AST_CONF_DIR/$DISABLED_MODS_FILE"
+ done
+ echo "#include $DISABLED_MODS_FILE" >> "$AST_CONF_DIR/modules.conf"
+
+ cat <<EOF >"$GDB_INIT"
+set args -C "$AST_CONF" -c
+EOF
+cat <<EOF >"$BASE_DIR/asterisk"
+#!/bin/sh
+# a wrapper to run asterisk from the "live" copy:
+cd "$PWD"
+exec "$0" run "\$@"
+EOF
+ chmod +x "$BASE_DIR/asterisk"
+ # Generate a sample config file for live_ast itself:
+ gen_live_conf
+ ;;
+conf-file)
+ # Just regenerate live.conf from the sample if it does not already exist:
+ gen_live_conf
+ ;;
+run)
+ shift
+ set_ld_env
+ $AST_BIN -C $AST_CONF "$@"
+ ;;
+gdb)
+ set_ld_env
+ gdb -x $GDB_INIT $AST_BIN
+ ;;
+*)
+ echo "$0: Usage: Equivalent of:"
+ echo "$0 configure [params] ./configure [params]"
+ echo "$0 install make install"
+ echo "$0 samples make samples"
+ echo "$0 run [params] asterisk [params]"
+ echo "$0 gdb gdb asterisk"
+ echo "$0 conf-file create live.conf if it does not exist"
+ exit 1
+ ;;
+esac
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/doc/HOWTO_collect_debug_information.txt
^
|
@@ -68,7 +68,7 @@
SIP (1.4 or higher)
- *ClI> sip set debug off
+ *CLI> sip set debug off
IAX2 (1.4 or higher)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/doc/asterisk.8
^
|
@@ -3,7 +3,7 @@
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng <steve@ggi-project.org>.
-.TH "ASTERISK" "8" "25 October 2005" "asterisk 1.2" ""
+.TH "ASTERISK" "8" "23 December 2006" "asterisk 1.4" ""
.SH NAME
asterisk \- All-purpose telephony server.
@@ -186,8 +186,6 @@
http://www.voip-info.org/wiki-Asterisk - The Asterisk Wiki
.PP
http://www.digium.com/ - Asterisk sponsor and hardware supplier
-.PP
-http://www.markocam.com/ - Asterisk author's web cam
.SH "AUTHOR"
.PP
Mark Spencer <markster@digium.com>
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/doc/manager.txt
^
|
@@ -122,6 +122,23 @@
You can always get more information about a manager command
with the "show manager command <command>" CLI command in Asterisk.
+Determining when all modules have finished loading
+--------------------------------------------------
+It is handy to have a single event notification for when all Asterisk
+modules have been loaded--especially for situations like running
+automated tests. This event will fire 1) immediately upon all modules
+loading or 2) upon connection to the AMI interface if the modules have
+already finished loading before the connection was made. This ensures
+that a user will never miss getting a FullyBooted event. In vary rare
+circumstances, it might be possible to get two copies of the message
+if the AMI connection is made right as the modules finish loading.
+
+Example:
+ Event: FullyBooted
+ Privilege: system,all
+ Status: Fully Booted
+
+
Examples
--------
Login - Log a user into the manager interface.
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/doc/plc.txt
^
|
@@ -0,0 +1,131 @@
+What is PLC?
+
+ PLC stands for Packet Loss Concealment. PLC describes any method of generating
+new audio data when packet loss is detected. In Asterisk, there are two main flavors
+of PLC, generic and native. Generic PLC is a method of generating audio data on
+signed linear audio streams. Signed linear audio, often abbreviated "slin," is required
+since it is a raw format that has no companding, compression, or other transformations
+applied. Native PLC is used by specific codec implementations, such as
+iLBC and Speex, which generates the new audio in the codec's native format. Native
+PLC happens automatically when using a codec that supports native PLC. Generic PLC
+requires specific configuration options to be used and will be the focus of this
+document.
+
+How does Asterisk detect packet loss?
+
+ Oddly, Asterisk does not detect packet loss when reading audio in. In order to
+detect packet loss, one must have a jitter buffer in use on the channel on which
+Asterisk is going to write missing audio using PLC. When a jitter buffer is in use,
+audio that is to be written to the channel is fed into the jitterbuffer. When the
+time comes to write audio to the channel, a bridge will request that the jitter
+buffer gives a frame of audio to the bridge so that the audio may be written. If
+audio is requested from the jitter buffer but the jitter buffer is unable to give
+enough audio to the bridge, then the jitter buffer will return an interpolation
+frame. This frame contains no actual audio data and indicates the number of samples
+of audio that should be inserted into the frame.
+
+A bit of background on translation
+
+ As stated in the introduction, generic PLC can only be used on slin audio.
+The majority of audio communication is not done in slin, but rather using lower
+bandwidth codecs. This means that for PLC to be used, there must be a translation
+step involving slin on the write path of a channel. This means that PLC cannot
+be used if the codecs on either side of the bridge are the same or do not require
+a translation to slin in order to translate between them. For instance, a
+ulaw <-> ulaw call will not use PLC since no translation is required. In addition,
+a ulaw <-> alaw call will also not use PLC since the translation path does not
+include any step involving slin.
+ One item of note is that slin must be present on the write path of a channel
+since that is the path where PLC is applied. Consider that Asterisk is bridging
+channels A and B. A uses ulaw for audio and B uses GSM. This translation involves
+slin, so things are shaping up well for PLC. Consider, however if Asterisk sets
+up the translation paths like so:
+
+ Fig. 1
+
+A +------------+ B
+<---ulaw<---slin<---GSM| |GSM--->
+ | Asterisk |
+ulaw--->slin--->GSM--->| |<---GSM
+ +------------+
+
+ The arrows indicate the direction of audio flow. Each channel has a write
+path (the top arrow) and a read path (the bottom arrow). In this setup, PLC
+can be used when sending audio to A, but it cannot be used when sending audio
+to B. The reason is simple, the write path to A's channel contains a slin
+step, but the write path to B contains no slin step. Such a translation setup
+is perfectly valid, and Asterisk can potentially set up such a path depending
+on circumstances. When we use PLC, however, we want slin audio to be present
+on the write paths of both A and B. A visual representation of what we want
+is the following:
+
+ Fig. 2
+
+A +------------+ B
+<---ulaw<---slin| |slin--->GSM--->
+ | Asterisk |
+ulaw--->slin--->| |<---slin<---GSM
+ +------------+
+
+ In this scenario, the write paths for both A and B begin with slin,
+and so PLC may be applied to either channel. This translation behavior has,
+in the past been doable with the transcode_via_sln option in asterisk.conf.
+Recent changes to the PLC code have also made the genericplc option in
+codecs.conf imply the transcode_via_sln option. The result is that by
+enabling genericplc in codecs.conf, the translation path set up in
+Fig. 2 should automatically be used.
+
+Additional restrictions and caveats
+
+ One restriction that has not been spelled out so far but that has been
+hinted at is the presence of a bridge. The term bridge in this sense means
+two channels exchanging audio with one another. A bridge is required because
+use of a jitter buffer is a prerequisite for using PLC, and a jitter buffer
+is only used when bridging two channels. This means that one-legged calls,
+(e.g. calls to voicemail, to an IVR, to an extension that just plays back
+audio) will not use PLC. In addition, MeetMe and ConfBridge calls will not
+use PLC.
+ It should be obvious, but it bears mentioning, that PLC cannot be used
+when using a technology's native bridging functionality. For instance, if
+two SIP channels can exchange RTP directly, then Asterisk will never be
+able to process the audio in the first place. Since translation of audio
+is a requirement for using PLC, and translation will not allow for a
+native bridge to be created, this is something that is not likely to be
+an issue, though.
+ Since a jitter buffer is a requirement in order to use PLC, it should
+be noted that simply enabling the jitter buffer via the jbenable option
+may not be enough. For instance, if bridging two SIP channels together,
+the default behavior will not be to enable jitter buffers on either channel.
+The rationale is that the jitter will be handled at the endpoints to which
+Asterisk is sending the audio. In order to ensure that a jitter buffer is
+used in all cases, one must enable the jbforce option for channel types
+on which PLC is desired.
+
+Summary
+ The following are all required for PLC to be used:
+* Enable genericplc in the plc section of codecs.conf
+* Enable (and potentially force) jitter buffers on channels
+* Two channels must be bridged together for PLC to be used
+(no Meetme or one-legged calls)
+* The audio must be translated between the two channels
+and must have slin as a step in the translation process.
+
+Protip
+
+ One of the restrictions mentioned is that PLC will only
+be used when two audio channels are bridged together. Through the
+use of Local channels, you can create a bridge even if the call
+is, for all intents and purposes, one-legged. By using a combination
+of the /n and /j suffixes for a Local channel, one can ensure
+that the Local channel is not optimized out of the talk path
+and that a jitter buffer is applied to the Local channel as well.
+Consider the following simple dialplan:
+
+[example]
+exten => 1,1,Playback(tt-weasels)
+exten => 2,1,Dial(Local/1@example/nj)
+
+When dialing extension 1, PLC cannot be used because there
+will be only a single channel involved. When dialing extension
+2, however, Asterisk will create a bridge between the incoming
+channel and the Local channel, thus allowing PLC to be used.
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/doc/voicemail_odbc_postgresql.txt
^
|
@@ -252,7 +252,7 @@
11) Just as a sanity check, make sure you check the voicemessages table via the
isql utility.
-[jsmith2@localhost ODBC]$ echo "SELECT id, msgnum, dir, duration FROM voicemessages WHERE msgnum = 1" | isql testing
+[jsmith2@localhost ODBC]$ echo "SELECT uniqueid, msgnum, dir, duration FROM voicemessages WHERE msgnum = 1" | isql testing
+---------------------------------------+
| Connected! |
| |
@@ -262,7 +262,7 @@
| |
+---------------------------------------+
SQL> +------------+------------+---------------------------------------------------------------------------------+---------------------+
-| id | msgnum | dir | duration |
+| uniqueid | msgnum | dir | duration |
+------------+------------+---------------------------------------------------------------------------------+---------------------+
+------------+------------+---------------------------------------------------------------------------------+---------------------+
SQLRowCount returns 0
@@ -370,9 +370,9 @@
\q to quit
asterisk=# SELECT * FROM voicemessages;
- id | msgnum | dir | context | macrocontext | callerid | origtime | duration | mailboxuser | mailboxcontext | recording | label | read | sip_id | pabx_id | iax_id
-----+--------+--------------------------------------------------+---------+--------------+-----------------------+------------+----------+-------------+----------------+-----------+-------+------+--------+---------+--------
- 26 | 0 | /var/spool/asterisk/voicemail/odbctest/101/INBOX | odbc | | "linksys" <linksys> | 1167794179 | 7 | 101 | odbctest | 16599 | | f | | |
+ uniqueid | msgnum | dir | context | macrocontext | callerid | origtime | duration | mailboxuser | mailboxcontext | recording | label | read | sip_id | pabx_id | iax_id
+----------+--------+--------------------------------------------------+---------+--------------+-----------------------+------------+----------+-------------+----------------+-----------+-------+------+--------+---------+--------
+ 26 | 0 | /var/spool/asterisk/voicemail/odbctest/101/INBOX | odbc | | "linksys" <linksys> | 1167794179 | 7 | 101 | odbctest | 16599 | | f | | |
(1 row)
Did you notice the the recording column is just a number? When a recording
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/funcs/func_callerid.c
^
|
@@ -22,7 +22,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 160703 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 280811 $")
#include <stdlib.h>
#include <stdio.h>
@@ -114,6 +114,7 @@
static int callerid_write(struct ast_channel *chan, char *cmd, char *data,
const char *value)
{
+ int valid = 1;
if (!value || !chan)
return -1;
@@ -157,6 +158,11 @@
ast_channel_unlock(chan);
} else {
ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
+ valid = 0;
+ }
+
+ if (valid) {
+ chan->cid.cid_tns = 1;
}
return 0;
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk.h
^
|
@@ -108,6 +108,7 @@
int astobj2_init(void); /*! Provided by astobj2.c */
void ast_autoservice_init(void); /*!< Provided by autoservice.c */
int ast_fd_init(void); /*!< Provided by astfd.c */
+int ast_test_init(void); /*!< Provided by test.c */
/* Many headers need 'ast_channel' to be defined */
struct ast_channel;
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/audiohook.h
^
|
@@ -191,6 +191,13 @@
*/
int ast_audiohook_remove(struct ast_channel *chan, struct ast_audiohook *audiohook);
+/*!
+ * \brief determines if a audiohook_list is empty or not.
+ *
+ * retval 0 false, 1 true
+ */
+int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list);
+
/*! \brief Pass a frame off to be handled by the audiohook core
* \param chan Channel that the list is coming off of
* \param audiohook_list List of audiohooks
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/autoconfig.h.in
^
|
@@ -10,6 +10,10 @@
/* Define to 1 if internal poll should be used. */
#undef AST_POLL_COMPAT
+/* Define to 1 if the implementation of mutexes supports comparison of a mutex
+ to its initializer. */
+#undef CAN_COMPARE_MUTEX_TO_INIT_VALUE
+
/* Define to 1 if the `closedir' function returns void instead of `int'. */
#undef CLOSEDIR_VOID
@@ -62,6 +66,10 @@
/* Define to 1 if your GCC C compiler supports the 'unused' attribute. */
#undef HAVE_ATTRIBUTE_unused
+/* Define to 1 if your GCC C compiler supports the 'warn_unused_result'
+ attribute. */
+#undef HAVE_ATTRIBUTE_warn_unused_result
+
/* Define to 1 if you have the `bzero' function. */
#undef HAVE_BZERO
@@ -275,9 +283,15 @@
/* Define to 1 if you have the OGG library. */
#undef HAVE_OGG
+/* Define to 1 if you have the OpenAIS library. */
+#undef HAVE_OPENAIS
+
/* Define if your system has the OpenH323 libraries. */
#undef HAVE_OPENH323
+/* Define to 1 if you have the MFR2 library. */
+#undef HAVE_OPENR2
+
/* Define to 1 if you have the OpenSSL library. */
#undef HAVE_OPENSSL
@@ -457,7 +471,7 @@
/* Define to 1 if you have the `strtoq' function. */
#undef HAVE_STRTOQ
-/* Define to 1 if `st_blksize' is member of `struct stat'. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
/* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -646,12 +660,12 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Define to 1 if the C compiler supports function prototypes. */
-#undef PROTOTYPES
-
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
#undef PTHREAD_CREATE_JOINABLE
@@ -671,11 +685,6 @@
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
-/* Define to 1 if the `setvbuf' function takes the buffering type as its
- second argument and the buffer pointer as the third, as on System V before
- release 3. */
-#undef SETVBUF_REVERSED
-
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
@@ -696,20 +705,30 @@
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#undef TM_IN_SYS_TIME
-/* Define to 1 if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
+/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
#undef _LARGEFILE_SOURCE
@@ -727,20 +746,6 @@
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
-/* Enable extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-
-/* Define like PROTOTYPES; this can be used by system headers. */
-#undef __PROTOTYPES
-
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/channel.h
^
|
@@ -859,6 +859,22 @@
\return Returns < 0 on failure, 0 if nothing ever arrived, and the # of ms remaining otherwise */
int ast_waitfor(struct ast_channel *chan, int ms);
+/*!
+ * \brief Should we keep this frame for later?
+ *
+ * There are functions such as ast_safe_sleep which will
+ * service a channel to ensure that it does not have a
+ * large backlog of queued frames. When this happens,
+ * we want to hold on to specific frame types and just drop
+ * others. This function will tell if the frame we just
+ * read should be held onto.
+ *
+ * \param frame The frame we just read
+ * \retval 1 frame should be kept
+ * \retval 0 frame should be dropped
+ */
+int ast_is_deferrable_frame(const struct ast_frame *frame);
+
/*! \brief Wait for a specied amount of time, looking for hangups
* \param chan channel to wait for
* \param ms length of time in milliseconds to sleep
@@ -1230,6 +1246,18 @@
*/
int ast_autoservice_stop(struct ast_channel *chan);
+/*!
+ * \brief Ignore certain frame types
+ * \note Normally, we cache DTMF, IMAGE, HTML, TEXT, and CONTROL frames
+ * while a channel is in autoservice and queue them up when taken out of
+ * autoservice. When this is not desireable, this API may be used to
+ * cause the channel to ignore those frametypes after the channel is put
+ * into autoservice, but before autoservice is stopped.
+ * \retval 0 success
+ * \retval -1 channel is not in autoservice
+ */
+int ast_autoservice_ignore(struct ast_channel *chan, enum ast_frame_type ftype);
+
/* If built with DAHDI optimizations, force a scheduled expiration on the
timer fd, at which point we call the callback function / data */
int ast_settimeout(struct ast_channel *c, int samples, int (*func)(const void *data), void *data);
@@ -1467,6 +1495,12 @@
*/
char *ast_channel_reason2str(int reason);
+/*!
+ * \brief Reload genericplc configuration value from codecs.conf
+ *
+ * Implementation is in main/channel.c
+ */
+int ast_plc_reload(void);
#if defined(__cplusplus) || defined(c_plusplus)
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/compiler.h
^
|
@@ -59,4 +59,10 @@
#define attribute_deprecated
#endif
+#ifdef HAVE_ATTRIBUTE_warn_unused_result
+#define attribute_warn_unused_result __attribute__((warn_unused_result))
+#else
+#define attribute_warn_unused_result
+#endif
+
#endif /* _ASTERISK_COMPILER_H */
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/file.h
^
|
@@ -199,7 +199,7 @@
* \param fmt the format you wish to check (the extension)
* \param preflang (the preferred language you wisht to find the file in)
* See if a given file exists in a given format. If fmt is NULL, any format is accepted.
- * Returns -1 if file does not exist, non-zero positive otherwise.
+ * Returns 0 if file does not exist, non-zero positive otherwise.
*/
int ast_fileexists(const char *filename, const char *fmt, const char *preflang);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/linkedlists.h
^
|
@@ -449,6 +449,7 @@
\li AST_LIST_INSERT_AFTER()
\li AST_LIST_INSERT_HEAD()
\li AST_LIST_INSERT_TAIL()
+ \li AST_LIST_INSERT_SORTALPHA()
*/
#define AST_LIST_TRAVERSE(head,var,field) \
for((var) = (head)->first; (var); (var) = (var)->field.next)
@@ -681,6 +682,35 @@
#define AST_RWLIST_INSERT_TAIL AST_LIST_INSERT_TAIL
/*!
+ * \brief Inserts a list entry into a alphabetically sorted list
+ * \param head Pointer to the list head structure
+ * \param elm Pointer to the entry to be inserted
+ * \param field Name of the list entry field (declared using AST_LIST_ENTRY())
+ * \param sortfield Name of the field on which the list is sorted
+ */
+#define AST_LIST_INSERT_SORTALPHA(head, elm, field, sortfield) do { \
+ if (!(head)->first) { \
+ (head)->first = (elm); \
+ (head)->last = (elm); \
+ } else { \
+ typeof((head)->first) cur = (head)->first, prev = NULL; \
+ while (cur && strcmp(cur->sortfield, elm->sortfield) < 0) { \
+ prev = cur; \
+ cur = cur->field.next; \
+ } \
+ if (!prev) { \
+ AST_LIST_INSERT_HEAD(head, elm, field); \
+ } else if (!cur) { \
+ AST_LIST_INSERT_TAIL(head, elm, field); \
+ } else { \
+ AST_LIST_INSERT_AFTER(head, prev, elm, field); \
+ } \
+ } \
+} while (0)
+
+#define AST_RWLIST_INSERT_SORTALPHA AST_LIST_INSERT_SORTALPHA
+
+/*!
\brief Appends a whole list to the tail of a list.
\param head This is a pointer to the list head structure
\param list This is a pointer to the list to be appended.
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/lock.h
^
|
@@ -55,6 +55,7 @@
#include "asterisk/time.h"
#endif
#include "asterisk/logger.h"
+#include "asterisk/compiler.h"
/* internal macro to profile mutexes. Only computes the delay on
* non-blocking calls.
@@ -204,13 +205,21 @@
do { \
char __filename[80], __func[80], __mutex_name[80]; \
int __lineno; \
- int __res = ast_find_lock_info(lock, __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \
- ast_mutex_unlock(lock); \
+ int __res2, __res = ast_find_lock_info(lock, __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \
+ __res2 = ast_mutex_unlock(lock); \
usleep(1); \
if (__res < 0) { /* Shouldn't ever happen, but just in case... */ \
- ast_mutex_lock(lock); \
+ if (__res2 == 0) { \
+ ast_mutex_lock(lock); \
+ } else { \
+ ast_log(LOG_WARNING, "Could not unlock mutex '%s': %s and no lock info found! I will NOT try to relock.\n", #lock, strerror(__res2)); \
+ } \
} else { \
- __ast_pthread_mutex_lock(__filename, __lineno, __func, __mutex_name, lock); \
+ if (__res2 == 0) { \
+ __ast_pthread_mutex_lock(__filename, __lineno, __func, __mutex_name, lock); \
+ } else { \
+ ast_log(LOG_WARNING, "Could not unlock mutex '%s': %s. {{{Originally locked at %s line %d: (%s) '%s'}}} I will NOT try to relock.\n", #lock, strerror(__res2), __filename, __lineno, __func, __mutex_name); \
+ } \
} \
} while (0)
@@ -260,7 +269,7 @@
int res;
pthread_mutexattr_t attr;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
/*
@@ -296,7 +305,7 @@
int res;
int canlog = strcmp(filename, "logger.c") & t->track;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
/* Don't try to uninitialize non initialized mutex
* This may no effect on linux
@@ -332,10 +341,6 @@
if ((res = pthread_mutex_destroy(&t->mutex)))
__ast_mutex_logger("%s line %d (%s): Error destroying mutex %s: %s\n",
filename, lineno, func, mutex_name, strerror(res));
-#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
- else
- t->mutex = PTHREAD_MUTEX_INIT_VALUE;
-#endif
ast_reentrancy_lock(t);
t->file[0] = filename;
t->lineno[0] = lineno;
@@ -354,7 +359,7 @@
int res;
int canlog = strcmp(filename, "logger.c") & t->track;
-#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS)
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
/* Don't warn abount uninitialized mutex.
* Simple try to initialize it.
@@ -437,12 +442,14 @@
}
static inline int __ast_pthread_mutex_trylock(const char *filename, int lineno, const char *func,
+ const char* mutex_name, ast_mutex_t *t) attribute_warn_unused_result;
+static inline int __ast_pthread_mutex_trylock(const char *filename, int lineno, const char *func,
const char* mutex_name, ast_mutex_t *t)
{
int res;
int canlog = strcmp(filename, "logger.c") & t->track;
-#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS)
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
/* Don't warn abount uninitialized mutex.
* Simple try to initialize it.
@@ -488,7 +495,7 @@
int res;
int canlog = strcmp(filename, "logger.c") & t->track;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
__ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
filename, lineno, func, mutex_name);
@@ -567,7 +574,7 @@
int res;
int canlog = strcmp(filename, "logger.c") & t->track;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
__ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
filename, lineno, func, mutex_name);
@@ -638,7 +645,7 @@
int res;
int canlog = strcmp(filename, "logger.c") & t->track;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
__ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
filename, lineno, func, mutex_name);
@@ -716,9 +723,15 @@
#else /* !DEBUG_THREADS */
#define DEADLOCK_AVOIDANCE(lock) \
- ast_mutex_unlock(lock); \
- usleep(1); \
- ast_mutex_lock(lock);
+ do { \
+ int __res; \
+ if (!(__res = ast_mutex_unlock(lock))) { \
+ usleep(1); \
+ ast_mutex_lock(lock); \
+ } else { \
+ ast_log(LOG_WARNING, "Failed to unlock mutex '%s' (%s). I will NOT try to relock. {{{ THIS IS A BUG. }}}\n", #lock, strerror(__res)); \
+ } \
+ } while (0)
typedef pthread_mutex_t ast_mutex_t;
@@ -862,7 +875,7 @@
{
int res;
pthread_rwlockattr_t attr;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
int canlog = strcmp(filename, "logger.c");
if (*prwlock != ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -889,7 +902,7 @@
int res;
int canlog = strcmp(filename, "logger.c");
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
if (*prwlock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
__ast_mutex_logger("%s line %d (%s): Warning: rwlock '%s' is uninitialized.\n",
filename, lineno, func, rwlock_name);
@@ -911,7 +924,7 @@
const char *file, int line, const char *func)
{
int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
int canlog = strcmp(file, "logger.c");
if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -938,7 +951,7 @@
const char *file, int line, const char *func)
{
int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
int canlog = strcmp(file, "logger.c");
if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -971,7 +984,7 @@
const char *file, int line, const char *func)
{
int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
int canlog = strcmp(file, "logger.c");
if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1004,7 +1017,7 @@
const struct timespec *abs_timeout, const char *file, int line, const char *func)
{
int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
int canlog = strcmp(file, "logger.c");
if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1053,7 +1066,7 @@
const struct timespec *abs_timeout, const char *file, int line, const char *func)
{
int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
int canlog = strcmp(file, "logger.c");
if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1102,7 +1115,7 @@
const char *file, int line, const char *func)
{
int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
int canlog = strcmp(file, "logger.c");
if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1135,7 +1148,7 @@
const char *file, int line, const char *func)
{
int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
int canlog = strcmp(file, "logger.c");
if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1371,7 +1384,7 @@
#define ast_channel_lock(x) ast_mutex_lock(&x->lock)
/*! \brief Unlock a channel. If DEBUG_CHANNEL_LOCKS is defined
in the Makefile, print relevant output for debugging */
-#define ast_channel_unlock(x) ast_mutex_unlock(&x->lock)
+#define ast_channel_unlock(x) ast_mutex_unlock(&x->lock)
/*! \brief Try locking a channel. If DEBUG_CHANNEL_LOCKS is defined
in the Makefile, print relevant output for debugging */
#define ast_channel_trylock(x) ast_mutex_trylock(&x->lock)
@@ -1393,7 +1406,7 @@
#define ast_channel_trylock(a) __ast_channel_trylock(a, __FILE__, __LINE__, __PRETTY_FUNCTION__)
/*! \brief Lock AST channel (and print debugging output)
\note You need to enable DEBUG_CHANNEL_LOCKS for this function */
-int __ast_channel_trylock(struct ast_channel *chan, const char *file, int lineno, const char *func);
+int __ast_channel_trylock(struct ast_channel *chan, const char *file, int lineno, const char *func) attribute_warn_unused_result;
#endif
#endif /* _ASTERISK_LOCK_H */
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/options.h
^
|
@@ -23,6 +23,8 @@
#ifndef _ASTERISK_OPTIONS_H
#define _ASTERISK_OPTIONS_H
+#include "asterisk/autoconfig.h"
+
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
@@ -73,16 +75,24 @@
AST_OPT_FLAG_DONT_WARN = (1 << 18),
/*! End CDRs before the 'h' extension */
AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN = (1 << 19),
- /*! Use Zaptel Timing for generators if available */
+ /*! Use DAHDI Timing for generators if available */
AST_OPT_FLAG_INTERNAL_TIMING = (1 << 20),
/*! Always fork, even if verbose or debug settings are non-zero */
AST_OPT_FLAG_ALWAYS_FORK = (1 << 21),
/*! Disable log/verbose output to remote consoles */
- AST_OPT_FLAG_MUTE = (1 << 22)
+ AST_OPT_FLAG_MUTE = (1 << 22),
+ /*! Generic PLC */
+ AST_OPT_FLAG_GENERIC_PLC = (1 << 23),
+ /*! Send the FullyBooted AMI event when all modules are loaded */
+ AST_OPT_FLAG_SEND_FULLYBOOTED = (1 << 24),
};
/*! These are the options that set by default when Asterisk starts */
+#if (defined(HAVE_DAHDI_VERSION) && HAVE_DAHDI_VERSION >= 230)
+#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN | AST_OPT_FLAG_INTERNAL_TIMING
+#else
#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN
+#endif
#define ast_opt_exec_includes ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES)
#define ast_opt_no_fork ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK)
@@ -107,6 +117,8 @@
#define ast_opt_internal_timing ast_test_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING)
#define ast_opt_always_fork ast_test_flag(&ast_options, AST_OPT_FLAG_ALWAYS_FORK)
#define ast_opt_mute ast_test_flag(&ast_options, AST_OPT_FLAG_MUTE)
+#define ast_opt_generic_plc ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC)
+#define ast_opt_send_fullybooted ast_test_flag(&ast_options, AST_OPT_FLAG_SEND_FULLYBOOTED)
extern struct ast_flags ast_options;
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/include/asterisk/test.h
^
|
@@ -0,0 +1,220 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2009-2010, Digium, Inc.
+ *
+ * David Vossel <dvossel@digium.com>
+ * Russell Bryant <russell@digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*!
+ * \file
+ * \brief Test Framework API
+ *
+ * For an overview on how to use the test API, see \ref AstUnitTestAPI
+ *
+ * \author David Vossel <dvossel@digium.com>
+ * \author Russell Bryant <russell@digium.com>
+ */
+
+#ifndef _AST_TEST_H_
+#define _AST_TEST_H_
+
+#ifdef TEST_FRAMEWORK
+#include "asterisk/cli.h"
+#include "asterisk/strings.h"
+#endif
+
+/*!
+
+\page AstUnitTestAPI Asterisk Unit Test API
+
+\section UnitTestAPIUsage How to Use the Unit Test API
+
+\subsection DefineTest Define a Test
+
+ Create a callback function for the test using the AST_TEST_DEFINE macro.
+
+ Each defined test has three arguments avaliable to it's test code.
+ \param struct ast_test_info *info
+ \param enum ast_test_command cmd
+ \param struct ast_test *test
+
+ While these arguments are not visible they are passed to every test function
+ defined using the AST_TEST_DEFINE macro.
+
+ Below is an example of how to define and write a test function.
+
+\code
+ AST_TEST_DEFINE(sample_test_cb) \\The name of the callback function
+ { \\The the function's body
+ switch (cmd) {
+ case TEST_INIT:
+ info->name = "sample_test";
+ info->category = "main/test/";
+ info->summary = "sample test for example purpose";
+ info->description = "This demonstrates how to initialize a test function";
+
+ return AST_TEST_NOT_RUN;
+ case TEST_EXECUTE:
+ break;
+ }
+ \test code
+ .
+ .
+ .
+ if (fail) { \\ the following is just some example logic
+ ast_test_status_update(test, "an error occured because...");
+ res = AST_RESULT_FAIL;
+ } else {
+ res = AST_RESULT_PASS
+ }
+ return res; \\ result must be of type enum ast_test_result_state
+ }
+\endcode
+
+ Details of the test execution, especially failure details, should be provided
+ by using the ast_test_status_update() function.
+
+\subsection RegisterTest Register a Test
+
+ Register the test using the AST_TEST_REGISTER macro.
+
+ AST_TEST_REGISTER uses the callback function to retrieve all the information
+ pertaining to a test, so the callback function is the only argument required
+ for registering a test.
+
+ AST_TEST_REGISTER(sample_test_cb); \\ Test callback function defined by AST_TEST_DEFINE
+
+ Tests are unregestered by using the AST_TEST_UNREGISTER macro.
+
+ AST_TEST_UNREGISTER(sample_test_cb); \\ Remove a registered test by callback function
+
+\subsection ExecuteTest Execute a Test
+
+ Execute and generate test results via CLI commands
+
+ CLI Examples:
+\code
+ 'test show registered all' will show every registered test.
+ 'test execute all' will execute every registered test.
+ 'test show results all' will show detailed results for ever executed test
+ 'test generate results xml' will generate a test report in xml format
+ 'test generate results txt' will generate a test report in txt format
+\endcode
+*/
+
+/*! Macros used for defining and registering a test */
+#ifdef TEST_FRAMEWORK
+
+#define AST_TEST_DEFINE(hdr) static enum ast_test_result_state hdr(struct ast_test_info *info, enum ast_test_command cmd, struct ast_test *test)
+#define AST_TEST_REGISTER(cb) ast_test_register(cb)
+#define AST_TEST_UNREGISTER(cb) ast_test_unregister(cb)
+
+#else
+
+#define AST_TEST_DEFINE(hdr) static enum ast_test_result_state attribute_unused hdr(struct ast_test_info *info, enum ast_test_command cmd, struct ast_test *test)
+#define AST_TEST_REGISTER(cb)
+#define AST_TEST_UNREGISTER(cb)
+#define ast_test_status_update(a,b,c...)
+
+#endif
+
+enum ast_test_result_state {
+ AST_TEST_NOT_RUN,
+ AST_TEST_PASS,
+ AST_TEST_FAIL,
+};
+
+enum ast_test_command {
+ TEST_INIT,
+ TEST_EXECUTE,
+};
+
+/*!
+ * \brief An Asterisk unit test.
+ *
+ * This is an opaque type.
+ */
+struct ast_test;
+
+/*!
+ * \brief Contains all the initialization information required to store a new test definition
+ */
+struct ast_test_info {
+ /*! \brief name of test, unique to category */
+ const char *name;
+ /*!
+ * \brief test category
+ *
+ * Tests are categorized in a directory tree style hierarchy. It is expected that
+ * this string have both a leading and trailing forward slash ('/').
+ */
+ const char *category;
+ /*! \brief optional short summary of test */
+ const char *summary;
+ /*! \brief optional brief detailed description of test */
+ const char *description;
+};
+
+#ifdef TEST_FRAMEWORK
+/*!
+ * \brief Generic test callback function
+ *
+ * \param error buffer string for failure results
+ *
+ * \retval AST_TEST_PASS for pass
+ * \retval AST_TEST_FAIL for failure
+ */
+typedef enum ast_test_result_state (ast_test_cb_t)(struct ast_test_info *info,
+ enum ast_test_command cmd, struct ast_test *test);
+
+/*!
+ * \brief unregisters a test with the test framework
+ *
+ * \param test callback function (required)
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int ast_test_unregister(ast_test_cb_t *cb);
+
+/*!
+ * \brief registers a test with the test framework
+ *
+ * \param test callback function (required)
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int ast_test_register(ast_test_cb_t *cb);
+
+/*!
+ * \brief update test's status during testing.
+ *
+ * \param test currently executing test
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+int __ast_test_status_update(const char *file, const char *func, int line,
+ struct ast_test *test, const char *fmt, ...)
+ __attribute__((format(printf, 5, 6)));
+
+/*!
+ * \ref __ast_test_status_update()
+ */
+#define ast_test_status_update(t, f, ...) __ast_test_status_update(__FILE__, __PRETTY_FUNCTION__, __LINE__, (t), (f), ## __VA_ARGS__)
+
+#endif /* TEST_FRAMEWORK */
+#endif /* _AST_TEST_H */
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/include/asterisk/translate.h
^
|
@@ -60,10 +60,6 @@
* or deallocation, nor any locking, because all of this is done in
* the generic code.
*
- * Translators using generic plc (packet loss concealment) should
- * supply a non-zero plc_samples indicating the size (in samples)
- * of artificially generated frames and incoming data.
- * Generic plc is only available for dstfmt = SLINEAR
*/
struct ast_translator {
const char name[80]; /*!< Name of translator */
@@ -102,8 +98,8 @@
int buf_size;
int desc_size; /*!< size of private descriptor in pvt->pvt, if any */
- int plc_samples; /*!< set to the plc block size if used, 0 otherwise */
- int useplc; /*!< current status of plc, changed at runtime */
+ int plc_samples; /* Unused. Kept for ABI purposes */
+ int useplc; /* Unused. Kept for ABI purposes */
int native_plc; /*!< true if the translator can do native plc */
struct ast_module *module; /* opaque reference to the parent module */
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/Makefile
^
|
@@ -27,7 +27,7 @@
netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
cryptostub.o sha1.o http.o fixedjitterbuf.o abstract_jb.o \
strcompat.o threadstorage.o dial.o astobj2.o global_datastores.o \
- audiohook.o poll.o
+ audiohook.o poll.o test.o
# we need to link in the objects statically, not as a library, because
# otherwise modules will not have them available if none of the static
@@ -121,7 +121,7 @@
$(CC) -g -o testexpr2 ast_expr2f.o ast_expr2.o
rm ast_expr2.o ast_expr2f.o
-asterisk.o channel.o: _ASTCFLAGS+=$(ZAPTEL_INCLUDE) $(DAHDI_INCLUDE)
+asterisk.o channel.o file.o: _ASTCFLAGS+=$(ZAPTEL_INCLUDE) $(DAHDI_INCLUDE)
stdtime/localtime.o: _ASTCFLAGS+=$(AST_NO_STRICT_OVERFLOW)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/acl.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 232350 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 271123 $")
#include <stdio.h>
#include <stdlib.h>
@@ -395,6 +395,7 @@
}
hp = ast_gethostbyname(value, &ahp);
if (hp) {
+ sin->sin_family = hp->h_addrtype;
memcpy(&sin->sin_addr, hp->h_addr, sizeof(sin->sin_addr));
} else {
ast_log(LOG_WARNING, "Unable to lookup '%s'\n", value);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/ast_expr2.y
^
|
@@ -15,7 +15,7 @@
#include "asterisk.h"
#if !defined(STANDALONE_AEL)
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 179807 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267009 $")
#endif
#include <sys/types.h>
@@ -969,7 +969,7 @@
/* compile regular expression */
if ((eval = regcomp (&rp, b->u.s, REG_EXTENDED)) != 0) {
regerror (eval, &rp, errbuf, sizeof(errbuf));
- ast_log(LOG_WARNING,"regcomp() error : %s",errbuf);
+ ast_log(LOG_WARNING, "regcomp() error : %s\n", errbuf);
free_value(a);
free_value(b);
return make_str("");
@@ -1020,7 +1020,7 @@
/* compile regular expression */
if ((eval = regcomp (&rp, b->u.s, REG_EXTENDED)) != 0) {
regerror (eval, &rp, errbuf, sizeof(errbuf));
- ast_log(LOG_WARNING,"regcomp() error : %s",errbuf);
+ ast_log(LOG_WARNING, "regcomp() error : %s\n", errbuf);
free_value(a);
free_value(b);
return make_str("");
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/asterisk.c
^
|
@@ -52,7 +52,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 252361 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 278981 $")
#undef sched_setscheduler
#undef setpriority
@@ -760,16 +760,21 @@
}
/*! \brief NULL handler so we can collect the child exit status */
-static void null_sig_handler(int signal)
+static void _null_sig_handler(int signal)
{
}
+static struct sigaction null_sig_handler = {
+ .sa_handler = _null_sig_handler,
+ .sa_flags = SA_RESTART,
+};
+
AST_MUTEX_DEFINE_STATIC(safe_system_lock);
/*! \brief Keep track of how many threads are currently trying to wait*() on
* a child process */
static unsigned int safe_system_level = 0;
-static void *safe_system_prev_handler;
+static struct sigaction safe_system_prev_handler;
void ast_replace_sigchld(void)
{
@@ -779,8 +784,9 @@
level = safe_system_level++;
/* only replace the handler if it has not already been done */
- if (level == 0)
- safe_system_prev_handler = signal(SIGCHLD, null_sig_handler);
+ if (level == 0) {
+ sigaction(SIGCHLD, &null_sig_handler, &safe_system_prev_handler);
+ }
ast_mutex_unlock(&safe_system_lock);
}
@@ -793,8 +799,9 @@
level = --safe_system_level;
/* only restore the handler if we are the last one */
- if (level == 0)
- signal(SIGCHLD, safe_system_prev_handler);
+ if (level == 0) {
+ sigaction(SIGCHLD, &safe_system_prev_handler, NULL);
+ }
ast_mutex_unlock(&safe_system_lock);
}
@@ -1153,13 +1160,17 @@
system call. We don't actually need to do anything though.
Remember: Cannot EVER ast_log from within a signal handler
*/
-static void urg_handler(int num)
+static void _urg_handler(int num)
{
- signal(num, urg_handler);
return;
}
-static void hup_handler(int num)
+static struct sigaction urg_handler = {
+ .sa_handler = _urg_handler,
+ .sa_flags = SA_RESTART,
+};
+
+static void _hup_handler(int num)
{
int a = 0;
if (option_verbose > 1)
@@ -1172,10 +1183,14 @@
fprintf(stderr, "hup_handler: write() failed: %s\n", strerror(errno));
}
}
- signal(num, hup_handler);
}
-static void child_handler(int sig)
+static struct sigaction hup_handler = {
+ .sa_handler = _hup_handler,
+ .sa_flags = SA_RESTART,
+};
+
+static void _child_handler(int sig)
{
/* Must not ever ast_log or ast_verbose within signal handler */
int n, status;
@@ -1187,9 +1202,13 @@
;
if (n == 0 && option_debug)
printf("Huh? Child handler, but nobody there?\n");
- signal(sig, child_handler);
}
+static struct sigaction child_handler = {
+ .sa_handler = _child_handler,
+ .sa_flags = SA_RESTART,
+};
+
/*! \brief Set an X-term or screen title */
static void set_title(char *text)
{
@@ -1301,14 +1320,21 @@
ast_module_shutdown();
}
if (ast_opt_console || ast_opt_remote) {
- if (getenv("HOME"))
+ if (getenv("HOME")) {
snprintf(filename, sizeof(filename), "%s/.asterisk_history", getenv("HOME"));
- if (!ast_strlen_zero(filename))
+ }
+ if (!ast_strlen_zero(filename)) {
ast_el_write_history(filename);
- if (el != NULL)
- el_end(el);
- if (el_hist != NULL)
- history_end(el_hist);
+ }
+ if (consolethread == AST_PTHREADT_NULL || consolethread == pthread_self()) {
+ /* Only end if we are the consolethread, otherwise there's a race with that thread. */
+ if (el != NULL) {
+ el_end(el);
+ }
+ if (el_hist != NULL) {
+ history_end(el_hist);
+ }
+ }
}
if (option_verbose)
ast_verbose("Executing last minute cleanups\n");
@@ -1366,7 +1392,7 @@
sig_flags.need_quit = 1;
if (sig_alert_pipe[1] != -1) {
if (write(sig_alert_pipe[1], &a, sizeof(a)) < 0) {
- fprintf(stderr, "hup_handler: write() failed: %s\n", strerror(errno));
+ fprintf(stderr, "quit_handler: write() failed: %s\n", strerror(errno));
}
}
/* There is no need to restore the signal handler here, since the app
@@ -1848,7 +1874,7 @@
/* Write over the CLI prompt */
if (!ast_opt_exec && !lastpos) {
- if (write(STDOUT_FILENO, "\r", 1) < 0) {
+ if (write(STDOUT_FILENO, "\r[0K", 5) < 0) {
}
}
if (write(STDOUT_FILENO, buf, res) < 0) {
@@ -2666,6 +2692,8 @@
_dahdi_chan_mode = CHAN_ZAP_MODE;
}
#endif
+ } else if (!strcasecmp(v->name, "sendfullybooted")) {
+ ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_SEND_FULLYBOOTED);
}
}
ast_config_destroy(cfg);
@@ -2703,7 +2731,7 @@
FILE *f;
sigset_t sigs;
int num;
- int isroot = 1;
+ int isroot = 1, rundir_exists = 0;
char *buf;
char *runuser = NULL, *rungroup = NULL;
@@ -2870,8 +2898,12 @@
/* It's common on some platforms to clear /var/run at boot. Create the
* socket file directory before we drop privileges. */
- if (mkdir(ast_config_AST_RUN_DIR, 0755) && errno != EEXIST) {
- ast_log(LOG_WARNING, "Unable to create socket file directory. Remote consoles will not be able to connect! (%s)\n", strerror(x));
+ if (mkdir(ast_config_AST_RUN_DIR, 0755)) {
+ if (errno == EEXIST) {
+ rundir_exists = 1;
+ } else {
+ ast_log(LOG_WARNING, "Unable to create socket file directory. Remote consoles will not be able to connect! (%s)\n", strerror(x));
+ }
}
#ifndef __CYGWIN__
@@ -2886,7 +2918,7 @@
ast_log(LOG_WARNING, "No such group '%s'!\n", rungroup);
exit(1);
}
- if (chown(ast_config_AST_RUN_DIR, -1, gr->gr_gid)) {
+ if (!rundir_exists && chown(ast_config_AST_RUN_DIR, -1, gr->gr_gid)) {
ast_log(LOG_WARNING, "Unable to chgrp run directory to %d (%s)\n", (int) gr->gr_gid, rungroup);
}
if (setgid(gr->gr_gid)) {
@@ -3035,6 +3067,13 @@
}
#endif
+#ifdef TEST_FRAMEWORK
+ if (ast_test_init()) {
+ printf("%s", term_quit());
+ exit(1);
+ }
+#endif
+
ast_makesocket();
sigemptyset(&sigs);
sigaddset(&sigs, SIGHUP);
@@ -3043,11 +3082,11 @@
sigaddset(&sigs, SIGPIPE);
sigaddset(&sigs, SIGWINCH);
pthread_sigmask(SIG_BLOCK, &sigs, NULL);
- signal(SIGURG, urg_handler);
+ sigaction(SIGURG, &urg_handler, NULL);
signal(SIGINT, __quit_handler);
signal(SIGTERM, __quit_handler);
- signal(SIGHUP, hup_handler);
- signal(SIGCHLD, child_handler);
+ sigaction(SIGHUP, &hup_handler, NULL);
+ sigaction(SIGCHLD, &child_handler, NULL);
signal(SIGPIPE, SIG_IGN);
/* ensure that the random number generators are seeded with a different value every time
@@ -3192,6 +3231,9 @@
sig_alert_pipe[0] = sig_alert_pipe[1] = -1;
ast_set_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED);
+ if (ast_opt_send_fullybooted) {
+ manager_event(EVENT_FLAG_SYSTEM, "FullyBooted", "Status: Fully Booted\r\n");
+ }
ast_process_pending_reloads();
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/audiohook.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 260049 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 279945 $")
#include <stdio.h>
#include <stdlib.h>
@@ -725,6 +725,17 @@
return end_frame;
}
+int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list)
+{
+ if (AST_LIST_EMPTY(&audiohook_list->spy_list) &&
+ AST_LIST_EMPTY(&audiohook_list->whisper_list) &&
+ AST_LIST_EMPTY(&audiohook_list->manipulate_list)) {
+
+ return 1;
+ }
+ return 0;
+}
+
/*! \brief Pass a frame off to be handled by the audiohook core
* \param chan Channel that the list is coming off of
* \param audiohook_list List of audiohooks
@@ -742,7 +753,6 @@
else
return frame;
}
-
/*! \brief Wait for audiohook trigger to be triggered
* \param audiohook Audiohook to wait on
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/autoservice.c
^
|
@@ -27,7 +27,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 223486 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 278167 $")
#include <stdio.h>
#include <stdlib.h>
@@ -61,6 +61,7 @@
* it gets stopped for the last time. */
unsigned int use_count;
unsigned int orig_end_dtmf_flag:1;
+ unsigned int ignore_frame_types;
/*! Frames go on at the head of deferred_frames, so we have the frames
* from newest to oldest. As we put them at the head of the readq, we'll
* end up with them in the right order for the channel's readq. */
@@ -115,6 +116,11 @@
AST_LIST_UNLOCK(&aslist);
if (!x) {
+ /* If we don't sleep, this becomes a busy loop, which causes
+ * problems when Asterisk runs at a different priority than other
+ * user processes. As long as we check for new channels at least
+ * once every 10ms, we should be fine. */
+ usleep(10000);
continue;
}
@@ -133,32 +139,8 @@
* thread in charge of this channel will know. */
defer_frame = &hangup_frame;
- } else {
-
- /* Do not add a default entry in this switch statement. Each new
- * frame type should be addressed directly as to whether it should
- * be queued up or not. */
-
- switch (f->frametype) {
- /* Save these frames */
- case AST_FRAME_DTMF_END:
- case AST_FRAME_CONTROL:
- case AST_FRAME_TEXT:
- case AST_FRAME_IMAGE:
- case AST_FRAME_HTML:
- defer_frame = f;
- break;
-
- /* Throw these frames away */
- case AST_FRAME_DTMF_BEGIN:
- case AST_FRAME_VOICE:
- case AST_FRAME_VIDEO:
- case AST_FRAME_NULL:
- case AST_FRAME_IAX:
- case AST_FRAME_CNG:
- case AST_FRAME_MODEM:
- break;
- }
+ } else if (ast_is_deferrable_frame(f)) {
+ defer_frame = f;
}
if (defer_frame) {
@@ -311,7 +293,9 @@
ast_channel_lock(chan);
while ((f = AST_LIST_REMOVE_HEAD(&as->deferred_frames, frame_list))) {
- ast_queue_frame_head(chan, f);
+ if (!((1 << f->frametype) & as->ignore_frame_types)) {
+ ast_queue_frame_head(chan, f);
+ }
ast_frfree(f);
}
ast_channel_unlock(chan);
@@ -321,6 +305,23 @@
return res;
}
+int ast_autoservice_ignore(struct ast_channel *chan, enum ast_frame_type ftype)
+{
+ struct asent *as;
+ int res = -1;
+
+ AST_LIST_LOCK(&aslist);
+ AST_LIST_TRAVERSE(&aslist, as, list) {
+ if (as->chan == chan) {
+ res = 0;
+ as->ignore_frame_types |= (1 << ftype);
+ break;
+ }
+ }
+ AST_LIST_UNLOCK(&aslist);
+ return res;
+}
+
void ast_autoservice_init(void)
{
ast_cond_init(&as_cond, NULL);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/callerid.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 206867 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 264820 $")
#include <time.h>
#include <string.h>
@@ -985,6 +985,8 @@
*ns = '\0';
*name = ns + 1;
ast_trim_blanks(*name);
+ } else {
+ *name = NULL;
}
} else { /* no quotes, trim off leading and trailing spaces */
*name = ast_skip_blanks(instr);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/channel.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 261094 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 282430 $")
#include <stdio.h>
#include <stdlib.h>
@@ -37,7 +37,7 @@
#include <unistd.h>
#include <math.h>
-#if defined(HAVE_DAHDI)
+#if defined(HAVE_DAHDI) || defined(HAVE_ZAPTEL)
#include <sys/ioctl.h>
#include "asterisk/dahdi_compat.h"
#endif
@@ -1149,7 +1149,7 @@
* as there can be no more matches.
*/
if (!(name && !namelen)) {
- prev = c;
+ _prev = c;
retries = -1;
}
}
@@ -1206,12 +1206,41 @@
return channel_find_locked(chan, NULL, 0, context, exten);
}
+int ast_is_deferrable_frame(const struct ast_frame *frame)
+{
+ /* Do not add a default entry in this switch statement. Each new
+ * frame type should be addressed directly as to whether it should
+ * be queued up or not.
+ */
+ switch (frame->frametype) {
+ case AST_FRAME_DTMF_END:
+ case AST_FRAME_CONTROL:
+ case AST_FRAME_TEXT:
+ case AST_FRAME_IMAGE:
+ case AST_FRAME_HTML:
+ return 1;
+
+ case AST_FRAME_DTMF_BEGIN:
+ case AST_FRAME_VOICE:
+ case AST_FRAME_VIDEO:
+ case AST_FRAME_NULL:
+ case AST_FRAME_IAX:
+ case AST_FRAME_CNG:
+ case AST_FRAME_MODEM:
+ return 0;
+ }
+ return 0;
+}
+
/*! \brief Wait, look for hangups and condition arg */
int ast_safe_sleep_conditional(struct ast_channel *chan, int ms, int (*cond)(void*), void *data)
{
struct ast_frame *f;
struct ast_silence_generator *silgen = NULL;
int res = 0;
+ AST_LIST_HEAD_NOLOCK(, ast_frame) deferred_frames;
+
+ AST_LIST_HEAD_INIT_NOLOCK(&deferred_frames);
/* If no other generator is present, start silencegen while waiting */
if (ast_opt_transmit_silence && !chan->generatordata) {
@@ -1219,6 +1248,7 @@
}
while (ms > 0) {
+ struct ast_frame *dup_f = NULL;
if (cond && ((*cond)(data) == 0)) {
break;
}
@@ -1233,7 +1263,18 @@
res = -1;
break;
}
- ast_frfree(f);
+
+ if (!ast_is_deferrable_frame(f)) {
+ ast_frfree(f);
+ continue;
+ }
+
+ if ((dup_f = ast_frisolate(f))) {
+ if (dup_f != f) {
+ ast_frfree(f);
+ }
+ AST_LIST_INSERT_HEAD(&deferred_frames, dup_f, frame_list);
+ }
}
}
@@ -1242,6 +1283,19 @@
ast_channel_stop_silence_generator(chan, silgen);
}
+ /* We need to free all the deferred frames, but we only need to
+ * queue the deferred frames if there was no error and no
+ * hangup was received
+ */
+ ast_channel_lock(chan);
+ while ((f = AST_LIST_REMOVE_HEAD(&deferred_frames, frame_list))) {
+ if (!res) {
+ ast_queue_frame_head(chan, f);
+ }
+ ast_frfree(f);
+ }
+ ast_channel_unlock(chan);
+
return res;
}
@@ -1385,7 +1439,10 @@
datastore->info = info;
- datastore->uid = ast_strdup(uid);
+ if (!ast_strlen_zero(uid) && !(datastore->uid = ast_strdup(uid))) {
+ ast_free(datastore);
+ datastore = NULL;
+ }
return datastore;
}
@@ -2349,6 +2406,19 @@
ast_clear_flag(chan, AST_FLAG_IN_DTMF);
if (!f->len)
f->len = ast_tvdiff_ms(now, chan->dtmf_tv);
+
+ /* detect tones that were received on
+ * the wire with durations shorter than
+ * AST_MIN_DTMF_DURATION and set f->len
+ * to the actual duration of the DTMF
+ * frames on the wire. This will cause
+ * dtmf emulation to be triggered later
+ * on.
+ */
+ if (ast_tvdiff_ms(now, chan->dtmf_tv) < AST_MIN_DTMF_DURATION) {
+ f->len = ast_tvdiff_ms(now, chan->dtmf_tv);
+ ast_log(LOG_DTMF, "DTMF end '%c' detected to have actual duration %ld on the wire, emulation will be triggered on %s\n", f->subclass, f->len, chan->name);
+ }
} else if (!f->len) {
ast_log(LOG_DTMF, "DTMF end accepted without begin '%c' on %s\n", f->subclass, chan->name);
f->len = AST_MIN_DTMF_DURATION;
@@ -2542,6 +2612,11 @@
chan->fin = FRAMECOUNT_INC(chan->fin);
done:
+ if (chan->audiohooks && ast_audiohook_write_list_empty(chan->audiohooks)) {
+ /* The list gets recreated if audiohooks are added again later */
+ ast_audiohook_detach_list(chan->audiohooks);
+ chan->audiohooks = NULL;
+ }
ast_channel_unlock(chan);
return f;
}
@@ -2836,7 +2911,7 @@
ast_log(LOG_DEBUG, "Prodding channel '%s'\n", chan->name);
a.subclass = chan->rawwriteformat;
a.data = nothing + AST_FRIENDLY_OFFSET;
- a.src = "ast_prod";
+ a.src = "ast_prod"; /* this better match check in ast_write */
if (ast_write(chan, &a))
ast_log(LOG_WARNING, "Prodding channel '%s' failed\n", chan->name);
}
@@ -2854,6 +2929,110 @@
return res;
}
+struct plc_ds {
+ /* A buffer in which to store SLIN PLC
+ * samples generated by the generic PLC
+ * functionality in plc.c
+ */
+ int16_t *samples_buf;
+ /* The current number of samples in the
+ * samples_buf
+ */
+ size_t num_samples;
+ plc_state_t plc_state;
+};
+
+static void plc_ds_destroy(void *data)
+{
+ struct plc_ds *plc = data;
+ ast_free(plc->samples_buf);
+ ast_free(plc);
+}
+
+static struct ast_datastore_info plc_ds_info = {
+ .type = "plc",
+ .destroy = plc_ds_destroy,
+};
+
+static void adjust_frame_for_plc(struct ast_channel *chan, struct ast_frame *frame, struct ast_datastore *datastore)
+{
+ int num_new_samples = frame->samples;
+ struct plc_ds *plc = datastore->data;
+
+ /* As a general note, let me explain the somewhat odd calculations used when taking
+ * the frame offset into account here. According to documentation in frame.h, the frame's
+ * offset field indicates the number of bytes that the audio is offset. The plc->samples_buf
+ * is not an array of bytes, but rather an array of 16-bit integers since it holds SLIN
+ * samples. So I had two choices to make here with the offset.
+ *
+ * 1. Make the offset AST_FRIENDLY_OFFSET bytes. The main downside for this is that
+ * I can't just add AST_FRIENDLY_OFFSET to the plc->samples_buf and have the pointer
+ * arithmetic come out right. I would have to do some odd casting or division for this to
+ * work as I wanted.
+ * 2. Make the offset AST_FRIENDLY_OFFSET * 2 bytes. This allows the pointer arithmetic
+ * to work out better with the plc->samples_buf. The downside here is that the buffer's
+ * allocation contains an extra 64 bytes of unused space.
+ *
+ * I decided to go with option 2. This is why in the calloc statement and the statement that
+ * sets the frame's offset, AST_FRIENDLY_OFFSET is multiplied by 2.
+ */
+
+ /* If this audio frame has no samples to fill in, ignore it */
+ if (!num_new_samples) {
+ return;
+ }
+
+ /* First, we need to be sure that our buffer is large enough to accomodate
+ * the samples we need to fill in. This will likely only occur on the first
+ * frame we write.
+ */
+ if (plc->num_samples < num_new_samples) {
+ ast_free(plc->samples_buf);
+ plc->samples_buf = ast_calloc(1, (num_new_samples * sizeof(*plc->samples_buf)) + (AST_FRIENDLY_OFFSET * 2));
+ if (!plc->samples_buf) {
+ ast_channel_datastore_remove(chan, datastore);
+ ast_channel_datastore_free(datastore);
+ return;
+ }
+ plc->num_samples = num_new_samples;
+ }
+
+ if (frame->datalen == 0) {
+ plc_fillin(&plc->plc_state, plc->samples_buf + AST_FRIENDLY_OFFSET, frame->samples);
+ frame->data = plc->samples_buf + AST_FRIENDLY_OFFSET;
+ frame->datalen = num_new_samples * 2;
+ frame->offset = AST_FRIENDLY_OFFSET * 2;
+ } else {
+ plc_rx(&plc->plc_state, frame->data, frame->samples);
+ }
+}
+
+static void apply_plc(struct ast_channel *chan, struct ast_frame *frame)
+{
+ struct ast_datastore *datastore;
+ struct plc_ds *plc;
+
+ datastore = ast_channel_datastore_find(chan, &plc_ds_info, NULL);
+ if (datastore) {
+ plc = datastore->data;
+ adjust_frame_for_plc(chan, frame, datastore);
+ return;
+ }
+
+ datastore = ast_channel_datastore_alloc(&plc_ds_info, NULL);
+ if (!datastore) {
+ return;
+ }
+ plc = ast_calloc(1, sizeof(*plc));
+ if (!plc) {
+ ast_channel_datastore_free(datastore);
+ return;
+ }
+ datastore->data = plc;
+ ast_channel_datastore_add(chan, datastore);
+ adjust_frame_for_plc(chan, frame, datastore);
+}
+
int ast_write(struct ast_channel *chan, struct ast_frame *fr)
{
int res = -1;
@@ -2883,10 +3062,10 @@
res = 0; /* XXX explain, why 0 ? */
goto done;
}
- if (chan->generatordata) {
- if (ast_test_flag(chan, AST_FLAG_WRITE_INT))
- ast_deactivate_generator(chan);
- else {
+ if (chan->generatordata && (!fr->src || strcasecmp(fr->src, "ast_prod"))) {
+ if (ast_test_flag(chan, AST_FLAG_WRITE_INT)) {
+ ast_deactivate_generator(chan);
+ } else {
if (fr->frametype == AST_FRAME_DTMF_END) {
/* There is a generator running while we're in the middle of a digit.
* It's probably inband DTMF, so go ahead and pass it so it can
@@ -2963,6 +3142,10 @@
if (chan->tech->write == NULL)
break; /*! \todo XXX should return 0 maybe ? */
+ if (ast_opt_generic_plc && fr->subclass == AST_FORMAT_SLINEAR) {
+ apply_plc(chan, fr);
+ }
+
/* If the frame is in the raw write format, then it's easy... just use the frame - otherwise we will have to translate */
if (fr->subclass == chan->rawwriteformat)
f = fr;
@@ -3002,6 +3185,9 @@
AST_LIST_NEXT(cur, frame_list) = NULL;
ast_frfree(cur);
}
+ if (new_frame != dup) {
+ ast_frfree(new_frame);
+ }
cur = dup;
}
}
@@ -3107,6 +3293,11 @@
chan->fout = FRAMECOUNT_INC(chan->fout);
}
done:
+ if (chan->audiohooks && ast_audiohook_write_list_empty(chan->audiohooks)) {
+ /* The list gets recreated if audiohooks are added again later */
+ ast_audiohook_detach_list(chan->audiohooks);
+ chan->audiohooks = NULL;
+ }
ast_channel_unlock(chan);
return res;
}
@@ -3590,6 +3781,7 @@
{
int src;
int dst;
+ int use_slin;
if (chan->readformat == peer->writeformat && chan->writeformat == peer->readformat) {
/* Already compatible! Moving on ... */
@@ -3629,11 +3821,14 @@
}
/* if the best path is not 'pass through', then
- transcoding is needed; if desired, force transcode path
- to use SLINEAR between channels, but only if there is
- no direct conversion available */
- if ((src != dst) && ast_opt_transcode_via_slin &&
- (ast_translate_path_steps(dst, src) != 1))
+ * transcoding is needed; if desired, force transcode path
+ * to use SLINEAR between channels, but only if there is
+ * no direct conversion available. If generic PLC is
+ * desired, then transcoding via SLINEAR is a requirement
+ */
+ use_slin = (src == AST_FORMAT_SLINEAR || dst == AST_FORMAT_SLINEAR);
+ if ((src != dst) && (ast_opt_generic_plc || ast_opt_transcode_via_slin) &&
+ (ast_translate_path_steps(dst, src) != 1 || use_slin))
dst = AST_FORMAT_SLINEAR;
if (ast_set_read_format(peer, dst) < 0) {
ast_log(LOG_WARNING, "Unable to set read format on channel %s to %d\n", peer->name, dst);
@@ -3837,6 +4032,7 @@
void *t_pvt;
struct ast_callerid tmpcid;
struct ast_channel *clone = original->masq;
+ struct ast_channel *bridged;
struct ast_cdr *cdr;
int rformat = original->readformat;
int wformat = original->writeformat;
@@ -4103,6 +4299,15 @@
pthread_kill(original->blocker, SIGURG);
if (option_debug)
ast_log(LOG_DEBUG, "Done Masquerading %s (%d)\n", original->name, original->_state);
+
+ if ((bridged = ast_bridged_channel(original))) {
+ ast_channel_lock(bridged);
+ ast_indicate(bridged, AST_CONTROL_SRCCHANGE);
+ ast_channel_unlock(bridged);
+ }
+
+ ast_indicate(original, AST_CONTROL_SRCCHANGE);
+
return 0;
}
@@ -4484,8 +4689,8 @@
ast_set_flag(c0, AST_FLAG_END_DTMF_ONLY);
/* Before we enter in and bridge these two together tell them both the source of audio has changed */
- ast_indicate(c0, AST_CONTROL_SRCUPDATE);
- ast_indicate(c1, AST_CONTROL_SRCUPDATE);
+ ast_indicate(c0, AST_CONTROL_SRCCHANGE);
+ ast_indicate(c1, AST_CONTROL_SRCCHANGE);
for (/* ever */;;) {
struct timeval now = { 0, };
@@ -4932,9 +5137,26 @@
ast_moh_cleanup_ptr(chan);
}
+int ast_plc_reload(void)
+{
+ struct ast_variable *var;
+ struct ast_config *cfg = ast_config_load("codecs.conf");
+ if (!cfg)
+ return 0;
+ for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
+ if (!strcasecmp(var->name, "genericplc")) {
+ ast_set2_flag(&ast_options, ast_true(var->value), AST_OPT_FLAG_GENERIC_PLC);
+ }
+ }
+ ast_config_destroy(cfg);
+ return 0;
+}
+
void ast_channels_init(void)
{
ast_cli_register_multiple(cli_channel, sizeof(cli_channel) / sizeof(struct ast_cli_entry));
+
+ ast_plc_reload();
}
/*! \brief Print call group and pickup group ---*/
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/cli.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 211528 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 275290 $")
#include <unistd.h>
#include <stdlib.h>
@@ -138,6 +138,10 @@
" Optional regular expression pattern is matched to group names for each\n"
" channel.\n";
+static char core_wait_fullybooted_help[] =
+"Usage: core waitfullybooted\n"
+" Wait until Asterisk has fully booted.\n";
+
static int handle_load_deprecated(int fd, int argc, char *argv[])
{
if (argc != 2)
@@ -1231,6 +1235,11 @@
return ast_module_helper(line, word, pos, state, 1, 1);
}
+static char *complete_mod_2_nr(const char *line, const char *word, int pos, int state)
+{
+ return ast_module_helper(line, word, pos, state, 1, 0);
+}
+
static char *complete_mod_3_nr(const char *line, const char *word, int pos, int state)
{
return ast_module_helper(line, word, pos, state, 2, 0);
@@ -1336,6 +1345,17 @@
#undef FORMAT_STRING
}
+static int handle_cli_wait_fullybooted(int fd, int argc, char *argv[])
+{
+ while (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {
+ usleep(100);
+ }
+
+ ast_cli(fd, "Asterisk has fully booted.\n");
+
+ return RESULT_SUCCESS;
+}
+
static int handle_help(int fd, int argc, char *argv[]);
static char * complete_help(const char *text, const char *word, int pos, int state)
@@ -1424,7 +1444,7 @@
static struct ast_cli_entry cli_module_unload_deprecated = {
{ "unload", NULL },
handle_unload_deprecated, NULL,
- NULL, complete_mod_2 };
+ NULL, complete_mod_2_nr };
static struct ast_cli_entry cli_show_uptime_deprecated = {
{ "show", "uptime", NULL },
@@ -1500,6 +1520,10 @@
{ { "soft", "hangup", NULL },
handle_softhangup, "Request a hangup on a given channel",
softhangup_help, complete_ch_3 },
+
+ { { "core", "waitfullybooted", NULL },
+ handle_cli_wait_fullybooted, "Wait until Asterisk has fully booted.",
+ core_wait_fullybooted_help },
};
/*! \brief initialize the _full_cmd string in * each of the builtins. */
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/config.c
^
|
@@ -28,7 +28,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 241015 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 273884 $")
#include <stdio.h>
#include <unistd.h>
@@ -708,7 +708,7 @@
if (*c) {
*c = '\0';
/* Find real argument */
- c = ast_skip_blanks(c + 1);
+ c = ast_strip(c + 1);
if (!(*c))
c = NULL;
} else
@@ -726,20 +726,13 @@
if (c) {
cur = c;
/* Strip off leading and trailing "'s and <>'s */
- if (*c == '"') {
- /* Dequote */
- while (*c) {
- if (*c == '"') {
- strcpy(c, c + 1); /* SAFE */
- c--;
- } else if (*c == '\\') {
- strcpy(c, c + 1); /* SAFE */
- }
- c++;
+ if ((*c == '"') || (*c == '<')) {
+ char quote_char = *c;
+ if (quote_char == '<') {
+ quote_char = '>';
}
- } else if (*c == '<') {
- /* C-style include */
- if (*(c + strlen(c) - 1) == '>') {
+
+ if (*(c + strlen(c) - 1) == quote_char) {
cur++;
*(c + strlen(c) - 1) = '\0';
}
@@ -1491,16 +1484,14 @@
ast_mutex_lock(&config_lock);
- ast_cli(fd, "\n\n");
for (eng = config_engine_list; eng; eng = eng->next) {
- ast_cli(fd, "\nConfig Engine: %s\n", eng->name);
+ ast_cli(fd, "Config Engine: %s\n", eng->name);
for (map = config_maps; map; map = map->next)
if (!strcasecmp(map->driver, eng->name)) {
ast_cli(fd, "===> %s (db=%s, table=%s)\n", map->name, map->database,
map->table ? map->table : map->name);
}
}
- ast_cli(fd,"\n\n");
ast_mutex_unlock(&config_lock);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/devicestate.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 205409 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 263639 $")
#include <sys/types.h>
#include <unistd.h>
@@ -145,7 +145,7 @@
number = buf;
if (!number) {
provider = strsep(&tech, ":");
- if (!provider)
+ if (!tech)
return AST_DEVICE_INVALID;
/* We have a provider */
number = tech;
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/dnsmgr.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 211528 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 271123 $")
#include <sys/types.h>
#include <netinet/in.h>
@@ -55,8 +55,6 @@
struct ast_dnsmgr_entry {
/*! where we will store the resulting address */
struct in_addr *result;
- /*! the last result, used to check if address has changed */
- struct in_addr last;
/*! Set to 1 if the entry changes */
int changed:1;
ast_mutex_t lock;
@@ -96,7 +94,6 @@
entry->result = result;
ast_mutex_init(&entry->lock);
strcpy(entry->name, name);
- memcpy(&entry->last, result, sizeof(entry->last));
AST_LIST_LOCK(&entry_list);
AST_LIST_INSERT_HEAD(&entry_list, entry, list);
@@ -172,13 +169,12 @@
if ((hp = ast_gethostbyname(entry->name, &ahp))) {
/* check to see if it has changed, do callback if requested (where de callback is defined ????) */
memcpy(&tmp, hp->h_addr, sizeof(tmp));
- if (tmp.s_addr != entry->last.s_addr) {
- ast_copy_string(iabuf, ast_inet_ntoa(entry->last), sizeof(iabuf));
+ if (tmp.s_addr != entry->result->s_addr) {
+ ast_copy_string(iabuf, ast_inet_ntoa(*entry->result), sizeof(iabuf));
ast_copy_string(iabuf2, ast_inet_ntoa(tmp), sizeof(iabuf2));
ast_log(LOG_NOTICE, "host '%s' changed from %s to %s\n",
entry->name, iabuf, iabuf2);
memcpy(entry->result, hp->h_addr, sizeof(entry->result));
- memcpy(&entry->last, hp->h_addr, sizeof(entry->last));
changed = entry->changed = 1;
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/dsp.c
^
|
@@ -42,7 +42,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 233014 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 263949 $")
#include <sys/types.h>
#include <stdlib.h>
@@ -1075,14 +1075,16 @@
int pass;
int newstate = DSP_TONE_STATE_SILENCE;
int res = 0;
- while(len) {
+ while (len) {
/* Take the lesser of the number of samples we need and what we have */
pass = len;
- if (pass > dsp->gsamp_size - dsp->gsamps)
+ if (pass > dsp->gsamp_size - dsp->gsamps) {
pass = dsp->gsamp_size - dsp->gsamps;
- for (x=0;x<pass;x++) {
- for (y=0;y<dsp->freqcount;y++)
+ }
+ for (x = 0; x < pass; x++) {
+ for (y = 0; y < dsp->freqcount; y++) {
goertzel_sample(&dsp->freqs[y], s[x]);
+ }
dsp->genergy += s[x] * s[x];
}
s += pass;
@@ -1090,14 +1092,15 @@
len -= pass;
if (dsp->gsamps == dsp->gsamp_size) {
float hz[7];
- for (y=0;y<7;y++)
+ for (y = 0; y < 7; y++) {
hz[y] = goertzel_result(&dsp->freqs[y]);
+ }
#if 0
printf("\n350: 425: 440: 480: 620: 950: 1400: 1800: Energy: \n");
printf("%.2e %.2e %.2e %.2e %.2e %.2e %.2e %.2e %.2e\n",
hz[HZ_350], hz[HZ_425], hz[HZ_440], hz[HZ_480], hz[HZ_620], hz[HZ_950], hz[HZ_1400], hz[HZ_1800], dsp->genergy);
#endif
- switch(dsp->progmode) {
+ switch (dsp->progmode) {
case PROG_MODE_NA:
if (pair_there(hz[HZ_480], hz[HZ_620], hz[HZ_350], hz[HZ_440], dsp->genergy)) {
newstate = DSP_TONE_STATE_BUSY;
@@ -1108,23 +1111,29 @@
} else if (hz[HZ_950] > TONE_MIN_THRESH * TONE_THRESH) {
newstate = DSP_TONE_STATE_SPECIAL1;
} else if (hz[HZ_1400] > TONE_MIN_THRESH * TONE_THRESH) {
- if (dsp->tstate == DSP_TONE_STATE_SPECIAL1)
+ /* End of SPECIAL1 or middle of SPECIAL2 */
+ if (dsp->tstate == DSP_TONE_STATE_SPECIAL1 || dsp->tstate == DSP_TONE_STATE_SPECIAL2) {
newstate = DSP_TONE_STATE_SPECIAL2;
+ }
} else if (hz[HZ_1800] > TONE_MIN_THRESH * TONE_THRESH) {
- if (dsp->tstate == DSP_TONE_STATE_SPECIAL2)
+ /* End of SPECIAL2 or middle of SPECIAL3 */
+ if (dsp->tstate == DSP_TONE_STATE_SPECIAL2 || dsp->tstate == DSP_TONE_STATE_SPECIAL3) {
newstate = DSP_TONE_STATE_SPECIAL3;
+ }
} else if (dsp->genergy > TONE_MIN_THRESH * TONE_THRESH) {
newstate = DSP_TONE_STATE_TALKING;
- } else
+ } else {
newstate = DSP_TONE_STATE_SILENCE;
+ }
break;
case PROG_MODE_CR:
if (hz[HZ_425] > TONE_MIN_THRESH * TONE_THRESH) {
newstate = DSP_TONE_STATE_RINGING;
} else if (dsp->genergy > TONE_MIN_THRESH * TONE_THRESH) {
newstate = DSP_TONE_STATE_TALKING;
- } else
+ } else {
newstate = DSP_TONE_STATE_SILENCE;
+ }
break;
case PROG_MODE_UK:
if (hz[HZ_400] > TONE_MIN_THRESH * TONE_THRESH) {
@@ -1136,46 +1145,47 @@
}
if (newstate == dsp->tstate) {
dsp->tcount++;
- if (dsp->ringtimeout)
+ if (dsp->ringtimeout) {
dsp->ringtimeout++;
+ }
switch (dsp->tstate) {
- case DSP_TONE_STATE_RINGING:
- if ((dsp->features & DSP_PROGRESS_RINGING) &&
- (dsp->tcount==THRESH_RING)) {
- res = AST_CONTROL_RINGING;
- dsp->ringtimeout= 1;
- }
- break;
- case DSP_TONE_STATE_BUSY:
- if ((dsp->features & DSP_PROGRESS_BUSY) &&
- (dsp->tcount==THRESH_BUSY)) {
- res = AST_CONTROL_BUSY;
- dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
- }
- break;
- case DSP_TONE_STATE_TALKING:
- if ((dsp->features & DSP_PROGRESS_TALK) &&
- (dsp->tcount==THRESH_TALK)) {
- res = AST_CONTROL_ANSWER;
- dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
- }
- break;
- case DSP_TONE_STATE_SPECIAL3:
- if ((dsp->features & DSP_PROGRESS_CONGESTION) &&
- (dsp->tcount==THRESH_CONGESTION)) {
- res = AST_CONTROL_CONGESTION;
- dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
- }
- break;
- case DSP_TONE_STATE_HUNGUP:
- if ((dsp->features & DSP_FEATURE_CALL_PROGRESS) &&
- (dsp->tcount==THRESH_HANGUP)) {
- res = AST_CONTROL_HANGUP;
- dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
- }
- break;
+ case DSP_TONE_STATE_RINGING:
+ if ((dsp->features & DSP_PROGRESS_RINGING) &&
+ (dsp->tcount == THRESH_RING)) {
+ res = AST_CONTROL_RINGING;
+ dsp->ringtimeout = 1;
+ }
+ break;
+ case DSP_TONE_STATE_BUSY:
+ if ((dsp->features & DSP_PROGRESS_BUSY) &&
+ (dsp->tcount == THRESH_BUSY)) {
+ res = AST_CONTROL_BUSY;
+ dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
+ }
+ break;
+ case DSP_TONE_STATE_TALKING:
+ if ((dsp->features & DSP_PROGRESS_TALK) &&
+ (dsp->tcount == THRESH_TALK)) {
+ res = AST_CONTROL_ANSWER;
+ dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
+ }
+ break;
+ case DSP_TONE_STATE_SPECIAL3:
+ if ((dsp->features & DSP_PROGRESS_CONGESTION) &&
+ (dsp->tcount == THRESH_CONGESTION)) {
+ res = AST_CONTROL_CONGESTION;
+ dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
+ }
+ break;
+ case DSP_TONE_STATE_HUNGUP:
+ if ((dsp->features & DSP_FEATURE_CALL_PROGRESS) &&
+ (dsp->tcount == THRESH_HANGUP)) {
+ res = AST_CONTROL_HANGUP;
+ dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
+ }
+ break;
}
- if (dsp->ringtimeout==THRESH_RING2ANSWER) {
+ if (dsp->ringtimeout == THRESH_RING2ANSWER) {
#if 0
ast_log(LOG_NOTICE, "Consider call as answered because of timeout after last ring\n");
#endif
@@ -1190,10 +1200,11 @@
dsp->tstate = newstate;
dsp->tcount = 1;
}
-
- /* Reset goertzel */
- for (x=0;x<7;x++)
+
+ /* Reset goertzel */
+ for (x = 0; x < 7; x++) {
dsp->freqs[x].v2 = dsp->freqs[x].v3 = 0.0;
+ }
dsp->gsamps = 0;
dsp->genergy = 0.0;
}
@@ -1201,7 +1212,7 @@
#if 0
if (res)
printf("Returning %d\n", res);
-#endif
+#endif
return res;
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/file.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 254451 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 263112 $")
#include <sys/types.h>
#include <errno.h>
@@ -53,6 +53,7 @@
#include "asterisk/linkedlists.h"
#include "asterisk/module.h"
#include "asterisk/astobj2.h"
+#include "asterisk/dahdi_compat.h"
/*
* The following variable controls the layout of localized sound files.
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/frame.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 224931 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 269960 $")
#include <stdlib.h>
#include <unistd.h>
@@ -1451,7 +1451,9 @@
}
bit += off;
- if ((len * 8 - bit) < 5) {
+ if ((len * 8 - bit) == 0) {
+ break;
+ } else if ((len * 8 - bit) < 5) {
ast_log(LOG_WARNING, "Not enough bits remaining after wide band for speex samples.\n");
break;
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/http.c
^
|
@@ -30,7 +30,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 253631 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 263456 $")
#include <sys/types.h>
#include <stdio.h>
@@ -572,7 +572,7 @@
{
char *c;
c = buf;
- ast_build_string(&c, &buflen, "Set-Cookie: %s=\"%s\"; Version=\"1\"", var, val);
+ ast_build_string(&c, &buflen, "Set-Cookie: %s=\"%s\"; Version=1", var, val);
if (expires)
ast_build_string(&c, &buflen, "; Max-Age=%d", expires);
ast_build_string(&c, &buflen, "\r\n");
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/loader.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 248012 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 275182 $")
#include <stdio.h>
#include <dirent.h>
@@ -258,6 +258,7 @@
{ "rtp", ast_rtp_reload },
{ "http", ast_http_reload },
{ "logger", logger_reload },
+ { "plc", ast_plc_reload },
{ NULL, NULL }
};
@@ -471,7 +472,7 @@
continue;
}
AST_LIST_REMOVE_CURRENT(&module_list, entry);
- if (mod->info->unload) {
+ if (mod->flags.running && !mod->flags.declined && mod->info->unload) {
mod->info->unload();
}
AST_LIST_HEAD_DESTROY(&mod->users);
@@ -497,8 +498,10 @@
return 0;
}
- if (!(mod->flags.running || mod->flags.declined))
+ if (!mod->flags.running || mod->flags.declined) {
+ ast_log(LOG_WARNING, "Unload failed, '%s' is not loaded.\n", resource_name);
error = 1;
+ }
if (!mod->lib) {
ast_log(LOG_WARNING, "Unloading embedded modules is not supported.\n");
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/logger.c
^
|
@@ -27,7 +27,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 248582 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 269635 $")
#include <signal.h>
#include <stdarg.h>
@@ -147,7 +147,10 @@
char *stringp = s;
while ((w = strsep(&stringp, ","))) {
- w = ast_skip_blanks(w);
+ w = ast_strip(w);
+ if (ast_strlen_zero(w)) {
+ continue;
+ }
if (!strcasecmp(w, "error"))
res |= (1 << __LOG_ERROR);
else if (!strcasecmp(w, "warning"))
@@ -573,26 +576,30 @@
logger_rotate_help },
};
-static int handle_SIGXFSZ(int sig)
+static void _handle_SIGXFSZ(int sig)
{
/* Indicate need to reload */
filesize_reload_needed = 1;
- return 0;
}
+static struct sigaction handle_SIGXFSZ = {
+ .sa_handler = _handle_SIGXFSZ,
+ .sa_flags = SA_RESTART,
+};
+
int init_logger(void)
{
char tmp[256];
int res = 0;
/* auto rotate if sig SIGXFSZ comes a-knockin */
- (void) signal(SIGXFSZ,(void *) handle_SIGXFSZ);
+ sigaction(SIGXFSZ, &handle_SIGXFSZ, NULL);
/* register the logger cli commands */
ast_cli_register_multiple(cli_logger, sizeof(cli_logger) / sizeof(struct ast_cli_entry));
mkdir((char *)ast_config_AST_LOG_DIR, 0755);
-
+
/* create log channels */
init_logger_chain();
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/manager.c
^
|
@@ -34,7 +34,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 257070 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 278023 $")
#include <stdio.h>
#include <stdlib.h>
@@ -1592,7 +1592,7 @@
if (c)
ast_channel_unlock(c);
astman_append(s, "Response: Success\r\n"
- "Variable: %s\r\nValue: %s\r\n", varname, varval);
+ "Variable: %s\r\nValue: %s\r\n", varname, S_OR(varval, ""));
if (!ast_strlen_zero(id))
astman_append(s, "ActionID: %s\r\n",id);
astman_append(s, "\r\n");
@@ -2300,6 +2300,9 @@
ast_log(LOG_EVENT, "%sManager '%s' logged on from %s\n",
(s->session->sessiontimeout ? "HTTP " : ""), s->session->username, ast_inet_ntoa(s->session->sin.sin_addr));
astman_send_ack(s, m, "Authentication accepted");
+ if (ast_opt_send_fullybooted && ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {
+ manager_event(EVENT_FLAG_SYSTEM, "FullyBooted", "Status: Fully Booted\r\n");
+ }
}
} else if (!strcasecmp(action, "Logoff")) {
astman_send_ack(s, m, "See ya");
@@ -2914,14 +2917,12 @@
char *buf;
size_t l;
- /* Ensure buffer is NULL-terminated */
- fprintf(ss.f, "%c", 0);
-
if ((l = lseek(ss.fd, 0, SEEK_END)) > 0) {
- if (MAP_FAILED == (buf = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_PRIVATE, ss.fd, 0))) {
+ if (MAP_FAILED == (buf = mmap(NULL, l + 1, PROT_READ | PROT_WRITE, MAP_SHARED, ss.fd, 0))) {
ast_log(LOG_WARNING, "mmap failed. Manager request output was not processed\n");
} else {
char *tmpbuf;
+ buf[l] = '\0';
if (format == FORMAT_XML)
tmpbuf = xml_translate(buf, params);
else if (format == FORMAT_HTML)
@@ -2942,7 +2943,7 @@
free(tmpbuf);
free(s->outputstr);
s->outputstr = NULL;
- munmap(buf, l);
+ munmap(buf, l + 1);
}
}
fclose(ss.f);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/pbx.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 243486 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 280982 $")
#include <sys/types.h>
#include <string.h>
@@ -492,7 +492,11 @@
};
static struct ast_context *contexts;
-AST_RWLOCK_DEFINE_STATIC(conlock); /*!< Lock for the ast_context list */
+/*!\brief Lock for the ast_context list
+ * This lock MUST be recursive, or a deadlock on reload may result. See
+ * https://issues.asterisk.org/view.php?id=17643
+ */
+AST_MUTEX_DEFINE_STATIC(conlock);
static AST_LIST_HEAD_STATIC(apps, ast_app);
@@ -1938,8 +1942,9 @@
return AST_EXTENSION_ONHOLD;
case AST_DEVICE_BUSY:
return AST_EXTENSION_BUSY;
- case AST_DEVICE_UNAVAILABLE:
case AST_DEVICE_UNKNOWN:
+ return AST_EXTENSION_NOT_INUSE;
+ case AST_DEVICE_UNAVAILABLE:
case AST_DEVICE_INVALID:
return AST_EXTENSION_UNAVAILABLE;
case AST_DEVICE_RINGINUSE:
@@ -1960,7 +1965,7 @@
/*! \brief ast_extensions_state2: Check state of extension by using hints */
static int ast_extension_state2(struct ast_exten *e)
{
- char hint[AST_MAX_EXTENSION];
+ char *hint;
char *cur, *rest;
struct ast_devstate_aggregate agg;
@@ -1969,7 +1974,7 @@
if (!e)
return -1;
- ast_copy_string(hint, ast_get_extension_app(e), sizeof(hint));
+ hint = ast_strdupa(ast_get_extension_app(e));
rest = hint; /* One or more devices separated with a & character */
while ( (cur = strsep(&rest, "&")) ) {
@@ -5938,7 +5943,7 @@
}
AST_LIST_TRAVERSE_SAFE_BEGIN(headp, newvariable, entries) {
- if (strcasecmp(ast_var_name(newvariable), nametail) == 0) {
+ if (strcmp(ast_var_name(newvariable), nametail) == 0) {
/* there is already such a variable, delete it */
AST_LIST_REMOVE_CURRENT(headp, entries);
ast_var_delete(newvariable);
@@ -6192,22 +6197,22 @@
*/
int ast_lock_contexts()
{
- return ast_rwlock_wrlock(&conlock);
+ return ast_mutex_lock(&conlock);
}
int ast_rdlock_contexts(void)
{
- return ast_rwlock_rdlock(&conlock);
+ return ast_mutex_lock(&conlock);
}
int ast_wrlock_contexts(void)
{
- return ast_rwlock_wrlock(&conlock);
+ return ast_mutex_lock(&conlock);
}
int ast_unlock_contexts()
{
- return ast_rwlock_unlock(&conlock);
+ return ast_mutex_unlock(&conlock);
}
/*
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/rtp.c
^
|
@@ -28,7 +28,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 254452 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 274157 $")
#include <stdio.h>
#include <stdlib.h>
@@ -776,7 +776,11 @@
new_duration += 0xFFFF + 1;
new_duration = (new_duration & ~0xFFFF) | samples;
- if (rtp->lastevent > seqno) {
+ /* The second portion of this check is to not mistakenly
+ * stop accepting DTMF if the seqno rolls over beyond
+ * 65535.
+ */
+ if (rtp->lastevent > seqno && rtp->lastevent - seqno < 50) {
/* Out of order frame. Processing this can cause us to
* improperly duplicate incoming DTMF, so just drop
* this.
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/term.c
^
|
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2010, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -18,14 +18,14 @@
/*! \file
*
- * \brief Terminal Routines
+ * \brief Terminal Routines
*
- * \author Mark Spencer <markster@digium.com>
+ * \author Mark Spencer <markster@digium.com>
*/
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 49006 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 269334 $")
#include <stdio.h>
#include <stdlib.h>
@@ -79,12 +79,21 @@
char buffer[512] = "";
int termfd = -1, parseokay = 0, i;
- if (!term)
+ if (ast_opt_no_color) {
return 0;
- if (!ast_opt_console || ast_opt_no_color || !ast_opt_no_fork)
+ }
+
+ if (!ast_opt_console) {
+ /* If any remote console is not compatible, we'll strip the color codes at that point */
+ vt100compat = 1;
+ goto end;
+ }
+
+ if (!term) {
return 0;
+ }
- for (i=0 ;; i++) {
+ for (i = 0;; i++) {
if (termpath[i] == NULL) {
break;
}
@@ -138,6 +147,7 @@
}
}
+end:
if (vt100compat) {
/* Make commands show up in nice colors */
snprintf(prepdata, sizeof(prepdata), "%c[%d;%d;%dm", ESC, ATTR_BRIGHT, COLOR_BROWN, COLOR_BLACK + 10);
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/main/test.c
^
|
@@ -0,0 +1,904 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2009-2010, Digium, Inc.
+ *
+ * David Vossel <dvossel@digium.com>
+ * Russell Bryant <russell@digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*!
+ * \file
+ * \brief Unit Test Framework
+ *
+ * \author David Vossel <dvossel@digium.com>
+ * \author Russell Bryant <russell@digium.com>
+ */
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 275021 $");
+
+#ifdef TEST_FRAMEWORK
+#include "asterisk/test.h"
+#include "asterisk/logger.h"
+#include "asterisk/linkedlists.h"
+#include "asterisk/utils.h"
+#include "asterisk/cli.h"
+#include "asterisk/term.h"
+#include "asterisk/version.h"
+#include "asterisk/paths.h"
+#include "asterisk/time.h"
+#include "asterisk/threadstorage.h"
+
+/*! This array corresponds to the values defined in the ast_test_state enum */
+static const char * const test_result2str[] = {
+ [AST_TEST_NOT_RUN] = "NOT RUN",
+ [AST_TEST_PASS] = "PASS",
+ [AST_TEST_FAIL] = "FAIL",
+};
+
+/*! holds all the information pertaining to a single defined test */
+struct ast_test {
+ struct ast_test_info info; /*!< holds test callback information */
+ /*!
+ * \brief Test defined status output from last execution
+ */
+ struct ast_dynamic_str *status_str;
+ /*!
+ * \brief CLI arguments, if tests being run from the CLI
+ *
+ * If this is set, status updates from the tests will be sent to the
+ * CLI in addition to being saved off in status_str.
+ */
+ int cli_fd;
+ enum ast_test_result_state state; /*!< current test state */
+ unsigned int time; /*!< time in ms test took */
+ ast_test_cb_t *cb; /*!< test callback function */
+ AST_LIST_ENTRY(ast_test) entry;
+};
+
+/*! global structure containing both total and last test execution results */
+static struct ast_test_execute_results {
+ unsigned int total_tests; /*!< total number of tests, regardless if they have been executed or not */
+ unsigned int total_passed; /*!< total number of executed tests passed */
+ unsigned int total_failed; /*!< total number of executed tests failed */
+ unsigned int total_time; /*!< total time of all executed tests */
+ unsigned int last_passed; /*!< number of passed tests during last execution */
+ unsigned int last_failed; /*!< number of failed tests during last execution */
+ unsigned int last_time; /*!< total time of the last test execution */
+} last_results;
+
+enum test_mode {
+ TEST_ALL = 0,
+ TEST_CATEGORY = 1,
+ TEST_NAME_CATEGORY = 2,
+};
+
+/*! List of registered test definitions */
+static AST_LIST_HEAD_STATIC(tests, ast_test);
+
+static struct ast_test *test_alloc(ast_test_cb_t *cb);
+static struct ast_test *test_free(struct ast_test *test);
+static int test_insert(struct ast_test *test);
+static struct ast_test *test_remove(ast_test_cb_t *cb);
+static int test_cat_cmp(const char *cat1, const char *cat2);
+
+int __ast_test_status_update(const char *file, const char *func, int line,
+ struct ast_test *test, const char *fmt, ...)
+{
+ struct ast_dynamic_str *buf = NULL;
+ va_list ap;
+
+ if (!(buf = ast_dynamic_str_create(128))) {
+ return -1;
+ }
+
+ va_start(ap, fmt);
+ ast_dynamic_str_thread_set_va(&buf, 0, NULL, fmt, ap);
+ va_end(ap);
+
+ if (test->cli_fd > -1) {
+ ast_cli(test->cli_fd, "[%s:%s:%d]: %s",
+ file, func, line, buf->str);
+ }
+
+ ast_dynamic_str_append(&test->status_str, 0, "[%s:%s:%d]: %s",
+ file, func, line, buf->str);
+
+ ast_free(buf);
+
+ return 0;
+}
+
+int ast_test_register(ast_test_cb_t *cb)
+{
+ struct ast_test *test;
+
+ if (!cb) {
+ ast_log(LOG_WARNING, "Attempted to register test without all required information\n");
+ return -1;
+ }
+
+ if (!(test = test_alloc(cb))) {
+ return -1;
+ }
+
+ if (test_insert(test)) {
+ test_free(test);
+ return -1;
+ }
+
+ return 0;
+}
+
+int ast_test_unregister(ast_test_cb_t *cb)
+{
+ struct ast_test *test;
+
+ if (!(test = test_remove(cb))) {
+ return -1; /* not found */
+ }
+
+ test_free(test);
+
+ return 0;
+}
+
+/*!
+ * \internal
+ * \brief executes a single test, storing the results in the test->result structure.
+ *
+ * \note The last_results structure which contains global statistics about test execution
+ * must be updated when using this function. See use in test_execute_multiple().
+ */
+static void test_execute(struct ast_test *test)
+{
+ struct timeval begin;
+
+ ast_dynamic_str_set(&test->status_str, 0, "%s", "");
+
+ begin = ast_tvnow();
+ test->state = test->cb(&test->info, TEST_EXECUTE, test);
+ test->time = ast_tvdiff_ms(ast_tvnow(), begin);
+}
+
+static void test_xml_entry(struct ast_test *test, FILE *f)
+{
+ if (!f || !test || test->state == AST_TEST_NOT_RUN) {
+ return;
+ }
+
+ fprintf(f, "\t<testcase time=\"%d.%d\" name=\"%s%s\"%s>\n",
+ test->time / 1000, test->time % 1000,
+ test->info.category, test->info.name,
+ test->state == AST_TEST_PASS ? "/" : "");
+
+ if (test->state == AST_TEST_FAIL) {
+ fprintf(f, "\t\t<failure><![CDATA[\n%s\n\t\t]]></failure>\n",
+ S_OR(test->status_str->str, "NA"));
+ fprintf(f, "\t</testcase>\n");
+ }
+
+}
+
+static void test_txt_entry(struct ast_test *test, FILE *f)
+{
+ if (!f || !test) {
+ return;
+ }
+
+ fprintf(f, "\nName: %s\n", test->info.name);
+ fprintf(f, "Category: %s\n", test->info.category);
+ fprintf(f, "Summary: %s\n", test->info.summary);
+ fprintf(f, "Description: %s\n", test->info.description);
+ fprintf(f, "Result: %s\n", test_result2str[test->state]);
+ if (test->state != AST_TEST_NOT_RUN) {
+ fprintf(f, "Time: %d\n", test->time);
+ }
+ if (test->state == AST_TEST_FAIL) {
+ fprintf(f, "Error Description: %s\n\n", S_OR(test->status_str->str, "NA"));
+ }
+}
+
+/*!
+ * \internal
+ * \brief Executes registered unit tests
+ *
+ * \param name of test to run (optional)
+ * \param test category to run (optional)
+ * \param cli args for cli test updates (optional)
+ *
+ * \return number of tests executed.
+ *
+ * \note This function has three modes of operation
+ * -# When given a name and category, a matching individual test will execute if found.
+ * -# When given only a category all matching tests within that category will execute.
+ * -# If given no name or category all registered tests will execute.
+ */
+static int test_execute_multiple(const char *name, const char *category, int cli_fd)
+{
+ char result_buf[32] = { 0 };
+ struct ast_test *test = NULL;
+ enum test_mode mode = TEST_ALL; /* 3 modes, 0 = run all, 1 = only by category, 2 = only by name and category */
+ int execute = 0;
+ int res = 0;
+
+ if (!ast_strlen_zero(category)) {
+ if (!ast_strlen_zero(name)) {
+ mode = TEST_NAME_CATEGORY;
+ } else {
+ mode = TEST_CATEGORY;
+ }
+ }
+
+ AST_LIST_LOCK(&tests);
+ /* clear previous execution results */
+ memset(&last_results, 0, sizeof(last_results));
+ AST_LIST_TRAVERSE(&tests, test, entry) {
+
+ execute = 0;
+ switch (mode) {
+ case TEST_CATEGORY:
+ if (!test_cat_cmp(test->info.category, category)) {
+ execute = 1;
+ }
+ break;
+ case TEST_NAME_CATEGORY:
+ if (!(test_cat_cmp(test->info.category, category)) && !(strcmp(test->info.name, name))) {
+ execute = 1;
+ }
+ break;
+ case TEST_ALL:
+ execute = 1;
+ }
+
+ if (execute) {
+ if (cli_fd > -1) {
+ ast_cli(cli_fd, "START %s - %s \n", test->info.category, test->info.name);
+ }
+
+ /* set the test status update argument. it is ok if cli is NULL */
+ test->cli_fd = cli_fd;
+
+ /* execute the test and save results */
+ test_execute(test);
+
+ test->cli_fd = -1;
+
+ /* update execution specific counts here */
+ last_results.last_time += test->time;
+ if (test->state == AST_TEST_PASS) {
+ last_results.last_passed++;
+ } else if (test->state == AST_TEST_FAIL) {
+ last_results.last_failed++;
+ }
+
+ if (cli_fd > -1) {
+ term_color(result_buf,
+ test_result2str[test->state],
+ (test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN,
+ 0,
+ sizeof(result_buf));
+ ast_cli(cli_fd, "END %s - %s Time: %s%dms Result: %s\n",
+ test->info.category,
+ test->info.name,
+ test->time ? "" : "<",
+ test->time ? test->time : 1,
+ result_buf);
+ }
+ }
+
+ /* update total counts as well during this iteration
+ * even if the current test did not execute this time */
+ last_results.total_time += test->time;
+ last_results.total_tests++;
+ if (test->state != AST_TEST_NOT_RUN) {
+ if (test->state == AST_TEST_PASS) {
+ last_results.total_passed++;
+ } else {
+ last_results.total_failed++;
+ }
+ }
+ }
+ res = last_results.last_passed + last_results.last_failed;
+ AST_LIST_UNLOCK(&tests);
+
+ return res;
+}
+
+/*!
+ * \internal
+ * \brief Generate test results.
+ *
+ * \param name of test result to generate (optional)
+ * \param test category to generate (optional)
+ * \param path to xml file to generate. (optional)
+ * \param path to txt file to generate, (optional)
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ *
+ * \note This function has three modes of operation.
+ * -# When given both a name and category, results will be generated for that single test.
+ * -# When given only a category, results for every test within the category will be generated.
+ * -# When given no name or category, results for every registered test will be generated.
+ *
+ * In order for the results to be generated, an xml and or txt file path must be provided.
+ */
+static int test_generate_results(const char *name, const char *category, const char *xml_path, const char *txt_path)
+{
+ enum test_mode mode = TEST_ALL; /* 0 generate all, 1 generate by category only, 2 generate by name and category */
+ FILE *f_xml = NULL, *f_txt = NULL;
+ int res = 0;
+ struct ast_test *test = NULL;
+
+ /* verify at least one output file was given */
+ if (ast_strlen_zero(xml_path) && ast_strlen_zero(txt_path)) {
+ return -1;
+ }
+
+ /* define what mode is to be used */
+ if (!ast_strlen_zero(category)) {
+ if (!ast_strlen_zero(name)) {
+ mode = TEST_NAME_CATEGORY;
+ } else {
+ mode = TEST_CATEGORY;
+ }
+ }
+ /* open files for writing */
+ if (!ast_strlen_zero(xml_path)) {
+ if (!(f_xml = fopen(xml_path, "w"))) {
+ ast_log(LOG_WARNING, "Could not open file %s for xml test results\n", xml_path);
+ res = -1;
+ goto done;
+ }
+ }
+ if (!ast_strlen_zero(txt_path)) {
+ if (!(f_txt = fopen(txt_path, "w"))) {
+ ast_log(LOG_WARNING, "Could not open file %s for text output of test results\n", txt_path);
+ res = -1;
+ goto done;
+ }
+ }
+
+ AST_LIST_LOCK(&tests);
+ /* xml header information */
+ if (f_xml) {
+ /*
+ * http://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo
+ */
+ fprintf(f_xml, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ fprintf(f_xml, "<testsuite errors=\"0\" time=\"%d.%d\" tests=\"%d\" "
+ "name=\"AsteriskUnitTests\">\n",
+ last_results.total_time / 1000, last_results.total_time % 1000,
+ last_results.total_tests);
+ fprintf(f_xml, "\t<properties>\n");
+ fprintf(f_xml, "\t\t<property name=\"version\" value=\"%s\"/>\n", ASTERISK_VERSION);
+ fprintf(f_xml, "\t</properties>\n");
+ }
+
+ /* txt header information */
+ if (f_txt) {
+ fprintf(f_txt, "Asterisk Version: %s\n", ASTERISK_VERSION);
+ fprintf(f_txt, "Asterisk Version Number: %d\n", ASTERISK_VERSION_NUM);
+ fprintf(f_txt, "Number of Tests: %d\n", last_results.total_tests);
+ fprintf(f_txt, "Number of Tests Executed: %d\n", (last_results.total_passed + last_results.total_failed));
+ fprintf(f_txt, "Passed Tests: %d\n", last_results.total_passed);
+ fprintf(f_txt, "Failed Tests: %d\n", last_results.total_failed);
+ fprintf(f_txt, "Total Execution Time: %d\n", last_results.total_time);
+ }
+
+ /* export each individual test */
+ AST_LIST_TRAVERSE(&tests, test, entry) {
+ switch (mode) {
+ case TEST_CATEGORY:
+ if (!test_cat_cmp(test->info.category, category)) {
+ test_xml_entry(test, f_xml);
+ test_txt_entry(test, f_txt);
+ }
+ break;
+ case TEST_NAME_CATEGORY:
+ if (!(strcmp(test->info.category, category)) && !(strcmp(test->info.name, name))) {
+ test_xml_entry(test, f_xml);
+ test_txt_entry(test, f_txt);
+ }
+ break;
+ case TEST_ALL:
+ test_xml_entry(test, f_xml);
+ test_txt_entry(test, f_txt);
+ }
+ }
+ AST_LIST_UNLOCK(&tests);
+
+done:
+ if (f_xml) {
+ fprintf(f_xml, "</testsuite>\n");
+ fclose(f_xml);
+ }
+ if (f_txt) {
+ fclose(f_txt);
+ }
+
+ return res;
+}
+
+/*!
+ * \internal
+ * \brief adds test to container sorted first by category then by name
+ *
+ * \retval 0 success
+ * \retval -1 failure
+ */
+static int test_insert(struct ast_test *test)
+{
+ /* This is a slow operation that may need to be optimized in the future
+ * as the test framework expands. At the moment we are doing string
+ * comparisons on every item within the list to insert in sorted order. */
+
+ AST_LIST_LOCK(&tests);
+ AST_LIST_INSERT_SORTALPHA(&tests, test, entry, info.category);
+ AST_LIST_UNLOCK(&tests);
+
+ return 0;
+}
+
+/*!
+ * \internal
+ * \brief removes test from container
+ *
+ * \return ast_test removed from list on success, or NULL on failure
+ */
+static struct ast_test *test_remove(ast_test_cb_t *cb)
+{
+ struct ast_test *cur = NULL;
+
+ AST_LIST_LOCK(&tests);
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&tests, cur, entry) {
+ if (cur->cb == cb) {
+ AST_LIST_REMOVE_CURRENT(&tests, entry);
+ break;
+ }
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+ AST_LIST_UNLOCK(&tests);
+
+ return cur;
+}
+
+/*!
+ * \brief compares two test categories to determine if cat1 resides in cat2
+ * \internal
+ *
+ * \retval 0 true
+ * \retval non-zero false
+ */
+
+static int test_cat_cmp(const char *cat1, const char *cat2)
+{
+ int len1 = 0;
+ int len2 = 0;
+
+ if (!cat1 || !cat2) {
+ return -1;
+ }
+
+ len1 = strlen(cat1);
+ len2 = strlen(cat2);
+
+ if (len2 > len1) {
+ return -1;
+ }
+
+ return strncmp(cat1, cat2, len2) ? 1 : 0;
+}
+
+/*!
+ * \internal
+ * \brief free an ast_test object and all it's data members
+ */
+static struct ast_test *test_free(struct ast_test *test)
+{
+ if (!test) {
+ return NULL;
+ }
+
+ ast_free(test->status_str);
+ ast_free(test);
+
+ return NULL;
+}
+
+/*!
+ * \internal
+ * \brief allocate an ast_test object.
+ */
+static struct ast_test *test_alloc(ast_test_cb_t *cb)
+{
+ struct ast_test *test;
+
+ if (!cb || !(test = ast_calloc(1, sizeof(*test)))) {
+ return NULL;
+ }
+
+ test->cli_fd = -1;
+ test->cb = cb;
+
+ test->cb(&test->info, TEST_INIT, test);
+
+ if (ast_strlen_zero(test->info.name)) {
+ ast_log(LOG_WARNING, "Test has no name, test registration refused.\n");
+ return test_free(test);
+ }
+
+ if (ast_strlen_zero(test->info.category)) {
+ ast_log(LOG_WARNING, "Test %s has no category, test registration refused.\n",
+ test->info.name);
+ return test_free(test);
+ }
+
+ if (test->info.category[0] != '/' || test->info.category[strlen(test->info.category) - 1] != '/') {
+ ast_log(LOG_WARNING, "Test category is missing a leading or trailing backslash for test %s%s",
+ test->info.category, test->info.name);
+ }
+
+ if (ast_strlen_zero(test->info.summary)) {
+ ast_log(LOG_WARNING, "Test %s/%s has no summary, test registration refused.\n",
+ test->info.category, test->info.name);
+ return test_free(test);
+ }
+
+ if (ast_strlen_zero(test->info.description)) {
+ ast_log(LOG_WARNING, "Test %s/%s has no description, test registration refused.\n",
+ test->info.category, test->info.name);
+ return test_free(test);
+ }
+
+ if (!(test->status_str = ast_dynamic_str_create(128))) {
+ return test_free(test);
+ }
+
+ return test;
+}
+
+static char *complete_test_category(const char *line, const char *word, int pos, int state)
+{
+ int which = 0;
+ int wordlen = strlen(word);
+ char *ret = NULL;
+ struct ast_test *test;
+
+ AST_LIST_LOCK(&tests);
+ AST_LIST_TRAVERSE(&tests, test, entry) {
+ if (!strncasecmp(word, test->info.category, wordlen) && ++which > state) {
+ ret = ast_strdup(test->info.category);
+ break;
+ }
+ }
+ AST_LIST_UNLOCK(&tests);
+ return ret;
+}
+
+static char *complete_test_name(const char *line, const char *word, int pos, int state, int cat_pos)
+{
+ int which = 0;
+ int wordlen = strlen(word);
+ char *ret = NULL;
+ struct ast_test *test;
+ char *cat = NULL;
+ char *tmp = ast_strdupa(line);
+ int i;
+
+ for (i = 0; i < cat_pos - 1 && tmp; cat = strsep(&tmp, " "), cat_pos--) {
+ tmp = ast_skip_blanks(tmp);
+ }
+
+ AST_LIST_LOCK(&tests);
+ AST_LIST_TRAVERSE(&tests, test, entry) {
+ if (!test_cat_cmp(test->info.category, cat) && (!strncasecmp(word, test->info.name, wordlen) && ++which > state)) {
+ ret = ast_strdup(test->info.name);
+ break;
+ }
+ }
+ AST_LIST_UNLOCK(&tests);
+ return ret;
+}
+
+static char *complete_show_registered(const char *line, const char *word, int pos, int state)
+{
+ static char * const option1[] = { "all", "category", NULL };
+ static char * const option2[] = { "name", NULL };
+
+ if (pos == 3) {
+ return ast_cli_complete(word, option1, state);
+ }
+ if (pos == 4) {
+ return complete_test_category(line, word, pos, state);
+ }
+ if (pos == 5) {
+ return ast_cli_complete(word, option2, state);
+ }
+ if (pos == 6) {
+ return complete_test_name(line, word, pos, state, 6);
+ }
+
+ return NULL;
+}
+
+/* CLI commands */
+static int test_cli_show_registered(int fd, int argc, char *argv[])
+{
+#define FORMAT "%-25.25s %-30.30s %-40.40s %-13.13s\n"
+ struct ast_test *test = NULL;
+ int count = 0;
+
+ if ((argc < 4) || (argc == 6) || (argc > 7) ||
+ ((argc == 4) && strcmp(argv[3], "all")) ||
+ ((argc == 7) && strcmp(argv[5], "name"))) {
+ return RESULT_SHOWUSAGE;
+ }
+ ast_cli(fd, FORMAT, "Category", "Name", "Summary", "Test Result");
+ ast_cli(fd, FORMAT, "--------", "----", "-------", "-----------");
+ AST_LIST_LOCK(&tests);
+ AST_LIST_TRAVERSE(&tests, test, entry) {
+ if ((argc == 4) ||
+ ((argc == 5) && !test_cat_cmp(test->info.category, argv[4])) ||
+ ((argc == 7) && !strcmp(test->info.category, argv[4]) && !strcmp(test->info.name, argv[6]))) {
+
+ ast_cli(fd, FORMAT, test->info.category, test->info.name,
+ test->info.summary, test_result2str[test->state]);
+ count++;
+ }
+ }
+ AST_LIST_UNLOCK(&tests);
+ ast_cli(fd, FORMAT, "--------", "----", "-------", "-----------");
+ ast_cli(fd, "\n%d Registered Tests Matched\n", count);
+
+ return RESULT_SUCCESS;
+}
+
+static char *complete_execute_registered(const char *line, const char *word, int pos, int state)
+{
+ static char * const option1[] = { "all", "category", NULL };
+ static char * const option2[] = { "name", NULL };
+
+ if (pos == 2) {
+ return ast_cli_complete(word, option1, state);
+ }
+ if (pos == 3) {
+ return complete_test_category(line, word, pos, state);
+ }
+ if (pos == 4) {
+ return ast_cli_complete(word, option2, state);
+ }
+ if (pos == 5) {
+ return complete_test_name(line, word, pos, state, 5);
+ }
+
+ return NULL;
+}
+
+static int test_cli_execute_registered(int fd, int argc, char *argv[])
+{
+ if (argc < 3|| argc > 6) {
+ return RESULT_SHOWUSAGE;
+ }
+
+ if ((argc == 3) && !strcmp(argv[2], "all")) { /* run all registered tests */
+ ast_cli(fd, "Running all available tests...\n\n");
+ test_execute_multiple(NULL, NULL, fd);
+ } else if (argc == 4) { /* run only tests within a category */
+ ast_cli(fd, "Running all available tests matching category %s\n\n", argv[3]);
+ test_execute_multiple(NULL, argv[3], fd);
+ } else if (argc == 6) { /* run only a single test matching the category and name */
+ ast_cli(fd, "Running all available tests matching category %s and name %s\n\n", argv[3], argv[5]);
+ test_execute_multiple(argv[5], argv[3], fd);
+ } else {
+ return RESULT_SHOWUSAGE;
+ }
+
+ AST_LIST_LOCK(&tests);
+ if (!(last_results.last_passed + last_results.last_failed)) {
+ ast_cli(fd, "--- No Tests Found! ---\n");
+ }
+ ast_cli(fd, "\n%d Test(s) Executed %d Passed %d Failed\n",
+ (last_results.last_passed + last_results.last_failed),
+ last_results.last_passed,
+ last_results.last_failed);
+ AST_LIST_UNLOCK(&tests);
+
+ return RESULT_SUCCESS;
+}
+
+static char *complete_show_results(const char *line, const char *word, int pos, int state)
+{
+ static char * const option1[] = { "all", "failed", "passed", NULL };
+
+ if (pos == 3) {
+ return ast_cli_complete(word, option1, state);
+ }
+
+ return NULL;
+}
+
+static int test_cli_show_results(int fd, int argc, char *argv[])
+{
+#define FORMAT_RES_ALL1 "%s%s %-30.30s %-25.25s %-10.10s\n"
+#define FORMAT_RES_ALL2 "%s%s %-30.30s %-25.25s %s%ums\n"
+ char result_buf[32] = { 0 };
+ struct ast_test *test = NULL;
+ int failed = 0;
+ int passed = 0;
+ int mode; /* 0 for show all, 1 for show fail, 2 for show passed */
+
+ /* verify input */
+ if (argc != 4) {
+ return RESULT_SHOWUSAGE;
+ } else if (!strcmp(argv[3], "passed")) {
+ mode = 2;
+ } else if (!strcmp(argv[3], "failed")) {
+ mode = 1;
+ } else if (!strcmp(argv[3], "all")) {
+ mode = 0;
+ } else {
+ return RESULT_SHOWUSAGE;
+ }
+
+ ast_cli(fd, FORMAT_RES_ALL1, "Result", "", "Name", "Category", "Time");
+ AST_LIST_LOCK(&tests);
+ AST_LIST_TRAVERSE(&tests, test, entry) {
+ if (test->state == AST_TEST_NOT_RUN) {
+ continue;
+ }
+ test->state == AST_TEST_FAIL ? failed++ : passed++;
+ if (!mode || ((mode == 1) && (test->state == AST_TEST_FAIL)) || ((mode == 2) && (test->state == AST_TEST_PASS))) {
+ /* give our results pretty colors */
+ term_color(result_buf, test_result2str[test->state],
+ (test->state == AST_TEST_FAIL) ? COLOR_RED : COLOR_GREEN,
+ 0, sizeof(result_buf));
+
+ ast_cli(fd, FORMAT_RES_ALL2,
+ result_buf,
+ " ",
+ test->info.name,
+ test->info.category,
+ test->time ? " " : "<",
+ test->time ? test->time : 1);
+ }
+ }
+ AST_LIST_UNLOCK(&tests);
+
+ ast_cli(fd, "%d Test(s) Executed %d Passed %d Failed\n", (failed + passed), passed, failed);
+
+ return RESULT_SUCCESS;
+}
+
+static char *complete_generate_results(const char *line, const char *word, int pos, int state)
+{
+ static char * const option[] = { "xml", "txt", NULL };
+
+ if (pos == 3) {
+ return ast_cli_complete(word, option, state);
+ }
+
+ return NULL;
+}
+
+static int test_cli_generate_results(int fd, int argc, char *argv[])
+{
+ const char *file = NULL;
+ const char *type = "";
+ int isxml = 0;
+ int res = 0;
+ struct ast_dynamic_str *buf = NULL;
+ struct timeval time = ast_tvnow();
+
+ /* verify input */
+ if (argc < 4 || argc > 5) {
+ return RESULT_SHOWUSAGE;
+ } else if (!strcmp(argv[3], "xml")) {
+ type = "xml";
+ isxml = 1;
+ } else if (!strcmp(argv[3], "txt")) {
+ type = "txt";
+ } else {
+ return RESULT_SHOWUSAGE;
+ }
+
+ if (argc == 5) {
+ file = argv[4];
+ } else {
+ if (!(buf = ast_dynamic_str_create(256))) {
+ return RESULT_FAILURE;
+ }
+ ast_dynamic_str_set(&buf, 0, "%s/asterisk_test_results-%ld.%s", ast_config_AST_LOG_DIR, (long) time.tv_sec, type);
+
+ file = buf->str;
+ }
+
+ if (isxml) {
+ res = test_generate_results(NULL, NULL, file, NULL);
+ } else {
+ res = test_generate_results(NULL, NULL, NULL, file);
+ }
+
+ if (!res) {
+ ast_cli(fd, "Results Generated Successfully: %s\n", S_OR(file, ""));
+ } else {
+ ast_cli(fd, "Results Could Not Be Generated: %s\n", S_OR(file, ""));
+ }
+
+ ast_free(buf);
+
+ return RESULT_SUCCESS;
+}
+
+static const char show_registered_help[] = ""
+ "Usage: 'test show registered' can be used in three ways.\n"
+ " 1. 'test show registered all' shows all registered tests\n"
+ " 2. 'test show registered category [test category]' shows all tests in the given\n"
+ " category.\n"
+ " 3. 'test show registered category [test category] name [test name]' shows all\n"
+ " tests in a given category matching a given name\n";
+
+static const char execute_registered_help[] = ""
+ "Usage: test execute can be used in three ways.\n"
+ " 1. 'test execute all' runs all registered tests\n"
+ " 2. 'test execute category [test category]' runs all tests in the given\n"
+ " category.\n"
+ " 3. 'test execute category [test category] name [test name]' runs all\n"
+ " tests in a given category matching a given name\n";
+
+static const char show_results_help[] = ""
+ "Usage: test show results can be used in three ways\n"
+ " 1. 'test show results all' Displays results for all executed tests.\n"
+ " 2. 'test show results passed' Displays results for all passed tests.\n"
+ " 3. 'test show results failed' Displays results for all failed tests.\n";
+
+static const char generate_results_help[] = ""
+ "Usage: 'test generate results'\n"
+ " Generates test results in either xml or txt format. An optional \n"
+ " file path may be provided to specify the location of the xml or\n"
+ " txt file\n"
+ " \nExample usage:\n"
+ " 'test generate results xml' this writes to a default file\n"
+ " 'test generate results xml /path/to/file.xml' writes to specified file\n";
+
+static struct ast_cli_entry test_cli[] = {
+ { { "test", "show", "registered", NULL },
+ test_cli_show_registered, "Show registered tests",
+ show_registered_help, complete_show_registered, },
+
+ { { "test", "execute", NULL },
+ test_cli_execute_registered, "Execute registered tests",
+ execute_registered_help, complete_execute_registered, },
+
+ { { "test", "show", "results", NULL },
+ test_cli_show_results, "Show last test results",
+ show_results_help, complete_show_results, },
+
+ { { "test", "generate", "results", NULL },
+ test_cli_generate_results, "Generate test results to a file",
+ generate_results_help, complete_generate_results, },
+};
+#endif /* TEST_FRAMEWORK */
+
+int ast_test_init()
+{
+#ifdef TEST_FRAMEWORK
+ /* Register cli commands */
+ ast_cli_register_multiple(test_cli, ARRAY_LEN(test_cli));
+#endif
+
+ return 0;
+}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/main/translate.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 225171 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 267539 $")
#include <sys/types.h>
#include <sys/socket.h>
@@ -94,22 +94,19 @@
/*!
* \brief Allocate the descriptor, required outbuf space,
- * and possibly also plc and desc.
+ * and possibly desc.
*/
static void *newpvt(struct ast_translator *t)
{
struct ast_trans_pvt *pvt;
int len;
- int useplc = t->plc_samples > 0 && t->useplc; /* cache, because it can change on the fly */
char *ofs;
/*
* compute the required size adding private descriptor,
- * plc, buffer, AST_FRIENDLY_OFFSET.
+ * buffer, AST_FRIENDLY_OFFSET.
*/
len = sizeof(*pvt) + t->desc_size;
- if (useplc)
- len += sizeof(plc_state_t);
if (t->buf_size)
len += AST_FRIENDLY_OFFSET + t->buf_size;
pvt = ast_calloc(1, len);
@@ -121,10 +118,6 @@
pvt->pvt = ofs;
ofs += t->desc_size;
}
- if (useplc) { /* then plc state */
- pvt->plc = (plc_state_t *)ofs;
- ofs += sizeof(plc_state_t);
- }
if (t->buf_size) /* finally buffer and header */
pvt->outbuf = ofs + AST_FRIENDLY_OFFSET;
/* call local init routine, if present */
@@ -146,10 +139,9 @@
ast_module_unref(t->module);
}
-/*! \brief framein wrapper, deals with plc and bound checks. */
+/*! \brief framein wrapper, deals with bound checks. */
static int framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
{
- int16_t *dst = (int16_t *)pvt->outbuf;
int ret;
int samples = pvt->samples; /* initial value */
@@ -163,18 +155,8 @@
ast_log(LOG_WARNING, "no samples for %s\n", pvt->t->name);
}
if (pvt->t->buffer_samples) { /* do not pass empty frames to callback */
- if (f->datalen == 0) { /* perform PLC with nominal framesize of 20ms/160 samples */
- if (pvt->plc) {
- int l = pvt->t->plc_samples;
- if (pvt->samples + l > pvt->t->buffer_samples) {
- ast_log(LOG_WARNING, "Out of buffer space\n");
- return -1;
- }
- l = plc_fillin(pvt->plc, dst + pvt->samples, l);
- pvt->samples += l;
- pvt->datalen = pvt->samples * 2; /* SLIN has 2bytes for 1sample */
- }
- /* We don't want generic PLC. If the codec has native PLC, then do that */
+ if (f->datalen == 0) { /* perform native PLC if available */
+ /* If the codec has native PLC, then do that */
if (!pvt->t->native_plc)
return 0;
}
@@ -187,13 +169,6 @@
* it otherwise.
*/
ret = pvt->t->framein(pvt, f);
- /* possibly store data for plc */
- if (!ret && pvt->plc) {
- int l = pvt->t->plc_samples;
- if (pvt->samples < l)
- l = pvt->samples;
- plc_rx(pvt->plc, dst + pvt->samples - l, l);
- }
/* diagnostic ... */
if (pvt->samples == samples)
ast_log(LOG_WARNING, "%s did not update samples %d\n",
@@ -690,16 +665,7 @@
ast_log(LOG_WARNING, "Invalid translator path: (%s codec is not valid)\n", t->srcfmt == -1 ? "starting" : "ending");
return -1;
}
- if (t->plc_samples) {
- if (t->buffer_samples < t->plc_samples) {
- ast_log(LOG_WARNING, "plc_samples %d buffer_samples %d\n",
- t->plc_samples, t->buffer_samples);
- return -1;
- }
- if (t->dstfmt != powerof(AST_FORMAT_SLINEAR))
- ast_log(LOG_WARNING, "plc_samples %d format %x\n",
- t->plc_samples, t->dstfmt);
- }
+
if (t->srcfmt >= MAX_FORMAT) {
ast_log(LOG_WARNING, "Source format %s is larger than MAX_FORMAT\n", ast_getformatname(t->srcfmt));
return -1;
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/makeopts.in
^
|
@@ -4,6 +4,7 @@
CC=@PTHREAD_CC@
HOST_CC=cc
+BUILD_CC=cc
CXX=@CXX@
INSTALL=@INSTALL@
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/pbx/Makefile
^
|
@@ -50,8 +50,12 @@
ael/ael_lex.c:
endif
$(ECHO_PREFIX) echo " [FLEX] $< -> $@"
- $(CMD_PREFIX) (cd ael; $(FLEX) ael.flex; sed -i -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c)
- $(CMD_PREFIX) (cd ael; sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ael_lex.c > zz; mv zz ael_lex.c)
+ $(CMD_PREFIX) (cd ael; $(FLEX) ael.flex)
+ $(CMD_PREFIX) sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' $@ > $@.fix
+ $(CMD_PREFIX) echo "#include \"asterisk.h\"" > $@
+ $(CMD_PREFIX) echo >> $@
+ $(CMD_PREFIX) cat $@.fix >> $@
+ $(CMD_PREFIX) rm $@.fix
ifneq ($(findstring REBUILD_PARSERS,$(MENUSELECT_CFLAGS)),)
ael/ael.tab.c ael/ael.tab.h: ael/ael.y
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/pbx/pbx_ael.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
#if !defined(STANDALONE_AEL)
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 211528 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 271552 $")
#endif
#include <sys/types.h>
@@ -59,6 +59,8 @@
#define DEBUG_MACROS (1 << 2)
#define DEBUG_CONTEXTS (1 << 3)
+#define BUF_SIZE 2000
+
static char *config = "extensions.ael";
static char *registrar = "pbx_ael";
static int pbx_load_module(void);
@@ -102,10 +104,10 @@
void linkprio(struct ael_extension *exten, struct ael_priority *prio, struct ael_extension *mother_exten);
void destroy_extensions(struct ael_extension *exten);
static void linkexten(struct ael_extension *exten, struct ael_extension *add);
-static void gen_prios(struct ael_extension *exten, char *label, pval *statement, struct ael_extension *mother_exten, struct ast_context *context );
+static int gen_prios(struct ael_extension *exten, char *label, pval *statement, struct ael_extension *mother_exten, struct ast_context *context );
void set_priorities(struct ael_extension *exten);
void add_extensions(struct ael_extension *exten);
-void ast_compile_ael2(struct ast_context **local_contexts, struct pval *root);
+int ast_compile_ael2(struct ast_context **local_contexts, struct pval *root);
void destroy_pval(pval *item);
void destroy_pval_item(pval *item);
int is_float(char *arg );
@@ -3189,7 +3191,7 @@
}
-static void gen_prios(struct ael_extension *exten, char *label, pval *statement, struct ael_extension *mother_exten, struct ast_context *this_context )
+static int gen_prios(struct ael_extension *exten, char *label, pval *statement, struct ael_extension *mother_exten, struct ast_context *this_context )
{
pval *p,*p2,*p3;
struct ael_priority *pr;
@@ -3200,15 +3202,25 @@
#ifdef OLD_RAND_ACTION
struct ael_priority *rand_test, *rand_end, *rand_skip;
#endif
- char buf1[2000];
- char buf2[2000];
+ char *buf1;
+ char *buf2;
+ char *new_label;
char *strp, *strp2;
- char new_label[2000];
int default_exists;
int local_control_statement_count;
struct ael_priority *loop_break_save;
struct ael_priority *loop_continue_save;
struct ael_extension *switch_case,*switch_null;
+
+ if (!(buf1 = malloc(BUF_SIZE))) {
+ return -1;
+ }
+ if (!(buf2 = malloc(BUF_SIZE))) {
+ return -1;
+ }
+ if (!(new_label = malloc(BUF_SIZE))) {
+ return -1;
+ }
if ((mother_exten && !mother_exten->checked_switch) || (exten && !exten->checked_switch)) {
if (contains_switch(statement)) { /* only run contains_switch if you haven't checked before */
@@ -3255,7 +3267,7 @@
case PV_VARDEC:
pr = new_prio();
pr->type = AEL_APPCALL;
- snprintf(buf1,sizeof(buf1),"%s=$[%s]", p->u1.str, p->u2.val);
+ snprintf(buf1, BUF_SIZE, "%s=$[%s]", p->u1.str, p->u2.val);
pr->app = strdup("Set");
remove_spaces_before_equals(buf1);
pr->appargs = strdup(buf1);
@@ -3276,16 +3288,16 @@
if (!mother_exten)
pr->appargs = strdup(p->u1.list->u1.str);
else { /* for the case of simple within-extension gotos in case/pattern/default statement blocks: */
- snprintf(buf1,sizeof(buf1),"%s|%s", mother_exten->name, p->u1.list->u1.str);
+ snprintf(buf1, BUF_SIZE, "%s|%s", mother_exten->name, p->u1.list->u1.str);
pr->appargs = strdup(buf1);
}
} else if (p->u1.list->next && !p->u1.list->next->next) /* two */ {
- snprintf(buf1,sizeof(buf1),"%s|%s", p->u1.list->u1.str, p->u1.list->next->u1.str);
+ snprintf(buf1, BUF_SIZE, "%s|%s", p->u1.list->u1.str, p->u1.list->next->u1.str);
pr->app = strdup("Goto");
pr->appargs = strdup(buf1);
} else if (p->u1.list->next && p->u1.list->next->next) {
- snprintf(buf1,sizeof(buf1),"%s|%s|%s", p->u1.list->u1.str,
+ snprintf(buf1, BUF_SIZE, "%s|%s|%s", p->u1.list->u1.str,
p->u1.list->next->u1.str,
p->u1.list->next->next->u1.str);
pr->app = strdup("Goto");
@@ -3307,7 +3319,7 @@
control_statement_count++;
loop_break_save = exten->loop_break; /* save them, then restore before leaving */
loop_continue_save = exten->loop_continue;
- snprintf(new_label,sizeof(new_label),"for-%s-%d", label, control_statement_count);
+ snprintf(new_label, BUF_SIZE, "for-%s-%d", label, control_statement_count);
for_init = new_prio();
for_inc = new_prio();
for_test = new_prio();
@@ -3328,7 +3340,7 @@
strp2 = strchr(p->u1.for_init, '=');
*(strp+1) = 0;
strcat(buf2,"$[");
- strncat(buf2,strp2+1, sizeof(buf2)-strlen(strp2+1)-2);
+ strncat(buf2,strp2+1, BUF_SIZE-strlen(strp2+1)-2);
strcat(buf2,"]");
for_init->appargs = strdup(buf2);
/* for_init->app = strdup("Set"); just set! */
@@ -3380,7 +3392,7 @@
strp2 = strchr(p->u3.for_inc, '=');
*(strp+1) = 0;
strcat(buf2,"$[");
- strncat(buf2,strp2+1, sizeof(buf2)-strlen(strp2+1)-2);
+ strncat(buf2,strp2+1, BUF_SIZE-strlen(strp2+1)-2);
strcat(buf2,"]");
for_inc->appargs = strdup(buf2);
for_inc->app = strdup("Set");
@@ -3421,11 +3433,11 @@
}
}
}
- snprintf(buf1,sizeof(buf1),"$[%s]",p->u2.for_test);
+ snprintf(buf1, BUF_SIZE, "$[%s]",p->u2.for_test);
for_test->app = 0;
for_test->appargs = strdup(buf1);
for_loop->goto_true = for_test;
- snprintf(buf1,sizeof(buf1),"Finish for-%s-%d", label, control_statement_count);
+ snprintf(buf1, BUF_SIZE, "Finish for-%s-%d", label, control_statement_count);
for_end->app = strdup("NoOp");
for_end->appargs = strdup(buf1);
/* link & load! */
@@ -3436,7 +3448,9 @@
exten->loop_break = for_end;
exten->loop_continue = for_inc;
- gen_prios(exten, new_label, p->u4.for_statements, mother_exten, this_context); /* this will link in all the statements here */
+ if (gen_prios(exten, new_label, p->u4.for_statements, mother_exten, this_context)) { /* this will link in all the statements here */
+ return -1;
+ }
linkprio(exten, for_inc, mother_exten);
linkprio(exten, for_loop, mother_exten);
@@ -3452,7 +3466,7 @@
control_statement_count++;
loop_break_save = exten->loop_break; /* save them, then restore before leaving */
loop_continue_save = exten->loop_continue;
- snprintf(new_label,sizeof(new_label),"while-%s-%d", label, control_statement_count);
+ snprintf(new_label, BUF_SIZE, "while-%s-%d", label, control_statement_count);
while_test = new_prio();
while_loop = new_prio();
while_end = new_prio();
@@ -3460,11 +3474,11 @@
while_test->goto_false = while_end;
while_loop->type = AEL_CONTROL1; /* simple goto */
while_end->type = AEL_APPCALL;
- snprintf(buf1,sizeof(buf1),"$[%s]",p->u1.str);
+ snprintf(buf1, BUF_SIZE, "$[%s]",p->u1.str);
while_test->app = 0;
while_test->appargs = strdup(buf1);
while_loop->goto_true = while_test;
- snprintf(buf1,sizeof(buf1),"Finish while-%s-%d", label, control_statement_count);
+ snprintf(buf1, BUF_SIZE, "Finish while-%s-%d", label, control_statement_count);
while_end->app = strdup("NoOp");
while_end->appargs = strdup(buf1);
@@ -3474,7 +3488,9 @@
exten->loop_break = while_end;
exten->loop_continue = while_test;
- gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context); /* this will link in all the while body statements here */
+ if (gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context)) { /* this will link in all the while body statements here */
+ return -1;
+ }
linkprio(exten, while_loop, mother_exten);
linkprio(exten, while_end, mother_exten);
@@ -3490,18 +3506,18 @@
local_control_statement_count = control_statement_count;
loop_break_save = exten->loop_break; /* save them, then restore before leaving */
loop_continue_save = exten->loop_continue;
- snprintf(new_label,sizeof(new_label),"sw-%s-%d", label, control_statement_count);
+ snprintf(new_label, BUF_SIZE, "sw-%s-%d", label, control_statement_count);
switch_test = new_prio();
switch_end = new_prio();
switch_test->type = AEL_APPCALL;
switch_end->type = AEL_APPCALL;
- strncpy(buf2,p->u1.str,sizeof(buf2));
- buf2[sizeof(buf2)-1] = 0; /* just in case */
+ strncpy(buf2, p->u1.str, BUF_SIZE);
+ buf2[BUF_SIZE-1] = 0; /* just in case */
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "sw-%d-%s|10",control_statement_count, buf2);
switch_test->app = strdup("Goto");
switch_test->appargs = strdup(buf1);
- snprintf(buf1,sizeof(buf1),"Finish switch-%s-%d", label, control_statement_count);
+ snprintf(buf1, BUF_SIZE, "Finish switch-%s-%d", label, control_statement_count);
switch_end->app = strdup("NoOp");
switch_end->appargs = strdup(buf1);
switch_end->origin = p;
@@ -3534,14 +3550,16 @@
switch_case->loop_continue = exten->loop_continue;
linkexten(exten,switch_case);
- strncpy(buf2,p2->u1.str,sizeof(buf2));
- buf2[sizeof(buf2)-1] = 0; /* just in case */
+ strncpy(buf2,p2->u1.str, BUF_SIZE);
+ buf2[BUF_SIZE-1] = 0; /* just in case */
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s", local_control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "sw-%d-%s", local_control_statement_count, buf2);
switch_case->name = strdup(buf1);
- snprintf(new_label,sizeof(new_label),"sw-%s-%s-%d", label, buf2, local_control_statement_count);
+ snprintf(new_label, BUF_SIZE, "sw-%s-%s-%d", label, buf2, local_control_statement_count);
- gen_prios(switch_case, new_label, p2->u2.statements, exten, this_context); /* this will link in all the case body statements here */
+ if (gen_prios(switch_case, new_label, p2->u2.statements, exten, this_context)) { /* this will link in all the case body statements here */
+ return -1;
+ }
/* here is where we write code to "fall thru" to the next case... if there is one... */
for (p3=p2->u2.statements; p3; p3=p3->next) {
@@ -3555,10 +3573,10 @@
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- strncpy(buf2,p2->next->u1.str,sizeof(buf2));
- buf2[sizeof(buf2)-1] = 0; /* just in case */
+ strncpy(buf2, p2->next->u1.str, BUF_SIZE);
+ buf2[BUF_SIZE-1] = 0; /* just in case */
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "sw-%d-%s|10", local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (p2->next && p2->next->type == PV_PATTERN) {
@@ -3567,14 +3585,14 @@
fall_thru->app = strdup("Goto");
gen_match_to_pattern(p2->next->u1.str, buf2);
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|10", local_control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "sw-%d-%s|10", local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-.|10",local_control_statement_count);
+ snprintf(buf1, BUF_SIZE, "sw-%d-.|10",local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (!p2->next) {
@@ -3590,7 +3608,7 @@
struct ael_priority *np2 = new_prio();
np2->type = AEL_APPCALL;
np2->app = strdup("NoOp");
- snprintf(buf,sizeof(buf),"End of Extension %s", switch_case->name);
+ snprintf(buf, BUF_SIZE, "End of Extension %s", switch_case->name);
np2->appargs = strdup(buf);
linkprio(switch_case, np2, mother_exten);
switch_case-> return_target = np2;
@@ -3613,14 +3631,16 @@
switch_case->loop_continue = exten->loop_continue;
linkexten(exten,switch_case);
- strncpy(buf2,p2->u1.str,sizeof(buf2));
- buf2[sizeof(buf2)-1] = 0; /* just in case */
+ strncpy(buf2, p2->u1.str, BUF_SIZE);
+ buf2[BUF_SIZE-1] = 0; /* just in case */
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"_sw-%d-%s", local_control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "_sw-%d-%s", local_control_statement_count, buf2);
switch_case->name = strdup(buf1);
- snprintf(new_label,sizeof(new_label),"sw-%s-%s-%d", label, buf2, local_control_statement_count);
+ snprintf(new_label, BUF_SIZE, "sw-%s-%s-%d", label, buf2, local_control_statement_count);
- gen_prios(switch_case, new_label, p2->u2.statements, exten, this_context); /* this will link in all the while body statements here */
+ if (gen_prios(switch_case, new_label, p2->u2.statements, exten, this_context)) { /* this will link in all the while body statements here */
+ return -1;
+ }
/* here is where we write code to "fall thru" to the next case... if there is one... */
for (p3=p2->u2.statements; p3; p3=p3->next) {
if (!p3->next)
@@ -3633,10 +3653,10 @@
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- strncpy(buf2,p2->next->u1.str,sizeof(buf2));
- buf2[sizeof(buf2)-1] = 0; /* just in case */
+ strncpy(buf2, p2->next->u1.str, BUF_SIZE);
+ buf2[BUF_SIZE-1] = 0; /* just in case */
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "sw-%d-%s|10", local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (p2->next && p2->next->type == PV_PATTERN) {
@@ -3645,14 +3665,14 @@
fall_thru->app = strdup("Goto");
gen_match_to_pattern(p2->next->u1.str, buf2);
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "sw-%d-%s|10", local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-.|10",local_control_statement_count);
+ snprintf(buf1, BUF_SIZE, "sw-%d-.|10", local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (!p2->next) {
@@ -3704,11 +3724,11 @@
switch_null->context = this_context;
switch_null->is_switch = 1;
switch_empty = new_prio();
- snprintf(buf1,sizeof(buf1),"sw-%d-.|10",local_control_statement_count);
+ snprintf(buf1, BUF_SIZE, "sw-%d-.|10", local_control_statement_count);
switch_empty->app = strdup("Goto");
switch_empty->appargs = strdup(buf1);
linkprio(switch_null, switch_empty, mother_exten);
- snprintf(buf1,sizeof(buf1),"sw-%d-", local_control_statement_count);
+ snprintf(buf1, BUF_SIZE, "sw-%d-", local_control_statement_count);
switch_null->name = strdup(buf1);
switch_null->loop_break = exten->loop_break;
switch_null->loop_continue = exten->loop_continue;
@@ -3718,12 +3738,14 @@
switch_case->loop_break = exten->loop_break;
switch_case->loop_continue = exten->loop_continue;
linkexten(exten,switch_case);
- snprintf(buf1,sizeof(buf1),"_sw-%d-.", local_control_statement_count);
+ snprintf(buf1, BUF_SIZE, "_sw-%d-.", local_control_statement_count);
switch_case->name = strdup(buf1);
- snprintf(new_label,sizeof(new_label),"sw-%s-default-%d", label, local_control_statement_count);
+ snprintf(new_label, BUF_SIZE, "sw-%s-default-%d", label, local_control_statement_count);
- gen_prios(switch_case, new_label, p2->u2.statements, exten, this_context); /* this will link in all the default: body statements here */
+ if (gen_prios(switch_case, new_label, p2->u2.statements, exten, this_context)) { /* this will link in all the default: body statements here */
+ return -1;
+ }
/* here is where we write code to "fall thru" to the next case... if there is one... */
for (p3=p2->u2.statements; p3; p3=p3->next) {
@@ -3737,10 +3759,10 @@
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- strncpy(buf2,p2->next->u1.str,sizeof(buf2));
- buf2[sizeof(buf2)-1] = 0; /* just in case */
+ strncpy(buf2, p2->next->u1.str, BUF_SIZE);
+ buf2[BUF_SIZE-1] = 0; /* just in case */
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "sw-%d-%s|10", local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (p2->next && p2->next->type == PV_PATTERN) {
@@ -3749,14 +3771,14 @@
fall_thru->app = strdup("Goto");
gen_match_to_pattern(p2->next->u1.str, buf2);
substitute_commas(buf2);
- snprintf(buf1,sizeof(buf1),"sw-%d-%s|10",local_control_statement_count, buf2);
+ snprintf(buf1, BUF_SIZE, "sw-%d-%s|10", local_control_statement_count, buf2);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (p2->next && p2->next->type == PV_DEFAULT) {
fall_thru = new_prio();
fall_thru->type = AEL_APPCALL;
fall_thru->app = strdup("Goto");
- snprintf(buf1,sizeof(buf1),"sw-%d-.|10",local_control_statement_count);
+ snprintf(buf1, BUF_SIZE, "sw-%d-.|10", local_control_statement_count);
fall_thru->appargs = strdup(buf1);
linkprio(switch_case, fall_thru, mother_exten);
} else if (!p2->next) {
@@ -3791,7 +3813,7 @@
case PV_MACRO_CALL:
pr = new_prio();
pr->type = AEL_APPCALL;
- snprintf(buf1,sizeof(buf1),"%s", p->u1.str);
+ snprintf(buf1, BUF_SIZE, "%s", p->u1.str);
for (p2 = p->u2.arglist; p2; p2 = p2->next) {
strcat(buf1,"|");
strcat(buf1,p2->u1.str);
@@ -3847,10 +3869,10 @@
#ifdef OLD_RAND_ACTION
case PV_RANDOM:
control_statement_count++;
- snprintf(new_label,sizeof(new_label),"rand-%s-%d", label, control_statement_count);
+ snprintf(new_label, BUF_SIZE, "rand-%s-%d", label, control_statement_count);
rand_test = new_prio();
rand_test->type = AEL_RAND_CONTROL;
- snprintf(buf1,sizeof(buf1),"$[%s]",
+ snprintf(buf1, BUF_SIZE, "$[%s]",
p->u1.str );
rand_test->app = 0;
rand_test->appargs = strdup(buf1);
@@ -3858,7 +3880,7 @@
rand_end = new_prio();
rand_end->type = AEL_APPCALL;
- snprintf(buf1,sizeof(buf1),"Finish rand-%s-%d", label, control_statement_count);
+ snprintf(buf1, BUF_SIZE, "Finish rand-%s-%d", label, control_statement_count);
rand_end->app = strdup("NoOp");
rand_end->appargs = strdup(buf1);
@@ -3872,12 +3894,16 @@
linkprio(exten, rand_test, mother_exten);
if (p->u3.else_statements) {
- gen_prios(exten, new_label, p->u3.else_statements, mother_exten, this_context); /* this will link in all the else statements here */
+ if (gen_prios(exten, new_label, p->u3.else_statements, mother_exten, this_context)) { /* this will link in all the else statements here */
+ return -1;
+ }
}
linkprio(exten, rand_skip, mother_exten);
- gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context); /* this will link in all the "true" statements here */
+ if (gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context)) { /* this will link in all the "true" statements here */
+ return -1;
+ }
linkprio(exten, rand_end, mother_exten);
@@ -3886,11 +3912,11 @@
case PV_IFTIME:
control_statement_count++;
- snprintf(new_label,sizeof(new_label),"iftime-%s-%d", label, control_statement_count);
+ snprintf(new_label, BUF_SIZE, "iftime-%s-%d", label, control_statement_count);
if_test = new_prio();
if_test->type = AEL_IFTIME_CONTROL;
- snprintf(buf1,sizeof(buf1),"%s|%s|%s|%s",
+ snprintf(buf1, BUF_SIZE, "%s|%s|%s|%s",
p->u1.list->u1.str,
p->u1.list->next->u1.str,
p->u1.list->next->next->u1.str,
@@ -3901,7 +3927,7 @@
if_end = new_prio();
if_end->type = AEL_APPCALL;
- snprintf(buf1,sizeof(buf1),"Finish iftime-%s-%d", label, control_statement_count);
+ snprintf(buf1, BUF_SIZE, "Finish iftime-%s-%d", label, control_statement_count);
if_end->app = strdup("NoOp");
if_end->appargs = strdup(buf1);
@@ -3931,12 +3957,15 @@
/* now, put the body of the if here */
- gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context); /* this will link in all the statements here */
+ if (gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context)) { /* this will link in all the statements here */
+ return -1;
+ }
if (p->u3.else_statements) {
linkprio(exten, if_skip, mother_exten);
- gen_prios(exten, new_label, p->u3.else_statements, mother_exten, this_context); /* this will link in all the statements here */
-
+ if (gen_prios(exten, new_label, p->u3.else_statements, mother_exten, this_context)) { /* this will link in all the statements here */
+ return -1;
+ }
}
linkprio(exten, if_end, mother_exten);
@@ -3946,24 +3975,24 @@
case PV_RANDOM:
case PV_IF:
control_statement_count++;
- snprintf(new_label,sizeof(new_label),"if-%s-%d", label, control_statement_count);
+ snprintf(new_label, BUF_SIZE, "if-%s-%d", label, control_statement_count);
if_test = new_prio();
if_end = new_prio();
if_test->type = AEL_IF_CONTROL;
if_end->type = AEL_APPCALL;
if ( p->type == PV_RANDOM )
- snprintf(buf1,sizeof(buf1),"$[${RAND(0|99)} < (%s)]",p->u1.str);
+ snprintf(buf1, BUF_SIZE, "$[${RAND(0|99)} < (%s)]", p->u1.str);
else {
char buf[8000];
strcpy(buf,p->u1.str);
substitute_commas(buf);
- snprintf(buf1,sizeof(buf1),"$[%s]",buf);
+ snprintf(buf1, BUF_SIZE, "$[%s]",buf);
}
if_test->app = 0;
if_test->appargs = strdup(buf1);
- snprintf(buf1,sizeof(buf1),"Finish if-%s-%d", label, control_statement_count);
+ snprintf(buf1, BUF_SIZE, "Finish if-%s-%d", label, control_statement_count);
if_end->app = strdup("NoOp");
if_end->appargs = strdup(buf1);
if_test->origin = p;
@@ -3983,12 +4012,15 @@
/* now, put the body of the if here */
- gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context); /* this will link in all the statements here */
+ if (gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context)) { /* this will link in all the statements here */
+ return -1;
+ }
if (p->u3.else_statements) {
linkprio(exten, if_skip, mother_exten);
- gen_prios(exten, new_label, p->u3.else_statements, mother_exten, this_context); /* this will link in all the statements here */
-
+ if (gen_prios(exten, new_label, p->u3.else_statements, mother_exten, this_context)) { /* this will link in all the statements here */
+ return -1;
+ }
}
linkprio(exten, if_end, mother_exten);
@@ -3996,7 +4028,9 @@
break;
case PV_STATEMENTBLOCK:
- gen_prios(exten, label, p->u1.list, mother_exten, this_context ); /* recurse into the block */
+ if (gen_prios(exten, label, p->u1.list, mother_exten, this_context)) { /* recurse into the block */
+ return -1;
+ }
break;
case PV_CATCH:
@@ -4016,9 +4050,11 @@
switch_case->context = this_context;
linkexten(exten,switch_case);
switch_case->name = strdup(p->u1.str);
- snprintf(new_label,sizeof(new_label),"catch-%s-%d",p->u1.str, control_statement_count);
+ snprintf(new_label, BUF_SIZE, "catch-%s-%d",p->u1.str, control_statement_count);
- gen_prios(switch_case, new_label, p->u2.statements,mother_exten,this_context); /* this will link in all the catch body statements here */
+ if (gen_prios(switch_case, new_label, p->u2.statements,mother_exten,this_context)) { /* this will link in all the catch body statements here */
+ return -1;
+ }
if (switch_case->return_needed) {
char buf[2000];
struct ael_priority *np2 = new_prio();
@@ -4035,6 +4071,10 @@
break;
}
}
+ free(buf1);
+ free(buf2);
+ free(new_label);
+ return 0;
}
void set_priorities(struct ael_extension *exten)
@@ -4250,7 +4290,7 @@
}
-void ast_compile_ael2(struct ast_context **local_contexts, struct pval *root)
+int ast_compile_ael2(struct ast_context **local_contexts, struct pval *root)
{
pval *p,*p2;
struct ast_context *context;
@@ -4322,7 +4362,9 @@
}
}
/* CONTAINS APPCALLS, CATCH, just like extensions... */
- gen_prios(exten, p->u1.str, p->u3.macro_statements, 0, context );
+ if (gen_prios(exten, p->u1.str, p->u3.macro_statements, 0, context)) {
+ return -1;
+ }
if (exten->return_needed) {
struct ael_priority *np2 = new_prio();
np2->type = AEL_APPCALL;
@@ -4364,7 +4406,9 @@
if ( p2->u3.hints )
exten->hints = strdup(p2->u3.hints);
exten->regexten = p2->u4.regexten;
- gen_prios(exten, p->u1.str, p2->u2.statements, 0, context );
+ if (gen_prios(exten, p->u1.str, p2->u2.statements, 0, context)) {
+ return -1;
+ }
if (exten->return_needed) {
struct ael_priority *np2 = new_prio();
np2->type = AEL_APPCALL;
@@ -4452,6 +4496,7 @@
add_extensions(exten_list); /* actually makes calls to create priorities in ast_contexts -- feeds dialplan to asterisk */
destroy_extensions(exten_list); /* all that remains is an empty husk, discard of it as is proper */
+ return 0;
}
@@ -4487,7 +4532,11 @@
ael2_semantic_check(parse_tree, &sem_err, &sem_warn, &sem_note);
if (errs == 0 && sem_err == 0) {
ast_log(LOG_NOTICE, "AEL load process: checked config file name '%s'.\n", rfilename);
- ast_compile_ael2(&local_contexts, parse_tree);
+ if (ast_compile_ael2(&local_contexts, parse_tree)) {
+ ast_log(LOG_ERROR, "AEL compile failure! Aborting\n");
+ destroy_pval(parse_tree); /* free up the memory */
+ return AST_MODULE_LOAD_DECLINE;
+ }
ast_log(LOG_NOTICE, "AEL load process: compiled config file name '%s'.\n", rfilename);
ast_merge_contexts_and_delete(&local_contexts, registrar);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/pbx/pbx_config.c
^
|
@@ -25,7 +25,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 233091 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 282129 $")
#include <sys/types.h>
#include <stdlib.h>
@@ -2475,13 +2475,14 @@
static int load_module(void)
{
- if (pbx_load_module())
- return AST_MODULE_LOAD_DECLINE;
-
+
if (static_config && !write_protect_config)
ast_cli_register(&cli_dialplan_save);
ast_cli_register_multiple(cli_pbx_config, sizeof(cli_pbx_config) / sizeof(struct ast_cli_entry));
+ if (pbx_load_module())
+ return AST_MODULE_LOAD_DECLINE;
+
return 0;
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/pbx/pbx_dundi.c
^
|
@@ -27,7 +27,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 255322 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 271761 $")
#include <stdlib.h>
#include <stdio.h>
@@ -2519,6 +2519,7 @@
ast_cli(fd, "Peer: %s\n", dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid));
ast_cli(fd, "Model: %s\n", model2str(peer->model));
ast_cli(fd, "Host: %s\n", peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "<Unspecified>");
+ ast_cli(fd, "Port: %d\n", ntohs(peer->addr.sin_port));
ast_cli(fd, "Dynamic: %s\n", peer->dynamic ? "yes" : "no");
ast_cli(fd, "Reg: %s\n", peer->registerid < 0 ? "No" : "Yes");
ast_cli(fd, "In Key: %s\n", ast_strlen_zero(peer->inkey) ? "<None>" : peer->inkey);
@@ -2550,8 +2551,8 @@
static int dundi_show_peers(int fd, int argc, char *argv[])
{
-#define FORMAT2 "%-20.20s %-15.15s %-10.10s %-8.8s %-15.15s\n"
-#define FORMAT "%-20.20s %-15.15s %s %-10.10s %-8.8s %-15.15s\n"
+#define FORMAT2 "%-20.20s %-15.15s %-6.6s %-10.10s %-8.8s %-15.15s\n"
+#define FORMAT "%-20.20s %-15.15s %s %-6d %-10.10s %-8.8s %-15.15s\n"
struct dundi_peer *peer;
int registeredonly=0;
char avgms[20];
@@ -2570,7 +2571,7 @@
return RESULT_SHOWUSAGE;
}
AST_LIST_LOCK(&peers);
- ast_cli(fd, FORMAT2, "EID", "Host", "Model", "AvgTime", "Status");
+ ast_cli(fd, FORMAT2, "EID", "Host", "Port", "Model", "AvgTime", "Status");
AST_LIST_TRAVERSE(&peers, peer, list) {
char status[20];
int print_line = -1;
@@ -2605,7 +2606,7 @@
strcpy(avgms, "Unavail");
snprintf(srch, sizeof(srch), FORMAT, dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid),
peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "(Unspecified)",
- peer->dynamic ? "(D)" : "(S)", model2str(peer->model), avgms, status);
+ peer->dynamic ? "(D)" : "(S)", ntohs(peer->addr.sin_port), model2str(peer->model), avgms, status);
if (argc == 5) {
if (!strcasecmp(argv[3],"include") && strstr(srch,argv[4])) {
@@ -2622,7 +2623,7 @@
if (print_line) {
ast_cli(fd, FORMAT, dundi_eid_to_str(eid_str, sizeof(eid_str), &peer->eid),
peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "(Unspecified)",
- peer->dynamic ? "(D)" : "(S)", model2str(peer->model), avgms, status);
+ peer->dynamic ? "(D)" : "(S)", ntohs(peer->addr.sin_port), model2str(peer->model), avgms, status);
}
}
ast_cli(fd, "%d dundi peers [%d online, %d offline, %d unmonitored]\n", total_peers, online_peers, offline_peers, unmonitored_peers);
@@ -4194,6 +4195,8 @@
ast_copy_string(peer->inkey, v->value, sizeof(peer->inkey));
} else if (!strcasecmp(v->name, "outkey")) {
ast_copy_string(peer->outkey, v->value, sizeof(peer->outkey));
+ } else if (!strcasecmp(v->name, "port")) {
+ peer->addr.sin_port = htons(atoi(v->value));
} else if (!strcasecmp(v->name, "host")) {
if (!strcasecmp(v->value, "dynamic")) {
peer->dynamic = 1;
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/res/.moduleinfo
^
|
@@ -34,7 +34,6 @@
<member name="res_musiconhold" displayname="Music On Hold Resource" remove_on_change="res/res_musiconhold.o res/res_musiconhold.so">
<conflict>win32</conflict>
<use>dahdi</use>
- <depend>working_fork</depend>
</member>
<member name="res_odbc" displayname="ODBC Resource" remove_on_change="res/res_odbc.o res/res_odbc.so">
<depend>unixodbc</depend>
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/res/.res_musiconhold.moduleinfo
^
|
@@ -1,5 +1,4 @@
<member name="res_musiconhold" displayname="Music On Hold Resource" remove_on_change="res/res_musiconhold.o res/res_musiconhold.so">
<conflict>win32</conflict>
<use>dahdi</use>
- <depend>working_fork</depend>
</member>
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/res/res_agi.c
^
|
@@ -29,7 +29,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 237405 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 273640 $")
#include <sys/types.h>
#include <netdb.h>
@@ -1651,7 +1651,7 @@
" to the offset without exceeding the end of the file. \"silence\" is the number\n"
" of seconds of silence allowed before the function returns despite the\n"
" lack of dtmf digits or reaching timeout. Silence value must be\n"
-" preceeded by \"s=\" and is also optional.\n";
+" preceded by \"s=\" and is also optional.\n";
static char usage_autohangup[] =
" Usage: SET AUTOHANGUP <time>\n"
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/res/res_config_odbc.c
^
|
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2010, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -36,7 +36,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 182808 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 277568 $")
#include <stdio.h>
#include <stdlib.h>
@@ -53,18 +53,33 @@
#include "asterisk/options.h"
#include "asterisk/res_odbc.h"
#include "asterisk/utils.h"
+#include "asterisk/stringfields.h"
struct custom_prepare_struct {
const char *sql;
const char *extra;
+ AST_DECLARE_STRING_FIELDS(
+ AST_STRING_FIELD(encoding)[256];
+ );
va_list ap;
};
+static void decode_chunk(char *chunk)
+{
+ for (; *chunk; chunk++) {
+ if (*chunk == '^' && strchr("0123456789ABCDEFabcdef", chunk[1]) && strchr("0123456789ABCDEFabcdef", chunk[2])) {
+ sscanf(chunk + 1, "%02hhd", chunk);
+ memmove(chunk + 1, chunk + 3, strlen(chunk + 3) + 1);
+ }
+ }
+}
+
static SQLHSTMT custom_prepare(struct odbc_obj *obj, void *data)
{
int res, x = 1;
struct custom_prepare_struct *cps = data;
const char *newparam, *newval;
+ char encodebuf[1024];
SQLHSTMT stmt;
va_list ap;
@@ -85,6 +100,27 @@
while ((newparam = va_arg(ap, const char *))) {
newval = va_arg(ap, const char *);
+ if (strchr(newval, ';') || strchr(newval, '^')) {
+ char *eptr = encodebuf;
+ const char *vptr = newval;
+ for (; *vptr && eptr < encodebuf + sizeof(encodebuf); vptr++) {
+ if (strchr("^;", *vptr)) {
+ /* We use ^XX, instead of %XX because '%' is a special character in SQL */
+ snprintf(eptr, encodebuf + sizeof(encodebuf) - eptr, "^%02hhX", *vptr);
+ eptr += 3;
+ vptr++;
+ } else {
+ *eptr++ = *vptr++;
+ }
+ }
+ if (eptr < encodebuf + sizeof(encodebuf)) {
+ *eptr = '\0';
+ } else {
+ encodebuf[sizeof(encodebuf) - 1] = '\0';
+ }
+ ast_string_field_set(cps, encoding[x], encodebuf);
+ newval = cps->encoding[x];
+ }
SQLBindParameter(stmt, x++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(newval), 0, (void *)newval, 0, NULL);
}
va_end(ap);
@@ -118,22 +154,29 @@
va_list aq;
struct custom_prepare_struct cps = { .sql = sql };
+ if (ast_string_field_init(&cps, 256)) {
+ return NULL;
+ }
va_copy(cps.ap, ap);
va_copy(aq, ap);
- if (!table)
+ if (!table) {
+ ast_string_field_free_memory(&cps);
return NULL;
+ }
obj = ast_odbc_request_obj(database, 0);
if (!obj) {
ast_log(LOG_ERROR, "No database handle available with the name of '%s' (check res_odbc.conf)\n", database);
+ ast_string_field_free_memory(&cps);
return NULL;
}
newparam = va_arg(aq, const char *);
if (!newparam) {
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
newval = va_arg(aq, const char *);
@@ -152,6 +195,7 @@
if (!stmt) {
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
@@ -160,6 +204,7 @@
ast_log(LOG_WARNING, "SQL Column Count error!\n[%s]\n\n", sql);
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
@@ -167,12 +212,14 @@
if (res == SQL_NO_DATA) {
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Fetch error!\n[%s]\n\n", sql);
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
for (x = 0; x < colcount; x++) {
@@ -185,6 +232,7 @@
if (var)
ast_variables_destroy(var);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
@@ -201,15 +249,20 @@
return NULL;
}
stringp = rowdata;
- while(stringp) {
+ while (stringp) {
chunk = strsep(&stringp, ";");
if (!ast_strlen_zero(ast_strip(chunk))) {
+ if (strchr(chunk, '^')) {
+ decode_chunk(chunk);
+ }
if (prev) {
prev->next = ast_variable_new(coltitle, chunk);
- if (prev->next)
+ if (prev->next) {
prev = prev->next;
- } else
+ }
+ } else {
prev = var = ast_variable_new(coltitle, chunk);
+ }
}
}
}
@@ -217,6 +270,7 @@
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return var;
}
@@ -248,20 +302,24 @@
struct custom_prepare_struct cps = { .sql = sql };
va_list aq;
+ if (!table || ast_string_field_init(&cps, 256)) {
+ return NULL;
+ }
va_copy(cps.ap, ap);
va_copy(aq, ap);
- if (!table)
- return NULL;
memset(&ra, 0, sizeof(ra));
obj = ast_odbc_request_obj(database, 0);
- if (!obj)
+ if (!obj) {
+ ast_string_field_free_memory(&cps);
return NULL;
+ }
newparam = va_arg(aq, const char *);
if (!newparam) {
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
initfield = ast_strdupa(newparam);
@@ -285,6 +343,7 @@
if (!stmt) {
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
@@ -293,6 +352,7 @@
ast_log(LOG_WARNING, "SQL Column Count error!\n[%s]\n\n", sql);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
@@ -301,6 +361,7 @@
ast_log(LOG_WARNING, "Out of memory!\n");
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return NULL;
}
@@ -337,11 +398,15 @@
continue;
}
stringp = rowdata;
- while(stringp) {
+ while (stringp) {
chunk = strsep(&stringp, ";");
if (!ast_strlen_zero(ast_strip(chunk))) {
- if (initfield && !strcmp(initfield, coltitle))
+ if (strchr(chunk, '^')) {
+ decode_chunk(chunk);
+ }
+ if (initfield && !strcmp(initfield, coltitle)) {
ast_category_rename(cat, chunk);
+ }
var = ast_variable_new(coltitle, chunk);
ast_variable_append(cat, var);
}
@@ -352,6 +417,7 @@
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return cfg;
}
@@ -366,19 +432,21 @@
va_list aq;
struct custom_prepare_struct cps = { .sql = sql, .extra = lookup };
+ if (!table || ast_string_field_init(&cps, 256)) {
+ return -1;
+ }
va_copy(cps.ap, ap);
va_copy(aq, ap);
-
- if (!table)
- return -1;
- obj = ast_odbc_request_obj(database, 0);
- if (!obj)
+ if (!(obj = ast_odbc_request_obj(database, 0))) {
+ ast_string_field_free_memory(&cps);
return -1;
+ }
newparam = va_arg(aq, const char *);
if (!newparam) {
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return -1;
}
newval = va_arg(aq, const char *);
@@ -394,20 +462,23 @@
if (!stmt) {
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
return -1;
}
res = SQLRowCount(stmt, &rowcount);
SQLFreeHandle (SQL_HANDLE_STMT, stmt);
ast_odbc_release_obj(obj);
+ ast_string_field_free_memory(&cps);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Row Count error!\n[%s]\n\n", sql);
return -1;
}
- if (rowcount >= 0)
- return (int)rowcount;
+ if (rowcount >= 0) {
+ return (int) rowcount;
+ }
return -1;
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/res/res_config_pgsql.c
^
|
@@ -1,8 +1,8 @@
/*
* Asterisk -- A telephony toolkit for Linux.
*
- * Copyright (C) 1999-2005, Digium, Inc.
- *
+ * Copyright (C) 1999-2010, Digium, Inc.
+ *
* Manuel Guesdon <mguesdon@oxymium.net> - Postgresql RealTime Driver Author/Adaptor
* Mark Spencer <markster@digium.com> - Asterisk Author
* Matthew Boehm <mboehm@cytelcom.com> - MySQL RealTime Driver Author
@@ -28,7 +28,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 182808 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 277568 $")
#include <stdlib.h>
#include <stdio.h>
@@ -76,11 +76,42 @@
cli_realtime_pgsql_status_usage },
};
+static char *encode_chunk(const char *chunk, char *buf, size_t len)
+{
+ char *cptr = buf;
+ for (; *chunk && cptr < buf + len; chunk++) {
+ if (strchr(";^", *chunk)) {
+ snprintf(cptr, buf + len - cptr, "^%02hhX", *chunk);
+ cptr += 3;
+ } else {
+ *cptr++ = *chunk;
+ }
+ }
+ if (cptr < buf + len) {
+ *cptr = '\0';
+ } else {
+ buf[len - 1] = '\0';
+ }
+ return buf;
+}
+
+static char *decode_chunk(char *chunk)
+{
+ char *orig = chunk;
+ for (; *chunk; chunk++) {
+ if (*chunk == '^' && strchr("0123456789ABCDEFabcdef", chunk[1]) && strchr("0123456789ABCDEFabcdef", chunk[2])) {
+ sscanf(chunk + 1, "%02hhd", chunk);
+ memmove(chunk + 1, chunk + 3, strlen(chunk + 3) + 1);
+ }
+ }
+ return orig;
+}
+
static struct ast_variable *realtime_pgsql(const char *database, const char *table, va_list ap)
{
PGresult *result = NULL;
int num_rows = 0, pgerror;
- char sql[256], escapebuf[513];
+ char sql[256], escapebuf[2049], semibuf[1024];
char *stringp;
char *chunk;
char *op;
@@ -109,7 +140,7 @@
If there is only 1 set, then we have our query. Otherwise, loop thru the list and concat */
op = strchr(newparam, ' ') ? "" : " =";
- PQescapeStringConn(pgsqlConn, escapebuf, newval, (sizeof(escapebuf) - 1) / 2, &pgerror);
+ PQescapeStringConn(pgsqlConn, escapebuf, encode_chunk(newval, semibuf, sizeof(semibuf)), (sizeof(escapebuf) - 1) / 2, &pgerror);
if (pgerror) {
ast_log(LOG_ERROR, "Postgres detected invalid input: '%s'\n", newval);
va_end(ap);
@@ -125,7 +156,7 @@
else
op = "";
- PQescapeStringConn(pgsqlConn, escapebuf, newval, (sizeof(escapebuf) - 1) / 2, &pgerror);
+ PQescapeStringConn(pgsqlConn, escapebuf, encode_chunk(newval, semibuf, sizeof(semibuf)), (sizeof(escapebuf) - 1) / 2, &pgerror);
if (pgerror) {
ast_log(LOG_ERROR, "Postgres detected invalid input: '%s'\n", newval);
va_end(ap);
@@ -167,7 +198,7 @@
}
}
- ast_log(LOG_DEBUG, "1Postgresql RealTime: Result=%p Query: %s\n", result, sql);
+ ast_log(LOG_DEBUG, "Postgresql RealTime: Result=%p Query: %s\n", result, sql);
if ((num_rows = PQntuples(result)) > 0) {
int i = 0;
@@ -189,7 +220,7 @@
stringp = PQgetvalue(result, rowIndex, i);
while (stringp) {
chunk = strsep(&stringp, ";");
- if (chunk && !ast_strlen_zero(ast_strip(chunk))) {
+ if (chunk && !ast_strlen_zero(decode_chunk(ast_strip(chunk)))) {
if (prev) {
prev->next = ast_variable_new(fieldnames[i], chunk);
if (prev->next) {
@@ -217,7 +248,7 @@
{
PGresult *result = NULL;
int num_rows = 0, pgerror;
- char sql[256], escapebuf[513];
+ char sql[256], escapebuf[2049], semibuf[1024];
const char *initfield = NULL;
char *stringp;
char *chunk;
@@ -264,7 +295,7 @@
else
op = "";
- PQescapeStringConn(pgsqlConn, escapebuf, newval, (sizeof(escapebuf) - 1) / 2, &pgerror);
+ PQescapeStringConn(pgsqlConn, escapebuf, encode_chunk(newval, semibuf, sizeof(semibuf)), (sizeof(escapebuf) - 1) / 2, &pgerror);
if (pgerror) {
ast_log(LOG_ERROR, "Postgres detected invalid input: '%s'\n", newval);
va_end(ap);
@@ -280,7 +311,7 @@
else
op = "";
- PQescapeStringConn(pgsqlConn, escapebuf, newval, (sizeof(escapebuf) - 1) / 2, &pgerror);
+ PQescapeStringConn(pgsqlConn, escapebuf, encode_chunk(newval, semibuf, sizeof(semibuf)), (sizeof(escapebuf) - 1) / 2, &pgerror);
if (pgerror) {
ast_log(LOG_ERROR, "Postgres detected invalid input: '%s'\n", newval);
va_end(ap);
@@ -353,7 +384,7 @@
stringp = PQgetvalue(result, rowIndex, i);
while (stringp) {
chunk = strsep(&stringp, ";");
- if (chunk && !ast_strlen_zero(ast_strip(chunk))) {
+ if (chunk && !ast_strlen_zero(decode_chunk(ast_strip(chunk)))) {
if (initfield && !strcmp(initfield, fieldnames[i])) {
ast_category_rename(cat, chunk);
}
@@ -366,7 +397,7 @@
}
ast_free(fieldnames);
} else {
- ast_log(LOG_WARNING,
+ ast_log(LOG_DEBUG,
"Postgresql RealTime: Could not find any rows in table %s.\n", table);
}
@@ -381,7 +412,7 @@
{
PGresult *result = NULL;
int numrows = 0, pgerror;
- char sql[256], escapebuf[513];
+ char sql[256], escapebuf[2049], semibuf[1024];
const char *newparam, *newval;
if (!table) {
@@ -405,7 +436,7 @@
/* Create the first part of the query using the first parameter/value pairs we just extracted
If there is only 1 set, then we have our query. Otherwise, loop thru the list and concat */
- PQescapeStringConn(pgsqlConn, escapebuf, newval, (sizeof(escapebuf) - 1) / 2, &pgerror);
+ PQescapeStringConn(pgsqlConn, escapebuf, encode_chunk(newval, semibuf, sizeof(semibuf)), (sizeof(escapebuf) - 1) / 2, &pgerror);
if (pgerror) {
ast_log(LOG_ERROR, "Postgres detected invalid input: '%s'\n", newval);
va_end(ap);
@@ -416,7 +447,7 @@
while ((newparam = va_arg(ap, const char *))) {
newval = va_arg(ap, const char *);
- PQescapeStringConn(pgsqlConn, escapebuf, newval, (sizeof(escapebuf) - 1) / 2, &pgerror);
+ PQescapeStringConn(pgsqlConn, escapebuf, encode_chunk(newval, semibuf, sizeof(semibuf)), (sizeof(escapebuf) - 1) / 2, &pgerror);
if (pgerror) {
ast_log(LOG_ERROR, "Postgres detected invalid input: '%s'\n", newval);
va_end(ap);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/res/res_features.c
^
|
@@ -30,7 +30,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 258670 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 278167 $")
#include <pthread.h>
#include <signal.h>
@@ -695,6 +695,7 @@
if (!ast_strlen_zero(courtesytone)) {
if (ast_autoservice_start(callee_chan))
return -1;
+ ast_autoservice_ignore(callee_chan, AST_FRAME_DTMF_END);
if (ast_stream_and_wait(caller_chan, courtesytone, caller_chan->language, "")) {
ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
ast_autoservice_stop(callee_chan);
@@ -798,6 +799,7 @@
transferer_real_context = real_ctx(transferer, transferee);
/* Start autoservice on chan while we talk to the originator */
ast_autoservice_start(transferee);
+ ast_autoservice_ignore(transferee, AST_FRAME_DTMF_END);
ast_indicate(transferee, AST_CONTROL_HOLD);
memset(xferto, 0, sizeof(xferto));
@@ -914,6 +916,7 @@
transferer_real_context = real_ctx(transferer, transferee);
/* Start autoservice on chan while we talk to the originator */
ast_autoservice_start(transferee);
+ ast_autoservice_ignore(transferee, AST_FRAME_DTMF_END);
ast_indicate(transferee, AST_CONTROL_HOLD);
/* Transfer */
@@ -970,6 +973,8 @@
}
if (!ast_check_hangup(transferer)) {
+ int hangup_dont = 0;
+
if (check_compat(transferer, newchan)) {
/* we do mean transferee here, NOT transferer */
finishup(transferee);
@@ -978,7 +983,18 @@
memset(&bconfig,0,sizeof(struct ast_bridge_config));
ast_set_flag(&(bconfig.features_caller), AST_FEATURE_DISCONNECT);
ast_set_flag(&(bconfig.features_callee), AST_FEATURE_DISCONNECT);
+
+ /* ast_bridge_call clears AST_FLAG_BRIDGE_HANGUP_DONT, but we don't
+ want that to happen here because we're also in another bridge already
+ */
+ if (ast_test_flag(chan, AST_FLAG_BRIDGE_HANGUP_DONT)) {
+ hangup_dont = 1;
+ }
res = ast_bridge_call(transferer, newchan, &bconfig);
+ if (hangup_dont) {
+ ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_DONT);
+ }
+
if (newchan->_softhangup || !transferer->_softhangup) {
ast_hangup(newchan);
if (ast_stream_and_wait(transferer, xfersound, transferer->language, ""))
@@ -1216,6 +1232,7 @@
}
ast_autoservice_start(idle);
+ ast_autoservice_ignore(idle, AST_FRAME_DTMF_END);
if (!ast_strlen_zero(feature->moh_class))
ast_moh_start(idle, feature->moh_class, NULL);
@@ -2167,7 +2184,7 @@
/* new channel */
ast_cdr_specialized_reset(new_chan_cdr,0);
} else {
- ast_cdr_specialized_reset(chan_cdr,0); /* nothing changed, reset the chan_cdr */
+ ast_cdr_specialized_reset(chan->cdr, 0); /* nothing changed, reset the chan cdr */
}
}
@@ -2193,9 +2210,11 @@
ast_channel_unlock(chan_ptr);
}
/* new channel */
- ast_cdr_specialized_reset(new_peer_cdr,0);
+ if (new_peer_cdr) {
+ ast_cdr_specialized_reset(new_peer_cdr, 0);
+ }
} else {
- ast_cdr_specialized_reset(peer_cdr,0); /* nothing changed, reset the peer_cdr */
+ ast_cdr_specialized_reset(peer->cdr, 0); /* nothing changed, reset the peer cdr */
}
}
@@ -2520,7 +2539,7 @@
ast_mutex_lock(&parking_lock);
pu = parkinglot;
while(pu) {
- if (pu->parkingnum == park) {
+ if (pu->parkingnum == park && !pu->notquiteyet) {
if (pu->chan->pbx) { /* do not allow call to be picked up until the PBX thread is finished */
ast_mutex_unlock(&parking_lock);
ast_module_user_remove(u);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/res/res_jabber.c
^
|
@@ -33,7 +33,7 @@
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 198370 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 273640 $")
#include <stdlib.h>
#include <stdio.h>
@@ -676,16 +676,16 @@
case IKS_PAK_S10N:
aji_handle_subscribe(client, pak);
if (option_debug)
- ast_log(LOG_DEBUG, "JABBER: I Dont know S10N subscribe!!\n");
+ ast_log(LOG_DEBUG, "JABBER: I Don't know S10N subscribe!!\n");
break;
case IKS_PAK_IQ:
if (option_debug)
- ast_log(LOG_DEBUG, "JABBER: I Dont have an IQ!!!\n");
+ ast_log(LOG_DEBUG, "JABBER: I Don't have an IQ!!!\n");
aji_handle_iq(client, node);
break;
default:
if (option_debug)
- ast_log(LOG_DEBUG, "JABBER: I Dont know %i\n", pak->type);
+ ast_log(LOG_DEBUG, "JABBER: I Don't know %i\n", pak->type);
break;
}
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/res/res_musiconhold.c
^
|
@@ -28,12 +28,11 @@
/*** MODULEINFO
<conflict>win32</conflict>
<use>dahdi</use>
- <depend>working_fork</depend>
***/
#include "asterisk.h"
-ASTERISK_FILE_VERSION(__FILE__, "$Revision: 260345 $")
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 270331 $")
#include <stdlib.h>
#include <errno.h>
@@ -226,16 +225,20 @@
return -1;
}
- /* If a specific file has been saved confirm it still exists and that it is still valid */
- if (state->save_pos >= 0 && state->save_pos < state->class->total_files && state->class->filearray[state->save_pos] == state->save_pos_filename) {
+ if (state->pos == 0 && state->save_pos_filename == NULL) {
+ /* First time so lets play the file. */
+ state->save_pos = -1;
+ } else if (state->save_pos >= 0 && state->save_pos < state->class->total_files && state->class->filearray[state->save_pos] == state->save_pos_filename) {
+ /* If a specific file has been saved confirm it still exists and that it is still valid */
state->pos = state->save_pos;
state->save_pos = -1;
} else if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
/* Get a random file and ensure we can open it */
for (tries = 0; tries < 20; tries++) {
state->pos = ast_random() % state->class->total_files;
- if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0)
+ if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0) {
break;
+ }
}
state->save_pos = -1;
state->samples = 0;
@@ -260,8 +263,9 @@
if (option_debug)
ast_log(LOG_DEBUG, "%s Opened file %d '%s'\n", chan->name, state->pos, state->class->filearray[state->pos]);
- if (state->samples)
+ if (state->samples) {
ast_seekstream(chan->stream, state->samples, SEEK_SET);
+ }
return 0;
}
@@ -353,6 +357,7 @@
.generate = moh_files_generator,
};
+#ifdef HAVE_WORKING_FORK
static int spawn_mp3(struct mohclass *class)
{
int fds[2];
@@ -605,6 +610,7 @@
}
return NULL;
}
+#endif
static int moh0_exec(struct ast_channel *chan, void *data)
{
@@ -917,6 +923,7 @@
return 0;
}
+#ifdef HAVE_WORKING_FORK
static int init_app_class(struct mohclass *class)
{
#ifdef HAVE_DAHDI
@@ -959,6 +966,7 @@
return 0;
}
+#endif
/*!
* \note This function owns the reference it gets to moh
@@ -988,10 +996,16 @@
} else if (!strcasecmp(moh->mode, "mp3") || !strcasecmp(moh->mode, "mp3nb") ||
!strcasecmp(moh->mode, "quietmp3") || !strcasecmp(moh->mode, "quietmp3nb") ||
!strcasecmp(moh->mode, "httpmp3") || !strcasecmp(moh->mode, "custom")) {
+#ifdef HAVE_WORKING_FORK
if (init_app_class(moh)) {
moh = mohclass_unref(moh);
return -1;
}
+#else
+ ast_log(LOG_WARNING, "Cannot use mode '%s' music on hold, as there is no working fork().\n", moh->mode);
+ moh = mohclass_unref(moh);
+ return -1;
+#endif
} else {
ast_log(LOG_WARNING, "Don't know how to do a mode '%s' music on hold\n", moh->mode);
moh = mohclass_unref(moh);
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/sounds/Makefile
^
|
@@ -18,8 +18,9 @@
PWD:=$(shell pwd)
SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds
MOH_DIR:=$(DESTDIR)$(ASTDATADIR)/moh
-CORE_SOUNDS_VERSION:=1.4.18
+CORE_SOUNDS_VERSION:=1.4.19
EXTRA_SOUNDS_VERSION:=1.4.11
+MOH_VERSION:=2.03
SOUNDS_URL:=http://downloads.asterisk.org/pub/telephony/sounds/releases
MCS:=$(subst -EN-,-en-,$(MENUSELECT_CORE_SOUNDS))
MCS:=$(subst -FR-,-fr-,$(MCS))
@@ -50,8 +51,8 @@
MM:=$(subst -GSM,-gsm,$(MM))
MM:=$(subst -G729,-g729,$(MM))
MM:=$(subst -G722,-g722,$(MM))
-MOH:=$(MM:MOH-%=asterisk-moh-%.tar.gz)
-MOH_TAGS:=$(MM:MOH-%=$(MOH_DIR)/.asterisk-moh-%)
+MOH:=$(MM:MOH-%=asterisk-moh-%-$(MOH_VERSION).tar.gz)
+MOH_TAGS:=$(MM:MOH-%=$(MOH_DIR)/.asterisk-moh-%-$(MOH_VERSION))
# If "fetch" is used, --continue is not a valid option.
ifneq ($(findstring wget,$(WGET)),)
WGET_ARGS:=--continue $(WGET_EXTRA_ARGS)
@@ -127,6 +128,7 @@
@PACKAGE=$(subst $(MOH_DIR)/.asterisk,asterisk,$@).tar.gz; \
if test ! -f $${PACKAGE}; then $(DOWNLOAD) $(WGET_ARGS) $(SOUNDS_URL)/$${PACKAGE}; fi; \
if test ! -f $${PACKAGE}; then exit 1; fi; \
+ rm -f $(subst -$(MOH_VERSION),,$@)-* && \
(cd $(MOH_DIR); cat $(PWD)/$${PACKAGE} | gzip -d | tar xof -) && \
touch $@
@@ -156,3 +158,6 @@
extra_sounds_version:
@echo $(EXTRA_SOUNDS_VERSION)
+
+moh_version:
+ @echo $(MOH_VERSION)
|
|
Added |
asterisk-1.4.36.tar.bz2/sounds/asterisk-core-sounds-en-gsm-1.4.19.tar.gz
^
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/sounds/asterisk-moh-opsound-wav-2.03.tar.gz
^
|
(renamed to sounds/asterisk-moh-opsound-wav-2.03.tar.gz)
|
[-]
[+]
|
Changed |
asterisk-1.4.36.tar.bz2/sounds/asterisk-moh-opsound-wav-2.03.tar.gz
^
|
(renamed to sounds/asterisk-moh-opsound-wav-2.03.tar.gz)
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/tests
^
|
+(directory)
|
|
Changed |
asterisk-1.4.36.tar.bz2/tests/.makeopts
^
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/tests/.moduleinfo
^
|
@@ -0,0 +1,8 @@
+<category name="MENUSELECT_TESTS" displayname="Test Modules" remove_on_change="tests/modules.link">
+<member name="test_astobj2" displayname="ASTOBJ2 Unit Test" remove_on_change="tests/test_astobj2.o tests/test_astobj2.so">
+ <depend>TEST_FRAMEWORK</depend>
+</member>
+<member name="test_skel" displayname="Skeleton (sample) Test" remove_on_change="tests/test_skel.o tests/test_skel.so">
+ <depend>TEST_FRAMEWORK</depend>
+</member>
+</category>
|
|
Changed |
asterisk-1.4.36.tar.bz2/tests/.test_astobj2.makeopts
^
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/tests/.test_astobj2.moduleinfo
^
|
@@ -0,0 +1,3 @@
+<member name="test_astobj2" displayname="ASTOBJ2 Unit Test" remove_on_change="tests/test_astobj2.o tests/test_astobj2.so">
+ <depend>TEST_FRAMEWORK</depend>
+</member>
|
|
Changed |
asterisk-1.4.36.tar.bz2/tests/.test_skel.makeopts
^
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/tests/.test_skel.moduleinfo
^
|
@@ -0,0 +1,3 @@
+<member name="test_skel" displayname="Skeleton (sample) Test" remove_on_change="tests/test_skel.o tests/test_skel.so">
+ <depend>TEST_FRAMEWORK</depend>
+</member>
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/tests/Makefile
^
|
@@ -0,0 +1,32 @@
+#
+# Asterisk -- A telephony toolkit for Linux.
+#
+# Makefile for test modules
+#
+# Copyright (C) 1999-2010, Digium, Inc.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+-include ../menuselect.makeopts ../menuselect.makedeps ../makeopts
+
+MENUSELECT_CATEGORY=TESTS
+MENUSELECT_DESCRIPTION=Test Modules
+
+ALL_C_MODS:=$(patsubst %.c,%,$(wildcard test_*.c))
+ALL_CC_MODS:=$(patsubst %.cc,%,$(wildcard test_*.cc))
+
+C_MODS:=$(filter-out $(MENUSELECT_TESTS),$(ALL_C_MODS))
+CC_MODS:=$(filter-out $(MENUSELECT_TESTS),$(ALL_CC_MODS))
+
+LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
+
+ifneq ($(findstring tests,$(MENUSELECT_EMBED)),)
+ EMBEDDED_MODS:=$(LOADABLE_MODS)
+ LOADABLE_MODS:=
+endif
+
+all: _all
+
+include $(ASTTOPDIR)/Makefile.moddir_rules
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/tests/test_astobj2.c
^
|
@@ -0,0 +1,329 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * David Vossel <dvossel@digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*!
+ * \file
+ * \brief astobj2 test module
+ *
+ * \author David Vossel <dvossel@digium.com>
+ */
+
+/*** MODULEINFO
+ <depend>TEST_FRAMEWORK</depend>
+ ***/
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 272881 $")
+
+#include "asterisk/utils.h"
+#include "asterisk/module.h"
+#include "asterisk/test.h"
+#include "asterisk/astobj2.h"
+
+struct test_obj {
+ char c[20];
+ int i;
+ int *destructor_count;
+};
+
+static void test_obj_destructor(void *obj)
+{
+ struct test_obj *test_obj = (struct test_obj *) obj;
+ *test_obj->destructor_count = *test_obj->destructor_count - 1;
+}
+
+static int increment_cb(void *obj, void *arg, int flag)
+{
+ int *i = (int *) arg;
+
+ *i = *i + 1;
+ return 0;
+}
+
+static int all_but_one_cb(void *obj, void *arg, int flag)
+{
+ struct test_obj *test_obj = (struct test_obj *) obj;
+
+ return (test_obj->i > 1) ? CMP_MATCH : 0;
+}
+
+static int test_cmp_cb(void *obj, void *arg, int flags)
+{
+ struct test_obj *cmp_obj = (struct test_obj *) obj;
+ struct test_obj *test_obj = (struct test_obj *) arg;
+ if (!arg) {
+ return 0;
+ }
+ return (cmp_obj->i == test_obj->i) ? CMP_MATCH | CMP_STOP : 0;
+}
+
+static int test_hash_cb(const void *obj, const int flags)
+{
+ struct test_obj *test_obj = (struct test_obj *) obj;
+ if (!test_obj || ast_strlen_zero(test_obj->c)) {
+ return 0;
+ }
+ return ast_str_hash(test_obj->c);
+}
+
+static int astobj2_test_helper(int use_hash, int use_cmp, unsigned int lim, struct ast_test *test)
+{
+ struct ao2_container *c1;
+ struct ao2_container *c2;
+ struct ao2_iterator it;
+ struct test_obj *obj;
+ struct test_obj tmp_obj;
+ int bucket_size;
+ int increment = 0;
+ int destructor_count = 0;
+ int num;
+ int res = AST_TEST_PASS;
+
+ /* This test needs at least 5 objects */
+ if (lim < 5) {
+ lim = 5;
+ }
+
+ bucket_size = (ast_random() % ((lim / 4) + 1)) + 1;
+ c1 = ao2_container_alloc(bucket_size, use_hash ? test_hash_cb : NULL, use_cmp ? test_cmp_cb : NULL);
+ c2 = ao2_container_alloc(bucket_size, test_hash_cb, test_cmp_cb);
+
+ if (!c1 || !c2) {
+ ast_test_status_update(test, "ao2_container_alloc failed.\n");
+ res = AST_TEST_FAIL;
+ goto cleanup;
+ }
+
+ /* Create objects and link into container */
+ destructor_count = lim;
+ for (num = 1; num <= lim; num++) {
+ if (!(obj = ao2_alloc(sizeof(struct test_obj), test_obj_destructor))) {
+ ast_test_status_update(test, "ao2_alloc failed.\n");
+ res = AST_TEST_FAIL;
+ goto cleanup;
+ }
+ snprintf(obj->c, sizeof(obj->c), "zombie #%d", num);
+ obj->destructor_count = &destructor_count;
+ obj->i = num;
+ ao2_link(c1, obj);
+ ao2_ref(obj, -1);
+ if (ao2_container_count(c1) != num) {
+ ast_test_status_update(test, "container did not link correctly\n");
+ res = AST_TEST_FAIL;
+ }
+ }
+
+ ast_test_status_update(test, "Container created: random bucket size %d: number of items: %d\n", bucket_size, lim);
+
+ /* Testing ao2_find with no flags */
+ num = 100;
+ for (; num; num--) {
+ int i = (ast_random() % ((lim / 2)) + 1); /* find a random object */
+ tmp_obj.i = i;
+ if (!(obj = ao2_find(c1, &tmp_obj, 0))) {
+ res = AST_TEST_FAIL;
+ ast_test_status_update(test, "COULD NOT FIND:%d, ao2_find() with no flags failed.\n", i);
+ } else {
+ /* a correct match will only take place when the custom cmp function is used */
+ if (use_cmp && obj->i != i) {
+ ast_test_status_update(test, "object %d does not match object %d\n", obj->i, tmp_obj.i);
+ res = AST_TEST_FAIL;
+ }
+ ao2_ref(obj, -1);
+ }
+ }
+
+ /* Testing ao2_find with OBJ_POINTER */
+ num = 75;
+ for (; num; num--) {
+ int i = (ast_random() % ((lim / 2)) + 1); /* find a random object */
+ snprintf(tmp_obj.c, sizeof(tmp_obj.c), "zombie #%d", i);
+ tmp_obj.i = i;
+ if (!(obj = ao2_find(c1, &tmp_obj, OBJ_POINTER))) {
+ res = AST_TEST_FAIL;
+ ast_test_status_update(test, "COULD NOT FIND:%d, ao2_find() with OBJ_POINTER flag failed.\n", i);
+ } else {
+ /* a correct match will only take place when the custom cmp function is used */
+ if (use_cmp && obj->i != i) {
+ ast_test_status_update(test, "object %d does not match object %d\n", obj->i, tmp_obj.i);
+ res = AST_TEST_FAIL;
+ }
+ ao2_ref(obj, -1);
+ }
+ }
+
+ /* Testing ao2_find with OBJ_POINTER | OBJ_UNLINK | OBJ_CONTINUE.
+ * In this test items are unlinked from c1 and placed in c2. Then
+ * unlinked from c2 and placed back into c1.
+ *
+ * For this module and set of custom hash/cmp functions, an object
+ * should only be found if the astobj2 default cmp function is used.
+ * This test is designed to mimic the chan_iax.c call number use case. */
+ num = lim < 25 ? lim : 25;
+ for (; num; num--) {
+ if (!(obj = ao2_find(c1, NULL, OBJ_POINTER | OBJ_UNLINK | OBJ_CONTINUE))) {
+ if (!use_cmp) {
+ ast_test_status_update(test, "ao2_find with OBJ_POINTER | OBJ_UNLINK | OBJ_CONTINUE failed with default hash function.\n");
+ res = AST_TEST_FAIL;
+ }
+ } else {
+ if (use_cmp) {
+ ast_test_status_update(test, "ao2_find with OBJ_POINTER | OBJ_UNLINK | OBJ_CONTINUE failed with custom hash function.\n");
+ res = AST_TEST_FAIL;
+ }
+ ao2_link(c2, obj);
+ ao2_ref(obj, -1);
+ }
+ }
+ it = ao2_iterator_init(c2, 0);
+ while ((obj = ao2_iterator_next(&it))) {
+ ao2_unlink(c2, obj);
+ ao2_link(c1, obj);
+ ao2_ref(obj, -1);
+ }
+ ao2_iterator_destroy(&it);
+
+ /* Test Callback with no flags. */
+ increment = 0;
+ ao2_callback(c1, 0, increment_cb, &increment);
+ if (increment != lim) {
+ ast_test_status_update(test, "callback with no flags failed. Increment is %d\n", increment);
+ res = AST_TEST_FAIL;
+ }
+
+ /* Test Callback with OBJ_NODATA. This should do nothing different than with no flags here. */
+ increment = 0;
+ ao2_callback(c1, OBJ_NODATA, increment_cb, &increment);
+ if (increment != lim) {
+ ast_test_status_update(test, "callback with OBJ_NODATA failed. Increment is %d\n", increment);
+ res = AST_TEST_FAIL;
+ }
+
+ /* Is the container count what we expect after all the finds and unlinks?*/
+ if (ao2_container_count(c1) != lim) {
+ ast_test_status_update(test, "container count does not match what is expected after ao2_find tests.\n");
+ res = AST_TEST_FAIL;
+ }
+
+ /* Testing iterator. Unlink a single object and break. do not add item back */
+ it = ao2_iterator_init(c1, 0);
+ num = (lim / 4) + 1;
+ while ((obj = ao2_iterator_next(&it))) {
+ if (obj->i == num) {
+ ao2_ref(obj, -1);
+ ao2_unlink(c1, obj);
+ break;
+ }
+ ao2_ref(obj, -1);
+ }
+ ao2_iterator_destroy(&it);
+
+ /* Is the container count what we expect after removing a single item? */
+ if (ao2_container_count(c1) != (lim - 1)) {
+ ast_test_status_update(test, "unlink during iterator failed. Number %d was not removed.\n", num);
+ res = AST_TEST_FAIL;
+ }
+
+ /* Test unlink all with OBJ_MULTIPLE, leave a single object for the container to destroy */
+ ao2_callback(c1, OBJ_MULTIPLE | OBJ_UNLINK | OBJ_NODATA, all_but_one_cb, NULL);
+ /* check to make sure all test_obj destructors were called except for 1 */
+ if (destructor_count != 1) {
+ ast_test_status_update(test, "OBJ_MULTIPLE | OBJ_UNLINK | OBJ_NODATA failed. destructor count %d\n", destructor_count);
+ res = AST_TEST_FAIL;
+ }
+
+cleanup:
+ /* destroy containers */
+ if (c1) {
+ ao2_ref(c1, -1);
+ }
+ if (c2) {
+ ao2_ref(c2, -1);
+ }
+
+ if (destructor_count > 0) {
+ ast_test_status_update(test, "all destructors were not called, destructor count is %d\n", destructor_count);
+ res = AST_TEST_FAIL;
+ } else if (destructor_count < 0) {
+ ast_test_status_update(test, "Destructor was called too many times, destructor count is %d\n", destructor_count);
+ res = AST_TEST_FAIL;
+ }
+
+ return res;
+}
+
+AST_TEST_DEFINE(astobj2_test_1)
+{
+ int res = AST_TEST_PASS;
+
+ switch (cmd) {
+ case TEST_INIT:
+ info->name = "astobj2_test1";
+ info->category = "main/astobj2/";
+ info->summary = "astobj2 test using ao2 objects, containers, callbacks, and iterators";
+ info->description =
+ "Builds ao2_containers with various item numbers, bucket sizes, cmp and hash "
+ "functions. Runs a series of tests to manipulate the container using callbacks "
+ "and iterators. Verifies expected behavior.";
+ return AST_TEST_NOT_RUN;
+ case TEST_EXECUTE:
+ break;
+ }
+
+
+ /* Test 1, 500 items with custom hash and cmp functions */
+ ast_test_status_update(test, "Test 1, astobj2 test with 500 items.\n");
+ if ((res = astobj2_test_helper(1, 1, 500, test)) == AST_TEST_FAIL) {
+ return res;
+ }
+
+ /* Test 2, 1000 items with custom hash and default cmp functions */
+ ast_test_status_update(test, "Test 2, astobj2 test with 1000 items.\n");
+ if ((res = astobj2_test_helper(1, 0, 1000, test)) == AST_TEST_FAIL) {
+ return res;
+ }
+
+ /* Test 3, 10000 items with default hash and custom cmp functions */
+ ast_test_status_update(test, "Test 3, astobj2 test with 10000 items.\n");
+ if ((res = astobj2_test_helper(0, 1, 10000, test)) == AST_TEST_FAIL) {
+ return res;
+ }
+
+ /* Test 4, 100000 items with default hash and cmp functions */
+ ast_test_status_update(test, "Test 4, astobj2 test with 100000 items.\n");
+ if ((res = astobj2_test_helper(0, 0, 100000, test)) == AST_TEST_FAIL) {
+ return res;
+ }
+
+ return res;
+}
+
+static int unload_module(void)
+{
+ AST_TEST_UNREGISTER(astobj2_test_1);
+ return 0;
+}
+
+static int load_module(void)
+{
+ AST_TEST_REGISTER(astobj2_test_1);
+ return AST_MODULE_LOAD_SUCCESS;
+}
+
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ASTOBJ2 Unit Test");
|
[-]
[+]
|
Added |
asterisk-1.4.36.tar.bz2/tests/test_skel.c
^
|
@@ -0,0 +1,82 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) <Year>, <Your Name Here>
+ *
+ * <Your Name Here> <<Your Email Here>>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*!
+ * \file
+ * \brief Skeleton Test
+ *
+ * \author\verbatim <Your Name Here> <<Your Email Here>> \endverbatim
+ *
+ * This is a skeleton for development of an Asterisk test module
+ * \ingroup tests
+ */
+
+/*** MODULEINFO
+ <depend>TEST_FRAMEWORK</depend>
+ ***/
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision: 272878 $")
+
+#include "asterisk/utils.h"
+#include "asterisk/module.h"
+#include "asterisk/test.h"
+
+AST_TEST_DEFINE(sample_test)
+{
+ void *ptr;
+
+ switch (cmd) {
+ case TEST_INIT:
+ info->name = "sample_test";
+ info->category = "main/sample/";
+ info->summary = "sample unit test";
+ info->description =
+ "This demonstrates what is required to implement "
+ "a unit test.";
+ return AST_TEST_NOT_RUN;
+ case TEST_EXECUTE:
+ break;
+ }
+
+ ast_test_status_update(test, "Executing sample test...\n");
+
+ if (!(ptr = ast_malloc(8))) {
+ ast_test_status_update(test, "ast_malloc() failed\n");
+ return AST_TEST_FAIL;
+ }
+
+ ast_free(ptr);
+
+ return AST_TEST_PASS;
+}
+
+static int unload_module(void)
+{
+ AST_TEST_UNREGISTER(sample_test);
+ return 0;
+}
+
+static int load_module(void)
+{
+ AST_TEST_REGISTER(sample_test);
+ return AST_MODULE_LOAD_SUCCESS;
+}
+
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Skeleton (sample) Test");
|