2014-06-13 Asterisk Development Team * Asterisk 12.3.2 Released. * AST-2014-007: Fix of fix to allow AMI and SIP TCP to send messages. The original fix for AST-2014-007 inadvertently introduced a regression in Asterisk's TCP and TLS handling that prevented Asterisk from sending data over these transports. This patch fixes that regression. 2014-06-12 Asterisk Development Team * Asterisk 12.3.1 Released. * AST-2014-005 res_pjsip_pubsub: unauthenticated remote crash in PJSIP pub/sub framework A remotely exploitable crash vulnerability exists in the PJSIP channel driver's pub/sub framework. If an attempt is made to unsubscribe when not currently subscribed and the endpoint's "sub_min_expiry" is set to zero, Asterisk tries to create an expiration timer with zero seconds, which is not allowed, so an assertion raised. The fix was to reject a subscription that is attempting to unsubscribe when not being already subscribed. Asterisk now checks for this situation appropriately and responds with a 400 instead of crashing. ASTERISK-23489 #close * AST-2014-006: Add class authorization requirements to MixMonitor AMI commands MixMonitor AMI commands StartMixMonitor and StopMixMonitor lacked class authorization. StopMixMonitor now requires that the manager user either have the call or system class authorization. StartMixMonitor is a slightly larger issue since it can execute shell commands if the right arguments are passed into it, and we consider this a permission escalation. ASTERISK-23609 #close Reported by: Corey Farrell * AST-2014-007: Fix DOS by consuming the number of allowed HTTP connections. Simply establishing a TCP connection and never sending anything to the configured HTTP port in http.conf will tie up a HTTP connection. Since there is a maximum number of open HTTP sessions allowed at a time you can block legitimate connections. A similar problem exists if a HTTP request is started but never finished. * Added http.conf session_inactivity timer option to close HTTP connections that aren't doing anything. Defaults to 30000 ms. * Removed the undocumented manager.conf block-sockets option. It interferes with TCP/TLS inactivity timeouts. * AMI and SIP TLS connections now have better authentication timeout protection. Though I didn't remove the bizzare TLS timeout polling code from chan_sip. * chan_sip can now handle SSL certificate renegotiations in the middle of a session. It couldn't do that before because the socket was non-blocking and the SSL calls were not restarted as documented by the OpenSSL documentation. * Fixed an off nominal leak of the ssl struct in handle_tcptls_connection() if the FILE stream failed to open and the SSL certificate negotiations failed. The patch creates a custom FILE stream handler to give the created FILE streams inactivity timeout and timeout after a specific moment in time capability. This approach eliminates the need for code using the FILE stream to be redesigned to deal with the timeouts. This patch indirectly fixes most of ASTERISK-18345 by fixing the usage of the SSL_read/SSL_write operations. ASTERISK-23673 #close Reported by: Richard Mudgett * AST-2014-008: Fix potential deadlock situation in res_pjsip. SIP transaction timeouts are handled in the PJSIP monitor thread. When this happens on a subscription, and the subscription is destroyed, the subscription destruction is dispatched synchronously to the threadpool. The issue is that the PJSIP dialog is locked by the monitor thread, and then the dispatched task attempts to lock the dialog. This leads to a deadlock that causes SIP traffic to no longer be accepted on the Asterisk server. The fix here is to treat the monitor thread as if it were a threadpool thread when it attempts to dispatch synchronous tasks. This way, the dispatched task turns into a simple function call within the same thread, and the locking issue is averted. ASTERISK-23802 #close 2014-05-29 Asterisk Development Team * Asterisk 12.3.0 Released. 2014-05-28 Asterisk Development Team * Asterisk 12.3.0-rc2 Released. * test_cel: Fix unit tests broken due to event def changes from res_corosync This patch instructs test_cel to skip any IE types it doesn't care about. The addition of the raw and bitfield types caused the tests to fail. * res_pjsip_session: Fix leaked video RTP ports. Simply enabling PJSIP to negotiage a video codec (e.g., h264) would leak video RTP ports if the codec were not negotiated by an incoming call. - Made add_sdp_streams() associate the handler with the media stream if the handler handled the media stream. Otherwise, when the ast_sip_session_media object was destroyed it didn't know how to clean up the RTP resources. - Fixed sdp_requires_deferral() associating the handler with the media stream when deciding if the SDP processing needs to be deferred for T.38. Like the leaked video RTP ports, the T.38 handler needs to clean up allocated resources from deciding if SDP processing needs to be deffered. - Cleaned up some dead code in handle_incoming_sdp() and sdp_requires_deferral(). ASTERISK-23721 #close Reported by: cervajs * ast-db-manage/cdr/env.py: Don't fail if a config file can't be loaded When generating SQL files via the repotools alembic_creator.py script, a configuration object is used programatically with SQLAlechemy, as opposed to a configuration file. This patch ignores failures to interpret a config file, as ... there isn't one in this case. * AMI/ARI: Update version numbers Update the semantic versioning of ARI to 1.3.0 and AMI to 2.3.0 to account for backwards compatible changes going from 12.2.0 to 12.3.0. 2014-05-22 Asterisk Development Team * Asterisk 12.3.0-rc1 Released. 2014-05-22 16:08 +0000 [r414405] Scott Griepentrog * main/stasis_channels.c, res/res_stasis.c, main/manager_channels.c, main/stasis_endpoints.c, rest-api/api-docs/events.json, res/stasis/app.c, res/ari/resource_events.c, include/asterisk/stasis_app.h, include/asterisk/stasis.h, apps/app_userevent.c, res/ari/resource_events.h, res/ari/ari_model_validators.c, CHANGES, main/stasis.c, res/ari/ari_model_validators.h, include/asterisk/stasis_channels.h, res/res_ari_events.c: ARI: Add ability to raise arbitrary User Events User events can now be generated from ARI. Events can be signalled with arbitrary json variables, and include one or more of channel, bridge, or endpoint snapshots. An application must be specified which will receive the event message (other applications can subscribe to it). The message will also be delivered via AMI provided a channel is attached. Dialplan generated user event messages are still transmitted via the channel, and will only be received by a stasis application they are attached to or if the channel is subscribed to. This change also introduces the multi object blob mechanism used to send multiple snapshot types in a single message. The dialplan app UserEvent was also changed to use multi object blob, and a new stasis message type created to handle them. ASTERISK-22697 #close Review: https://reviewboard.asterisk.org/r/3494/ 2014-05-22 16:00 +0000 [r414404] Richard Mudgett * /, apps/app_meetme.c: app_meetme: Don't interrupt MOH for waitmarked users. Occasionally, when the last marked user leaves the conference, waitmarked users don't get MOH if MOH is supposed to be played while a waitmarked user is waiting for another marked user. * Made not interrupt MOH when the user is a waitmarked user. The waitmarked user doesn't need to hear any leave announcements from the conference as the user would have already heard different leave announcements if they were enabled. Apparently DAHDI occasionally sends unending non-silent streams to these users or a normal user still in the conference has continuous high background noise. These non-silent streams cause MOH to be suspended while the never ending "announcement" is played. Issue caused by ASTERISK-13680. AST-1349 #close Reported by: Tyler Stewart Review: https://reviewboard.asterisk.org/r/3543/ ........ Merged revisions 414401 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414402 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-22 15:44 +0000 [r414400] Jonathan Rose * channels/chan_sip.c, main/parking.c, main/bridge.c, main/bridge_basic.c, res/parking/parking_applications.c, include/asterisk/parking.h, include/asterisk/bridge.h, res/parking/parking_bridge_features.c, channels/chan_mgcp.c, res/res_pjsip_refer.c, channels/chan_dahdi.c, channels/sig_analog.c: res_pjsip_refer: Fix bugs involving Parking/PJSIP/transfers PJSIP would never send the final 200 Notify for a blind transfer when transferring to parking. This patch fixes that. In addition, it fixes a reference leak when performing blind transfers to non-bridging extensions. Review: https://reviewboard.asterisk.org/r/3485/ 2014-05-22 14:01 +0000 [r414330-414347] Matthew Jordan * /, UPGRADE.txt: UPGRADE: Add note for REF_DEBUG flag ........ Merged revisions 414345 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414346 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/event.c, main/stasis.c, include/asterisk/devicestate.h, include/asterisk/event.h, main/stasis_message.c, include/asterisk/event_defs.h, res/res_corosync.c, include/asterisk/stasis.h, main/app.c, main/devicestate.c: res_corosync: Update module to work with Stasis (and compile) This patch fixes res_corosync such that it works with Asterisk 12. This restores the functionality that was present in previous versions of Asterisk, and ensures compatibility with those versions by restoring the binary message format needed to pass information from/to them. The following changes were made in the core to support this: * The event system has been partially restored. All event definition and event types in this patch were pulled from Asterisk 11. Previously, we had hoped that this information would live in res_corosync; however, the approach in this patch seems to be better for a few reasons: (1) Theoretically, ast_events can be used by any module as a binary representation of a Stasis message. Given the structure of an ast_event object, that information has to live in the core to be used universally. For example, defining the payload of a device state ast_event in res_corosync could result in an incompatible device state representation in another module. (2) Much of this representation already lived in the core, and was not easily extensible. (3) The code already existed. :-) * Stasis message types now have a message formatter that converts their payload to an ast_event object. * Stasis message forwarders now handle forwarding to themselves. Previously this would result in an infinite recursive call. Now, this simply creates a new forwarding object with no forwards set up (as it is the thing it is forwarding to). This is advantageous for res_corosync, as returning NULL would also imply an unrecoverable error. Returning a subscription in this case allows for easier handling of message types that are published directly to an aggregate topic that has forwarders. Review: https://reviewboard.asterisk.org/r/3486/ ASTERISK-22912 #close ASTERISK-22372 #close 2014-05-21 22:17 +0000 [r414272] Richard Mudgett * /, main/core_unreal.c: core_unreal: Only block media frames when a generator is on both ends of an unreal channel. The fix for ASTERISK-12292 was a bit too aggressive. You could have generators pointed at each other on local channels but need to get other kinds of frames such as DTMF or CONNECTED_LINE frames accross. ........ Merged revisions 414269 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414270 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-21 19:07 +0000 [r414216] Scott Griepentrog * /, funcs/func_strings.c: pbx.c: prevent potential crash from recursive replace() Recurisve usage of replace() resulted in corruption of the temporary string storage and potential crash. By changing the string to be allocated separtely per instance, this is eliminated. ASTERISK-23650 #comment Reported by: Roel van Meer ASTEIRSK-23650 #close Review: https://reviewboard.asterisk.org/r/3539/ ........ Merged revisions 414214 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414215 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-19 19:50 +0000 [r414195] Paul Belanger * res/res_stasis_answer.c: Replace __ast_answer with ast_raw_answer in app_control_answer While load testing an ARI application, I noticed asterisk was returning HTTP 500 internal server errors on channels/:id/answer. After talking to #asterisk-dev, the issue appeared to be a lack of media flowing after __ast_answer() was called. So now, we call ast_raw_answer instead and no longer wait for media. ASTERISK-23758 #close Review: https://reviewboard.asterisk.org/r/3549/ 2014-05-19 13:46 +0000 [r414154] Alexandr Anikin * addons/chan_ooh323.c, /: chan_ooh323: fix h323_log full path name * fix to use astlogdir option for h323_log file instead of hardcoded ASTERISK-23754 #close Reported by: Igor Goncharovsky Patches: ooh323_logger_patch.diff ........ Merged revisions 414152 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414153 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-19 01:09 +0000 [r414122-414137] Matthew Jordan * main/framehook.c, include/asterisk/channel.h, bridges/bridge_native_rtp.c, main/bridge_channel.c, res/res_pjsip_refer.c, res/res_pjsip_session.c, main/channel.c: Undo r414122 The Test Suite caught a few problems, undoing until those are resolved * include/asterisk/channel.h, bridges/bridge_native_rtp.c, main/bridge_channel.c, res/res_pjsip_session.c, main/channel.c, main/framehook.c: bridge_native_rtp/bridge_channel: Fix direct media issues due to frame hook This patch fixes issues with direct media bridges that occur after a blind transfer. These issues were caught by the (currently failing) pjsip/transfers/blind_transfer/caller_direct_media test. The test currently fails primarily for two reasons: (1) When Bob and Charlie (the transfer target and the transfer destination) enter a bridge together, the framehook remains on the transfer target channel until both channels are in the bridge. As it consumes voice frames, the initial bridge type is a simple bridge. The framehook is removed when both channels are in the bridge; however, this does not currently cause the bridging framework to re-evaluate the bridge. This patch adds a AST_SOFTHANGUP_UNBRIDGE poke to the transfer target channel when a framehook is removed so the bridge can re-evaluate itself. (2) When a channel leaves a native RTP bridge, it may be leaving due to being hung up. Sending a re-INVITE to a channel that is about to be hung up is not nice - in fact, there's a good chance we'll send the BYE request before the channel has had a chance to send back a 200 OK. To be somewhat nicer, this patch adds a function to channel.h that allows the bridging framework to query for exactly why a channel is leaving a bridge via the channel's soft hangup flags. This allows it to only send the re-INVITE if there's a chance the channel will survive the native bridging experience. Review: https://reviewboard.asterisk.org/r/3535/ 2014-05-16 20:05 +0000 [r413993-414069] Richard Mudgett * /, channels/chan_dahdi.c: chan_dahdi: Fix analog dialtone detection. * Check if waitingfordt (waitfordialtone) is enabled in dahdi_read() to allow the DSP to operate early enough to detect dialtone. * Made use the correct variable in my_check_waitingfordt(). ASTERISK-23709 #close Reported by: Steve Davies Patches: dialtone_detect_fix (license #5012) patch uploaded by Steve Davies Review: https://reviewboard.asterisk.org/r/3534/ ........ Merged revisions 414067 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 414068 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/sig_pri.c: sig_pri.c: Pull the pri_dchannel() PRI_EVENT_RING case into its own function. * Populate the CALLERID(ani2) value (and the special CALLINGANI2 channel variable) with the ANI2 value in addition to the PRI specific ANI2 channel variable. * Made complete snapshot staging with the channel lock held. All channel snapshots need to be done while the channel lock is held. ........ Merged revisions 414050 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, apps/app_meetme.c: app_meetme: Fix overwrite of DAHDI conference data structure. Starting a conference recording using the admin menu overwrites the DAHDI conference data structure used to modify the admin user's conference mute mode. * Made no longer pass the user's DAHDI conference data structure into the menu functions. The menu now uses its own DAHDI conference data structure to start the recording channel. * Moved the unlock conf->playlock to before playing the conf-full message. No sense keeping the lock while that prompt is playing. The user is never going to get into the conference at that point. ........ Merged revisions 413991 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413992 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-14 15:39 +0000 [r413896] Walter Doekes * res/res_musiconhold.c, /: res_musiconhold: Minor cleanup. Fix a few free()'s that should be ast_free()'s. Reverted an old workaround that isn't necessary. Reorder a tiny bit of code. Remove a bit of commented-out code. Review: https://reviewboard.asterisk.org/r/3536/ ........ Merged revisions 413894 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413895 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-13 18:01 +0000 [r413877] Jonathan Rose * main/netsock2.c, /, channels/chan_sip.c, include/asterisk/netsock2.h: chan_sip: Add TLS and SRTP status to CLI command 'sip show channel' ASTERISK-23564 #close Reported by: Patrick Laimbock Review: https://reviewboard.asterisk.org/r/3474/ ........ Merged revisions 413876 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-13 13:52 +0000 [r413789-413792] Walter Doekes * res/res_format_attr_h264.c, /: h264: Fix H264 SDP payload format. https://tools.ietf.org/html/rfc3984#section-8.1 says profile-level-id takes 3 bytes in base16 (6 hex digits). This fixes video setup in certain cases. ASTERISK-23664 #close ASTERISK-23664 #comment Patch r3530.patch uploaded by Guillaume Maudoux. Review: https://reviewboard.asterisk.org/r/3530/ ........ Merged revisions 413791 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/rtp_engine.c, /: rtp: Fix case typo in H263+ mime. http://tools.ietf.org/html/rfc3555#section-4.2.6 says the canonical mime subtype is "H263-1998", not "h263-1998". Original code was added in r183101 on 2009-03-19 02:26:50 +0100. This fixes issues with Polycom phones. ASTERISK-23665 #close ASTERISK-23665 #comment Patch r3529.patch uploaded by Guillaume Maudoux, backported by me. Review: https://reviewboard.asterisk.org/r/3529/ ........ Merged revisions 413787 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413788 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-13 00:25 +0000 [r413766-413771] Richard Mudgett * /, configure, include/asterisk/autoconfig.h.in, configure.ac, channels/sig_pri.c: chan_dahdi/sig_pri: Prevent unnecessary PROGRESS events when overlap dialing is enabled. When overlap dialing is enabled, the lack of inband audio available information in the SETUP_ACKNOWLEDGE events causes an interoperability problem with SIP. sig_pri doesn't know if there is dialtone present when a SETUP_ACKNOWLEDGE is received so it assumes it is there and posts an AST_CONTROL_PROGRESS frame. The SIP channel driver then sends out a 183 Session Progress and blocks the desired 180 Ringing message when the ALERTING message comes in. * Made the configure script detect if the installed version of libpri supports the SETUP_ACKNOWLEDGE enhancements. * Using the new API, made generate an AST_CONTROL_PROGRESS frame on an incoming SETUP_ACKNOWLEDGE message when the message indicates inband audio is present instead of assuming that dialtone is present. * Using the new API, made SETUP_ACKNOWLEDGE send out an inband audio available indication only if dialtone is expected. The change also makes the fallback behaviour of sending the PROGRESS message better by sending it only if dialtone is expected. * Changed receiving a PROCEEDING message to not generate an AST_CONTROL_PROGRESS frame if the progress indication ie indicates non-end-to-end-ISDN. This helps interoperability with SIP. * Changed sending a PROCEEDING message in response to an AST_CONTROL_PROCEEDING frame to not indicate inband audio available. It was silly to do so anyway because the channel driver doesn't know if inband audio is even available. This helps interoperability with SIP. This patch and a corresponding change in libpri work together to allow Asterisk to control the inband audio available progress indication ie on the SETUP_ACKNOWLEDGE message when dialtone is present. AST-1338 #close Reported by: Tyler Stewart Review: https://reviewboard.asterisk.org/r/3521/ ........ Merged revisions 413714 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413765 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/sig_pri.c: Fix compiler warning from GCC 4.10 fixup. 2014-05-12 22:23 +0000 [r413712] Jonathan Rose * /, apps/app_chanspy.c: app_chanspy: Fix a test that was failing on account of r413551 ASTERISK-23381 #close ASTERISK-23381 #comment Reported by: Robert Moss Review: https://reviewboard.asterisk.org/r/3505/ ........ Merged revisions 413710 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-11 02:05 +0000 [r413650-413681] Joshua Colp * include/asterisk/channel.h, bridges/bridge_native_rtp.c, include/asterisk/framehook.h, main/channel.c, main/framehook.c, main/bridge_basic.c: framehooks: Add callback for determining if a hook is consuming frames of a specific type. In the past framehooks have had no capability to determine what frame types a hook is actually interested in consuming. This has meant that code has had to assume they want all frames, thus preventing native bridging. This change adds a callback which allows a framehook to be queried for whether it is consuming a frame of a specific type. The native RTP bridging module has also been updated to take advantange of this, allowing native bridging to occur when previously it would not. ASTERISK-23497 #comment Reported by: Etienne Lessard ASTERISK-23497 #close Review: https://reviewboard.asterisk.org/r/3522/ * main/framehook.c, main/bridge_basic.c, include/asterisk/channel.h, bridges/bridge_native_rtp.c, include/asterisk/framehook.h, main/channel.c: Undoing framehook support. Issues were uncovered by Bamboo. * include/asterisk/channel.h, bridges/bridge_native_rtp.c, include/asterisk/framehook.h, main/channel.c, main/framehook.c, main/bridge_basic.c: framehooks: Add callback for determining if a hook is consuming frames of a specific type. In the past framehooks have had no capability to determine what frame types a hook is actually interested in consuming. This has meant that code has had to assume they want all frames, thus preventing native bridging. This change adds a callback which allows a framehook to be queried for whether it is consuming a frame of a specific type. The native RTP bridging module has also been updated to take advantange of this, allowing native bridging to occur when previously it would not. ASTERISK-23497 #comment Reported by: Etienne Lessard ASTERISK-23497 #close Review: https://reviewboard.asterisk.org/r/3522/ 2014-05-09 23:13 +0000 [r413588-413597] Kinsey Moore * /, funcs/func_env.c: Fix 32bit build for func_env ........ Merged revisions 413592 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413595 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/slinfactory.c, main/core_unreal.c, main/acl.c, res/res_pjsip_t38.c, channels/sig_pri.c, channels/chan_jingle.c, channels/chan_dahdi.c, channels/sig_analog.c, include/asterisk/astobj.h, res/res_corosync.c, res/res_stun_monitor.c, apps/app_sms.c, main/audiohook.c, pbx/pbx_config.c, channels/iax2/firmware.c, apps/app_adsiprog.c, channels/chan_sip.c, funcs/func_sysinfo.c, main/utils.c, res/res_format_attr_h263.c, res/res_jabber.c, res/res_http_websocket.c, res/res_pktccops.c, res/res_monitor.c, main/file.c, res/res_pjsip/pjsip_configuration.c, main/adsi.c, channels/sip/include/sip.h, cel/cel_pgsql.c, main/pbx.c, res/res_calendar_icalendar.c, res/res_crypto.c, main/aoc.c, channels/chan_gtalk.c, main/netsock.c, res/res_ari_model.c, res/res_config_odbc.c, res/res_pjsip_outbound_registration.c, main/event.c, funcs/func_iconv.c, apps/app_stack.c, res/res_calendar.c, res/res_sorcery_config.c, main/frame.c, main/parking.c, res/res_format_attr_h264.c, channels/chan_iax2.c, apps/confbridge/conf_config_parser.c, funcs/func_hangupcause.c, main/manager.c, formats/format_pcm.c, funcs/func_srv.c, res/res_format_attr_silk.c, main/asterisk.c, main/xmldoc.c, res/res_rtp_asterisk.c, main/format.c, main/ccss.c, res/res_calendar_caldav.c, main/enum.c, main/config.c, res/res_srtp.c, main/loader.c, channels/pjsip/dialplan_functions.c, funcs/func_channel.c, main/bucket.c, main/abstract_jb.c, res/res_stasis_recording.c, apps/app_verbose.c, main/dsp.c, apps/app_voicemail.c, main/stun.c, main/security_events.c, apps/app_festival.c, res/res_timing_dahdi.c, main/devicestate.c, res/res_xmpp.c, apps/app_getcpeid.c, main/cli.c, res/res_format_attr_celt.c, main/manager_bridges.c, cel/cel_odbc.c, channels/chan_skinny.c, funcs/func_frame_trace.c, main/callerid.c, pbx/pbx_dundi.c, res/res_pjsip_pubsub.c, res/res_fax_spandsp.c, channels/chan_mgcp.c, res/res_stasis_playback.c, /, main/translate.c, cdr/cdr_adaptive_odbc.c, res/res_musiconhold.c, pbx/dundi-parser.c, apps/app_queue.c, res/res_calendar_ews.c, channels/iax2/parser.c, main/io.c, channels/chan_phone.c, res/res_agi.c, channels/chan_motif.c, apps/app_minivm.c, apps/app_dumpchan.c, main/logger.c, apps/app_confbridge.c, channels/sip/config_parser.c, res/res_odbc.c, main/manager_channels.c, main/udptl.c, apps/app_dial.c, res/res_fax.c, funcs/func_env.c, bridges/bridge_softmix.c, main/taskprocessor.c, res/res_stasis_snoop.c, res/res_format_attr_opus.c, res/ael/pval.c, main/channel.c, main/cdr.c, main/data.c, res/res_pjsip/location.c, main/config_options.c, main/app.c, channels/chan_alsa.c, main/stdtime/localtime.c, main/bridge_channel.c, res/res_pjsip_registrar.c, main/sched.c, channels/chan_unistim.c, main/rtp_engine.c: Allow Asterisk to compile under GCC 4.10 This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-09 16:35 +0000 [r413556] Jonathan Rose * apps/app_chanspy.c, /: app_chanspy: Fix a bug where Barge mode could fail If the barge audiohook was attached prior to the spyee and its peer actually being bridged, the audiohook would not be applied and the connected peer would not be able to hear audio from the spy when the spy is in barge mode. (closes issue ASTERISK-23381) Reported by: Robert Moss Review: https://reviewboard.asterisk.org/r/3505/ ........ Merged revisions 413551 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-08 00:35 +0000 [r413487] Joshua Colp * apps/app_queue.c, main/manager.c, /: app_queue: Extend documentation for various Manager actions and events. ........ Merged revisions 413485 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413486 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-07 20:58 +0000 [r413452-413454] Richard Mudgett * apps/app_confbridge.c: app_confbridge: Fixed "CBAnn" channels not going away. Fixed a ref leak in conf_handle_talker_cb() everytime the conference bridge was found to report a channel's talker status change. The resulting leak caused the "CBAnn" channels and the conference bridge to never be destroyed. Thanks to Richard Kenner on the asterisk-user's list for locating the problem. Reported by: Richard Kenner * /, apps/app_confbridge.c: app_confbridge: Fix ref leak in CLI "confbridge kick" command. Fixed ref leak in the CLI "confbridge kick" command when the channel to be kicked was not in the conference. ........ Merged revisions 413451 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-07 17:50 +0000 [r413306-413398] Mark Michelson * res/res_config_odbc.c, /: Fix encoding of custom prepare extra data. Patches: res_config_odbc-take2.patch by John Hardin (License #6512) ........ Merged revisions 413396 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413397 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_pjsip/presence_xml.c, res/res_pjsip_pidf_digium_body_supplement.c: Improve XML sanitization in NOTIFYs, especially for presence subtypes and messages. Embedded carriage return line feed combinations may appear in presence subtypes and messages since they may be derived from user input in an instant messenger client. As such, they need to be properly escaped so that XML parsers do not vomit when the messages are received. * res/res_pjsip_registrar.c: Check for an act on failures to update contacts during registration. There was an underlying issue in a realtime backend where database updates would fail. Since we were not checking for failure, we would end up in a strange state where the old database entry was still present but Asterisk thought that it had been updated. Now when an entry fails to update, we print a warning and delete the old contact from sorcery so there is no mismatch between foreground and backend state. Patches: res_pjsip_registrar.patch by John Hardin (License #6512) * res/res_config_odbc.c, /: Ensure that all parts of SQL UPDATEs and DELETEs are encoded. Patches: res_config_odbc.patch by John Hardin (License #6512) ........ Merged revisions 413304 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413305 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-02 20:35 +0000 [r413226-413282] Mark Michelson * res/res_config_odbc.c: Correct variable traversal logic in res_config_odbc's update_odbc function. Closes issue ASTERISK-23675 Reported by Leando Dardini Patches: asterisk-23675-odbc-linkedlist-traversal_12.diff uploaded by Michael L. Young (license #5026) * res/res_config_odbc.c, /: Prevent crashes in res_config_odbc due to uninitialized string fields. Patches: odbc-crash.patch by John Hardin (License #6512) ........ Merged revisions 413241 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413251 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, res/res_config_pgsql.c: Return the number of rows affected by a SQL insert, rather than an object ID. The realtime API specifies that the store callback is supposed to return the number of rows affected. res_config_pgsql was instead returning an Oid cast as an int, which during any nominal execution would be cast to 0. Returning 0 when more than 0 rows were inserted causes problems to the function's callers. To give an idea of how strange code can be, this is the necessary code change to fix a device state issue reported against chan_pjsip in Asterisk 12+. The issue was that the registrar would attempt to insert contacts into the database. Because of the 0 return from res_config_pgsql, the registrar would think that the contact was not successfully inserted, even though it actually was. As such, even though the contact was query-able and it was possible to call the endpoint, Asterisk would "think" the endpoint was unregistered, meaning it would report the device state as UNAVAILABLE instead of NOT_INUSE. The necessary fix applies to all versions of Asterisk, so even though the bug reported only applies to Asterisk 12+, the code correction is being inserted into 1.8+. Closes issue ASTERISK-23707 Reported by Mark Michelson ........ Merged revisions 413224 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413225 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-05-02 16:33 +0000 [r413210] Richard Mudgett * channels/chan_sip.c, UPGRADE.txt, res/res_pjsip_refer.c: res_pjsip_refer: Add Referred-By header on INVITE for blind transfers. Per rfc3892, the Referred-By header in a REFER must be copied into the referenced request (IE. The outgoing INVITE to the transfer target). * Automatically put the Referred-By header in the outgoing INVITE message if the SIPREFERREDBYHDR channel variable is defined with a value. * Made chan_sip.c:get_refer_info() set SIPREFERREDBYHDR for inheritance so chan_pjsip has a better chance to interoperate. * Fixed refer_blind_callback() and refer_incoming_refer_request() to not modify the data in the pointer returned by pjsip_msg_find_hdr_by_name(). It seems wrong to modify that data since the calling routine doesn't own the buffer. ASTERISK-23501 #close Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/3514/ 2014-05-02 15:58 +0000 [r413196] Jonathan Rose * CHANGES, res/parking/parking_bridge_features.c, res/parking/parking_manager.c, res/parking/res_parking.h: Parking: Add 'AnnounceChannel' argument to manager action 'Park' (closes ASTERISK-23397) Reported by: Denis Review: https://reviewboard.asterisk.org/r/3446/ 2014-05-01 15:41 +0000 [r413173] Mark Michelson * res/res_pjsip_exten_state.c: Remove unnecessary repetition checks from res_pjsip_exten_state The PBX core already takes care of ensuring that repeated state changes are not communicated to exten state consumers. Because the check in res_pjsip_exten_state was incomplete, it was causing valid presence state changes not to be sent out. For instance, if the presence state did not change but the message or subtype did, then no presence-related NOTIFY request would be sent out. closes issue ASTERISK-23672 Reported by Mark Michelson 2014-05-01 12:30 +0000 [r413159] Joshua Colp * res/res_pjsip/config_transport.c: res_pjsip: Add the ability to configure ciphers based on name. Previously this code would only accept the OpenSSL identifier instead of the documented name. ASTERISK-23498 #close ASTERISK-23498 #comment Reported by: Anthony Messina Review: https://reviewboard.asterisk.org/r/3491/ 2014-04-30 20:47 +0000 [r413142] Richard Mudgett * main/message.c, /, channels/chan_sip.c, include/asterisk/message.h, res/res_pjsip_messaging.c: chan_sip.c: Fixed off-nominal message iterator ref count and alloc fail issues. * Fixed early exit in sip_msg_send() not destroying the message iterator. * Made ast_msg_var_iterator_next() and ast_msg_var_iterator_destroy() tolerant of a NULL iter parameter in case ast_msg_var_iterator_init() fails. * Made ast_msg_var_iterator_destroy() clean up any current message data ref. * Made struct ast_msg_var_iterator, ast_msg_var_iterator_init(), ast_msg_var_iterator_next(), ast_msg_var_unref_current(), and ast_msg_var_iterator_destroy() use iter instead of i. * Eliminated RAII_VAR usage in res_pjsip_messaging.c:vars_to_headers(). ........ Merged revisions 413139 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-30 20:38 +0000 [r413140] Joshua Colp * channels/chan_pjsip.c: chan_pjsip: Fix deadlock when retrieving call-id of channel. If a task was in-flight which required the channel or bridge lock it was possible for the synchronous task retrieving the call-id to deadlock as it holds those locks. After discussing with Mark Michelson the synchronous task was removed and the call-id accessed directly. This should be safe as each object involved is guaranteed to exist and the call-id will never change. 2014-04-30 13:06 +0000 [r413124] Kinsey Moore * /, res/res_http_websocket.c: Websocket: Add session locking and delay close This resolves a race condition where data could be written to a NULL FILE pointer causing a crash as a websocket connection was in the process of shutting down by adding locking to websocket session writes and by deferring session teardown until session destruction. (closes issue ASTERISK-23605) Review: https://reviewboard.asterisk.org/r/3481/ Reported by: Matt Jordan ........ Merged revisions 413123 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-30 12:41 +0000 [r413117-413121] Joshua Colp * res/stasis/control.c: res_stasis: Add progress indications to operations which perform media. This change fixes operations which did not account for the fact that they may be executed on channels which have not been answered. These operations will now indicate progress when invoked. ASTERISK-23560 #close ASTERISk-23560 #comment Reported by: Jan Svoboda Review: https://reviewboard.asterisk.org/r/3495/ * res/res_pjsip_sdp_rtp.c: res_pjsip_sdp_rtp: Fix issue where sending a hold SDP twice could cause an unhold. This change fixes a bug where if an SDP with media address and sendonly was received twice the underlying call would go off hold, instead of remaining on hold. This occured because the code did not properly take into account that the SDP may contain both a valid media address and the sendonly attribute. The code now examines the sendonly attribute and media address first, so if the SDP is received again no change will occur. ASTERISK-23558 #comment Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/3472/ * channels/chan_pjsip.c, res/res_pjsip_session.c: chan_pjsip: Add support for picking up calls in the configured pickup group. AST-1363 Review: https://reviewboard.asterisk.org/r/3478/ 2014-04-29 15:09 +0000 [r413102] George Joseph * include/asterisk/spinlock.h: Add "destroy" implementation for spinlock. The original commit for spinlock was missing "destroy" implementations. Most of them are no-ops but phtread_spin and pthread_mutex do need their locks destroyed. 2014-04-29 11:19 +0000 [r413088] Joshua Colp * channels/chan_pjsip.c: chan_pjsip: Implement core ability to get Call-ID of a channel. This changes implement the "get_pvt_uniqueid" which is used to return the technology specific unique identifier. In the case of SIP this is the Call-ID of the dialog. Review: https://reviewboard.asterisk.org/r/3480/ 2014-04-28 20:01 +0000 [r413073] Kinsey Moore * main/bridge.c, main/bridge_basic.c: Bridging: Don't lock NULL bridges When bridge locking was added for bridge snapshot creation, some locations where bridge locking was added were not guaranteed to actually have a bridge and locking NULL AO2 objects tends to cause segfaults. This ensures that NULL bridges aren't locked. 2014-04-25 17:48 +0000 [r413009] Matthew Jordan * res/res_rtp_asterisk.c, /: res_rtp_asterisk: Add support for DTLS handshake retransmissions On congested networks, it is possible for the DTLS handshake messages to get lost. This patch adds a timer to res_rtp_asterisk that will periodically check to see if the handshake has succeeded. If not, it will retransmit the DTLS handshake. Review: https://reviewboard.asterisk.org/r/3337 ASTERISK-23649 #close Reported by: Nitesh Bansal patches: dtls_retransmission.patch uploaded by Nitesh Bansal (License 6418) ........ Merged revisions 413008 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-24 14:37 +0000 [r412992] Kevin Harwell * contrib/ast-db-manage/config/versions/e96a0b8071c_increase_pjsip_column_size.py (added): pjsip realtime: increase the size of some columns The string lengths on certain columns created through alembic for PJSIP were too short. For instance, columns containing URIs are currently set to 40 characters, but this can be too small and result in truncated values. Added an alembic migration script that increases the size of these columns and a few others to 255. ASTERISK-23639 #close Reported by: Mark Michelson Review: https://reviewboard.asterisk.org/r/3475/ 2014-04-23 20:06 +0000 [r412976] George Joseph * include/asterisk/spinlock.h (added), configure, include/asterisk/autoconfig.h.in, configure.ac: This patch adds support for spinlocks in Asterisk. There are cases in Asterisk where it might be desirable to lock a short critical code section but not incur the context switch and yield penalty of a mutex or rwlock. The primary spinlock implementations execute exclusively in userspace and therefore don't incur those penalties. Spinlocks are NOT meant to be a general replacement for mutexes. They should be used only for protecting short blocks of critical code such as simple compares and assignments. Operations that may block, hold a lock, or cause the thread to give up it's timeslice should NEVER be attempted in a spinlock. The first use case for spinlocks is in astobj2 - internal_ao2_ref. Currently the manipulation of the reference counter is done with an ast_atomic_fetchadd_int which works fine. When weak reference containers are introduced however, there's an additional comparison and assignment that'll need to be done while the lock is held. A mutex would be way too expensive here, hence the spinlock. Given that lock contention in this situation would be infrequent, the overhead of the spinlock is only a few more machine instructions than the current ast_atomic_fetchadd_int call. ASTERISK-23553 #close Review: https://reviewboard.asterisk.org/r/3405/ 2014-04-23 18:00 +0000 [r412924] Richard Mudgett * /, main/http.c: http: Fix spurious ERROR message in responses with no content. Backport -r411687 and fix the fix because content_length is the length of out plus the length of the file controlled by fd. When a response has an out content length of 0, fwrite would be called to write a buffer with no data in it. This resulted in the following classic error message: [Apr 3 11:49:17] ERROR[26421] http.c: fwrite() failed: Success This patch makes it so that we only attempt to write the content of out if the out string is non-zero. ........ Merged revisions 412922 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412923 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-22 10:09 +0000 [r412882] Joshua Colp * res/stasis/app.c: res_stasis: Fix crash when handling a failed blind transfer message. This changes fixes a crash that occurs when stasis determines if it should send a message out to an application or not. The code incorrectly assumed that a bridge snapshot would always be present when in reality for failure cases it may not be. ASTERISK-23573 #close 2014-04-21 17:54 +0000 [r412823] Jonathan Rose * /, CHANGES: chan_sip: trust_id_outbound CHANGES message improvement (closes issue AST-1301) (closes issue ASTERISK-19465) Reported by: Krzysztof Chmielewski ........ Merged revisions 412821 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412822 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-21 16:15 +0000 [r412749] Kinsey Moore * main/manager.c, /, main/http.c: HTTP: Add TCP_NODELAY to accepted connections This adds the TCP_NODELAY option to accepted connections on the HTTP server built into Asterisk. This option disables the Nagle algorithm which controls queueing of outbound data and in some cases can cause delays on receipt of response by the client due to how the Nagle algorithm interacts with TCP delayed ACK. This option is already set on all non-HTTP AMI connections and this change would cover standard HTTP requests, manager HTTP connections, and ARI HTTP requests and websockets in Asterisk 12+ along with any future use of the HTTP server. Review: https://reviewboard.asterisk.org/r/3466/ ........ Merged revisions 412745 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412748 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-21 16:05 +0000 [r412747] Jonathan Rose * /, channels/chan_sip.c, configs/sip.conf.sample, CHANGES, channels/sip/include/sip.h: chan_sip: Add sendrpid trust options In r411189, some behavior was changed which made sendrpid behavior act in a more trusting manner by sending full user data for peers set with private caller presence in P-Asserted-Identity headers. Since this changed long time expected behaviors, we decided to pull that patch when that was pointed out by the community. Instead, this patch provides a trust_id_outbound setting which will expose the data per RFC-3325 if set to 'yes' and simply not send the PAI/RPID headers at all if set to 'no'. By default trust_id_outbound will be set to 'legacy' which will preserve the behavior prior to these patches. Extra special thanks to Walter Doekes for providing advice and feedback. (closes issue AST-1301) (closes issue ASTERISK-19465) Reported by: Krzysztof Chmielewski Review: https://reviewboard.asterisk.org/r/3447/ ........ Merged revisions 412744 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412746 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-21 14:57 +0000 [r412728-412730] Kinsey Moore * apps/app_confbridge.c: Confbridge: Fix ConfbridgeKick AMI documentation This adds documentation for the "all" channel option for the ConfbridgeKick AMI action and adjusts AMI responses accordingly. (issue ASTERISK-23282) Reported by: Dorian Logan * apps/app_confbridge.c: Confbridge: Add references for kick all option After the ability to kick all attendees from a conference was added, a rework removed the comment about that feature from the CLI documentation. This adds that documentation and adds "all" to the participant tab completion list for the confbridge kick command. (closes issue ASTERISK-23282) Reported by: Dorian Logan 2014-04-21 08:31 +0000 [r412713] Igor Goncharovskiy * channels/chan_unistim.c, /: Fix wrong dialtone. The "modulation" should not be referenced for tone+tone as it refers to the on-off characteristic - this often resulted in a single tone rather than the multitone as in the UK. ........ Merged revisions 412712 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-19 02:13 +0000 [r412657-412698] Matthew Jordan * main/asterisk.c: main/asterisk: Fix startup sequence for realtime features When ASTERISK-23265/ASTERISK-23320 was fixed, it inadvertently led to realtime features breaking. This was due to features loading prior to realtime. This patch fixes this by loading features after loading dynamic modules. ASTERISK-23487 #close Reported by: Denis Tested by: Denis * /, apps/app_sms.c: app_sms: Fix uninitialized values; hangup channel when REL is sent successfully This patch fixes two issues in app_sms: (1) Firstly, the 'flags' field on the stack in sms_exec() is uninitialised, causing it to use the wrong protocol in some cases. This patch correctly initializes the flags fields. (2) Secondly, when disconnect supervision is not working or inbanddisconnect=yes is set in chan_dahdi.conf, app_sms was failing to terminate the call after it sent the REL(ease) message and the peer stopped talking to it. This patch fixes the code to handle the 'bad stop bit' message more gracefully in that case, and hang up the call. Review: https://reviewboard.asterisk.org/r/1392/ ASTERISK-18331 #close Reported by: David Woodhouse patches: asterisk-fix-sms.patch uploaded by David Woodhouse (License 5754) ........ Merged revisions 412655 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412656 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-18 20:26 +0000 [r412639-412653] Jonathan Rose * res/ari/resource_bridges.h, res/ari/resource_recordings.h, rest-api-templates/ari_resource.h.mustache, res/ari/resource_device_states.h, res/ari/resource_endpoints.h, res/ari/resource_mailboxes.h, res/ari/resource_events.h, res/ari/resource_asterisk.h, res/ari/resource_applications.h, res/ari/resource_playbacks.h, res/ari/resource_channels.h, res/ari/resource_sounds.h: ARI: Remove unnecessary \briefs from automatically generated documentation Review: https://reviewboard.asterisk.org/r/3440/ * include/asterisk/stasis_app.h, res/stasis/control.h, res/ari/resource_channels.c, CHANGES, res/res_stasis.c, rest-api/api-docs/bridges.json, res/ari/resource_bridges.c, res/res_ari_bridges.c, res/res_stasis_playback.c, res/ari/resource_bridges.h, res/stasis/control.c: ARI: Make bridges/{bridgeID}/play queue sound files Previously multiple play actions against a bridge at one time would cause the sounds to play simultaneously on the bridge. Now if a sound is already playing, the play action will queue playback to occur after the completion of other sounds currently on the queue. (closes issue ASTERISK-22677) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/3379/ 2014-04-18 17:16 +0000 [r412587] Rusty Newton * /, sounds/sounds.xml, sounds/Makefile: sounds: Fix Sounds Makefile and XML that didn't support new sound prompt sets In sounds/Makefile 1 Adds and moves some lines necessary for the en_GB core set. I'm just following how the other sets are defined here. 2 removes the ES extra sounds related lines as we don't have ES extra sound sets. In sounds/sounds.xml 3 Adds member definitons for EN_AU, EN_GB, IT for core sound sets, and EN_GB in extra sound sets ASTERISK-23550 #close Review: https://reviewboard.asterisk.org/r/3464/ ........ Merged revisions 412586 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-18 16:39 +0000 [r412582] Mark Michelson * res/res_pjsip/location.c: Allow for multiple contacts to be configured in a single contact= line. This is useful for configuring multiple permanent contacts for an AOR when using realtime AORs. Review: https://reviewboard.asterisk.org/r/3462 2014-04-18 16:38 +0000 [r412579-412581] Richard Mudgett * apps/app_originate.c, include/asterisk/pbx.h, main/dial.c, main/pbx.c: Originated calls: Fix several originate call problems. * Restore the reason value set by pbx_outgoing_attempt() to use AST_CONTROL_xxx values as all the consumers were expecting rather than cause codes. * Fixed the dial routines to set cause codes for more than just ast_request() so pbx_outgoing_attempt() reason codes will function. * Fix inconsistent locked_channel return status in pbx_outgoing_attempt(). The chanel may not have been locked or the channel may have been a stale pointer. * Fixed the OutgoingSpoolFailed channel to run dialplan whenever the dialing fails for an originate exten and 1 < synchronous. * Fix incorrect ast_cond_wait() usage in pbx_outgoing_attempt(). Indroduced by issue ASTERISK-22212 patch. * Made struct pbx_outgoing use the ao2 lock instead of its own lock for the cond wait mutex. No sense in having two locks associated with the same struct when only one is needed. Review: https://reviewboard.asterisk.org/r/3421/ * main/stasis_channels.c, apps/app_queue.c, apps/app_dial.c: app_dial and app_queue: Make lock the forwarding channel while taking the channel snapshot. * Fixed ast_channel_publish_dial_forward() not locking the forwarded channel when taking the channel snapshot. * Fixed app_dial.c:do_forward() using the wrong channel to get the original call forwarding string. * Removed unnecessary locking when calling ast_channel_publish_dial() and ast_channel_publish_dial_forward() in app_dial and app_queue. Holding channel locks when calling ast_channel_publish_dial_forward() with a forwarded channel could result in pausing the system while the stasis bus completes processsing a forwarded channel subscription. Review: https://reviewboard.asterisk.org/r/3451/ 2014-04-18 14:21 +0000 [r412565] Kinsey Moore * res/ari/ari_websockets.c, res/res_ari.c, main/manager.c: ARI: Add debug logging for events and responses This adds DEBUG level logging for ARI websocket events and HTTP responses similar to what is available for AMI. Logging for ARI HTTP requests is already adequate for debugging purposes. 2014-04-17 22:49 +0000 [r412551] Joshua Colp * res/res_pjsip/pjsip_options.c, res/res_pjsip.c, res/res_pjsip_registrar.c, res/res_pjsip/location.c, res/res_pjsip/pjsip_configuration.c: res_pjsip: Handle reloading when permanent contacts exist and qualify is configured. This change fixes a problem where permanent contacts being qualified were not being updated. This was caused by the permanent contacts getting a uuid and not a known identifier, causing an inability to look them up when updating in the qualify code. A bug also existed where the new configuration may not be available immediately when updating qualifies. (closes issue ASTERISK-23514) Reported by: Richard Mudgett Review: https://reviewboard.asterisk.org/r/3448/ 2014-04-17 22:42 +0000 [r412535-412549] Jonathan Rose * main/app.c: Fix a silly shadowed variable mistake that was missed from play tones patch * main/app.c, rest-api/api-docs/channels.json, CHANGES, rest-api/api-docs/bridges.json, res/ari/resource_channels.h, include/asterisk/app.h, res/res_stasis_playback.c, res/ari/resource_bridges.h: ARI: Add tones playback resource Adds a tones URI type to the playback resource. The tone can be specified by name (from indications.conf) or by a tone pattern. In addition, tonezone can be specified in the URI (by appending ;tonezone=). Tones must be stopped manually in order for a stasis control to move on from playback of the tone. Tones may be paused, resumed, restarted, and stopped. They may not be rewound or fast forwarded (tones can't be controlled in a way that lets you skip around from note to note and pausing and resuming will also restart the tone from the beginning). Tests are currently in development for this feature (https://reviewboard.asterisk.org/r/3428/). (closes issue ASTERISK-23433) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3427/ 2014-04-17 20:24 +0000 [r412483] Matthew Jordan * channels/chan_oss.c, /, main/Makefile: main/Makefile: Fix build failure on SmartOS/Illumos/SunOS This patch fixes two issues when building on SmartOS: - channels/chan_oss.c: it makes sure soundcard.h is found - main/Makefile: only use "-Wl,--version-script" when GNU LD is used as the Sun Linker doesn't support that. Similar checks are already used elswhere in the Makefile Review: https://reviewboard.asterisk.org/r/3426 ASTERISK-23576 #close Reported by: Sebastian Wiedenroth patches: fix-sunos.diff uploaded by Sebastian Wiedenroth (License 6597) ........ Merged revisions 412468 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-17 15:16 +0000 [r412453] Kevin Harwell * res/res_pjsip_refer.c: res_pjsip_refer: Channel variable SIPREFERTOHDR not being set during blind transfer The SIPREFERTOHDR channel variable is not being set on any channel when performing a blind transfer using PJSIP. The 'refer->refer_to' was not being set during a blind transfer. Updated so the 'refer_to' is set to the target uri on a blind transfer. (closes issue ASTERISK-23502) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/3445/ 2014-04-16 19:13 +0000 [r412439] Kinsey Moore * include/asterisk/stasis_app.h: Stasis: Add a usage note on stasis_app_get_bridge This function returns an ast_bridge without a refcount bump and the caller must increment the count if it intends to hold the pointer. (closes issue ASTERISK-23588) Review: https://reviewboard.asterisk.org/r/3450/ Reported by: Matt Jordan 2014-04-15 18:27 +0000 [r412383-412413] Richard Mudgett * res/res_parking.c, main/rtp_engine.c, main/stasis_channels.c, main/features_config.c: Eliminate some more unnecessary RAII_VAR() uses. RAII_VAR() is not a hammer appropriate to pound all nails. * res/res_pjsip/security_events.c, res/parking/parking_applications.c, channels/chan_oss.c, main/stasis_bridges.c, res/res_pjsip_session.c, res/stasis_recording/stored.c, main/cdr.c, res/res_parking.c, channels/chan_skinny.c, res/res_pjsip/location.c, res/res_stasis_recording.c, main/stasis_channels.c, res/ari/resource_channels.c, res/parking/parking_manager.c, res/ari/resource_recordings.c, res/res_pjsip_refer.c, main/pbx.c, res/res_ari.c, res/res_stasis_playback.c, res/stasis/app.c, res/res_fax.c: Remove unused RAII_VAR() declarations. * Remove unused RAII_VAR() declarations. The compiler cannot catch these because the cleanup function "references" the unused variable. Some actually allocated and released resources that were never used. * Fixed some whitespace issues in stasis_bridges.c. * include/asterisk/rtp_engine.h, main/rtp_engine.c, channels/chan_sip.c: chan_sip.c: Fix channel staging assertion failure. The failing assertion ensures that the final snapshot gets generated so CDR records can get finalized. The only place where a channel staging snapshot flag could be left set is in chan_sip.c:handle_request_bye(). The function could return before clearing the flag because the channel could dissappear while the function had to have the channel unlocked. * Fixed handle_request_bye() channel snapshot staging coverage area to not have a return in the middle of it and be unable to clear the staging flag. * Pushed the channel snapshot staging coverage area into ast_rtp_instance_set_stats_vars() to ensure that the staging is not interrutped. * Made callers of ast_rtp_instance_set_stats_vars() not call it with any channels or channel driver private locks held to eliminate the deadlock potential. The callers must hold references to the passed in channel and rtp objects. * Eliminated sip_hangup() trying to get the bridge peer. It is futile at this point because the channel could never be in a bridge. Review: https://reviewboard.asterisk.org/r/3431/ * /, channels/chan_sip.c: chan_sip.c: Moved some sip_pvt unrefs after their last use. * Moved sip_pvt unref in ast_hangup() and handle_request_do() to the end of the function. The unref needs to happen after the last use of the pointer. ........ Merged revisions 412348 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-15 15:58 +0000 [r412330] Jonathan Rose * /, channels/chan_sip.c, configs/sip.conf.sample: Reverting r411189 so that it can be put up for public review --- r411189 | jrose | 2014-03-26 10:50:48 -0500 (Wed, 26 Mar 2014) | 12 lines chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325) Prior to this patch, the P-Asserted-Identity header would include anonymous caller id information which seems to go against the point of the P-Asserted-Identity header. Now the real caller ID information will be included in this header. Also, no privacy header would be included. This patch adds 'Privacy: id' to outgoing SIP messages that include the P-Asserted-Identity header. (closes issue AST-1301) --- ........ Merged revisions 412328 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412329 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-14 15:53 +0000 [r412306] Corey Farrell * /, main/autoservice.c: autoservice: fix reference leak of logger callid. autoservice acquires a local reference to the logger callid of each channel in a loop. This local reference was not released, causing the callid of every channel in autoservice to leak. This change moves the callid unref inside the loop. ASTERISK-23616 #close Reported by: ibercom ........ Merged revisions 412305 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-11 21:41 +0000 [r412227] Richard Mudgett * apps/app_stack.c, /: app_stack: Add missing unlock in off-nominal path of STACK_PEEK function. ASTERISK-23620 #close Reported by: Bradley Watkins Patches: ASTERISK-23620_unlock_oldlist.patch (license #5021) patch uploaded by Bradley Watkins ........ Merged revisions 412225 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412226 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-11 12:35 +0000 [r412193] Kinsey Moore * res/ari/resource_bridges.c, main/bridge.c, main/bridge_basic.c, include/asterisk/stasis_bridges.h, tests/test_cel.c, apps/app_confbridge.c: bridging: Ensure locking during snapshot creation While the vast majority of bridge snapshot creation is locked properly, there are currently some instances that are not. This adds the missing locking to ensure bridge state is not malleable during snapshot creation. (closes issue ASTERISK-22904) Review: https://reviewboard.asterisk.org/r/3415/ Reported by: Matt Jordan 2014-04-11 02:48 +0000 [r412088-412153] Matthew Jordan * build_tools/cflags.xml, /, channels/chan_sip.c, channels/sip/security_events.c, include/asterisk/astobj2.h, main/astobj2.c, contrib/scripts/refcounter.py (added), main/asterisk.c: main/astobj2: Make REF_DEBUG a menuselect item; improve REF_DEBUG output This patch does the following: (1) It makes REF_DEBUG a meneselect item. Enabling REF_DEBUG now enables REF_DEBUG globally throughout Asterisk. (2) The ref debug log file is now created in the AST_LOG_DIR directory. Every run will now blow away the previous run (as large ref files sometimes caused issues). We now also no longer open/close the file on each write, instead relying on fflush to make sure data gets written to the file (in case the ao2 call being performed is about to cause a crash) (3) It goes with a comma delineated format for the ref debug file. This makes parsing much easier. This also now includes the thread ID of the thread that caused ref change. (4) A new python script instead for refcounting has been added in the contrib/scripts folder. Review: https://reviewboard.asterisk.org/r/3377/ ........ Merged revisions 412114 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 412115 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_hep_pjsip.c: res_hep_pjsip: Use the channel name instead of the call ID when it is available During discussions with Alexandr Dubovikov at Kamailio World, it became apparent that while the SIP call ID is a useful identifier prior to an Asterisk channel being created, it is far more preferable to use the channel name (or some channel based identifier) when the channel is available. Homer is smart enough to tie the various messages together. This patch opts to use the channel name when it is available, falling back to the call ID otherwise. 2014-04-10 21:07 +0000 [r412074] Kevin Harwell * res/res_pjsip_pubsub.c: res_pjsip_pubsub: Set the body generation result to 0 for a valid path The result of the "ast_sip_pubsub_generate_body_content" was not set/initialized. Consequently, the nominal path potentially returned an invalid value, thus not sending mwi notifications. 2014-04-09 20:32 +0000 [r412048] Mark Michelson * CHANGES, apps/app_mixmonitor.c: Add a Command header to the AMI Mixmonitor action. This fixes a parsing error that occurred during the processing of the AMI action. The error did not result in MixMonitor itself misbehaving, but it could result in the AMI response not giving correct information back. The new header allows for one to specify a post-process command to run when recording finishes. Previously, in order to do this, the post-process command would have to be placed at the end of the Options: header. Patches: mixmonitor_command_2.patch by jhardin (License #6512) 2014-04-09 18:16 +0000 [r412034] Kinsey Moore * res/res_stasis_answer.c: res_stasis_answer: Add missing newlines 2014-04-08 21:23 +0000 [r411945-411985] Richard Mudgett * /, main/asterisk.c: Internal timing: Add notice that the -I and internal_timing option are no longer needed. Add notice messages during execution that the -I command line option and the astersik.conf internal_timing option are no longer needed. The internal timing functionality is now always enabled if there is a timing module loaded. NOTE: Since the command line options and the asterisk.conf config file are processed before the logging system is initialized, the messages are output to stderr. Change requested as a result of asterisk-dev list comments about the commit for ASTERISK-22846 that removed the -I and internal_timing options. Review: https://reviewboard.asterisk.org/r/3423/ ........ Merged revisions 411964 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411974 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/config.c, /: config: Fix CB_ADD_LEN() to work as originally intended. Fix a long standing bug in CB_ADD_LEN() behaving like CB_ADD(). ASTERISK-23546 #close Reported by: Walter Doekes ........ Merged revisions 411960 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411961 from http://svn.asterisk.org/svn/asterisk/branches/11 * apps/confbridge/conf_config_parser.c, /: app_confbridge: Fix confbridge.conf dsp_talking_threshold option setting wrong parameter. Fixed copy pasta error. ASTERISK-23545 #close Reported by: John Knott ........ Merged revisions 411944 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-08 14:48 +0000 [r411927] Joshua Colp * res/res_pjsip.c: res_pjsip: Ignore explicit transport configuration if a WebSocket transport is specified. This change makes it so if a transport is configured on an endpoint that is a WebSocket type the option will be ignored. In practice this is fine because the WebSocket transport can not create outgoing connections, it can only reuse existing ones. By ignoring the option the existing PJSIP logic for using the existing connection will be invoked and stuff will proceed. (closes issue ASTERISK-23584) Reported by: Rusty Newton 2014-04-07 20:39 +0000 [r411883] Kinsey Moore * res/res_pjsip_pubsub.c: PJSIP: Ensure test event has new state The change that fixed the pubsub test event's use of a dangling pointer also changed when it was processed relative to the pjsip subscription state change processing. This change corrects the order of events while holding a reference to the pointer that was previously dangling. 2014-04-07 16:02 +0000 [r411868] Jonathan Rose * main/manager_channels.c: AGI/Manager: Prevent multiple NewExten events during AGI application changes AGI applications would trigger NewExten events every time the state of the AGI application changed. This has historically not been the behavior and this behavior was introduced with a CDR patch. This patch corrects that. (closes issue ASTERISK-23390) Reported by: Benjamin Keith Ford Review: https://reviewboard.asterisk.org/r/3406/ 2014-04-07 14:55 +0000 [r411809-411811] Walter Doekes * apps/app_queue.c: app_queue: Re-add HoldTime to QueueCallerAbandon event (simple typo during ast12 refactor). Reported by: Ibrahim22 (on IRC) Tested by: Ibrahim22 * configs/res_odbc.conf.sample, /, UPGRADE.txt: configs: Clean up long line and typo in res_odbc.conf.sample. ........ Merged revisions 411807 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411808 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-07 14:28 +0000 [r411790-411804] Kinsey Moore * res/res_stasis.c: Stasis: Fix Stasis() bridge refcount issue The Stasis() dialplan application monitors what bridge a channel is in and so necessarily holds on to a bridge pointer. This change ensures that it also holds on to a reference for that bridge to prevent the bridge pointer from becoming a dangling pointer. * res/res_pjsip_pubsub.c: PJSIP: Fix crash introduced in r411671 The test event introduced in revision 411671 uses a dangling pointer to access information about pubsub state changes. This moves the event to within the lifetime of the pointer. 2014-04-04 19:02 +0000 [r411701-411717] Richard Mudgett * include/asterisk/options.h, main/asterisk.c, main/channel.c, /, channels/chan_sip.c, configs/asterisk.conf.sample, UPGRADE.txt: internal_timing: Remove the option and always make it enabled if a timing module is loaded. The masquerade supertest frequently fails because either the local channel chain doesn't completely optimize out or the DTMF handshake doesn't completely get accross. Local channel optimization requires frames flowing to trigger when optimization can happen. When optimization happens the media frame that triggered the optimization is dropped. Sending DTMF requires frames to flow in the other direction for timing purposes while sending nothing. If internal timing is not enabled when MOH is playing, Asterisk switches to received timing when an audio frame is received. With optimization dropping media frames and MOH not sending frames unless it receives frames, occasionaly there are no more frames being passed and the test fails. * The asterisk command line -I option and the asterisk.conf internal_timing option are removed. Asterisk now always uses internal timing when needed if any timing module is loaded. The issue ASTERISK-14861 did this quite awhile ago in v1.4 but effectively is broken if other internal timing modules besides DAHDI are used. The ast_read_generator_actions() now only does received timing if it has no choice for frame generators like MOH, silence, and playback streaming. * Cleaned up some code dealing with frame generators in ast_deactivate_generator(), generator_write_format_change(), ast_activate_generator(), and ast_channel_stop_silence_generator(). ASTERISK-22846 #close Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3414/ ........ Merged revisions 411715 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411716 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/stasis_cache.c, main/utils.c, res/res_musiconhold.c, main/channel.c: Add some asserts that were handy when looking for a stasis cache problem. * Assert if a channel is destroyed but has the snapshot staging flag set. In this case the final channel destruction snapshot would never get taken. * Assert if what we just got out of the stasis cache is not what we were looking for. This assert would have saved several days searching for a bug and a lot of my hair. * Assert if the music on hold message posts could not find the associated channel. A crash will happen later when manager tries to send the MOH AMI message. This assert catches the problem when the stasis message is posted instead of by the thread processing the defective message. * Always generate a backtrace when an ast_assert() fails. Review: https://reviewboard.asterisk.org/r/3411/ 2014-04-04 15:11 +0000 [r411687] Matthew Jordan * main/http.c: http: Fix spurious ERROR message in responses with no content When a response has a content length of 0, fwrite would be called to write a buffer with no data in it. This resulted in the following classic error message: [Apr 3 11:49:17] ERROR[26421] http.c: fwrite() failed: Success This patch makes it so that we only attempt to write out the content if the calculated content_length is non-zero. 2014-04-03 11:57 +0000 [r411670] Kinsey Moore * res/res_pjsip_pubsub.c: res_pjsip_pubsub: Add test event for state change This adds a test event when subscription state changes so that integration tests may trigger new actions at the appropriate times. Review: https://reviewboard.asterisk.org/r/3383/ 2014-04-03 11:43 +0000 [r411668] Matthew Jordan * res/res_hep.c: res_hep: Fix crash when hep.conf not available Parts of res_hep properly checked for a valid configuration object before attempting to access the configuration. A check, however, was missed when a packet is sent. This patch fixes the crash caused by not checking if the configuration object is valid. 2014-04-01 22:41 +0000 [r411636-411638] Richard Mudgett * res/parking/parking_bridge.c: res_parking: Minor tweaks. * Use ast_bridge_channel_lock()/ast_bridge_channel_unlock() instead of ao2_lock()/ao2_unlock() for struct ast_bridge_channel variables. * Use ast_copy_string() instead of inlining it. * Remove an already done TODO comment. * Some whitespace tweaks. * main/stasis_channels.c: stasis_channels.c: Eliminate another overuse of RAII_VAR(). 2014-04-01 16:51 +0000 [r411586] Joshua Colp * /, apps/app_queue.c: app_queue: Fix a bug where realtime members would be deleted during reload causing waiting callers to get ejected. This patch causes realtime queue members to remain in queues during the reload process. Previously these members would be removed causing any waiting callers to be ejected from the queue with a reason of "EXITEMPTY". ASTERISK-23547 #close ASTERISK-23547 #comment Patch app_queue_fix_realtime_reload_1.8_trunk.patch submitted by Italo Rossi (license 6409) Review: https://reviewboard.asterisk.org/r/3404/ ........ Merged revisions 411584 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411585 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-04-23 Asterisk Development Team * Asterisk 12.2.0 Released. 2014-04-21 Asterisk Development Team * Asterisk 12.2.0-rc3 Released. * chan_sip: Add sendrpid trust options In r411189, some behavior was changed which made sendrpid behavior act in a more trusting manner by sending full user data for peers set with private caller presence in P-Asserted-Identity headers. Since this changed long time expected behaviors, we decided to pull that patch when that was pointed out by the community. Instead, this patch provides a trust_id_outbound setting which will expose the data per RFC-3325 if set to 'yes' and simply not send the PAI/RPID headers at all if set to 'no'. By default trust_id_outbound will be set to 'legacy' which will preserve the behavior prior to these patches. Extra special thanks to Walter Doekes for providing advice and feedback. * main/asterisk: Fix startup sequence for realtime features When ASTERISK-23265/ASTERISK-23320 was fixed, it inadvertently led to realtime features breaking. This was due to features loading prior to realtime. This patch fixes this by loading features after loading dynamic modules. 2014-04-14 Asterisk Development Team * Asterisk 12.2.0-rc2 Released. * autoservice: fix reference leak of logger callid. autoservice acquires a local reference to the logger callid of each channel in a loop. This local reference was not released, causing the callid of every channel in autoservice to leak. This change moves the callid unref inside the loop. ASTERISK-23616 #close Reported by: ibercom * res_hep_pjsip: Use the channel name instead of the call ID when it is available During discussions with Alexandr Dubovikov at Kamailio World, it became apparent that while the SIP call ID is a useful identifier prior to an Asterisk channel being created, it is far more preferable to use the channel name (or some channel based identifier) when the channel is available. Homer is smart enough to tie the various messages together. This patch opts to use the channel name when it is available, falling back to the call ID otherwise. * res_pjsip_pubsub: Set the body generation result to 0 for a valid path The result of the "ast_sip_pubsub_generate_body_content" was not set/initialized. Consequently, the nominal path potentially returned an invalid value, thus not sending mwi notifications. * Stasis: Fix Stasis() bridge refcount issue The Stasis() dialplan application monitors what bridge a channel is in and so necessarily holds on to a bridge pointer. This change ensures that it also holds on to a reference for that bridge to prevent the bridge pointer from becoming a dangling pointer. * http: Fix spurious ERROR message in responses with no content When a response has a content length of 0, fwrite would be called to write a buffer with no data in it. This resulted in the following classic error message: [Apr 3 11:49:17] ERROR[26421] http.c: fwrite() failed: Success This patch makes it so that we only attempt to write out the content if the calculated content_length is non-zero. * res_hep: Fix crash when hep.conf not available Parts of res_hep properly checked for a valid configuration object before attempting to access the configuration. A check, however, was missed when a packet is sent. This patch fixes the crash caused by not checking if the configuration object is valid. 2014-03-28 Asterisk Development Team * Asterisk 12.2.0-rc1 Released. 2014-03-28 18:09 +0000 [r411534] Matthew Jordan * include/asterisk/res_hep.h (added), res/res_hep_pjsip.c (added), res/res_hep.exports.in (added), CHANGES, configs/hep.conf.sample (added), res/res_hep.c (added): res_hep/res_hep_pjsip: Add a HEPv3 capture agent module and a logger for PJSIP This patch adds the following: (1) A new module, res_hep, which implements a generic packet capture agent for the Homer Encapsulation Protocol (HEP) version 3. Note that this code is based on a patch provided by Alexandr Dubovikov; I basically just wrapped it up, added configuration via the configuration framework, and threw in a taskprocessor. (2) A new module, res_hep_pjsip, which forwards all SIP message traffic that passes through the res_pjsip stack over to res_hep for encapsulation and transmission to a HEPv3 capture server. Much thanks to Alexandr for his Asterisk patch for this code and for a *lot* of patience waiting for me to port it to 12/trunk. Due to some dithering on my part, this has taken the better part of a year to port forward (I still blame CDRs for the delay). ASTERISK-23557 #close Review: https://reviewboard.asterisk.org/r/3207/ 2014-03-28 17:52 +0000 [r411532] Alexandr Anikin * addons/ooh323c/src/oochannels.c, addons/ooh323c/src/ooCmdChannel.c, addons/ooh323c/src/ooq931.c, addons/ooh323c/src/ooh323.c, addons/ooh323c/src/ooGkClient.c, addons/chan_ooh323.c, /: process stack command even if gatekeeper client isn't register don't destroy gatekeeper client if it is not started don't destroy gatekeeper client in some sort of gatekeeper errors signal rtp create condition when call cleared before rtp structure created (closes issue ASTERISK-23460) Reported by: Dmitry Melekhov Patches: ASTERISK-23460-2.patch Tested by: Dmitry Melekhov ........ Merged revisions 411531 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-28 17:35 +0000 [r411529] Matthew Jordan * rest-api/api-docs/applications.json, rest-api/api-docs/playbacks.json, UPGRADE.txt, rest-api/api-docs/channels.json, rest-api/api-docs/sounds.json, rest-api/resources.json, CHANGES, include/asterisk/manager.h, rest-api/api-docs/bridges.json, rest-api/api-docs/recordings.json, rest-api/api-docs/deviceStates.json, rest-api/api-docs/endpoints.json, rest-api/api-docs/mailboxes.json, rest-api/api-docs/events.json, rest-api/api-docs/asterisk.json: Update API versions and UPGRADE/CHANGES for 12.2.0 This patch does the following: * It updates the AMI version to 2.2.0 to indicate backwards compatible changes have been made since the last release * It updates the ARI version to 1.2.0 to indicate backwards compatible changes have been made since the last release * It updates the UPGRADE/CHANGES files with changes that were not mentioned 2014-03-28 17:08 +0000 [r411514] Mark Michelson * contrib/ast-db-manage/config/versions/3855ee4e5f85_add_missing_pjsip_options.py (added): Add alembic script that adds contact user_agent and endpoint message_context. 2014-03-28 16:48 +0000 [r411512] Matthew Jordan * /, res/res_odbc.exports.in, UPGRADE.txt, res/res_odbc.c, configs/res_odbc.conf.sample, include/asterisk/res_odbc.h, res/res_config_odbc.c: res_config_odbc/res_odbc: Fix handling of non-text columns updates with empty values. This patch fixes setting nullable integer columns to NULL instead of an empty string, which fails for PostgreSQL, for example. The current code is supposed to do so, but the check is broken. The patch also allows the first column in the list to be a nullable integer. This patch also adds a compatibility setting in res_odbc.conf, allow_empty_string_in_nontext. It is enabled by default. It should be disabled for database backends (such as PostgreSQL) that require NULL instead of an empty string for Integer columns. Review: https://reviewboard.asterisk.org/r/3375 (issue ASTERISK-23459) Reported by: zvision patches: res_config_odbc.diff uploaded by zvision (License 5755) ........ Merged revisions 411399 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411408 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-28 16:17 +0000 [r411465] Scott Griepentrog * main/tcptls.c, main/manager.c, /, main/http.c: http: response body often missing after specific request This patch works around a problem with the HTTP body being dropped from the response to a specific client and under specific circumstances: a) Client request comes from node.js user agent "Shred" via use of swagger-client library. b) Asterisk and Client are *not* on the same host or TCP/IP stack In testing this problem, it has been determined that the write of the HTTP body is lost, even if the data is written using low level write function. The only solution found is to instruct the TCP stack with the shutdown function to flush the last write and finish the transmission. See review for more details. ASTERISK-23548 #close (closes issue ASTERISK-23548) Reported by: Sam Galarneau Review: https://reviewboard.asterisk.org/r/3402/ ........ Merged revisions 411462 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411463 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-28 16:00 +0000 [r411374-411461] Matthew Jordan * /: Remove block on 411408 * /, UPGRADE.txt: UPGRADE: Note IAX2 compatibility issue between 1.4 and 1.8+ systems. ........ Merged revisions 411457 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411458 from http://svn.asterisk.org/svn/asterisk/branches/11 * contrib/realtime/mysql/voicemail_messages.sql (removed), contrib/realtime/postgresql/realtime.sql (removed), contrib/realtime/mysql/voicemail_data.sql (removed), contrib/realtime/mysql/musiconhold.sql (removed), contrib/realtime/mysql/queue_log.sql (removed), contrib/realtime/mysql/voicemail.sql (removed), contrib/realtime/mysql/sippeers.sql (removed), contrib/realtime/mysql/iaxfriends.sql (removed), contrib/realtime/mysql/meetme.sql (removed): contrib/realtime: Remove empty SQL script files Since the relatime scripts are now managed by Alembic, the previous realtime scripts were previously removed. However, the removal process messed up, as the files were still in the repository. The contents were just empty. This removes the files from the tree. * channels/sip/include/sip.h, /: chan_sip: Add MESSAGE request to allowed methods The allowed methods advertised by chan_sip did not previously note the MESSAGE request. Even in Asterisk 1.8, we do accept in-dialog MESSAGE requests; we should advertise that we support MESSAGE requests. ASTERISK-23504 #close ASTERISK-23504 #comment Reported by: Martin Kontsek ASTERISK-23504 #comment Patch sip.h_patch.diff uploaded by Martin Kontsek (license 6587) Review: https://reviewboard.asterisk.org/r/3396/ ........ Merged revisions 411372 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411373 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-27 19:15 +0000 [r411311-411315] Corey Farrell * main/message.c, apps/app_jack.c, funcs/func_dialplan.c, channels/chan_sip.c, funcs/func_math.c, funcs/func_jitterbuffer.c, res/res_mutestream.c, funcs/func_global.c, apps/app_speech_utils.c, res/res_pjsip_header_funcs.c, funcs/func_callcompletion.c, funcs/func_blacklist.c, funcs/func_cdr.c, funcs/func_channel.c, apps/app_stack.c, funcs/func_callerid.c, res/res_calendar.c, apps/app_voicemail.c, funcs/func_speex.c, /, funcs/func_strings.c, res/res_xmpp.c, res/res_jabber.c, main/features_config.c, channels/chan_iax2.c, apps/confbridge/conf_config_parser.c, channels/pjsip/dialplan_functions.c, funcs/func_groupcount.c, funcs/func_pitchshift.c, funcs/func_odbc.c, funcs/func_volume.c, funcs/func_frame_trace.c: Fix dialplan function NULL channel safety issues (closes issue ASTERISK-23391) Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3386/ ........ Merged revisions 411313 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411314 from http://svn.asterisk.org/svn/asterisk/branches/11 * include/asterisk.h, /, main/format.c: main/formats: Fix crash in ast_format_cmp during non-clean shutdown. * Update asterisk.h to reflect availability of ast_register_cleanup in 11.9. * Use ast_register_cleanup for format_attr_shutdown. (closes issue ASTERISK-23103) Reported by: JoshE ........ Merged revisions 411310 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-27 14:20 +0000 [r411295] Mark Michelson * main/sorcery.c: Give sorcery instances a reference to their wizards. On graceful shutdown, sorcery wizards are all killed off, but it is possible for sorcery instances to still have dangling pointers after this, possibly causing a crash. Giving the sorcery instances a reference to their wizards ensures that the wizard reference will remain valid for the lifetime of the sorcery instance. Review: https://reviewboard.asterisk.org/r/3401 2014-03-26 22:44 +0000 [r411245] Joshua Colp * /, main/say.c: say: Fix a bug where SayNumber in Polish tries to play incorrect sound. This change fixes a bug where calling SayNumber with a number divisible by 100 using the Polish language would cause the code to attempt to play a sound file with an empty name. (closes issue ASTERISK-23509) Reported by: zvision Review: https://reviewboard.asterisk.org/r/3378/ ........ Merged revisions 411243 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411244 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-26 16:07 +0000 [r411193] Jonathan Rose * configs/sip.conf.sample, /, channels/chan_sip.c: chan_sip: Send real CallerID information with P-Assserted-Identity (RFC-3325) Prior too this patch, the P-Asserted-Identity header would include anonymous caller id information which seems to go against the point of the P-Asserted-Identity header. Now the real caller ID information will be included in this header. Also, no privacy header would be included. This patch adds 'Privacy: id' to outgoing SIP messages that include the P-Asserted-Identity header. (closes issue AST-1301) ........ Merged revisions 411189 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411190 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-26 16:03 +0000 [r411191] Richard Mudgett * contrib/ast-db-manage/config/versions/4c573e7135bd_fix_tos_field_types.py: Fix 'alembic branches' merge conflict as described by the web page. 2014-03-25 18:43 +0000 [r411173] Sean Bright * res/ari/config.c: ARI: Don't complain about missing ARI users when we aren't enabled Currently, if ARI is not enabled it will still complain that there are no configured users. This patch checks to see if ARI is enabled before logging and error or iterating the container to validate the users. Review: https://reviewboard.asterisk.org/r/3391/ 2014-03-25 17:52 +0000 [r411157-411159] Mark Michelson * tests/test_sorcery.c, tests/test_sorcery_realtime.c, main/sorcery.c, res/res_mwi_external.c, res/res_pjsip/config_system.c, configs/sorcery.conf.sample, main/bucket.c, include/asterisk/sorcery.h, res/res_pjsip/pjsip_configuration.c, tests/test_sorcery_astdb.c: Prevent duplicate sorcery wizards from being applied to sorcery object types. This commit contains several changes to sorcery: 1) Application of sorcery configuration based on module name is automatically performed when sorcery is opened for a module. 2) Sorcery will not attempt to apply the same wizard to an object type more than once. 3) Sorcery gives more exact results when attempting to apply a wizard, whether as the default or based on configuration. Sorcery unit tests still pass for me after making these changes. Review: https://reviewboard.asterisk.org/r/3326 * res/res_pjsip/pjsip_configuration.c, UPGRADE.txt, res/res_pjsip_messaging.c, res/res_pjsip.c, include/asterisk/res_pjsip.h: Add a "message_context" option for PJSIP endpoints. 2014-03-25 16:55 +0000 [r411141] Richard Mudgett * include/asterisk/res_pjsip.h, res/res_pjsip/pjsip_options.c, res/res_pjsip.c: res_pjsip: Fix contact authenticate_qualify endpoint lookup when qualifing a contact. * Fixed bad use of ao2_find() in on_endpoint(). * Replaced use of find_endpoints() with find_an_endpoint() since only the first found endpoint is ever needed. * Fixed qualify_contact_cb() to update the contact with the aor authenticate_qualify setting. Otherwise, permanent contacts in the aor type sections would have a config line order dependancy. * Fixed off nominal path contact ref leak in qualify_contact(). The comment saying the unref is not needed was wrong. * Fixed off nominal path use of the endpoint parameter if it is NULL in send_out_of_dialog_request(). * Added missing off nominal path unref of pjsip tdata in send_out_of_dialog_request(). * Fixed off nominal path failing to call the callback in send_request_cb() when the request is challenged for authentication. * Eliminated silly RAII_VAR() use in qualify_contact_cb(). * Updated ast_sip_send_request() doxygen to better reflect reality. (closes issue ASTERISK-23254) Reported by: rmudgett Review: https://reviewboard.asterisk.org/r/3381/ 2014-03-25 16:04 +0000 [r411091] Kinsey Moore * /, channels/chan_sip.c: chan_sip: Fix incorrect use of timers If update_provisional_keepalive() is called while send_provisional_keepalive_full() is waiting on the PVT lock, then pvt->provisional_keepalive_sched_id will be changed to a new sched_id value by update_provisional_keepalive(), but that new sched_id then may be overwritten with -1 by send_provisional_keepalive_full(), killing the pvt's reference to a schedule and "leaking" the reference. (closes issue ASTERISK-22079) Review: https://reviewboard.asterisk.org/r/3368/ Reported by: Jamuel Starkey, Matteo, Leif Madsen, Steve Davies Patches: provisional_keepalive_fix.diff uploaded by Steve Davies (license 5012) ........ Merged revisions 411088 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411089 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-25 15:44 +0000 [r411086] Jonathan Rose * res/res_stasis.c: ARI: Resolve a subscription leak against implicit bridge subscriptions When a channel in a stasis application is joined to a bridge, a subscription for that bridge is created implicitly for the stasis application serving the channel. Prior to this patch, subsequent removals of the channel from the bridge would leave the subscription open. Review: https://reviewboard.asterisk.org/r/3380/ 2014-03-24 21:38 +0000 [r411023] Joshua Colp * /, channels/chan_sip.c: chan_sip: Always use fromdomain if set for domain, even if callerid is set to restricted. (closes issue ASTERISK-20841) Reported by: Kelly Goedert ........ Merged revisions 411021 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 411022 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-21 16:01 +0000 [r410995] Richard Mudgett * res/res_pjsip_registrar.c: res_pjsip_registrar.c: Miscellaneous cleanup in rx_task(). * Fix variable shadowing of 'updated' by renaming it to 'contact_update'. * Checked 'contact_update' for ast_sorcery_copy() failure. * Removed silly use of RAII_VAR() for 'contact_update'. 2014-03-20 22:54 +0000 [r410966] Jonathan Rose * /, apps/app_confbridge.c: app_confbridge: Fix bug - users with startmuted set don't start muted (closes issue ASTERISK-23461) Reported by: Chico Manobela Review: https://reviewboard.asterisk.org/r/3373/ ........ Merged revisions 410965 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-20 16:27 +0000 [r410949] Richard Mudgett * include/asterisk/channel.h, res/ari/resource_channels.c, res/res_stasis_snoop.c, include/asterisk/rtp_engine.h, main/dial.c, main/manager.c, main/channel_internal_api.c, main/core_unreal.c: assigned-uniqueids: Miscellaneous cleanup and fixes. * Fix memory leak in ast_unreal_new_channels(). Made it generate the ;2 uniqueid on a stack variable instead of mallocing it. * Made send error response to ARI and AMI requests instead of just logging excessive uniqueid length and allowing truncation. action_originate() and ari_channels_handle_originate_with_id(). * Fixed minor truncating uniqueid hole when generating the ;2 uniqueid string length. Created public and internal lengths of uniqueid. The internal length can handle a max public uniqueid plus an appended ;2. * free() and ast_free() are NULL tolerant so they don't need a NULL test before calling. * Made use better struct initialization format instead of the position dependent initialization format. Also anything not explicitly initialized in the struct is initialized to zero by the compiler. * Made ast_channel_internal_set_fake_ids() use the safer ast_copy_string() instead of strncpy(). Review: https://reviewboard.asterisk.org/r/3371/ 2014-03-19 17:26 +0000 [r410933] Mark Michelson * res/res_pjsip_endpoint_identifier_ip.c: PJSIP: Allow for identify sections to be specified in sorcery.conf. "identify" is a special type of configuration object in PJSIP because unlike the other objects, it is not provided by the base res_pjsip module. Instead, it is provided by the res_pjsip_endpoint_identifier_ip module. If using the default sorcery wizard (config,criteria=type=identify) then things work because the module that applies the default wizard is the correct module. However, if attempting to use sorcery.conf to apply an alternate wizard, it was not possible. If you attempted to specify the identify object type in the res_pjsip section, then the object could not be registered since the object was undocumented for the res_pjsip module. There was no alternate configuration section defined for it, so you were out of luck if you wanted to override the default wizard. With this change, the identify section will properly have a sorcery.conf-based wizard applied when the identify definition is within the res_pjsip_endpoint_identifier_ip section. 2014-03-19 14:24 +0000 [r410904-410918] Joshua Colp * res/res_stasis.c: res_stasis: Fix a bug where the default bridge type was not set. * CHANGES, res/res_stasis.c, rest-api/api-docs/bridges.json, res/ari/resource_bridges.h: res_stasis: Extend bridge type to be a comma separated list of bridge attributes. This change turns the bridge type field into a comma separated list of attributes. These attributes include: mixing, holding, dtmf_events, and proxy_media. By setting the various attributes a user can control the type of bridge created with the behavior they need for their application. (closes issue ASTERISK-23437) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3359/ 2014-03-19 02:29 +0000 [r410890] Matthew Jordan * res/res_ari.c: res_ari: Fix documentation schema error 2014-03-18 23:31 +0000 [r410876] Rusty Newton * res/res_ari.c: res_ari: Add notes about Asterisk HTTP server to the "enabled" config option for the res_ari general section Added note and see-also reminding user to enable the HTTP server. (closes issue ASTERISK-22499) Reported by: Rusty Newton 2014-03-18 15:28 +0000 [r410861] Matthew Jordan * main/cdr.c: cdr: Add asserts for when we don't know about a CDR for a channel In the CDR core, every channel should either be filtered out (due to being an 'internal' channel used as an implementation detail, such as playing media back into a bridge) or it should get a CDR. Even if that CDR ends up being discarded, we still give the channel a CDR in case we end up needing it. If we hit a situation where a channel does not have a CDR, we should blow up in -dev-mode. Asserts are appropriate for that. This patch adds those asserts, as they would have quickly caught the error fixed by r410814. 2014-03-18 14:51 +0000 [r410858] Scott Griepentrog * main/http.c: ARI: allow json content type with zero length body When a request was received with a Content-type of json, the body was sent for json parsing - even if it was zero length. This resulted in ARI requests failing that were valid, such as a channel DELETE with no parameters. The code has now been changed to skip json parsing with zero content length. (closes issue SWP-6748) Reported by: Samuel Galarneau Review: https://reviewboard.asterisk.org/r/3360/ 2014-03-18 12:45 +0000 [r410844] Joshua Colp * res/res_pjsip/config_system.c: res_pjsip: Fix memory leak of nameservers in off-nominal resolver creation failure. Thanks Walter Doekes! 2014-03-18 11:51 +0000 [r410830] Sean Bright * res/res_fax_spandsp.c, /: res_fax_spandsp: Use g711_free() when available. Per Johann Steinwendtner on the asterisk-dev mailing list: http://lists.digium.com/pipermail/asterisk-dev/2014-March/066102.html g711_free() was introduced in spandsp 0.0.6pre4 and g711_release() became a noop. I opted not to remove the call to g711_release() since it is harmless and to call g711_free() if we have a sufficiently recent version of spandsp. (issue ASTERISK-20149) Reported by: Alexandr Gordeev ........ Merged revisions 410829 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-18 02:02 +0000 [r410813] Richard Mudgett * main/stasis_cache.c: stasis_cache: Use the right variable in the cache entry ao2 cmp function. 2014-03-17 22:53 +0000 [r410793-410795] Joshua Colp * CHANGES, res/res_pjsip/include/res_pjsip_private.h, res/res_pjsip.c, main/dns.c, res/res_pjsip/config_system.c, include/asterisk/dns.h: res_pjsip: Enable PJSIP DNS client support. This change enables DNS client support within PJSIP. System nameservers are automatically discovered using res_init or res_ninit. If this fails then PJSIP will resort to using gethostbyname for resolution. By enabling this support we gain SRV support, failover, and weight support. (closes issue ASTERISK-23435) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3343/ * res/res_pjsip_multihomed.c: res_pjsip_multihomed: Make address replacement less aggressive. This change makes the res_pjsip_multihomed module less aggressive when changing the address in messages. It will now only occur if the transport in use is bound to the any address OR if the system determined source address matches the bound address of the transport in use. Review: https://reviewboard.asterisk.org/r/3369/ 2014-03-17 21:56 +0000 [r410747-410750] Russ Meyerriecks * /, main/callerid.c: !fixup: callerid: Logic error in checksum processing Fixes syntax error in previous commit :-( ........ Merged revisions 410748 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410749 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/callerid.c, /: callerid: Logic error in checksum processing Callerid checksum-ing was being handled incorrectly here. When the checksum is calculated to be 0x00, it will perform 0x100-0x00 which results in 0x100. This value will then fail the otherwise correct callerid message. This patch changes the logic to simply add the calculated checksum to the transmitted 2's compliment checksum. Review: https://reviewboard.asterisk.org/r/3356/ (closes issue ASTERISK-23488) ........ Merged revisions 410710 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410717 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-17 18:36 +0000 [r410673-410696] Mark Michelson * res/res_mwi_external.c, res/res_pjsip/config_system.c, configs/sorcery.conf.sample, include/asterisk/sorcery.h, res/res_pjsip/pjsip_configuration.c, tests/test_sorcery_astdb.c, tests/test_sorcery.c, tests/test_sorcery_realtime.c, main/sorcery.c: Revert changes to sorcery that accidentally got committed. These changes were still up for review and have not been approved yet. I must have had the changes in my working copy when making a different change. * tests/test_sorcery.c, main/channel.c, res/res_pjsip/config_system.c, res/res_mwi_external.c, include/asterisk/bridge_channel.h, funcs/func_frame_trace.c, configs/sorcery.conf.sample, res/res_pjsip/pjsip_configuration.c, include/asterisk/sorcery.h, tests/test_sorcery_astdb.c, include/asterisk/frame.h, main/bridge_channel.c, tests/test_sorcery_realtime.c, main/sorcery.c, res/res_stasis_playback.c, main/frame.c, bridges/bridge_softmix.c: Fix stuck channel in ARI through the introduction of synchronous bridge actions. Playing back a file to a channel in an ARI bridge would attempt to wait until the playback concluded before returning. The method used involved signaling the waiting thread in the ARI custom playback function. The problem with this is that there were some corner cases that were not accounted for: * If a bridge channel could not be found, then we never would attempt the playback but would still attempt to wait for the playback to complete. * If the bridge playfile action failed to queue, we would still attempt to wait for the playback to complete. * If the bridge playfile action were queued but some circumstance caused the playback not to occur (the bridge dies, the channel is removed from the bridge), then we would never be notified. The solution to this is to move the waiting logic into the bridge code. A new bridge API function is added to queue a synchronous action on a bridge. The waiting thread is notified when the queued frame has been freed, either due to an error occurring or due to successful playback. As a failsafe, the waiting thread has a 10 minute timeout just in case there is a frame leak somewhere. Review: https://reviewboard.asterisk.org/r/3338 2014-03-17 16:42 +0000 [r410671] Richard Mudgett * apps/confbridge/conf_chan_announce.c: app_confbridge: Add missing destructor call to announcer channel destructor. 2014-03-16 20:20 +0000 [r410650] Matthew Jordan * res/stasis/app.c: stasis/app.c: Add some extra debugging for subscription counts Events are sent to a connected ARI application based on the things that ARI application cares about. These subscriptions can be set up implicitly - such as when that ARI application creates a new object - or explicitly, via the application resource's subscription operations. Debugging *why* something was being sent to an application - or why something was not being sent to an application - was a bit tricky, as there was no debug information for the subscriptions. This patch adds some debug level 3 statements that show the subscription counts for applications. (Level 3 was chosen as it matches the verbose level 3 statements elsewhere) 2014-03-14 21:55 +0000 [r410625] Mark Michelson * tests/test_sorcery_realtime.c: Fix failing realtime sorcery tests. The store realtime callback needs to return a positive value for sorcery to treat the store as a success. 2014-03-14 21:28 +0000 [r410623] Jonathan Rose * main/manager.c, /: manager: fix memory leak in manager_add_filter function (closes issue ASTERISK-23420) Reported by: Etienne Lessard Patches: manager_eventfilter_leak uploaded by Etienne Lessard (license 6394) ........ Merged revisions 410609 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-14 20:53 +0000 [r410590-410607] Mark Michelson * main/db.c, /: Remove an extra ast_cond_wait() that slipped through the patch. ........ Merged revisions 410606 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/config.c, res/res_sorcery_realtime.c: Handle the return values of realtime updates and stores more accurately. Realtime backends' update and store callbacks return the number of rows affected, or -1 if there was a failure. There were a couple of issues: * The config API was treating 0 as a successful return, and positive values as a failure. Now the config API treats anything >= 0 as a success. * res_sorcery_realtime was treating 0 as a successful return from the store procedure, and any positive values as a failure. Now sorcery treats anything > 0 as a success. It still considers 0 a "failure" since there is no change to report to observers. Review: https://reviewboard.asterisk.org/r/3341 * res/res_pjsip_mwi.c: Prevent conflicts regarding unsolicited and solicited MWI to an endpoint. If an endpoint is receiving unsolicited MWI for a mailbox and then attempts to subscribe to an AOR that provides MWI for the same mailbox, then the SUBSCRIBE is rejected with a 500 response. Review: https://reviewboard.asterisk.org/r/3345 2014-03-14 17:56 +0000 [r410588] Scott Griepentrog * CHANGES: uniqueid: Update CHANGES to reflect new features Note the new features provided by uniqueid in the CHANGES file. (issue ASTERISK-23120) Review: https://reviewboard.asterisk.org/r/3316/ 2014-03-14 16:26 +0000 [r410574] Jonathan Rose * CHANGES, res/res_pjsip/config_transport.c, include/asterisk/acl.h, main/acl.c, res/res_pjsip/pjsip_configuration.c: PJSIP: TOS values should be represented as decimals in sorcery objects (closes issue ASTERISK-23235) Reported by: George Joseph Review: https://reviewboard.asterisk.org/r/3324/ 2014-03-14 16:11 +0000 [r410559] Mark Michelson * main/db.c, /: Prevent delayed astdb syncs. The syncing thread sleeps for a second before waiting to be told to attempt to sync again. If a signal were sent during this sleeping period, we would end up having to wait until the next sync signal occurred in order to sync up the astdb. This code rearrangement also ensures that any pending transactions will be synced prior to Asterisk shutting down. Patches: db_sync.patch by John Hardin (License #6512) ........ Merged revisions 410556 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-14 16:05 +0000 [r410558] Jonathan Rose * res/ari/resource_bridges.c: ARI/bridges: Forward Playback/Recording Started/Finished to bridge topic (closes issue ASTERISK-23444) Reported by: Ben Merrills Review: https://reviewboard.asterisk.org/r/3340/ 2014-03-14 15:55 +0000 [r410541-410555] Richard Mudgett * include/asterisk/app.h, res/res_mwi_external.c, main/app.c: res_mwi_external: Clear the stasis cache entry when the external MWI is deleted. One of the things missing when external MWI support was added was the ability to clear the stasis cache entry of deleted external MWI mailboxes. Review: https://reviewboard.asterisk.org/r/3325/ * main/cdr.c: cdr.c: Add missing aow_unlock(cdr) in off nominal path of handle_dial_message(). * Trivial common code hoisting in handle_bridge_leave_message(). * Some whitespace fixing. 2014-03-13 19:30 +0000 [r410527] Kinsey Moore * res/stasis/control.c, res/stasis/control.h, res/res_stasis.c: ARI: Ensure managing application receives ChannelEnteredBridge messages This fixes an issue where a Stasis application running over ARI and subscribed to ari/events could miss the ChannelEnteredBridge event because it did not subscribe to the new bridge fast enough. To accomplish this, it subscribes the application controlling the channel to the new bridge before adding it to that bridge which required the stasis_app_control structure to maintain a reference to the stasis_app. (closes issue ASTERISK-23295) Review: https://reviewboard.asterisk.org/r/3336/ 2014-03-13 13:24 +0000 [r410509-410510] Joshua Colp * res/res_pjsip_multihomed.c: res_pjsip_multihomed: Remove change for testing fix. * res/res_pjsip_multihomed.c: res_pjsip_multihomed: Fix a bug where the 200 OK for a REGISTER would contain the wrong contact. 2014-03-12 19:05 +0000 [r410491-410493] Richard Mudgett * res/res_musiconhold.c, main/channel.c: res_musiconhold.c: Generate MOH start/stop events whenever the MOH stream is started/stopped. * Made res_musiconhold.c always post the MusicOnHoldStart/MusicOnHoldStop events when it actually starts/stops the music streams. This allows the events to always happen when MOH starts/stops. The event posting code was moved to the MOH alloc/release routines. * Made channel_do_masquerade() stop any MOH on the original channel before masquerading so the original channel will get a stop event with correct information. * Cleaned up a couple odd codings in moh_files_alloc() and moh_alloc() dealing with the music state variable. (issue ASTERISK-23311) Reported by: Benjamin Keith Ford Review: https://reviewboard.asterisk.org/r/3306/ * apps/confbridge/conf_state.c, apps/confbridge/conf_state_single.c, apps/confbridge/conf_state_inactive.c, apps/confbridge/conf_state_single_marked.c, /: app_confbridge: Make explicitly stop MOH if a user is kicked or hangs up while MOH is playing. When MOH is playing to a user in a conference and the user is kicked or hangs up from the conference then the AMI MusicOnHoldStop events didn't happen. (Asterisk v11 AMI event: MusicOnHold, state:Stop) (closes issue ASTERISK-23311) Reported by: Benjamin Keith Ford Review: https://reviewboard.asterisk.org/r/3306/ ........ Merged revisions 410490 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-12 12:50 +0000 [r410451-410471] Joshua Colp * res/res_pjsip_multihomed.c: res_pjsip_multihomed: Fix a bug where outgoing messages for TCP would go out using UDP. This change fixes a bug where the code which changes the transport did not check whether the message is going out over UDP or not before changing it. For TCP and TLS transports we don't need to change the transport as the correct one is already chosen. * res/res_pjsip_multihomed.c (added): res_pjsip_multihomed: Add module which places the correct address within messages. Due to how messages are handled within PJSIP it is not until a message is actually sent that the destination is reliably known. This means that the addresses placed within the message may not be of the interface the message is being sent out on. This module determines what interface a message is being sent on and updates the message to contain the correct address if applicable. This module was tested by myself in a virtualized environment with multiple interfaces and also by Kinsey Moore in the following configuration: Networks: * 10.24.16.0/21 ** hard phone ** default gateway * 10.24.64.0/21 ** softphone with pjsip-based stack Transport details: bind address: 0.0.0.0 protocol: UDP All endpoints were tested with explicitly configured transports and unconfigured transports. This was tested with inbound and outbound calls, both of which were experiencing detrimental effects from incorrect IP addresses in SIP messages. These effects were only experienced by the soft phone on the 10.24.64.0 network since the messages to the hard phone on the 10.24.16.0 network had the correct IP address. (closes issue ASTERISK-23020) Reported by: xrobau Review: https://reviewboard.asterisk.org/r/3102/ 2014-03-10 17:16 +0000 [r410383] Richard Mudgett * main/http.c, /: AST-2014-001: Stack overflow in HTTP processing of Cookie headers. Sending a HTTP request that is handled by Asterisk with a large number of Cookie headers could overflow the stack. Another vulnerability along similar lines is any HTTP request with a ridiculous number of headers in the request could exhaust system memory. (closes issue ASTERISK-23340) Reported by: Lucas Molas, researcher at Programa STIC, Fundacion; and Dr. Manuel Sadosky, Buenos Aires, Argentina ........ Merged revisions 410380 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410381 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-10 16:32 +0000 [r410368] Scott Griepentrog * main/manager.c, res/ari/resource_channels.c: unqiueid: correct max uniqueid length test This patch adds null string test prior to checking for a max uniqueid value that was added in r410157. 2014-03-10 13:25 +0000 [r410329] Kinsey Moore * /, channels/chan_sip.c: AST-2014-002: chan_sip: Exit early on bad session timers request This change allows chan_sip to avoid creation of the channel and consumption of associated file descriptors altogether if the inbound request is going to be rejected anyway. (closes issue ASTERISK-23373) Reported by: Corey Farrell Patches: chan_sip-earlier-st-1.8.patch uploaded by Corey Farrell (license 5909) chan_sip-earlier-st-11.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 410308 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410311 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-10 12:52 +0000 [r410306] Joshua Colp * res/res_pjsip/pjsip_options.c, res/res_pjsip.c: AST-2014-003: res_pjsip: When handling 401/407 responses don't assume a request will have an endpoint. This change removes the assumption that an outgoing request will always have an endpoint and makes the authenticate_qualify option work once again. (closes issue ASTERISK-23210) Reported by: Joshua Colp 2014-03-08 16:41 +0000 [r410287] George Joseph * res/res_pjsip/config_transport.c, main/sorcery.c, include/asterisk/res_pjsip.h, res/res_pjsip/config_auth.c, res/res_pjsip/location.c, res/res_pjsip_outbound_registration.c, res/res_pjsip_endpoint_identifier_ip.c, include/asterisk/res_pjsip_cli.h, include/asterisk/sorcery.h, res/res_pjsip/pjsip_cli.c, res/res_pjsip/pjsip_configuration.c: pjsip_cli: Create pjsip show channel and contact, and general cli code cleanup. Created the 'pjsip show channel' and 'pjsip show contact' commands. Refactored out the hated ast_hashtab. Replaced with ao2_container. Cleaned up function naming. Internal only, no public name changes. Cleaned up whitespace and brace formatting in cli code. Changed some NULL checking from "if"s to ast_asserts. Fixed some register/unregister ordering to reduce deadlock potential. Fixed ast_sip_location_add_contact where the 'name' buffer was too short. Fixed some self-assignment issues in res_pjsip_outbound_registration. (closes issue ASTERISK-23276) Review: http://reviewboard.asterisk.org/r/3283/ 2014-03-08 15:43 +0000 [r410274] Matthew Jordan * res/ari/resource_channels.c: resource_channels: Check if a passed in ID is NULL before checking its length Calling strlen on a NULL string is explosive. This patch checks whether or not the passed in string is NULL or zero length before checking to see if the string is too long. 2014-03-07 22:53 +0000 [r410226] Corey Farrell * /, channels/chan_sip.c: chan_sip: Fix deadlock of monlock between unload_module and do_monitor Release monlock before calling pthread_join. This ensures do_monitor cannot freeze by locking monlock during module unload. (closes issue ASTERISK-21406) Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/3284/ ........ Merged revisions 410224 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410225 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-07 22:07 +0000 [r410211] Scott Griepentrog * include/asterisk/sorcery.h: sorcery: correct field register argument list This fixes mistakes I previously made in merging gtjoseph's changes with mine. 2014-03-07 21:53 +0000 [r410194-410209] Matthew Jordan * main/config_options.c: config_options: Display the see-also information for CLI config option help The config option help information has always parsed the tags in the XML documentation. Unfortunately, it just never bothered displaying them on the CLI. With this patch, when you execute 'config show help [module] [obj] [option]', it will display what other options are useful to you. (closes issue ASTERISK-22008) Reported by: Richard Mudgett * res/res_pjsip.c: res_pjsip: Fix documentation for one touch recording see-also links The one touch recording options have several see-also links between the various configuration options. These were 'broken' by the snake casing of those options. This patch corrects the see-also links such that they reference the correct option names. 2014-03-07 21:10 +0000 [r410190] Scott Griepentrog * main/sorcery.c, include/asterisk/sorcery.h, res/res_pjsip/pjsip_configuration.c: pjsip: allow and disallow show same codecs In order to prevent confusion over the allow and disallow list of codecs being the same an option for registering a field as an alias is added. The alias field will be read from the configuration file, but afterwards is not listed as a known field. With disallow set as an alias, the CLI command pjsip show endpoint # will list the allow= field, but not the disallow field. (closes issue ASTERISK-23092) Review: https://reviewboard.asterisk.org/r/3193/ 2014-03-07 21:03 +0000 [r410187] Mark Michelson * tests/test_sorcery_realtime.c, main/sorcery.c, res/res_sorcery_realtime.c, include/asterisk/sorcery.h: Make res_sorcery_realtime filter unknown retrieved results. When retrieving data from a database or other realtime backend, it's quite possible to retrieve variables that Asterisk does not care about but that are legitimate to exist. Asterisk does not need to throw a hissy fit when these variables are encountered but rather just filter them out. Review: https://reviewboard.asterisk.org/r/3305 2014-03-07 20:28 +0000 [r410171-410184] Richard Mudgett * include/asterisk/devicestate.h, main/stasis_cache.c, main/stasis_message.c, tests/test_devicestate.c, include/asterisk/stasis.h, main/app.c, main/devicestate.c, tests/test_stasis.c: stasis cache: Enhance to keep track of an item from different entities. A stasis cache entry now contains more than a single message/snapshot. It contains messages/snapshots for the local entity as well as any remote entities that post to the cached item. In addition callbacks can be supplied when the cache is created to compute and post the aggregate message/snapshot representing all entities stored in the cache entry. * All stasis messages now have an eid to indicate what entity posted it. * The stasis cache enhancements allow device state to cache and aggregate the device states from local and remote entities in a single operation. The cached aggregate device state is available immediately after it is posted to the stasis bus. This improves performance by eliminating a cache dump and associated ao2 container traversals to calculate the aggregate state. (closes issue ASTERISK-23204) Reported by: Mark Michelson Review: https://reviewboard.asterisk.org/r/3281/ * tests/test_cel.c, channels/sig_pri.c, channels/sig_ss7.c, include/asterisk/bridge.h, tests/test_cdr.c, channels/sig_pri.h, channels/chan_dahdi.c, channels/sig_ss7.h: uniqueid: Fix chan_dahdi, sig_pri, sig_ss7, test_cdr, and test_cel compiler errors. (issue ASTERISK-23120) 2014-03-07 15:46 +0000 [r410157] Scott Griepentrog * addons/chan_mobile.c, main/bridge_channel.c, channels/chan_pjsip.c, channels/chan_mgcp.c, channels/chan_unistim.c, res/res_calendar_icalendar.c, main/pbx.c, channels/chan_bridge_media.c, main/ccss.c, main/bridge.c, tests/test_stasis_channels.c, apps/app_originate.c, apps/app_bridgewait.c, res/parking/parking_applications.c, include/asterisk/channel.h, res/res_calendar_caldav.c, apps/app_queue.c, apps/app_followme.c, main/cel.c, res/res_ari_channels.c, rest-api/api-docs/bridges.json, res/res_calendar_ews.c, main/dial.c, channels/chan_dahdi.c, channels/chan_h323.c, tests/test_cel.c, rest-api/api-docs/channels.json, include/asterisk/bridge_internal.h, apps/confbridge/conf_chan_announce.c, include/asterisk/core_unreal.h, res/res_calendar.c, addons/chan_ooh323.c, channels/chan_sip.c, res/stasis/control.c, main/channel_internal_api.c, include/asterisk/stasis_app.h, channels/chan_console.c, res/res_stasis_snoop.c, channels/chan_iax2.c, channels/chan_oss.c, apps/app_agent_pool.c, main/channel.c, main/manager.c, channels/chan_misdn.c, tests/test_voicemail_api.c, channels/chan_alsa.c, channels/chan_nbs.c, main/message.c, tests/test_cdr.c, res/res_clioriginate.c, res/res_ari_bridges.c, tests/test_substitution.c, channels/chan_multicast_rtp.c, res/res_stasis_playback.c, apps/app_meetme.c, apps/confbridge/conf_chan_record.c, tests/test_app.c, include/asterisk/channel_internal.h, main/bridge_basic.c, main/core_unreal.c, channels/chan_gtalk.c, include/asterisk/stasis_app_playback.h, res/ari/resource_bridges.c, channels/chan_jingle.c, channels/chan_phone.c, pbx/pbx_spool.c, res/ari/resource_bridges.h, res/parking/parking_tests.c, channels/chan_motif.c, apps/app_confbridge.c, include/asterisk/pbx.h, res/ari/resource_channels.c, res/res_stasis.c, include/asterisk/bridge.h, res/ari/resource_channels.h, apps/app_voicemail.c, apps/app_dial.c, res/res_calendar_exchange.c, channels/chan_vpb.cc, apps/app_page.c, apps/app_chanisavail.c, main/core_local.c, include/asterisk/dial.h, res/parking/parking_bridge_features.c, tests/test_stasis_endpoints.c, res/parking/parking_bridge.c, channels/chan_skinny.c, include/asterisk/stasis_app_snoop.h: uniqueid: channel linkedid, ami, ari object creation with id's Much needed was a way to assign id to objects on creation, and much change was necessary to accomplish it. Channel uniqueids and linkedids are split into separate string and creation time components without breaking linkedid propgation. This allowed the uniqueid to be specified by the user interface - and those values are now carried through to channel creation, adding the assignedids value to every function in the chain including the channel drivers. For local channels, the second channel can be specified or left to default to a ;2 suffix of first. In ARI, bridge, playback, and snoop objects can also be created with a specified uniqueid. Along the way, the args order to allocating channels was fixed in chan_mgcp and chan_gtalk, and linkedid is no longer lost as masquerade occurs. (closes issue ASTERISK-23120) Review: https://reviewboard.asterisk.org/r/3191/ 2014-03-07 04:51 +0000 [r410107] Matthew Jordan * /, channels/chan_sip.c: chan_sip: Allow static realtime members to be qualified during module load. When a static realtime peer with qualify=yes is loaded, Asterisk will fail to send an OPTIONS request due to the lastms being equal to 0. This results in the peer being unable to receive calls from Asterisk because the status is permanently UNKNOWN. This patch allows an OPTIONS request to be sent during module load by ignoring the lastms value on startup only. Review: https://reviewboard.asterisk.org/r/3294/ (closes issue ASTERISK-17523) Reported by: Maciej Krajewski Tested by: wushumasters patches: realtime_fix_11.7.0.txt uploaded by Trevor Peirce (license 6112) ........ Merged revisions 410105 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410106 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-06 23:40 +0000 [r410090] Russell Bryant * res/res_musiconhold.c, /: moh: fix a refcount error with realtime MOH I observed a crash in res_musiconhold on an Asterisk 11 system using realtime MOH. Investigation of the backtrace showed a corrupt mohclass, implying that it got destroyed before the code expected it to. I went looking for reference counting errors that could have caused this crash and this patch this result. It contains 2 changes. 1) Remove a usless block of code that was impossible to reach. There was even a comment indicating that it was impossible to reach. The conditional includes "!ast_test_flag(global_flags, MOH_CACHERTCLASSES)" and it's inside of an if block with the opposite check "ast_test_flag(global_flags, MOH_CACHERTCLASSES)". There's no good reason to keep it around. 2) A similar block to #1 contained a reference counting error. It stores state->class in the local variable mohclass without increasing its reference count. The reference count on mohclass is decremented at the end of the function. This block of code probably very rarely runs, which would help explain why this system was working fine for many months before experiencing a crash. Review: https://reviewboard.asterisk.org/r/3282/ ........ Merged revisions 410043 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 410044 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-06 23:35 +0000 [r410089] Richard Mudgett * main/sorcery.c: sorcery.c: Fix off-nominal path ref and memory leak in ast_sorcery_objectset_json_create(). * Made exit a loop early on error in ast_sorcery_objectset_json_create(). * Removed some dead code in ast_sorcery_objectset_create2(). 2014-03-06 18:50 +0000 [r410028] Jonathan Rose * main/acl.c, res/res_pjsip/pjsip_configuration.c, UPGRADE.txt, contrib/ast-db-manage/config/versions/4c573e7135bd_fix_tos_field_types.py (added), res/res_pjsip/config_transport.c, include/asterisk/acl.h: pjsip configuration: Make transport TOS values consistent with endpoints Transport TOS values were interpreted as DSCP values without being documented as such. Endpoint TOS values (tos_audio/tos_video) behaved normally as TOS values have historically. This patch makes the transport TOS values behave as TOS values and makes all TOS values readable as string values (e.g. AF11). In addition, alembic scripts have been updated to use the proper field types for all TOS/COS values. (issue ASTERISK-23235) Reported by: George Joseph Review: https://reviewboard.asterisk.org/r/3304/ 2014-03-06 18:18 +0000 [r410025] Joshua Colp * res/res_stasis_recording.c, res/ari/resource_channels.c, CHANGES, res/ari/ari_model_validators.c, rest-api/api-docs/recordings.json, res/ari/resource_bridges.c, res/ari/ari_model_validators.h, include/asterisk/stasis_app_recording.h: res_stasis_recording: Add a "target_uri" field to recording events. This change adds a target_uri field to the live recording object. It contains the URI of what is being recorded. (closes issue ASTERISK-23258) Reported by: Ben Merrills Review: https://reviewboard.asterisk.org/r/3299/ 2014-03-06 15:43 +0000 [r410011] Mark Michelson * res/res_pjsip_mwi.c: Don't attempt to link in an aggregate MWI subscription if an endpoint does not aggregate MWI. Attempting to link a NULL object into an ao2 container had been benign previously, but since enabling DO_CRASH in the testsuite, this is now causing a crash. It's better to be right here anyway. 2014-03-06 15:13 +0000 [r410006] George Joseph * res/res_pjsip_outbound_registration.c, main/bucket.c, res/res_pjsip_endpoint_identifier_ip.c, include/asterisk/config.h, include/asterisk/sorcery.h, res/res_pjsip/pjsip_configuration.c, res/res_pjsip_acl.c, CHANGES, tests/test_sorcery.c, res/res_pjsip/config_transport.c, main/config.c, main/sorcery.c, res/res_pjsip/config_auth.c, funcs/func_sorcery.c (added), res/res_pjsip/location.c: sorcery: Create AST_SORCERY dialplan function. This patch creates the AST_SORCERY dialplan function which allows someone to retrieve any value from a sorcery-based config file. It's similar to AST_CONFIG. The creation of the function itself was fairly straightforward but it required changes to the underlying sorcery infrastructure that rippled into individual sorcery objects. The changes stemmed from inconsistencies in how sorcery created ast_variable objectsets from sorcery objects and the inconsistency in how individual objects used that feature especially when it came to parameters that can be specified multiple times like contact in aor and match in identify. You can read more here... http://lists.digium.com/pipermail/asterisk-dev/2014-February/065202.html So, what this patch does, besides actually creating the AST_SORCERY function, is the following... * Creates ast_variable_list_append which is a helper to append one ast_variable list to another. * Modifies the ast_sorcery_object_field_register functions to accept the already-defined sorcery_fields_handler callback. * Modifies ast_sorcery_objectset_create to accept a parameter indicating return type preference...a single ast_variable with all values concatenated or an ast_variable list with multiple entries. Also fixed a few bugs. * Modifies individual sorcery object implementations to use the new function definition of the ast_sorcery_object_field_register functions. * Modifies location.c and res_pjsip_endpoint_identifier_ip.c to implement sorcery_fields_handler handlers so they return multiple occurrences as an ast_variable_list. * Added a whole bunch of tests to test_sorcery. (closes issue ASTERISK-22537) Review: http://reviewboard.asterisk.org/r/3254/ 2014-03-06 02:05 +0000 [r409991] Matthew Jordan * res/res_fax_spandsp.c, /: res_fax_spandsp: Fix crash when passing ulaw/alaw data to spandsp When acting as a T.38 fax gateway, res_fax_spandsp would at times cause a crash in libspandsp. This would occur when, during fax tone detection, a ulaw/alaw frame would be passed to modem_connect_tones_rx. That particular routine expects the data to be in slin format. This patch looks at the frame type and, if the data is ulaw/alaw, converts the format to slin before passing it to modem_connect_tones_rx. Review: https://reviewboard.asterisk.org/r/3296 (closes issue ASTERISK-20149) Reported by: Alexandr Gordeev Tested by: Michal Rybarik patches: spandsp_g711decode.diff uploaded by Michal Rybarik (license 6578) ........ Merged revisions 409990 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-06 00:32 +0000 [r409967-409976] Richard Mudgett * apps/confbridge/conf_state_inactive.c, apps/confbridge/conf_state_multi.c: app_confbridge: Remove some noop code. * res/res_musiconhold.c: res_musiconhold.c: Remove some unnecessary RAII_VAR() usage. * Made the moh_register() define use useful parameter names. 2014-03-05 20:40 +0000 [r409900-409918] Kinsey Moore * main/config.c, /: config: Fix inverted test The test of the result of the stat() call was inverted such that its output was only used if the call failed. This inverts the test so that the output of stat() is used correctly. This was causing full reloads on unchanged files. (closes issue ASTERISK-23383) Reported by: David Woolley ........ Merged revisions 409916 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409917 from http://svn.asterisk.org/svn/asterisk/branches/11 * bridges/bridge_native_rtp.c: bridge_native_rtp: Fix crash involving masquerade It is possible for a channel to be masqueraded out of a bridge which means it may no longer have RTP glue to check upon leaving said bridge. If this situation occurred (it's possible at least during dial and call pickup) then Asterisk would crash. This change makes sure the glue is checked before use. (closes issue AST-1290) Reported by: John Bigelow 2014-03-05 18:46 +0000 [r409887] Mark Michelson * funcs/func_presencestate.c, /: Fix documentation for PRESENCE_STATE to properly illustrate how to create a presence hint. There was a missing comma. This was discovered by Dan Kaplan. ........ Merged revisions 409886 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-05 18:40 +0000 [r409885] Richard Mudgett * contrib/ast-db-manage/cdr/versions (added), contrib/ast-db-manage/cdr/versions/210693f3123d_create_cdr_table.py (added), contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py (added), contrib/ast-db-manage/cdr.ini.sample (added), contrib/ast-db-manage/cdr/env.py (added), contrib/ast-db-manage/cdr (added), contrib/ast-db-manage/cdr/script.py.mako (added): alembic: Add missing queue and CDR table creation scripts. * Added the queues and queue_members tables to the config alembic scripts. * Added the CDR table alembic creation script. The CDR table is more of an example for new setups since the actual table can be fully customized in cdr_adaptive_odbc.conf. (closes issue ASTERISK-23233) Reported by: jmls Review: https://reviewboard.asterisk.org/r/3227/ 2014-03-05 16:57 +0000 [r409835] David M. Lee * /, configure, include/asterisk/autoconfig.h.in, configure.ac, main/config.c: Corrected cross-platform stat nanosecond code When nanosecond time resolution was added for identifying config file changes, it didn't cover all of the myriad of ways that one might obtain nanosecond time resolution off of struct stat. Rather than complicate the #if even further figuring out one system from the next, this patch directly tests for the three struct members I know about today, and #ifdef's accordingly. Review: https://reviewboard.asterisk.org/r/3273/ ........ Merged revisions 409833 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409834 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-05 12:05 +0000 [r409779] Sean Bright * /, contrib/scripts/astgenkey, contrib/scripts/astgenkey.8: Fix references to 'keys' CLI commands in astgenkey ........ Merged revisions 409777 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409778 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-05 06:30 +0000 [r409746-409762] Igor Goncharovskiy * channels/chan_unistim.c, /: Correct RTP handling in chan_unistim and fix transfer process broken in previous fix: - Fixed too early RTP setup with phone, that cause no ringback tone on caller side - Handle call transfer cancel only in STATE_CALL case (related to ASTERISK-23073) (Reported by: Németh Tamás, niurkin sil) ........ Merged revisions 409761 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/chan_unistim.c, /: Add update_peer function to unistim_rtp_glue, improve other unistim_rtp_glue functions conforming to other channel drivers. Do not forget auto-detected and user-selected phone settings on 'unistim reload' ........ Merged revisions 409705 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409745 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-05 04:59 +0000 [r409697-409704] Moises Silva * /, res/res_http_websocket.c: Fix res/res_http_websocket.c build failure in 32bit due to incorrect print format for uint64_t ........ Merged revisions 409703 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_http_websocket.c, /: Fix WebRTC over WSS not working Several fixes for the WebSockets implementation in res/res_http_websocket.c * Flush the websocket session FILE* as fwrite() may not actually guarantee sending the data to the network. If we do not flush, it seems that buffering on the SSL socket for outbound messages causes issues * Refactored ast_websocket_read to take into account that SSL file descriptors may be ready to read via fread() but poll() will not actually say so because the data was already read from the network buffers and is now in the libc buffers (closes issue ASTERISK-23099) (closes issue ASTERISK-21930) Review: https://reviewboard.asterisk.org/r/3248/ ........ Merged revisions 409681 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-05 00:55 +0000 [r409682] Richard Mudgett * include/asterisk/stasis_internal.h: stasis: Made internal_stasis_subscribe() prototype and definition match exactly. 2014-03-04 19:34 +0000 [r409626] Michael L. Young * funcs/func_audiohookinherit.c, /: func_audiohookinheritance: Check If A Channel Was Specified This patch prevents a crash when using the function audiohookinheritance without setting the channel. (closes issue ASTERISK-23104) Reported by: Joel Vandal Tested by: Joel Vandal Patches: asterisk-23104_audiohook_inherit_no_channel-11.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/3272/ ........ Merged revisions 409623 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409625 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-04 17:07 +0000 [r409570] Jonathan Rose * /, res/res_rtp_asterisk.c: res_rtp_asterisk: Fix one way audio problems with hold/unhold when using ICE ICE sessions will now be restarted if sessions are changed to use new sets of remote candidates. (closes issue ASTERISK-22911) Reported by: Vytis Valentinavičius Review: https://reviewboard.asterisk.org/r/3275/ ........ Merged revisions 409565 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-04 16:53 +0000 [r409568] Kinsey Moore * /, main/astobj2.c: AO2: Add an assert for bad objects This adds an assert that will only be active if Asterisk is compiled with DO_CRASH and allows the testsuite to fail tests that would otherwise require log file parsing. ........ Merged revisions 409566 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409567 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-04 14:54 +0000 [r409474] Sean Bright * /, channels/chan_sip.c: Minor whitespace change to 'sip show peers' output. (closes issue ASTERISK-23406) Reported by: ibercom Tested by: ibercom Patches: asterisk-11.patch uploaded by ibercom ........ Merged revisions 409472 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409473 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-03 19:44 +0000 [r409422] Joshua Colp * res/res_stasis_recording.c: res_stasis_recording: Fix memory leak of the absolute name. 2014-03-03 02:08 +0000 [r409363] Matthew Jordan * main/asterisk.c, /: doxygen: Tweak the link back to ye olde Digium website ........ Merged revisions 409361 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409362 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-02 15:14 +0000 [r409346] Tzafrir Cohen * /, Makefile.rules: Makefile: replace -O6 with -O3 -O6 is not a legal option of gcc. Unofficially gcc considers it to be equivalent of -O3. clang chalks on it, though. This commit sets the default optimization flag to be -O3, like gcc actually considered it. Review: https://reviewboard.asterisk.org/r/3280/ ........ Merged revisions 409308 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409344 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-01 20:27 +0000 [r409287] Joshua Colp * res/res_pjsip_session.c: res_pjsip_session: Set options (100rel, timers) on incoming sessions. This change passes options to the UAS creation function. This in turn sets up 100rel and session timer properties on the incoming session. Reported by Julian Russell on asterisk-users mailing list. 2014-03-01 00:04 +0000 [r409256-409274] Richard Mudgett * main/devicestate.c: devicestate.c: Simplified some logic in _ast_device_state(). * main/stasis_cache.c: stasis_cache.c: Remove some unnecessary RAII_VAR() usage. * main/stasis.c: stasis.c: Misc code cleanups. * Remove some unnecessary RAII_VAR() usage. * Made the struct stasis_subscription ao2 object use the ao2 lock instead of a redundant join_lock in the struct for ast_cond_wait(). * Removed locks on some ao2 objects that don't need the lock. * Made the topic pool entries container use the ao2 template functions. * Add some missing allocation failure checks. * Add missing cleanup in off nominal path of dispatch_message(). * /, channels/chan_sip.c: chan_sip: Add precautionary p->owner checks. * Add precautionary p->owner checks in sip_hangup(), get_refer_info(), get_also_info(), and interpret_t38_parameters(). * Simplify some tangled logic in get_refer_info(), get_also_info(), and add_rpid(). * Removed some dead code in handle_request_invite(). (closes issue ASTERISK-23323) Reported by: Walter Doekes Patches: issueA23323-more_p_owner_checks-1.8.x.patch (license #5674) uploaded by wdoekes (modified) issueA23323-more_p_owner_checks-11.x.patch (license #5674) uploaded by wdoekes (modified) issueA23323-more_p_owner_checks-12.x.patch (license #5674) uploaded by wdoekes (modified) issueA23323-more_p_owner_checks-trunk.patch (license #5674) uploaded by wdoekes (modified) ........ Merged revisions 409207 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409255 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-28 21:24 +0000 [r409234] Kinsey Moore * apps/app_queue.c: app_queue: Fix documented AMI event name During the rewrite of AMI events to use the Stasis bus, the name of the QueueMemberPaused event was changed to QueueMemberPause. This corrects documentation to reflect that. 2014-02-28 18:02 +0000 [r409158] Richard Mudgett * /, channels/chan_sip.c: chan_sip: Fix crash in ast_channel_hangupcause_set(). * Fix crash in ast_channel_hangupcause_set() because p->owner not checked before calling. Regression introduced by the fix for ASTERISK-22621. (closes issue ASTERISK-23135) Reported by: OK (issue ASTERISK-23323) Reported by: Walter Doekes ........ Merged revisions 409156 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409157 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-27 19:42 +0000 [r409131] Jonathan Rose * /, res/res_rtp_asterisk.c: Multiple revisions 409129-409130 ........ r409129 | jrose | 2014-02-27 13:19:02 -0600 (Thu, 27 Feb 2014) | 15 lines res_rtp_asterisk: Fix checklist creating problems in ICE sessions Prior to this patch, local candidate lists including SRFLX would fail to start properly when building ICE candidate check lists. This patch fixes that problem by making sure that each SRFLX candidate is associated with the proper base address so that the check list can create matches properly. This patch was written by jcolp. The issue will be left open to await testing by the issue participants. (issue ASTERISK-23213) Reported by: Andrea Suisani Review: https://reviewboard.asterisk.org/r/3256/ ........ r409130 | jrose | 2014-02-27 13:38:10 -0600 (Thu, 27 Feb 2014) | 8 lines res_rtp_asterisk: correct build error from r409129 Accidentally placed a declaration below functional code (issue ASTERISK-23213) Reported by: Andrea Suisani Review: https://reviewboard.asterisk.org/r/3256/ ........ Merged revisions 409129-409130 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-27 16:25 +0000 [r409087] David M. Lee * /, utils/astman.c: Fix memory stomping bug in astman. This memset complained in dev mod on my Ubuntu box. The memset is both unnecessary and dangerous. At this point, m hasn't been initialized yet, so the memset will write off to whatever address happens to be on the stack at the time. ........ Merged revisions 409077 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409083 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-27 16:05 +0000 [r409054] Corey Farrell * res/res_fax.c, configs/res_fax.conf.sample, /: res_fax: Warn that minrate=2400 is not valid for V.27 instead of failing load. Change minrate from 2400 to 4800 on config reload in response to changes from ASTERISK-22790 only. Any config with minrate of 2400 that would fail before r405693 will still fail. Comment out many settings in res_fax.conf.sample. The defaults are set in res_fax.c, so setting the same value in sample config does nothing but make the sample config more fragile. (closes issue ASTERISK-23231) Reported by: David Brillert Review: https://reviewboard.asterisk.org/r/3261/ ........ Merged revisions 409052 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 409053 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-27 12:28 +0000 [r408999] Matthew Jordan * res/res_pjsip_sdp_rtp.c: res_pjsip_sdp_rtp: Apply packetization rules on inbound SDP handling The setting 'use_ptime' is supposed to tell Asterisk to honour the ptime attribute in an offer, preferring it to whatever packetization preferences have been set internally. Currently, however, something rather quirky will happen: (1) The SDP answer will be constructed in create_outgoing_sdp_stream. This will use the preferences from the endpoint, such that the 200 OK response will add the packetization preferences from the endpoint, and not what was offered. (2) When the 200 response is issued, apply_negotiated_sdp_stream is called. This will call apply_packetization, which will use the ptime attribute from the offer internally. We end up telling the offerer to use the internal ptime attribute, but we end up using the offered ptime attribute. Hilarity ensues. This patch modifies the behaviour by calling apply_packetization from negotiate_incoming_sdp_stream, which is called prior to create_outgoing_sdp_stream. This causes the format preferences on the session's media object to be set to the inbound ptime value (if 'use_ptime' is enabled), such that the construction of the answer gets the right value immediately. Review: https://reviewboard.asterisk.org/r/3244/ 2014-02-26 23:33 +0000 [r408983] Richard Mudgett * tests/test_stasis.c: test_stasis.c: Misc cleanups. * Make the consumer ao2 object use the ao2 lock instead of a redundant lock in the struct for ast_cond_wait(). * Fixed some curly brace placements. * Fixed use of malloc(0). malloc(0) has variant behavior. It is up to the implementation to determine if it returns NULL or a valid pointer that can be later passed to free(). 2014-02-26 19:00 +0000 [r408970] Scott Griepentrog * channels/chan_pjsip.c: pjsip: avoid edge case potential crash in answer() When accidentally compiling against a wrong version of pjsip headers with a different pjsip_inv_session size, the invite_tsx structure could be null in the answer() function. This led to a crash because it attempted to send the session response with an uninitialized packet pointer. This patch presets packet to null and adds a diagnostic log message to explain why the call fails. Review: https://reviewboard.asterisk.org/r/3267/ 2014-02-26 17:03 +0000 [r408957] Joshua Colp * res/res_ari.c: res_ari: Make some additional error responses consistent with the rest of the system. This change makes some error cases use ast_ari_response_error to construct their error responses instead of manually doing it. This ensures they are consistent with the other error responses. Based on the original patch as done by Paul Belanger on the associated review. Review: https://reviewboard.asterisk.org/r/2904/ 2014-02-26 13:46 +0000 [r408941-408943] Kinsey Moore * include/asterisk/res_pjsip_session.h: PJSIP: Fix some bad spacing * res/res_pjsip_refer.c: PJSIP: Prevent crash if channel has gone away It is currently possible for an ast_sip_session to exist without an associated channel as is the case when a new invite is coming in or just after a hangup is issued on a chan_pjsip channel. Part of the attended transfer code assumed the channel would be non-NULL and used it as such causing a crash. This bug was exposed thanks to the attended transfer ARI test in the test suite. (closes issue ASTERISK-23287) Reported by: Matt Jordan 2014-02-25 17:50 +0000 [r408880-408882] Kevin Harwell * res/res_pjsip_exten_state.c, res/res_pjsip_pidf_digium_body_supplement.c (added), include/asterisk/res_pjsip_body_generator_types.h: res_pjsip_exten_state: Presence for digium phones Added presence support for digium phones. Review: https://reviewboard.asterisk.org/r/3239/ * res/res_pjsip_send_to_voicemail.c (added), res/res_pjsip_header_funcs.c: res_pjsip_send_to_voicemail: transferring to voicemail for digium phones Added the ability for transferring directly to voicemail on digium phones. Added a new module that checks for the presence of a custom header and/or diversion header within a sip REFER. If either is found and they specify a sending to voicemail action then variables are added to the channel allowing the user access to them in the dialplan. Dialplan can then be written that branches based upon these values allowing, for instace, for a single number to be used for dialing and/or accessing voicemail directly. Also fixed a problem where the PJSIP_HEADER function was allowing non pjsip channels through (checked to make sure it has the correct channel type before proceeding). Review: https://reviewboard.asterisk.org/r/3245/ 2014-02-25 17:43 +0000 [r408878] Rusty Newton * configs/voicemail.conf.sample, /: configs/voicemail.conf.sample - Make mailcmd sample text more explicit Made the wording a bit more explicit. Didn't really change the meaning. ........ Merged revisions 408876 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408877 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-22 19:56 +0000 [r408855] Matthew Jordan * main/asterisk.c: main: Initialize dialplan providing core components prior to module pre-load It is possible to pre-load pbx_config. As a result, pbx_config - which will load and parse the dialplan - will attempt to use various dialplan components, such as device state providers and presence state providers, prior to them being initialized by the core. This would lead to a crash, as the components had not created their Stasis cache entries. This patch moves a number of core component initializations before the module pre-load. This guarantees that if someone does pre-load pbx_config - or other pbx modules - that the Stasis caches for the various core components are created. (closes issue ASTERISK-23320) Reported by: xrobau (closes issue ASTERISK-23265) Reported by: Andrew Nagy Tested by: Andrew Nagy, Rusty Newton 2014-02-22 17:57 +0000 [r408839] Alexandr Anikin * addons/chan_ooh323.c, /: ignore AST_CONTROL_PVT_CAUSE_CODE without any messages (closes issue ASTERISK-23336) Reported by: Alexander Semych ........ Merged revisions 408838 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-22 02:29 +0000 [r408787] Corey Farrell * /, utils/extconf.c, utils/conf2ael.c, res/ael/pval.c, main/pbx.c: Remove extra defines of AST_PBX_MAX_STACK. * Ensure AST_PBX_MAX_STACK is only defined in extconf.h and pbx.h. * Fix incorrect function parameters in utils/extconf.c. (closes issue ASTERISK-23141) Reported by: Maxim Review: https://reviewboard.asterisk.org/r/3241/ ........ Merged revisions 408785 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408786 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-21 18:34 +0000 [r408730] Kevin Harwell * main/rtp_engine.c, /: rtp_engine: Dynamic payload change in rtp mapping not supported Asterisk didn't support the dynamic payload change in rtp mapping in the 200 OK response. Scenario: Asterisk sends the INVITE proposing alaw and telephone-event, it proposes rtpmap:101 for telephone-event. Peer responds with 2xx, it answers with alaw and telephone-event also, but it proposes a different rtpmap number (rtpmap:103) for telephone-event. Expected Behaviour: Asterisk should honour the rtpmapping in the response and send DTMF packets using 103 as payload type for DTMF. Actual Behaviour: Asterisk sends DTMF packets using payload type 101. With this patch asterisk now supports changes that can occur in the rtp mapping in the response. (closes issue ASTERISK-23279) Reported by: NITESH BANSAL Review: https://reviewboard.asterisk.org/r/3225/ Patches: dynamic_payload_change.patch uploaded by nbansal (license 6418) ........ Merged revisions 408729 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-21 18:17 +0000 [r408711-408715] Richard Mudgett * main/manager.c: manager: Fix AMI Status action of a single channel. Fixed use of uninitialized ao2 container iterator in an off-nominal condition. Either a memory allocation error or the requested channel is an internal channel not exposed to the outside. * res/res_stasis_recording.c, main/stasis_channels.c, res/res_sorcery_astdb.c, include/asterisk/json.h, main/sorcery.c, res/ari/resource_endpoints.c, apps/app_meetme.c, res/res_fax.c: json: Fix off-nominal json ref counting issues. * Fixed off-nominal json ref counting issue with using the following API calls: ast_json_object_set() and ast_json_array_append(). * Fixed off-nominal error reporting in ast_ari_endpoints_list(). * Fixed some miscellaneous off-nominal json ref counting issues in report_receive_fax_status() and dial_to_json(). * main/json.c: json: Fix json API wrapper code for json library versions earlier than 2.3.0. * Fixed json ref counting issue with json API wrapper code for ast_json_object_update_existing() and ast_json_object_update_missing() when the json library is earlier than version 2.3.0. 2014-02-21 16:20 +0000 [r408644-408649] Kevin Harwell * main/rtp_engine.c, /: rtp_engine: Output mixup in ${CHANNEL(rtpqos,audio,all)} Fixed the output of CHANNEL(rtpqos,audio,all) to use txjitter instead of rxjitter. (closes issue ASTERISK-23261) Reported by: rsw686 Patches: rtpqos.patch uploaded by rsw686 (license 5887) ........ Merged revisions 408646 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408647 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/channel.c, /: channel.c: MOH is not working for transferee after attended transfer Updated the code to check to see if MOH is playing on the transferor and if so then start it on the channel that replaces it during a masquerade. Example scenario of the problem: Alice calls Bob and then Bob begins the attended transfer process into a queue. Upon going on hold Alice hears music and so does Bob once he is in the queue. Bob then transfers Alice into the queue and then music for Alice stops even though she should be hearing it since has now replaced Bob in the queue. The problem that was occurring is that once the channel was masqueraded the app (queues, confbridge, etc...) had no way of knowing that the channel had just been swapped out thus it did not start music for the present channel. Credit to Olle Johansson for pointing me in the right direction on this issue. (closes issue ASTERISK-19499) Reported by: Timo Teräs Review: https://reviewboard.asterisk.org/r/3226/ ........ Merged revisions 408642 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408643 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-21 10:42 +0000 [r408591] Alexandr Anikin * /, addons/ooh323c/src/ooCalls.h: Fix type of roundTripDelay variables ........ Merged revisions 408589 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408590 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-21 00:49 +0000 [r408538] Michael L. Young * /, apps/app_chanspy.c: app_chanspy: Documentation Update To Clarify "x" Option When using the "x" option (specify a DTMF digit to exit the application), it is not obvious in the documentation that this only works when spying on a channel. If a channel being used to spy on other channels is waiting to connect to a channel or is no longer attached to a channel, the DTMF is ignored. As noted on the issue tracker, since there are workarounds available and this is a rarely used option we are opting for a documentation change here. (closes issue ASTERISK-22661) Reported by: Chris Hillman Patches: asterisk-22661-doc-clarify-chan_spy.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2990/ ........ Merged revisions 408536 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408537 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-20 21:09 +0000 [r408518-408522] George Joseph * res/res_pjsip/location.c, res/res_pjsip_outbound_registration.c: pjsip_cli: Add pjsip commands 'show registrations' and 'show contacts'. Added 'show registrations' and 'show contacts' to pjsip cli to make things a little more consistent. The output is exactly the same as the list command. Just needed to add entries to their respective ast_cli_entry structures. (closes issue ASTERISK-23275) Review: http://reviewboard.asterisk.org/r/3210/ * res/res_pjsip/pjsip_cli.c, main/config.c: pjsip_cli: Fix memory leak in ast_sip_cli_print_sorcery_objectset. Fixed memory leaks in ast_sip_cli_print_sorcery_objectset and ast_variable_list_sort. (closes issue ASTERISK-23266) Review: http://reviewboard.asterisk.org/r/3200/ * res/res_pjsip/include/res_pjsip_private.h, res/res_pjsip.c, tests/test_sorcery.c, main/sorcery.c, res/res_pjsip/config_system.c, include/asterisk/sorcery.h: sorcery: Create sorcery instance registry. In order to retrieve an arbitrary sorcery instance from a dialplan function (or any place else) there needs to be a registry of sorcery instances. ast_sorcery_init now creates a hashtab as a registry. ast_sorcery_open now checks the hashtab for an existing sorcery instance matching the caller's module name. If it finds one, it bumps the refcount and returns it. If not, it creates a new sorcery instance, adds it to the hashtab, then returns it. ast_sorcery_retrieve_by_module_name is a new function that does a hashtab lookup by module name. It can be called by the future dialplan function. res_pjsip/config_system needed a small change to share the main res_pjsip sorcery instance. tests/test_sorcery was updated to include a test for the registry. (closes issue ASTERISK-22537) Review: http://reviewboard.asterisk.org/r/3184/ 2014-02-20 19:02 +0000 [r408502] Matthew Jordan * res/res_pjsip.c: res_pjsip: Update documentation for 'use_avpf' option When 'use_avpf' is set to True, inbound offers must use the AVPF/SAVPF RTP profile. However, when 'use_avpf' is set to False, Asterisk will accept both AVP/SAVP or AVPF/SAVPF RTP profiles in inbound offers. The documentation previously implied that Asterisk would reject AVPF/SAVPF if 'use_avpf' was set to False and a UA offered said profile in an INVITE request. 2014-02-20 02:43 +0000 [r408449] Rusty Newton * apps/app_queue.c, /: apps/app_queue - Fix incorrect Macro parameter documentation Macro is executed on the called channel, not the calling channel. (closes issue ASTERISK-23069) Reported By: Bryan Anderson ........ Merged revisions 408447 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408448 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-19 19:07 +0000 [r408385-408389] Richard Mudgett * /, main/config.c: config: Add file size and nanosecond resolution fields to the cached modified config file information. Repeatedly modifying config files and reloading too fast sometimes fails to reload the configuration because the cached modification timestamp has one second resolution. * Added file size and nanosecond resolution fields to the cached config file modification timestamp information. Now if the file size changes or the file system supports nanosecond resolution the modified file has a better chance of being detected for reload. * Added a missing unlock in an off-nominal code path. (closes issue AST-1303) Review: https://reviewboard.asterisk.org/r/3235/ ........ Merged revisions 408387 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408388 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_sorcery_astdb.c: res_sorcery_astdb.c: Fix regex handling and keep simple prefix matching performance. The sorcery astDB wizzard does not handle regex correctly if the pattern begins with an anchor character. This patch attempts to convert the anchored regex pattern to a prefix pattern supported by astDB for performance reasons. If it is not able to convert the pattern it falls back to getting all astDB members of the family and doing a normal regex pattern matching on the retrieved records. Review: https://reviewboard.asterisk.org/r/3161/ 2014-02-19 12:00 +0000 [r408314-408331] Alexandr Anikin * addons/ooh323c/src/ooCapability.c, /, addons/ooh323c/src/ooh245.c: process receiveAndTransmit user input remote caps instead of receive only send receiveAndTransmit user input our caps instead of receive only ........ Merged revisions 408328 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408330 from http://svn.asterisk.org/svn/asterisk/branches/11 * addons/ooh323c/src/ooh323.c, /: Allow different socket and signalling ip on h.323 connection if gk mode is active Reported by: Gabriele Odone Patches: ASTERISK-22738-1.patch Tested by: Gabriele Odone (closes issue ASTERISK-22738) ........ Merged revisions 408312 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-18 19:18 +0000 [r408297] Richard Mudgett * contrib/ast-db-manage/config/versions/21e526ad3040_add_pjsip_debug_option.py, contrib/ast-db-manage/voicemail/versions/a2e9769475e_create_tables.py, contrib/ast-db-manage/voicemail/versions, contrib/ast-db-manage, contrib/ast-db-manage/config/env.py, contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py, contrib/ast-db-manage/config, contrib/ast-db-manage/voicemail/env.py, contrib/ast-db-manage/voicemail, contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py, contrib/ast-db-manage/config/versions: alembic: Add svn:ignore *.pyc to directories and svn:executable to *.py files. 2014-02-17 15:21 +0000 [r408270] Mark Michelson * res/res_pjsip/location.c, UPGRADE.txt, res/res_pjsip.c, res/res_pjsip_registrar.c, include/asterisk/res_pjsip.h: Store SIP User-Agent information in contacts. When an endpoint sends a REGISTER request to Asterisk, we now will associate the User-Agent header with all contacts that were bound in that REGISTER request. 2014-02-16 03:23 +0000 [r408194-408220] Matthew Jordan * main/pbx.c, /: pbx: Handle a completely empty dialplan during a context merge It is highly unlikely, but - at least in Asterisk 12 - theoretically possible to load Asterisk with no dialplan whatsoever. If that occurs, and some other module (that is not a pbx module) attempts to merge its contexts into the dialplan, the existing merge routine will crash. This is because it is not insane, and rightly believes that you provided some sort of dialplan, somewhere. This patch will gracefully merge the contexts in such a case. Note that this is highly unlikely to occur in 1.8/11, as features will most likely provide some dialplan via parking. However, in Asterisk 12, parking is now provided by res_parking, and hence may create its dialplan later. (closes issue ASTERISK-23297) Reported by: CJ Oster Review: https://reviewboard.asterisk.org/r/3222 ........ Merged revisions 408200 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408201 from http://svn.asterisk.org/svn/asterisk/branches/11 * Makefile, /: buildsystem: Unbreak the build (infloop) on Asterisk 11+ Apparently r408084 ( https://reviewboard.asterisk.org/r/3212/ ) broke the build. This patch fixes it by ignoring the .lastclean dependencies if the MENUSELECT_EMBED variable is not defined. patches: tmp.diff uploaded by wdoekes (License 5674) Review: https://reviewboard.asterisk.org/r/3228/ ........ Merged revisions 408193 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-14 21:44 +0000 [r408138-408140] Scott Griepentrog * main/stasis_endpoints.c: ARI: correct upper/lower case URI discrepancies URI's are supposed to be case sensitive and all lower case. In practice some portions of URI's in ARI are case insensitive and others are not, such as TECH, which in one instance would match a lower case name and in another would not. In this patch, the ast_endpoint_lastest_snapshot() function is modified to change the TECH portion to full upper case before lookup. This resolves the discrepancy noted by the reporter. However I chose to avoid forcing the /ari prefix of the URI's to be lower case for now. Except for the two cases here, all URI's should be lower case, unless they are part of a resource name or id. Review: https://reviewboard.asterisk.org/r/3211/ Reported by: Zane Conkle (closes issue ASTERISK-23125) * main/format.c, /: format.c: correct possible null pointer dereference In ast_format_sdp_parse and ast_format_sdp_generate the check checks for a valid interface and function were potentially confusing, and hid an error in the test of the presence of the function that is called later. This patch clears up and corrects the test. Review: https://reviewboard.asterisk.org/r/3208/ (closes issue ASTERISK-23098) Reported by: marcelloceschia Patches: main_format.patch uploaded by marcelloceschia (license 6036) ASTERISK-23098.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 408137 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-14 13:29 +0000 [r408085] Walter Doekes * Makefile, /: buildsystem: Don't force main to depend on everything else. Directory 'main' only needs to depend on embedded modules. If no module embedding is selected, the dependency is dropped. Review: https://reviewboard.asterisk.org/r/3212/ ........ Merged revisions 408083 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 408084 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-14 12:39 +0000 [r408069] Matthew Jordan * channels/chan_sip.c: chnan_sip: Set SIP_DEFER_BYE_ON_TRANSFER prior to calling bridge blind transfer This patch moves setting SIP_DEFER_BY_ON_TRANSFER prior to calling ast_bridge_transfer_blind. This prevents a BYE from being sent prior to the NOTIFY request that informs the transferor if the transfer succeeded or failed. This patch also clears said flag from the off nominal NOTIFY paths in the local_attended_transfer code, as once we've sent the NOTIFY request it is safe to send by the BYE request. This was caught by the blind-transfer-accountcode test in the Asterisk Test Suite. (closes issue ASTERISK-23290) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3214/ 2014-02-13 18:50 +0000 [r407988-408005] Mark Michelson * res/res_pjsip_mwi.c, res/res_pjsip_pubsub.c: Remove all PJSIP MWI-specific use from our MWI code. PJSIP has built-in MWI code that could be useful to some degree, but our utilization of the API actually made our code a bit more cluttered since we had to have special cases peppered throughout. With this change, we move to using the pjsip_evsub API instead, which streamlines the code by removing special cases. Review: https://reviewboard.asterisk.org/r/3205 * res/res_pjsip/location.c: Fix crash in AMI PJSIPShowEndpoint action. If an AOR has no permanent contacts, then the permanent_contacts container is never allocated. This makes the code safe in the face of NULLs. I also changed the variable that counts contacts from "num" to "total_contacts" since there are now two variables that are indicate numbers of things. 2014-02-12 08:18 +0000 [r407968] Walter Doekes * main/config.c: realtime: Fix ast_update2_realtime() on raspberry pi. The old code depended on undefined va_arg behaviour: calling a function twice with the same va_list parameter and expecting it to continue where it left off. The changed code behaves like the manpage says it should. Also added a bunch of early returns to trap errors (e.g. OOM) instead of crashing. The problem was found by Julian Lyndon-Smith. The deviant behaviour on the raspberry PI also uncovered another bug (fixed in r407875) in the res_config_pgsql.so driver. Reported by: jmls Tested by: jmls Review: https://reviewboard.asterisk.org/r/3201/ 2014-02-11 03:16 +0000 [r407937] Matthew Jordan * res/ari/resource_channels.c: ari/resource_channels: Add channel variables earlier in the creation process This patch tweaks the behaviour of POST /channels with channel variables such that the variables are passed into the pbx.c routines that perform the origination. This allows the variables to be assigned to the newly created channels immediately upon their construction, as opposed to be assigned after the originate has completed. The upshot of this is that the variables are available on the channels if they execute in the dialplan, as opposed to only being available once the channels are answered. Review: https://reviewboard.asterisk.org/r/3183/ 2014-02-10 16:43 +0000 [r407875] Walter Doekes * res/res_config_pgsql.c, /: res_config_pgsql: Fix ast_update2_realtime calls. Fix so multiple updates from a single call works (add missing ','). Remove bogus ast_free's that weren't supposed to be there. Moved a few spaces for readability. Review: https://reviewboard.asterisk.org/r/3194/ ........ Merged revisions 407873 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407874 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-10 15:54 +0000 [r407858] Kinsey Moore * apps/confbridge/conf_state_multi_marked.c, apps/confbridge/conf_state_empty.c, apps/confbridge/conf_config_parser.c, configs/confbridge.conf.sample, /, apps/confbridge/include/confbridge.h, UPGRADE.txt, apps/app_confbridge.c: ConfBridge: Correct prompt playback target Currently, when the first marked user enters the conference that contains waitmarked users, a prompt is played indicating that the user is being placed into the conference. Unfortunately, this prompt is played to the marked user and not the waitmarked users which is not very helpful. This patch changes that behavior to play a prompt stating "The conference will now begin" to the entire conference after adding and unmuting the waitmarked users since the design of confbridge is not conducive to playing a prompt to a subset of users in a conference in an asynchronous manner. (closes issue PQ-1396) Review: https://reviewboard.asterisk.org/r/3155/ Reported by: Steve Pitts ........ Merged revisions 407857 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-07 20:48 +0000 [r407766] Richard Mudgett * /, channels/chan_iax2.c: chan_iax2: Add some more iaxs[] NULL checks to a routine already full of them. ........ Merged revisions 407764 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407765 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-07 20:09 +0000 [r407747-407750] Matthew Jordan * main/security_events.c: security_events: Fix assertion failure in dev-mode on optional IE parsing When formatting an optional IE, the value is, of course, optional. As such, it is entirely appropriate for ast_json_object_get to return NULL. If that occurs, we now simply skip the IE that was requested, as it was not provided by the entity that raised the event. Thanks to George Joseph (gtjoseph) for catching this and reporting it in #asterisk-dev * funcs/func_cdr.c: funcs/func_cdr: Handle empty time values when extracting parsed values When extracting timestamps that are parsed, time stamp values that are not set (time values of 0.000000) should not actually result in a parsed string. The value should be skipped, and the result of the CDR function should be an empty string. Prior to this patch, the result was fed to the time formatting, which would result in an output of a date/time in 1969. 2014-02-07 18:18 +0000 [r407729] Richard Mudgett * configs/iax.conf.sample, /, channels/chan_iax2.c, include/asterisk/frame.h: chan_iax2: Block unnecessary control frames to/from the wire. Establishing an IAX2 call between Asterisk v1.4 and v1.8 (or later) results in an unexpected call disconnect. The problem happens because newer values in the enum ast_control_frame_type are not consistent between the branch versions of Asterisk. For example: 1) v1.4 calls v1.8 (or later) using IAX2 2) v1.8 answers and sends a connected line update control frame. (on v1.8 AST_CONTROL_CONNECTED_LINE = 22) 3) v1.4 receives the control frame as an end-of-q (on v1.4 AST_CONTROL_END_OF_Q = 22) 4) v1.4 disconnects the call once the receive queue becomes empty. Several things are done by this patch to fix the problem and attempt to prevent it from happening again in the future: * Added a warning at the definition of enum ast_control_frame_type about how to add new control frame values. * Made block sending and receiving control frames that have no reason to go over the wire. * Extended the connectedline iax.conf parameter to also include the redirecting information updates. * Updated the connectedline iax.conf parameter documentation to include a notice that the parameter must be "no" when the peer is an Asterisk v1.4 instance. (closes issue AST-1302) Review: https://reviewboard.asterisk.org/r/3174/ ........ Merged revisions 407678 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407727 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-07 16:46 +0000 [r407676] Matthew Jordan * main/security_events.c: security_events: Fix error caused by DTD validation error The appdocsxml.dtd specifies that a "required" attribute in a parameter may have a value of yes, no, true, or false. On some systems, specifying "False" instead of "false" would cause a validation error. This patch fixes the casing to explicitly match the DTD. 2014-02-07 13:13 +0000 [r407624] Tzafrir Cohen * /, configs/indications.conf.sample: indications.conf: add stutter tone; end properly * If the "stutter" (voicemail indication) tone is indeed a stutter tone, and it ends with a constant tone, make sure that it is the dial tone. This was done for India (in), Mexico (mx) and the Philippines (ph). * If no "stutter" tone exists for a country, provide one. This was done for Spain (es), Malaysia (my) and Venezuela (ve). Review: https://reviewboard.asterisk.org/r/3158/ ........ Merged revisions 407622 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407623 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-03-03 Asterisk Development Team * Asterisk 12.1.0 Released. 2014-03-01 Asterisk Development Team * Asterisk 12.1.0-rc3 Released. * chan_sip: Fix crash in ast_channel_hangupcause_set(). Fix crash in ast_channel_hangupcause_set() because p->owner not checked before calling. Regression introduced by the fix for ASTERISK-22621. (closes issue ASTERISK-23135) Reported by: OK (issue ASTERISK-23323) Reported by: Walter Doekes 2013-02-27 Asterisk Development Team * Asterisk 12.1.0-rc2 Released. * res_rtp_asterisk: Fix checklist creating problems in ICE sessions Prior to this patch, local candidate lists including SRFLX would fail to start properly when building ICE candidate check lists. This patch fixes that problem by making sure that each SRFLX candidate is associated with the proper base address so that the check list can create matches properly. This patch was written by jcolp. The issue will be left open to await testing by the issue participants. (issue ASTERISK-23213) Reported by: Andrea Suisani Review: https://reviewboard.asterisk.org/r/3256/ * res_fax: Warn that minrate=2400 is not valid for V.27 instead of failing load. Change minrate from 2400 to 4800 on config reload in response to changes from ASTERISK-22790 only. Any config with minrate of 2400 that would fail before r405693 will still fail. Comment out many settings in res_fax.conf.sample. The defaults are set in res_fax.c, so setting the same value in sample config does nothing but make the sample config more fragile. (closes issue ASTERISK-23231) Reported by: David Brillert Review: https://reviewboard.asterisk.org/r/3261/ * main: Initialize dialplan providing core components prior to module pre-load It is possible to pre-load pbx_config. As a result, pbx_config - which will load and parse the dialplan - will attempt to use various dialplan components, such as device state providers and presence state providers, prior to them being initialized by the core. This would lead to a crash, as the components had not created their Stasis cache entries. This patch moves a number of core component initializations before the module pre-load. This guarantees that if someone does pre-load pbx_config - or other pbx modules - that the Stasis caches for the various core components are created. (closes issue ASTERISK-23320) Reported by: xrobau (closes issue ASTERISK-23265) Reported by: Andrew Nagy Tested by: Andrew Nagy, Rusty Newton * ari/resource_channels: Add channel variables earlier in the creation process This patch tweaks the behaviour of POST /channels with channel variables such that the variables are passed into the pbx.c routines that perform the origination. This allows the variables to be assigned to the newly created channels immediately upon their construction, as opposed to be assigned after the originate has completed. The upshot of this is that the variables are available on the channels if they execute in the dialplan, as opposed to only being available once the channels are answered. * security_events: Fix assertion failure in dev-mode on optional IE parsing When formatting an optional IE, the value is, of course, optional. As such, it is entirely appropriate for ast_json_object_get to return NULL. If that occurs, we now simply skip the IE that was requested, as it was not provided by the entity that raised the event. Thanks to George Joseph (gtjoseph) for catching this and reporting it in #asterisk-dev * funcs/func_cdr: Handle empty time values when extracting parsed values When extracting timestamps that are parsed, time stamp values that are not set (time values of 0.000000) should not actually result in a parsed string. The value should be skipped, and the result of the CDR function should be an empty string. Prior to this patch, the result was fed to the time formatting, which would result in an output of a date/time in 1969. * security_events: Fix error caused by DTD validation error The appdocsxml.dtd specifies that a "required" attribute in a parameter may have a value of yes, no, true, or false. On some systems, specifying "False" instead of "false" would cause a validation error. This patch fixes the casing to explicitly match the DTD. 2013-02-06 Asterisk Development Team * Asterisk 12.1.0-rc1 Released. 2014-02-06 20:06 +0000 [r407589] Matthew Jordan * main/security_events.c, UPGRADE.txt, CHANGES: security_events: Add AMI documentation; output optional fields This patch adds documentation for the Security Events that are emited over AMI. It also notes these events in the UPGRADE/CHANGES file. 2014-02-06 19:57 +0000 [r407587] Rusty Newton * configs/pjsip.conf.sample: configs/pjsip.conf.sample: Configuration section naming in pjsip.conf.sample needs a little clarification There is a bit of nuance to how you name things in pjsip.conf. This is a documentation patch to at least clear it up a little for users. Review: https://reviewboard.asterisk.org/r/3180/ 2014-02-06 17:54 +0000 [r407572] Kevin Harwell * contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py: pjsip realtime: already created enum failure for postgresql If an enum had been previously created the alembic script would attempt to re-create it and an error would be generated while running migrations for a postgresql server. The work around for this is to use the ENUM object type for postgres as opposed to the generic enum type used by sqlalchemy. Using this type in the script seems to work properly for both postgres and mysql. 2014-02-06 17:06 +0000 [r407568] Richard Mudgett * res/res_pjsip_logger.c, res/res_pjsip/include/res_pjsip_private.h, res/res_pjsip/pjsip_options.c, res/res_pjsip/config_transport.c, include/asterisk/res_pjsip.h, res/res_pjsip/config_global.c, res/res_pjsip/config_auth.c, res/res_pjsip/location.c, res/res_pjsip_outbound_registration.c, res/res_pjsip_endpoint_identifier_ip.c, include/asterisk/res_pjsip_cli.h, res/res_pjsip/pjsip_cli.c, res/res_pjsip/pjsip_configuration.c, res/res_pjsip/config_domain_aliases.c: res_pjsip: Updates and adds more PJSIP CLI commands. * Adds identify, transport, and registration support to the PJSIP CLI. * Creates three additional callbacks, one for an iterator, one for a comparator, and one for a container. This eliminates the link dependency from higher level modules to lower level ones. * Eliminates duplicate sorting in PJSIP CLI commands. * Cleans up PJSIP CLI output formatting. * Pushes CLI command registration down to the implementing source file. * Adds several ast_sip_destroy_sorcery functions to complement existing ast_sip_sorcery_initialize functions. The destroy functions unregister PJSIP CLI commands and PJSIP CLI formatters. Reported by: George Joseph Review: https://reviewboard.asterisk.org/r/3104/ 2014-02-06 16:53 +0000 [r407567] Mark Michelson * contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py: Fix alembic script to work properly in offline mode. When run in offline mode, this would attempt to check the database for the presence of a type it was going to try to create. I now check the context to see if we're running in offline mode and change a parameter accordingly. 2014-02-05 23:03 +0000 [r407513] Rusty Newton * /, formats/format_wav.c: formats/format_wav: enhancing log message "Not a wav file" to be clear on what is supported Modifying the log message to be more specific as to what is supported. Specifically it seems format_wav supports only PCM encoded versions with a lower-case '.wav' extension. (closes issues ASTERISK-22310) Reported by: Jim Credland Review: https://reviewboard.asterisk.org/r/3188/ ........ Merged revisions 407511 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407512 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-05 20:55 +0000 [r407461] Jonathan Rose * CHANGES: CHANGES: Improved description of Name/Creator changes to bridge ARI, adds AMI The changes log was written with language that was a little too internal Asterisk specific, so it's been changed to be more in the frame of reference of an ARI user. Also, previously the AMI event changes were omitted from the change log as well as the ability to include a bridge name in the ARI post bridges command. 2014-02-05 20:43 +0000 [r407458] Kinsey Moore * main/logger.c, /: Logger: Fix handling of absolute paths This fixes path handling for log files so that an extra / is not appended to the file path when the path is absolute (begins with /). This would previously result in different but functionally equivalent paths in the output of 'logger show channels'. ........ Merged revisions 407455 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407456 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-05 19:41 +0000 [r407442] Kevin Harwell * res/res_pjsip/config_global.c: res_pjsip: When no global type the debug option defaults to "yes" If the global section was not specified in pjsip.conf then the configuration object does not exist in sorcery so when retrieving "debug" option it would return NULL. Then the NULL result was passed to ast_false utils function which would return false because it wasn't set to some representation of false, thus enabling sip debug logging. Made it so if the global config object does not exist then it will return a default of "no" for sip debugging. (issue ASTERISK-23038) Reported by: Rusty Newton 2014-02-05 17:27 +0000 [r407423] Kinsey Moore * UPGRADE.txt: UPGRADE: Note change in behavior for device state subscriptions 2014-02-05 17:12 +0000 [r407419] Jonathan Rose * CHANGES: CHANGES: Update changes log to include new bridge fields added in r404042 2014-02-05 14:22 +0000 [r407389-407402] Matthew Jordan * UPGRADE.txt, rest-api/api-docs/channels.json, rest-api/api-docs/sounds.json, rest-api/resources.json, CHANGES, include/asterisk/manager.h, rest-api/api-docs/bridges.json, rest-api/api-docs/recordings.json, rest-api/api-docs/deviceStates.json, rest-api/api-docs/endpoints.json, rest-api/api-docs/mailboxes.json, rest-api/api-docs/events.json, rest-api/api-docs/asterisk.json, rest-api/api-docs/applications.json, rest-api/api-docs/playbacks.json: ARI/AMI: Update versions; update UPGRADE/CHANGES notes for 12.1.0 changes Due to backwards compatible changes made to AMI/ARI, the version needs to be bumped to 1.1.0/2.1.0, respectively. * rest-api-templates/api.wiki.mustache, rest-api-templates/swagger_model.py: api.wiki.mustache: Update wiki template to support body parameters This patch updates the api.wiki.mustache template and the swagger_model python script to understand if an operation has a body parameter. If an operation does have a body parameter, it will now be displayed in the corresponding wiki entry. 2014-02-04 20:08 +0000 [r407274-407339] Richard Mudgett * include/asterisk/devicestate.h, /, main/devicestate.c: devicestate: Make ast_devstate_changed_literal() return value and doxygen consistent. Nothing actually cares about the value anyway. (closes issue ASTERISK-23178) Reported by: Jonathan Rose ........ Merged revisions 407337 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407338 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_pjsip/pjsip_configuration.c: res_pjsip: Fix assertion for pjsip.conf authorization list options. (closes issue ASTERISK-23168) Reported by: George Joseph Review: https://reviewboard.asterisk.org/r/3143/ * configs/sip.conf.sample, main/tcptls.c, /: tcptls.c: Made TLS handle a certificate chain file. Thanks to Guillaume Martres for doing the necessary research to validate the change. (closes issue ASTERISK-17727) Reported by: LN Patches: use_certificate_chain.patch (license #5864) patch uploaded by st documente_certificate_chain.patch (license #6576) patch uploaded by Guillaume Martres ........ Merged revisions 407272 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407273 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-04 16:54 +0000 [r407259] Matthew Jordan * funcs/func_cdr.c: funcs/func_cdr: Fix non-epoch timestamps broken by improper char array deref Thanks to snuffy for pointing this issue out and fixing it. (closes issue ASTERISK-23250) Reported by: snuffy patches: func_cdr-fix.diff uploaded by snuffy (License 5024) 2014-02-04 02:21 +0000 [r407213] Joshua Colp * /, res/res_clialiases.c: res_clialiases: Fix crash when reloading and re-aliasing an alias that is in use. The code assumed that unregistering the alias would always succeed while in practice this is not actually true. A common case is the "reload" command itself. If the cli_aliases.conf configuration file was changed and reload executed the command would fail to unregister and ultimately point to freed memory. The reload process now checks whether unregistering succeeded or not and if not the old CLI alias is retained. (closes issue ASTERISK-19773) Reported by: Joel Vandal (closes issue ASTERISK-22757) Reported by: Gareth Blades ........ Merged revisions 407205 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407210 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-02-04 02:04 +0000 [r407197] Damien Wedhorn * channels/chan_skinny.c: Skinny - Fix deadlock when pickup of no call. Locking issues in skinny when picking up a call that doesn't exist. Cleaned up sub locking by fully removing and using the chan lock instead. Also changed ast_call_pickup to check whether chan was masq'd. (closes issue ASTERISK-23249) Reported by: wedhorn Tested by: snuffy, myself Patches: skinny-locking01.diff uploaded by wedhorn (license 5019) 2014-02-03 01:14 +0000 [r407166] Matthew Jordan * main/cdr.c: cdrs: Check for applications to lock onto during dial begin handling This patch brings CDR processing further in line with r407085. During some dial operations, the application would not be locked to the Dial application and would instead continue to show the previously known application. In particular, this would occur when a Parked call would time out. This was due to a previous snapshot already locking the application to Park - processing this in a Dial Begin allows the Dial application to reassert its rightful place. (CDRs. Ugh.) But hooray for the Parked Call tests for catching this in the Asterisk Test Suite. 2014-02-01 16:23 +0000 [r407153] Joshua Colp * res/ari/ari_model_validators.c, res/res_stasis.c, main/stasis_bridges.c, res/ari/ari_model_validators.h, rest-api/api-docs/events.json, res/stasis/app.c: res_stasis: Enable transfers and provide events when they occur. This change enables transfers within ARI created bridges and adds events for when they occur. Unlike other events these will be received if *any* subscribed object is involved in the transfer. (closes issue ASTERISK-22984) Reported by: David M. Lee Review: https://reviewboard.asterisk.org/r/3120/ 2014-02-01 00:24 +0000 [r407104] coreyfarrell : * /, apps/app_stack.c: app_stack: protect against missing parameters to STACK_PEEK and LOCAL_PEEK STACK_PEEK requires 2 parameters and LOCAL_PEEK requires 1 parameter. This protects against situations where those parameters are blank or missing by logging an error and returning. (closes issue ASTERISK-23220) Reported by: James Sharp ........ Merged revisions 407100 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407103 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-31 23:40 +0000 [r407082-407084] Matthew Jordan * main/manager_channels.c, apps/app_dial.c, main/cdr.c, main/pbx.c, main/bridge_after.c, UPGRADE.txt: CDRs: fix a variety of dial status problems, h/hangup handler creating CDRs This patch fixes a number of small-ish problems that were noticed when witnessing the records that the FreePBX dialplan produces: (1) Mid-call events (as well as privacy options) have the ability to change the overall state of the Dial operation after the called party answers. This means that publishing the DialEnd event when the called party is premature; we have to wait for the execution of these subroutines to complete before we can signal the overall status of the DialEnd. This patch moves that publication and adds handlers for the mid-call events. (2) The AST_FLAG_OUTGOING channel flag is cleared if an after bridge goto datastore is detected. This flag was preventing CDRs from being recorded for all outbound channels that had a 'continue' option enabled on them by the Dial application. (3) The CDR engine now locks the 'Dial' application as being the CDR application if it detects that the current CDR has entered that app. This is similar to the logic that is done for Parking. In general, if we entered into Dial, then we want that CDR to record the application as such - this prevents pre-dial handlers, mid-call handlers, and other shenaniganry from changing the application value. (4) The CDR engine now checks for the AST_SOFTHANGUP_HANGUP_EXEC in more places to determine if the channel is in hangup logic or dead. In either case, we don't want to record changes in the channel. (5) The default option for "endbeforehexten" has been changed to "yes". In general, you don't want to see CDRs in the 'h' exten or in hangup logic. Since the semantics of that option changed in 12, it made sense to update the default value as well. (6) Finally, because we now have the ability to synchronize on the messages published to the CDR topic, on shutdown the CDR engine will now synchronize to the messages currently in flight. This helps to ensure that all in-flight CDRs are written before shutting down. (closes issue ASTERISK-23164) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3154 * apps/app_dial.c, /: app_dial: Allow macro/gosub pre-bridge execution to occur on priorities The parsing for the destination of the macro/gosub uses the '^' character to separate out context, extension, and priority. However, the logic for the macro/gosub execution was written such that it would only do the actual macro/gosub jump if a '^' character existed. This doesn't apply when the macro/gosub jump occurs in a priority/priority label. This patch changes the logic so that the parsing still occurs, but the jump will occur even for priorities/priority labels. (issue ASTERISK-23164) Review: https://reviewboard.asterisk.org/r/3154 ........ Merged revisions 407041 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 407074 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-31 23:14 +0000 [r407034-407036] Kevin Harwell * contrib/ast-db-manage/config/versions/21e526ad3040_add_pjsip_debug_option.py (added), configs/pjsip.conf.sample, UPGRADE.txt, res/res_pjsip_logger.c, CHANGES, res/res_pjsip.c, include/asterisk/res_pjsip.h, res/res_pjsip/config_global.c: res_pjsip: Config option to enable PJSIP logger at load time. Added a "debug" configuration option for res_pjsip that when set to "yes" enables SIP messages to be logged. It is specified under the "system" type. Also added an alembic script to add the option to realtime. (closes issue ASTERISK-23038) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/3148/ * res/res_pjsip_exten_state.c: res_pjsip_exten_state: Exporting global symbols caused load order issues Removed the exportation of global symbols from the module as it is no longer needed and it could potentially cause load problems as on some systems it would try to load before res_pjsip_pubsub 2014-01-31 22:38 +0000 [r407031] Mark Michelson * include/asterisk/res_pjsip_presence_xml.h (added): Add file that apparently got missed in the merge. 2014-01-31 22:17 +0000 [r407019] Kevin Harwell * UPGRADE.txt, contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py, contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py: alembic: script modifications due to errors A couple of the scripts had errors that would not allow a full migration to take place. The extensions table needed to make its 'id' column a primary key in order to work with mysql. The other script ...add_endpoints... was missing tables that it was trying to add columns to. Added the primary key on id for extensions and added the tables in for the missing pjsip configuration options. While it is not ideal to modify already released scripts this was a case where it had to be done due to errors in the script and lacking a better alternative. Review: https://reviewboard.asterisk.org/r/3167/ 2014-01-31 22:11 +0000 [r407016] Mark Michelson * res/res_pjsip_xpidf_body_generator.c (added), res/res_pjsip_mwi_body_generator.c (added), res/res_pjsip_pubsub.c, res/res_pjsip_pidf.c (removed), res/res_pjsip_pidf_eyebeam_body_supplement.c (added), res/res_pjsip_exten_state.c, res/res_pjsip/presence_xml.c (added), include/asterisk/res_pjsip_pubsub.h, res/res_pjsip_pidf_body_generator.c (added), include/asterisk/res_pjsip_exten_state.h (removed), res/res_pjsip_pubsub.exports.in, include/asterisk/res_pjsip_body_generator_types.h (added), res/res_pjsip_mwi.c: Decouple subscription handling from NOTIFY/PUBLISH body generation. When the PJSIP pubsub framework was created, subscription handlers were required to state what event they handled along with what body types they knew how to generate. While this serves well when implementing a base RFC, it has problems when trying to extend the body to support non-standard or proprietary body elements. The code also was NOTIFY-specific, meaning that when the time comes that we start writing code to send out PUBLISH requests with MWI or presence bodies, we would likely find ourselves duplicating code that had previously been written. This changeset introduces the concept of body generators and body supplements. A body generator is responsible for allocating a native structure for a given body type, providing the primary body content, converting the native structure to a string, and deallocating resources. A body supplement takes the primary body content (the native structure, not a string) generated by the body generator and adds nonstandard elements to the body. With these elements living in their own module, it becomes easy to extend our support for body types and to re-use resources when sending a PUBLISH request. Body generators and body supplements register themselves with the pubsub core, similar to how subscription and publish handlers had done. Now, subscription handlers do not need to know what type of body content they generate, but they still need to inform the pubsub core about what the default body type for a given event package is. The pubsub core keeps track of what body generators and body supplements have been registered. When a SUBSCRIBE arrives, the pubsub core will check that there is a subscription handler for the event in the SUBSCRIBE, then it will check that there is a body generator that can provide the content specified in the Accept header(s). Because of the nature of body generators and supplements, it means res_pjsip_exten_state and res_pjsip_mwi have been completely gutted. They no longer worry about body types, instead calling ast_sip_pubsub_generate_body_content() when they need to generate a NOTIFY body. Review: https://reviewboard.asterisk.org/r/3150 2014-01-31 22:05 +0000 [r407014] Kevin Harwell * res/res_pjsip_mwi.c: res_pjsip_mwi: Subscribe fails when missing aor name When subscribing to MWI (res_pjsip_mwi) and the sip uri did not contain a name (ex: sip:) then the subscription would fail since it would be unable to locate an associated aor. This patch makes it so that when a subscribe comes with no aor name then it will subscribe to all aors on the located endpoint. (closes issue ASTERISK-23072) Reported by: Bob M Review: https://reviewboard.asterisk.org/r/3164/ 2014-01-31 15:01 +0000 [r407000] Kinsey Moore * res/res_pjsip_nat.c: PJSIP: Fix address for ACK in NAT situations In NAT scenarios where a call is placed to a Grandstream phone, res_pjsip will sometimes send the ACK to a 200 OK to the private address of the device behind the NAT instead of the address of the NAT device. This corrects that behavior by rewriting the address in the Contact header in the incoming 200 OK and the dialog's target address if necessary (since it has already been rewritten to the incorrect private address). (closes issue ASTERISK-23106) Review: https://reviewboard.asterisk.org/r/3168/ Reported by: Matt Jordan 2014-01-31 05:28 +0000 [r406987] Damien Wedhorn * channels/chan_skinny.c: Skinny: fix up possible double unlock of chan. Return before chan is possibly unlocked a second time when hanging up a channel in SUBSTATE_OFFHOOK. 2014-01-30 20:34 +0000 [r406935] coreyfarrell : * main/udptl.c, res/res_rtp_asterisk.c, /: res_rtp_asterisk & udptl: fix port selection to work with SELinux restrictions ast_bind to a port reserved for another program by SELinux causes errno == EACCES. This caused random failures when binding rtp or udptl sockets. Treat EACCES as a non-fatal error, try next port. (closes issue ASTERISK-23134) Reported by: Corey Farrell ........ Merged revisions 406933 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406934 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-30 17:33 +0000 [r406919] Sean Bright * main/manager.c, /: Make a NOTICE about an invalid channel name more useful. ........ Merged revisions 406918 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-29 00:42 +0000 [r406862] Russell Bryant * /, configs/queues.conf.sample: queues.conf.sample Fix documented default for persistentmembers Closes issue ASTERISK-22662 ........ Merged revisions 406860 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406861 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-28 23:35 +0000 [r406788-406847] Kevin Harwell * res/res_pjsip_pubsub.c: res_pjsip_pubsub: potential crash on timeout What seems to be happening is if a subscription has been terminated and the subscription timeout/expires is less than the time it takes for all pending transactions (currently on the subscription) to end then the subscription timer will not have been canceled yet and sub will be null. Since the subscription has already been canceled nothing needs to be done so a null check in the asterisk code is sufficient in working around this problem. (closes issue ASTERISK-23129) Reported by: Dan Jenkins * cdr/cdr_radius.c, cel/cel_radius.c, /, configure, include/asterisk/autoconfig.h.in, configure.ac: cdr_radius, cel_radius: build agains libfreeradius-client Asterisk's RADIUS module currently build against libradiusclient-ng, but this project has been superseeded by libfreeradius-client. The API is 99% compatible except that the header name has changed, the library name has changed, and the configuration file location has changed. (closes issue ASTERISK-22980) Reported by: Jeremy Lainé Patches: freeradius-client.patch uploaded by sharky (license 6561) ........ Merged revisions 406801 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406802 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_pjsip/include/res_pjsip_private.h, include/asterisk/compat.h: res_pjsip,compat: INFINITY and NAN undefined On some systems the values for INFINITY and NAN are not defined thus causing a build error on those systems. Added definitions for those if they had not previously been defined. (closes issue ASTERISK-23056) Reported by: capouch Patches: inf-nan-patch.txt uploaded by capouch (license 6564) 2014-01-28 19:13 +0000 [r406775] Kinsey Moore * res/res_stasis_device_state.c: ARI: Make double subscribe respond with success Currently, attempting to subscribe an application to a device state that it has already subscribed to will generate a 500 error response. This will now be treated as a subscription refresh even though ARI subscriptions don't currently support lifetimes and will respond with the normal response for a successful subscription (200 OK). (closes issue ASTERISK-23143) Reported by: Matt Jordan 2014-01-28 16:41 +0000 [r406723] Scott Griepentrog * main/rtp_engine.c, /: rtp_engine: improved handling of get_rtp_info failure In ast_rtp_instance_make_compatible(), after a failure of channel tech call get_rtp_info() to return peer_instance, the null pointer would be passed to ao2_ref, producing an error that looked like a refernce counting problem but is not. This patch corrects that and adds helpful LOG_ERROR messages to indicate which failure path occurred. (issue AST-1276) Review: https://reviewboard.asterisk.org/r/3156/ ........ Merged revisions 406721 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406722 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-28 00:11 +0000 [r406707] Richard Mudgett * tests/test_cel.c, tests/test_cdr.c: test_cdr.c, test_cel.c: Correctly destroy created bridges. * Fixed the test_cel_attended_transfer_bridges_link unit test to also account for the local channel link being destroyed now that the bridges are actually destroyed. * Made CDR unit test use its own version of do_sleep() from the CEL unit tests. 2014-01-27 20:36 +0000 [r406574-406645] Russell Bryant * /, main/config.c: Allow nested #includes in extconfig.conf extconfig.conf was hard-coded to not allow nested includes for some reason. The code has been this way since a patch was merged for ASTERISK-3333 (revision 4889), which was a significant update to this code ("Merge config updates"). I can't figure out any good reason why this should be limited. This patch just removes the limit and uses the default nesting depth limit. Closes issue ASTERISK-17837 Review: https://reviewboard.asterisk.org/r/3159/ ........ Merged revisions 406643 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406644 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/channel.c, /, main/file.c, include/asterisk/channel.h: Protect ast_filestream object when on a channel The ast_filestream object gets tacked on to a channel via chan->timingdata. It's a reference counted object, but the reference count isn't used when putting it on a channel. It's theoretically possible for another thread to interfere with the channel while it's unlocked and cause the filestream to get destroyed. Use the astobj2 reference count to make sure that as long as this code path is holding on the ast_filestream and passing it into the file.c playback code, that it knows it's valid. Bug reported by Leif Madsen. Review: https://reviewboard.asterisk.org/r/3135/ ........ Merged revisions 406566 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406567 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-26 23:03 +0000 [r406516] Richard Mudgett * main/tcptls.c, /: tcptls.c: Add missing cleanup on off nominal path. ........ Merged revisions 406514 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406515 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-26 02:10 +0000 [r406489] Joshua Colp * res/res_pjsip_session.c: res_pjsip_session: Be less strict with core requested outgoing capabilities. The core may (depending on circumstances) request a single codec on outgoing calls. Many channel drivers ignore or treat this as a suggestion while still including configured codecs. The res_pjsip_session logic treated this as an explicit request, leaving out other configured codecs. This change makes res_pjsip_session behave like other channel driver and simply adds the requested codec to the list. (closes issue ASTERISK-23082) Reported by: xrobau Review: https://reviewboard.asterisk.org/r/3140/ 2014-01-24 23:29 +0000 [r406401-406465] Richard Mudgett * main/cel.c, /: CEL: Protect data structures during reload and shutdown. The CEL data structures need to be protected during a configuration reload and shutdown. Asterisk crashed during a shutdown because CEL events were still in flight and the CEL data structures were already destroyed. * Protected the cel_backends, cel_dialstatus_store, and cel_linkedids ao2 containers with a global ao2 object wrapper. * Added NULL checks before use of the cel_backends, cel_dialstatus_store, and cel_linkedids ao2 containers in case the CEL module is already shutdown. * Fixed overloading of the cel_linkedids held objects reference count. During shutdown any held objects would be leaked. * Fixed memory leak of cel_linkedids held objects if the LINKEDID_END is not being tracked. The objects in the cel_linkedids container were not removed if the LINKEDID_END event is not used. * Added access protection to the cel_backends container during the CLI "cel show status" command. * Made cel_backends, cel_dialstatus_store, and cel_linkedids use the standard ao2 callback templates for the hash and cmp functions. * Eliminated unnecessary uses of RAII_VAR(). * Made ast_cel_engine_init() cleanup alocated resources on failure. (closes issue AST-1253) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/3128/ ........ Merged revisions 406417 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406418 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/manager.c, /: manager: Register atexit shutdown routine only once. * Made register atexit shutdown routine only once in __init_manager(). * Fixed some initial load failure conditions in __init_manager(). * Made reset options to defaults on reload when the reload will actually happen. * Removed unnecessary container traversals of the white/black filters during manager_free_user(). * ast_free() does not need a NULL check before calling. ........ Merged revisions 406359 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406400 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-24 21:25 +0000 [r406389] Jonathan Rose * res/res_config_pgsql.c, /: res_config_pgsql: Fix a memory leak and use RAII_VAR for cleanup when practical Review: https://reviewboard.asterisk.org/r/3141/ ........ Merged revisions 406360 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406361 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-24 18:04 +0000 [r406342] Richard Mudgett * main/manager.c, /: manager: Protect data structures during shutdown. Occasionally, the manager module would get an "INTERNAL_OBJ: bad magic number" error on a "core restart gracefully" command if an AMI connection is established. * Added ao2_global_obj protection to the sessions global container. * Fixed the order of unreferencing a session object in session_destroy(). * Removed unnecessary container traversals of the white/black filters during session_destructor(). (closes issue AST-1242) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/3144/ ........ Merged revisions 406341 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-23 23:41 +0000 [r406327] Mark Michelson * res/res_pjsip_pidf.c: Today is not my day for writing code that compiles. 2014-01-23 22:54 +0000 [r406311] Michael L. Young * addons/res_config_mysql.c: res_config_mysql: Fix Setting The Column Name Incorrectly When support for a realtime sorcery module was added in revision 386731, the wrong property was accidentally used for setting the column name to be updated in the database table. This patch fixes the typo. (closes issue ASTERISK-23177) Reported by: Denis Tested by: Denis Patches: asterisk-23177-use-field-name.diff by Michael L. Young (license 5026) 2014-01-23 21:09 +0000 [r406294-406295] Mark Michelson * res/res_pjsip_pidf.c: Fix presence body errors found during testing: * PIDF bodies were reporting an "open" state in many cases where it should have been reporting "closed" * XPIDF bodies had XML nodes placed incorrectly within the hierarchy. * SIP URIs in XPIDF bodies did not go through XML sanitization * XML sanitization had some errors: * Right angle bracket was being replaced with "&rt;" instead of ">" * Double quote, apostrophe, and ampersand were not being escaped. * res/res_pjsip_pidf.c: Fix presence body errors found during testing: * PIDF bodies were reporting an "open" state in many cases where it should have been reporting "closed" * XPIDF bodies had XML nodes placed incorrectly within the hierarchy. * SIP URIs in XPIDF bodies did not go through XML sanitization * XML sanitization had some errors: * Right angle bracket was being replaced with "&rt;" instead of ">" * Double quote, apostrophe, and ampersand were not being escaped. 2014-01-22 22:23 +0000 [r406264] Scott Griepentrog * utils/extconf.c, main/pbx.c, /: pbx.c: Pre-initialize timezone to avoid crash on destroy In ast_build_timing, initialize the timezone value to NULL in order to avoid deferencing an uninitialized value later when calling ast_destroy_timing. The timezone value could be uninitialized if ast_build_timing were to fail due to a zero length time string. (closes issue ASTERISK-22861) Reported by: Sebastian Murray-Roberts Review: https://reviewboard.asterisk.org/r/3134/ Patches: ast_build_timing-initialize-timezone.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 406241 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406245 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-22 19:34 +0000 [r406152-406223] Kinsey Moore * apps/app_confbridge.c, /: ConfBridge: Fix channel parameter documentation Confbridge AMI and CLI commands for mute, unmute, and setting the single video source can accept channel prefixes in lieu of a full channel name, but documentation states only that it is required and is a channel name. This corrects the documentation. (closes issue PQ-1397) Reported by: Steve Pitts ........ Merged revisions 406217 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_sip.c: chan_sip: Decline image streams on unsupported transports This change allows chan_sip to decline individual image streams over unsupported transports in the SDP of the 200 response. Previously, an image stream offer with RTP/AVP as the transport would cause chan_sip to respond with a 488. (closes issue ASTERISK-22988) Reported by: adomjan Original patch by: adomjan ........ Merged revisions 406170 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406171 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_stasis_playback.c: res_stasis_playback: Correct error argument order Several of the playback error messages for invalid media input in res_stasis_playback.c had the media name and channel name reversed. They now correctly identify the channel name and media name. Reported by: skrusty 2014-01-21 21:47 +0000 [r406133] Rusty Newton * res/res_pjsip.c: res_pjsip: Documentation improvement for Endpoint and AOR mailbox options. Making the help text for both more explicit regarding the format of mailbox identifiers. i.e. clarifying the format for app_voicemail mailboxes vs mailboxes from external MWI sources through modules such as res_external_mwi. 2014-01-21 21:06 +0000 [r406081] Walter Doekes * configs/manager.conf.sample, main/manager.c, /: manager: Clarify eventfilter documentation. Textual changes only. Review: https://reviewboard.asterisk.org/r/3133/ ........ Merged revisions 406079 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406080 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-21 20:20 +0000 [r406003-406049] Kinsey Moore * /, channels/chan_mgcp.c: chan_mgcp: Enforce locking for oseq This restricts direct usage of global oseq so that all accesses are locked and threads are not racing to get oseq values that they did not claim. This also fixes a build error in res_pktccops under dev mode. (closes issue ASTERISK-23100) Reported by: adomjan Patch by: adomjan ........ Merged revisions 406037 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 406038 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_pjsip_outbound_registration.c, res/res_pjsip.c: PJSIP: Handle headers in a list appropriately The PJSIP header parsing function (pjsip_parse_hdr) can generate more than one header instance from a single header field. These header instances exist as a list attached to the returned header and must be handled appropriately when they are added to a message or else only the first header instance will be used. This changes the linked list functions used in outbound proxy code to merge the lists properly. * rest-api-templates/ari_resource.h.mustache, res/res_ari_device_states.c, res/res_ari_mailboxes.c, res/res_ari_asterisk.c, rest-api-templates/res_ari_resource.c.mustache, res/res_ari_applications.c, rest-api-templates/body_parsing.mustache (added), res/res_ari_channels.c, res/ari/resource_playbacks.h, rest-api-templates/param_parsing.mustache, res/ari/resource_sounds.h, res/ari/resource_bridges.h, res/ari/resource_device_states.h, res/ari/resource_mailboxes.h, rest-api/api-docs/channels.json, res/ari/resource_asterisk.h, res/ari/resource_applications.h, res/ari/resource_channels.c, res/res_ari_playbacks.c, res/res_ari_sounds.c, rest-api-templates/asterisk_processor.py, res/ari/resource_channels.h, res/res_ari_bridges.c: ARI: Support channel variables in originate This adds back in support for specifying channel variables during an originate without compromising the ability to specify query parameters in the JSON body. This was accomplished by generating the body-parsing code in a separate function instead of being integrated with the URI query parameter parsing code such that it could be called by paths with body parameters. This is transparent to the user of the API and prevents manual duplication of code or data structures. (closes issue ASTERISK-23051) Review: https://reviewboard.asterisk.org/r/3122/ Reported by: Matt Jordan 2014-01-20 23:18 +0000 [r405982] Damien Wedhorn * channels/chan_skinny.c: Skinny: fix up handling of fragmented packets. Bad offset in reading second or more fragment of skinny packets. Fixed to offset by char (single byte) rather than size of req. 2014-01-20 22:15 +0000 [r405928] Richard Mudgett * /, channels/sig_pri.c: chan_dahdi/PRI: Suppress CONNECTED_LINE updates when nothing in the udpate is valid. * Also simplified some subddress handling code. (closes issue ASTERISK-23008) Reported by: Michael Cargile ........ Merged revisions 405926 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405927 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-20 21:53 +0000 [r405924] Damien Wedhorn * channels/chan_skinny.c: Skinny: fix up session logging. Logging from the skinny session loop was providing some incorrect reasons for exiting the loop. Cleaned up messages and handling so correct reason displayed. 2014-01-20 18:07 +0000 [r405908] Jonathan Rose * channels/chan_pjsip.c: chan_pjsip: Provide a means for tracking device state when holding/unholding Previously PJSIP did not track hold/unhold and it would always simply be 'inuse'. This patch fixes that. review: https://reviewboard.asterisk.org/r/3129/ 2014-01-18 23:57 +0000 [r405893] Damien Wedhorn * channels/chan_skinny.c: Skinny: fix reversed device reset from CLI. Existing code would do a full device restart when "skinny reset device" was entered at the CLI and do a reset when "skinny reset device restart" entered. 2014-01-17 22:05 +0000 [r405877] Sean Bright * channels/chan_sip.c: Make sure the maxptime attribute is added to the correct offers. 2014-01-17 21:32 +0000 [r405861-405875] Scott Griepentrog * main/frame.c, include/asterisk/format_pref.h, res/res_pjsip_sdp_rtp.c, main/format_pref.c, main/sorcery.c: pjsip: fix support for allow=all This change adds improvements to support for allow=all in pjsip.conf so that it functions as intended. Previously, the allow/disallow socery configuration would set & clear codecs from the media.codecs and media.prefs list, but if all was specified the prefs list was not updated. Then a call would fail when create_outgoing_sdp_stream() created an SDP with no audio codecs. A new function ast_codec_pref_append_all() is provided to add all codecs to the prefs list - only those not already on the list. This enables the configuration to specify a codec preference, but still add all codecs, and even then remove some codecs, as shown in this example: allow = ulaw, alaw, all, !g729, !g723 Also, the display order of allow in cli output is updated to match the configuration by using prefs instead of caps when generating a human readable string. Finally, a change to create_outgoing_sdp_stream() skips a codec when it does not have a payload code instead of the call failing. (closes issue ASTERISK-23018) Reported by: xrobau Review: https://reviewboard.asterisk.org/r/3131/ * main/http.c: http: supported chunked Transfer-Encoding This change implements support for HTTP Transfer-Encoding chunked in both JSON and Form (post vars) body content. A new function ast_http_get_contents() handles both regular and chunked mode body, returning after the entire body is received. (closes issue ASTERISK-23068) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3125/ 2014-01-17 18:54 +0000 [r405777-405843] Rusty Newton * res/res_pjsip.c: Fixing some XML syntax issues with my previous commit at r405777 for ASTERISK-23071 * /, channels/chan_sip.c, doc/asterisk.8, main/features.c, configs/sip.conf.sample, apps/app_queue.c, apps/app_transfer.c, channels/chan_iax2.c: Documentation: doc fixes across various parts of the code for ASTERISK issues 23061,23028,23046,23027 Fixes typos of "transfered" instead of "transferred" in various code. Fixes incorrect gosub param help text for app_queue. Fixes Asterisk man pages containing unquoted minus signs. Adds note about the "textsupport" option in sip.conf.sample. (issue ASTERISK-23061) (issue ASTERISK-23028) (issue ASTERISK-23046) (issue ASTERISK-23027) (closes issue ASTERISK-23061) (closes issue ASTERISK-23028) (closes issue ASTERISK-23046) (closes issue ASTERISK-23027) Reported by: Eugene, Jeremy Laine, Denis Pantsyrev Patches: transferred.patch uploaded by Jeremy Laine (license 6561) hyphen.patch uploaded by Jeremy Laine (license 6561) sip.conf.sample.patch uploaded by Eugene (license 6360) ........ Merged revisions 405791 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405792 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_pjsip.c: res_pjsip: enhance documentation for mailboxes options, for both endpoints and aors Made documentation more explicit as to the use of the both options. (issue ASTERISK-23071) (closes issue ASTERISK-23071) Reported by: Matt Jordan 2014-01-16 20:05 +0000 [r405746-405748] Kevin Harwell * res/res_pjsip/pjsip_options.c: res_pjsip: AOR option qualify_frequency not respected on startup If an endpoint had previously dynamically registered a contact and the contact information was successfully stored in astdb then upon restart the qualify notifications would not be sent out if the qualify_frequency was set. This was due to the fact that only permanent contacts were being checked and scheduled for qualifies on startup. Modified the code to check and schedule all registered contacts at startup. (closes issue ASTERISK-23062) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/3124/ * main/manager.c, /: manager: Originate doesn't abort on failed format_cap allocation action_originate responds to the remote system with an error when cap==NULL, but doesn't return (abort the originate). Patched to return. (closes issue ASTERISK-23034) Reported by: Corey Farrell Patches: ASTERISK-23034.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 405745 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-16 19:32 +0000 [r405743] Kinsey Moore * res/res_pjsip.c: PJSIP: Fix outbound OPTIONS support When path support was added and contacts were made available during request creation and transmission, the code path used by outbound qualify support was not modified correctly and was causing request creation to fail. This ensures that outbound request creation with only a contact and no dialog, endpoint, or uri can succeed which restores qualify support. Reported by: gtjoseph Reported by: kharwell 2014-01-16 19:06 +0000 [r405643-405694] Kevin Harwell * /, res/res_fax.c, configs/res_fax.conf.sample, UPGRADE.txt: res_fax: check_modem_rate() returned incorrect rate for V.27 According to the new standard for V.27 and V.32 they are able to transmit at a bit rate of 4,800 or 9,600. The check_mode_rate function needed to be updated to reflect this. Also, because of this change the default 'minrate' value was updated to be 4800. (closes issue ASTERISK-22790) Reported by: Paolo Compagnini Patches: res_fax.txt uploaded by looserouting (license 6548) ........ Merged revisions 405656 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405693 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/chan_pjsip.c: chan_pjsip: initial device state on endpoints is INVALID When endpoints get loaded their device state gets set to 'INVALID' because the channel driver has not been loaded yet. Fixed by updating the device state for every endpoint upon load of the channel driver. (closes issue ASTERISK-23065) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/3123/ 2014-01-15 16:48 +0000 [r405585-405587] Jonathan Rose * CHANGES: Remove subversion conflict tag accidentally left in CHANGES * CHANGES: Include CHANGES info for r405553 2014-01-15 16:36 +0000 [r405583] Joshua Colp * /, cel/cel_manager.c: cel_manager: Don't crash if configuration file is invalid. The cel_manager module did not properly handle the case where the configuration file was invalid. The module will now output a warning message and disable itself if this occurs. Reported by: Bryan Walters ........ Merged revisions 405581 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405582 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-15 13:14 +0000 [r405565] Kinsey Moore * res/res_pjsip_messaging.c, UPGRADE.txt, res/res_pjsip_t38.c, res/res_pjsip_caller_id.c, CHANGES, res/res_pjsip/pjsip_options.c, res/res_pjsip.c, res/res_pjsip_nat.c, res/res_pjsip_session.c, contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py (added), res/res_pjsip_header_funcs.c, res/res_pjsip/location.c, res/res_pjsip_outbound_registration.c, res/res_pjsip_path.c (added), res/res_pjsip_mwi.c, res/res_pjsip/pjsip_distributor.c, res/res_pjsip_diversion.c, channels/chan_pjsip.c, res/res_pjsip_registrar.c, res/res_pjsip_refer.c, include/asterisk/res_pjsip.h, include/asterisk/res_pjsip_session.h, res/res_pjsip_notify.c: PJSIP: Add Path header support This adds Path support to chan_pjsip in res_pjsip_path.c with minimal additions in res_pjsip_registrar.c to store the path and additions in res_pjsip_outbound_registration.c to enable advertisement of path support to registrars and intervening proxies. Path information is stored on contacts and is enabled via Address of Record (AoRs) and Registration configuration sections. While adding path support, it became necessary to be able to add SIP supplements that handled messages outside of sessions, so a framework for handling these types of hooks was added in parallel to the already-existing session supplements and several senders of out-of-dialog requests were refactored as a result. (closes issue ASTERISK-21084) Review: https://reviewboard.asterisk.org/r/3050/ 2014-01-14 23:26 +0000 [r405553] Jonathan Rose * rest-api/resources.json, res/ari/ari_model_validators.c, res/res_stasis_mailbox.exports.in (added), res/ari/ari_model_validators.h, rest-api/api-docs/mailboxes.json (added), include/asterisk/stasis_app_mailbox.h (added), res/ari/resource_mailboxes.c (added), res/ari.make, res/res_ari_mailboxes.c (added), res/ari/resource_mailboxes.h (added), res/res_stasis_mailbox.c (added): ARI: Add mailboxes resource for controlling and polling external MWI Adds the following AMI commands: PUT mailboxes/mailboxName modifies mailbox state and implicitly creates new mailboxes GET mailboxes/mailboxName retrieves a JSON representation of a single mailbox if it exists GET mailboxes retrieves a JSON array of all mailboxes DELETE mailbox/mailboxName deletes a mailbox Note that res_mwi_external must be loaded for these functions to actually do anything. Review: https://reviewboard.asterisk.org/r/3117/ 2014-01-14 21:44 +0000 [r405541] Richard Mudgett * main/strings.c: string container: Remove unnecessary RAII_VAR usage and string object lock. 2014-01-14 18:13 +0000 [r405435] Scott Griepentrog * /, channels/chan_sip.c: chan_sip: fix Local From tag on outbound register regression In ASTERISK-12117, an improvement to insure consistant local from tags on outbound registrations resulted in an undesirable behavior - caused by leftover unexpired sip_pvt dialogs (with the previous cseq number), resulting in many uncessary REGISTER requests. Instead of significant rework of transmit_register(), this change deletes the dialogs after a 200 OK response indiciating a successful registration, keeping the old dialogs from interfering with normal operation. (closes issue ASTERISK-22946) Reported by: Stephan Eisvogel Review: https://reviewboard.asterisk.org/r/3109/ ........ Merged revisions 405433 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405434 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-14 18:03 +0000 [r405432] Richard Mudgett * include/asterisk/logger.h, main/pbx.c, main/manager.c, /, funcs/func_timeout.c, apps/app_dumpchan.c, main/logger.c, UPGRADE.txt, apps/app_verbose.c, main/asterisk.c, configs/logger.conf.sample, main/cli.c: verbosity: Fix performance of console verbose messages. The per console verbose level feature as previously implemented caused a large performance penalty. The fix required some minor incompatibilities if the new rasterisk is used to connect to an earlier version. If the new rasterisk connects to an older Asterisk version then the root console verbose level is always affected by the "core set verbose" command of the remote console even though it may appear to only affect the current console. If an older version of rasterisk connects to the new version then the "core set verbose" command will have no effect. * Fixed the verbose performance by not generating a verbose message if nothing is going to use it and then filtered any generated verbose messages before actually sending them to the remote consoles. * Split the "core set debug" and "core set verbose" CLI commands to remove the per module verbose support that cannot work with the per console verbose level. * Added a silent option to the "core set verbose" command. * Fixed "core set debug off" tab completion. * Made "core show settings" list the current console verbosity in addition to the root console verbosity. * Changed the default verbose level of the 'verbose' setting in the logger.conf [logfiles] section. The default is now to once again follow the current root console level. As a result, using the AMI Command action with "core set verbose" could again set the root console verbose level and affect the verbose level logged. (closes issue AST-1252) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/3114/ ........ Merged revisions 405431 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-14 03:12 +0000 [r405367] Damien Wedhorn * channels/chan_skinny.c: Skinny: do not add call to missed calls list if answered elsewhere. Patch updates skinny devices with a SKINNY_CONNECTED callstate if an inbound ringing or callwaiting call is answered elsewhere. 2014-01-13 17:09 +0000 [r405350] Jonathan Rose * res/res_pjsip_session.c: PJSIP: Backport r405270 - Unhold on reinvite without SDP Adds behavior to unhold on a reinvite without an SDP section Review: https://reviewboard.asterisk.org/r/3106/ 2014-01-13 13:28 +0000 [r405338] Kinsey Moore * res/res_pjsip/pjsip_cli.c: res_pjsip: Fix CLI tab completion issues This fixes several issues with the new res_pjsip CLI tab completion such as output of headers during tab completion and being able to tab-complete more items than the code actually handled (further items would simply be ignored). (closes issue ASTERISK-23081) Review: https://reviewboard.asterisk.org/r/3115/ Reported by: xrobau 2014-01-12 22:23 +0000 [r405325] Joshua Colp * res/ari/resource_playbacks.c, res/ari/resource_channels.c, include/asterisk/ari.h, res/ari/resource_bridges.c, res/ari/resource_recordings.c, res/ari/resource_device_states.c, res/res_ari.c, res/ari/resource_endpoints.c, res/ari/resource_applications.c: res_ari: Fix various memory leaks. This change fixes a few memory leaks that were found based on a mailing list post. 1. Some JSON response messages were never freed. This was caused by the documentation stating that message references were stolen when in reality they were not. The code now follows the documentation and usage has been updated. 2. HTTP response headers were never freed. 3. The variable list for wildcards paths was never freed. (closes issue ASTERISK-23128) Reported by: Kenneth Watson (on list) Review: https://reviewboard.asterisk.org/r/3119/ 2014-01-12 21:58 +0000 [r405311-405312] Matthew Jordan * funcs/func_cdr.c, include/asterisk/cdr.h, apps/app_cdr.c, main/cdr.c, apps/app_forkcdr.c: CDRs: Synchronize dialplan applications that manipulate CDRs with the engine In https://reviewboard.asterisk.org/r/3057/, applications and functions that manipulate CDRs were made to interact over Stasis. This was done to synchronize manipulations of CDRs from the dialplan with the updates the engine itself receives over the message bus. This change rested on a faulty premise: that messages published to the CDR topic or to a topic that forwards to the CDR topic are synchronized with the messages handled by the CDR topic subscription in the CDR engine. This is not the case. There is no ordering guaranteed for two messages published to the same topic; ordering is only guaranteed if a message is published to the same subscriber. Stasis was modified in r405311 to allow a publisher to synchronize on the subscriber. This patch uses that API to synchronize the CDR publishers with the CDR engine message router, which maintains the overall topic subscription. (closes issue ASTERISK-22884) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3099/ * main/stasis.c, main/stasis_message_router.c, include/asterisk/stasis.h, include/asterisk/stasis_message_router.h, tests/test_stasis.c: stasis: Add methods to allow for synchronous publishing to subscriber This patch adds an API call to Stasis that allows a publisher to publish a stasis message that will not return until a specific subscriber handles the message. Since a subscriber can have their own forwarding topic which orders messages from many topics, this allows a publisher who knows of that subscriber to synchronize to that subscriber regardless of the forwarding relationships between topics. This is of particular use for dialplan applications that need to synchronize on a particular subscriber's handling of a message. (issue ASTERISK-22884) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3099/ 2014-01-10 19:39 +0000 [r405298] Mark Michelson * res/res_pjsip/security_events.c: Print "" for artificial endpoint in PJSIP security events. Previously, this printed a UUID, which was not very clear when dealing with an artificial endpoint. Review: https://reviewboard.asterisk.org/r/3113 2014-01-10 18:00 +0000 [r405282] Richard Mudgett * main/logger.c, /: Logging callid: Fix some sizeof() references per coding guidelines. ........ Merged revisions 405281 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-09 23:45 +0000 [r405268] Damien Wedhorn * channels/chan_dahdi.c: Fix chan_dahdi copile issue in dev-mode. Error "unused variable i in dahdi_create_channel_range" when compiling in dev-mode. Small restructure to dahdi_create_channel_range to move the for(x) loop and int i,x to a block within the IFDEF. 2014-01-09 23:36 +0000 [r405266] Kevin Harwell * res/res_pjsip_messaging.c, res/res_pjsip.c: res_pjsip_messaging: potential for field values in from/to headers to be missing Added in ability to specify display name format ("name" ) for a given URI and made sure it was fully propagated to the outgoing message. Also made it so outoing messages in res_pjsip always send as "sip:". (closes issue ASTERISK-22924) Reported by: Anthony Messina Review: https://reviewboard.asterisk.org/r/3094/ 2014-01-09 20:25 +0000 [r405253] Kinsey Moore * main/astobj2.c, res/res_pjsip_session.c, include/asterisk/astobj2.h: astobj2: Correct ao2_iterator opacity violations This corrects the ao2_iterator opacity violations in res_pjsip_session.c by adding a global function to get the number of elements inside the container hidden behind the iterator. (closes issue ASTERISK-23053) Review: https://reviewboard.asterisk.org/r/3111/ Reported by: Richard Mudgett 2014-01-09 16:51 +0000 [r405235] Kevin Harwell * res/res_rtp_asterisk.c, /: res_rtp_asterisk: Fails to resume WebRTC call from hold In ast_rtp_ice_start if the ice session create check list failed, start check was never initiated and ice_started was never set to true. Upon re-entering the function (for instance, [un]hold) it would try to create the check list again with duplicate remote candidates. Fixed so that if the create check list fails the necessary data structures are properly re-initialized for any subsequent retries. Note, it was decided to not stop ice support (by calling ast_rtp_ice_stop) on a check list failure because it possible things might still work. However, a debug message was added to help with any future troubleshooting. (closes issue ASTERISK-22911) Reported by: Vytis Valentinavičius Patches: works_on_my_machine.patch uploaded by xytis (license 6558) ........ Merged revisions 405234 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-09 15:49 +0000 [r405216] Matthew Jordan * apps/app_confbridge.c, apps/confbridge/conf_state_multi_marked.c, /: app_confbridge: Fix crash caused when waitmarked/marked users leave together When waitmarked users join a ConfBridge, the conference state is transitioned from EMPTY -> INACTIVE. In this state, the users are maintined in a waiting users list. When a marked user joins, the ConfBridge conference transitions from INACTIVE -> MULTI_MARKED, and all users are put onto the active list of users. This process works correctly. When the marked user leaves, if they are the last marked user, the MULTI_MARKED state does the following: (1) It plays back a message to the bridge stating that the leader has left the conference. This requires an unlocking of the bridge. (2) It moves waitmarked users back to the waiting list (3) It transitions to the appropriate state: in this case, INACTIVE However, because it plays the prompt back to the bridge before moving the users and before finishing the state transition, this creates a race condition: with the bridge unlocked, waitmarked users who leave the conference (or are kicked from it) can cause a state transition of the bridge to another state before the conference is transitioned to the INACTIVE state. This causes the state machine to get a bit wonky, often leading to a crash when the MULTI_MARKED state attempts to conclude its processing. This patch fixes this problem: (1) It prevents kicked users from being kicked again. That's just a nicety. (2) More importantly, it fixes the race condition by only playing the prompt once the state has transitioned correctly to INACTIVE. If waitmarked users sneak out during the prompt being played, no harm no foul. Review: https://reviewboard.asterisk.org/r/3108/ (closes issue AST-1258) Reported by: Steve Pitts ........ Merged revisions 405215 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-09 14:14 +0000 [r405162] Walter Doekes * /, apps/app_dumpchan.c: "Minimun" typo. ........ Merged revisions 405160 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405161 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-08 16:48 +0000 [r405131] Mark Michelson * res/res_pjsip/security_events.c: Use proper case for checking if digest authentication is used. 2014-01-08 16:28 +0000 [r405083-405124] Kinsey Moore * /, configure, configure.ac, pbx/pbx_lua.c: pbx_lua: Add support for Lua 5.2 This adds support for Lua 5.2 in pbx_lua which is available on newer operating systems. (closes issue ASTERISK-23011) Review: https://reviewboard.asterisk.org/r/3075/ Reported by: George Joseph Patch by: George Joseph ........ Merged revisions 405090 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405091 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_sip.c: Add the missing part of r400140 When the patch to add retry-on-forbidden-response was committed, part of the patch for chan_sip was not committed which caused the feature to be entirely nonfunctional. This corrects the code in question. (closes issue ASTERISK-17138) Review: https://reviewboard.asterisk.org/r/2874 ........ Merged revisions 405033 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405081 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-07 19:55 +0000 [r405019-405034] Joshua Colp * res/res_pjsip_acl.c: res_pjsip_acl: Fix another case of assuming a contact will always contain a URI. * res/res_pjsip_nat.c: res_pjsip_nat: Don't assume a Contact header will always contain a URI. If the 'rewrite_contact' option was enabled and a Contact header was received which contained a '*' a crash would occur. This change makes the res_pjsip_nat module ignore the Contact header if it contains only a '*'. (closes issue ASTERISK-23101) Reported by: Matt Jordan 2014-01-06 21:54 +0000 [r404952-405006] Richard Mudgett * apps/app_voicemail.c: app_voicemail: Explicitly set defaultenabled=yes * res/res_mwi_external_ami.c (added): External MWI AMI support. The external MWI AMI interface provides a thin wrapper around the core external MWI resource. The resource adds the following AMI actions: MWIGet, MWIDelete, and MWIUpdate. (closes issue AFS-46) Review: https://reviewboard.asterisk.org/r/3061/ * apps/app_voicemail.c, res/res_mwi_external.c (added), configs/sorcery.conf.sample, include/asterisk/res_mwi_external.h (added), res/res_mwi_external.exports.in (added): External MWI core support. * The core external MWI resource provides for MWI message counts persistence using sorcery. With sorcery, the user is able to configure which sorcery wizzard backend to use if the default astdb is not desired. * The core external MWI resoruce provides some debugging CLI commands enabled by defining MWI_DEBUG_CLI. The debugging CLI commands are: "mwi delete all", "mwi delete like ", "mwi delete mailbox ", "mwi list all", "mwi list like ", "mwi show mailbox ", and "mwi update mailbox [ []]". (closes issue AFS-43) Review: https://reviewboard.asterisk.org/r/3061/ 2014-01-05 16:00 +0000 [r404923-404935] Joshua Colp * res/res_pjsip_outbound_registration.c: res_pjsip_outbound_registration: Don't assume that a registration client will always exist. * res/res_pjsip_outbound_registration.c: res_pjsip_outbound_registration: Create registration client in pj thread. Depending on which threading was loading the outbound registration it was possible for the registration client to be allocated outside of a pj thread. This change moves the creation inside the synchronous task where it is guaranteed it will occur in a pj thread. Reported by: Rob Thomas 2014-01-04 10:42 +0000 [r404911] Tzafrir Cohen * main/asterisk.c, /: asterisk.c: suppress live_dangerously warning on rasterisk Even since the fixes of AST-2013-007, Asterisk prints the following warning on startup if the user decided to live dangerously: Privilege escalation protection disabled! See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details. This message is intended for the logs and interactive startup. No need for it to appear on a remote console. This commit removes it from there. (closes issue ASTERISK-23084) Review: https://reviewboard.asterisk.org/r/3101/ ........ Merged revisions 404861 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404888 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-03 21:59 +0000 [r404859] Kevin Harwell * /, cel/cel_pgsql.c: cel_pgsql: module not correctly reloading Upon reload the module unconditionally "unloaded" the module (freeing memory and setting pointers to NULL) and then when attempting a "load" if the config file had not changed then nothing would be reinitialized. By moving the "unload" to occur conditionally (reload only) after an attempted configuration load, but before module "loading" alleviates the issue. The module now loads/unloads/reloads correctly. (closes issue ASTERISK-22871) Reported by: Matteo ........ Merged revisions 404857 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404858 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-03 21:45 +0000 [r404843-404855] Matthew Jordan * res/res_pjsip_logger.c: res_pjsip_logger: Add the ASTERISK_FILE_VERSION macro Registering yourself with the Asterisk core is the nice thing to do, even when you're a logging module. * res/res_pjsip_authenticator_digest.c, tests/test_utils.c: res_pjsip_authenticator_digest: Fix md5 hash buffer An md5 hash is 32 bytes long. The char buffer must be at least 33 bytes to avoid clobbering of the stack. This patch also fixes a potential clobbering in test_utils.c. Thanks to Andrew Nagy for reporting and testing this out in #asterisk-dev Reported by: Andrew Nagy Tested by: Andrew Nagy 2014-01-03 19:00 +0000 [r404781-404786] Kevin Harwell * channels/chan_dahdi.c, /: chan_dahdi: dahdi show channels slices PRI channel dnid on output dahdi show channels output slices the callerid (which is dnid copied over on PRI channels). If the channel naming structures look like: 'DAHDI/i1/1408409XXXX-6' then the output slices 1408409XXXX down to 1408409XXX. This patch just opens it up to 15 chars so you can see the whole thing. (closes issue ASTERISK-22918) Reported by: outtolunc Patches: svn_chan_dahdi.c.format12_15.diff.txt uploaded by outtolunc (license 5198) ........ Merged revisions 404784 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404785 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, apps/app_meetme.c: app_meetme: compiler warning Fixed a compiler warning (errors in 'dev-mode') given by gcc version 4.8.1. The one in app_meetme involved the 'sizeof-pointer-memaccess' (see: http://gcc.gnu.org/gcc-4.8/porting_to.html) warning. Fixed so it would no longer issue a warning and can compile again in 'dev-mode'. Review: https://reviewboard.asterisk.org/r/3098/ ........ Merged revisions 404742 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404773 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-03 18:24 +0000 [r404764] Richard Mudgett * tests/test_stasis.c: test_stasis.c: Fix ref leak in normal execution path. 2014-01-03 17:25 +0000 [r404725-404737] Joshua Colp * res/res_pjsip/pjsip_configuration.c, res/res_pjsip/location.c: res_pjsip: Ensure more URI validation happens in pj threads. * res/res_pjsip_outbound_registration.c: res_pjsip_outbound_registration: Ensure URI validation happens in a pjlib thread. This change moves outbound registration URI validation into the task executed within a pjlib thread. Reported by: Andrew Nagy 2014-01-02 19:37 +0000 [r404676] Scott Griepentrog * /, funcs/func_strings.c: func_strings: use memmove to prevent overlapping memory on strcpy When calling REPLACE() with an empty replace-char argument, strcpy is used to overwrite the the matching . However as the src and dest arguments to strcpy must not overlap, it causes other parts of the string to be overwritten with adjacent characters and the result is mangled. Patch replaces call to strcpy with memmove and adds a test suite case for REPLACE. (closes issue ASTERISK-22910) Reported by: Gareth Palmer Review: https://reviewboard.asterisk.org/r/3083/ Patches: func_strings.patch uploaded by Gareth Palmer (license 5169) ........ Merged revisions 404674 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404675 from http://svn.asterisk.org/svn/asterisk/branches/11 2014-01-02 19:06 +0000 [r404663] Kevin Harwell * channels/chan_pjsip.c, include/asterisk/res_pjsip.h, configs/pjsip.conf.sample, res/res_pjsip/pjsip_configuration.c, CHANGES, res/res_pjsip.c: res_pjsip: add 'set_var' support on endpoints Added a new 'set_var' option for ast_sip_endpoint(s). For each variable specified that variable gets set upon creation of a pjsip channel involving the endpoint. (closes issue ASTERISK-22868) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/3095/ 2013-12-31 22:49 +0000 [r404613-404652] Joshua Colp * channels/chan_pjsip.c, res/res_pjsip_session.c: chan_pjsip: Handle hanging up before calling. Channel creation in Asterisk is broken up into two steps: requesting and calling. In some cases a channel may be requested but never called. This happens in the ChanIsAvail dialplan application for determining if something is reachable or not. The PJSIP channel driver did not take this situation into account and attempted to end a session that was never called out on. The code now checks the session state to determine if the session has been called out on and if not terminates it instead of ending it. (closes issue ASTERISK-23074) Reported by: Kilburn * res/res_pjsip_endpoint_identifier_ip.c: res_pjsip_endpoint_identifier_ip: Accept hostnames in the 'match' field. Hostnames specified in the 'match' field will be resolved and all addresses returned. Each address will be added to the endpoint identifier for the matching process. Reported by: Rob Thomas 2013-12-31 21:38 +0000 [r404605] Kevin Harwell * /, cel/cel_pgsql.c: cel_pgsql: deadlock on unload and core_event_dispatcher A deadlock can happen between a thread unloading or reloading the cel_pgsql module and the core_event_dispatcher taskprocessor thread. Description of what is happening: Thread 1 (for example, a netconsole thread): a "module reload cel_pgsql" is launched the thread enter the "my_unload_module" function (cel_pgsql.c) the thread acquire the write lock on psql_columns the thread enter the "ast_event_unsubscribe" function (event.c) the thread try to acquire the write lock on ast_event_subs[sub->type] Thread 2 (core_event_dispatcher taskprocessor thread): the taskprocessor pop a CEL event the thread enter the "handle_event" function (event.c) the thread acquire the read lock on ast_event_subs[sub->type] the thread callback the "pgsql_log" function (cel_pgsql.c), since it's a subscriber of CEL events the thread try to acquire a read lock on psql_columns (closes issue ASTERISK-22854) Reported by: Etienne Lessard Patches: cel_pgsql_fix_deadlock_event.patch uploaded by hexanol (license 6394) ........ Merged revisions 404603 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404604 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-31 20:26 +0000 [r404592] Joshua Colp * res/res_pjsip_outbound_registration.c: res_pjsip_outbound_registration: Add validation for 'server_uri' and 'client_uri'. When applying configuration for outbound registrations the 'server_uri' and 'client_uri' fields were not validated. The code will now confirm that they exist and that they contain parseable SIP URIs. Reported by: Andrew Nagy 2013-12-30 23:21 +0000 [r404581] Kevin Harwell * main/channel.c, /: channels.c: core show channeltypes slicing 'core show channeltypes' type column is being sliced, resulting in incomplete type names. (closes issue ASTERISK-22919) Reported by: outtolunc Patches: svn_channel.c.format_15.diff.txt uploaded by outtolunc (license 5198) ........ Merged revisions 404579 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-24 17:10 +0000 [r404565-404568] David M. Lee * UPGRADE.txt: Added note to UPGRADE.txt about the default value of live_dangerously changing * main/http.c: http: Properly reject requests with Transfer-Encoding set Asterisk does not support any of the transfer encodings specified in HTTP/1.1, other than the default "identity" encoding. According to RFC 2616: A server which receives an entity-body with a transfer-coding it does not understand SHOULD return 501 (Unimplemented), and close the connection. A server MUST NOT send transfer-codings to an HTTP/1.0 client. This patch adds the 501 Unimplemented response, instead of the hard work of actually implementing other recordings. This behavior is especially problematic for Node.js clients, which use chunked encoding by default. (closes issue ASTERISK-22486) Review: https://reviewboard.asterisk.org/r/3092/ 2013-12-24 02:19 +0000 [r404553] Joshua Colp * res/res_pjsip_pubsub.c: res_pjsip_pubsub: Ensure dialog manipulation happens on proper thread. When destroying a subscription we remove the serializer from its dialog and decrease its reference count. Depending on which thread dropped the subscription reference count to 0 it was possible for this to occur in a thread where it is not possible. (closes issue ASTERISK-22952) Reported by: Matt Jordan 2013-12-21 03:34 +0000 [r404531] Matthew Jordan * res/res_pjsip/pjsip_cli.c: res_pjsip/pjsip_cli: fix compilation error caused by passing ast_free When wanting to pass *free as a function pointer, ast_free_ptr has to be used instead of ast_free. This allows it to be compiled with MALLOC_DEBUG enabled. 2013-12-20 22:02 +0000 [r404509] David M. Lee * res/ari/resource_channels.h, rest-api/api-docs/applications.json, rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c: ari: Remove support for specifying channel vars during origination. When we added support for specifying channel variables for an origination, we didn't consider how that would interact with another feature, namely specifying request parameters in a JSON request body. The method of specifying channel variables (as a flat JSON object passed in the JSON body) interferes with parsing parameters out of the request body. Unfortunately, fixing this would be a backward incompatible change. In the interest of keeping the API sane and keeping our release schedule, we're dropping the feature for specifying channel variables in the origination request. We will bring the feature back soon, as a backward compatible addition to the API. (closes issue ASTERISK-23051) Review: https://reviewboard.asterisk.org/r/3088 2013-12-20 Asterisk Development Team * Asterisk 12.0.0 Released. 2013-12-20 22:02 +0000 [r404509] David M. Lee * rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c, res/ari/resource_channels.h, rest-api/api-docs/applications.json: ari: Remove support for specifying channel vars during origination. When we added support for specifying channel variables for an origination, we didn't consider how that would interact with another feature, namely specifying request parameters in a JSON request body. The method of specifying channel variables (as a flat JSON object passed in the JSON body) interferes with parsing parameters out of the request body. Unfortunately, fixing this would be a backward incompatible change. In the interest of keeping the API sane and keeping our release schedule, we're dropping the feature for specifying channel variables in the origination request. We will bring the feature back soon, as a backward compatible addition to the API. (closes issue ASTERISK-23051) Review: https://reviewboard.asterisk.org/r/3088 2013-12-20 21:25 +0000 [r404480-404488] Matthew Jordan * /: Remove automerge properties * res/res_pjsip/pjsip_cli.c (added), include/asterisk/sorcery.h, res/res_pjsip/pjsip_configuration.c, res/res_pjsip/include/res_pjsip_private.h, res/res_pjsip_registrar.c, main/sorcery.c, include/asterisk/res_pjsip.h, CREDITS, res/res_pjsip/config_auth.c, /, res/res_pjsip_endpoint_identifier_ip.c, include/asterisk/config.h, main/config.c, main/channel.c, res/res_pjsip/location.c, include/asterisk/res_pjsip_cli.h (added): res_pjsip: Add PJSIP CLI commands Implements the following cli commands: pjsip list aors pjsip list auths pjsip list channels pjsip list contacts pjsip list endpoints pjsip show aor(s) pjsip show auth(s) pjsip show channels pjsip show endpoint(s) Also... Minor modifications made to the AMI command implementations to facilitate reuse. New function ast_variable_list_sort added to config.c and config.h to implement variable list sorting. (issue ASTERISK-22610) patches: pjsip_cli_v2.patch uploaded by george.joseph (License 6322) 2013-12-20 21:16 +0000 [r404458] Scott Griepentrog * /, main/say.c: say.c: correct time for polish In ast_say_date_with_format_pl(), change ast_say_number() to use tm_sec instead of tm_mn. (closes issue ASTERISK-22856) Reported by: Robert Mordec Review: https://reviewboard.asterisk.org/r/3082/ Patches: say.c.patch uploaded by veilen (license 6555) ........ Merged revisions 404456 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404457 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-20 20:11 +0000 [r404439] Mark Michelson * res/res_pjsip_refer.c: Fix issue where PJSIP blind transferer dialog may not complete as planned. When transferring to a dialplan extension that will not place any outbound calls, the only control frames that the PJSIP REFER framehook will receive are inconsequential (such as unhold or srcchange). As such, we shouldn't allow for the reception of those types of frames prevent us from signaling to the transferring party that the transfer has completed successfully once voice frames are read. Thanks to Jonathan Rose for pointing this out. 2013-12-20 20:04 +0000 [r404437] Matthew Jordan * res/ari/resource_applications.h, res/res_stasis_device_state.c: res_stasis_device_state: Set resource type for subscriptions to deviceState The documentation for ARI already specifies that the device state resource when used for subscribing for events is "deviceState", not "device_state". The code, however, used "device_state"; although this was inconsistent as well in doxygen comments in resource_applications. Because the actual resource being subscribed to is /deviceStates/{device}/, it makes sense for the resource type specifier to be deviceState. Note that the key value in the events is still "device_state". 2013-12-20 19:52 +0000 [r404434] Richard Mudgett * res/res_pjsip/location.c, tests/test_cel.c, res/ari/resource_channels.c, tests/test_scoped_lock.c, tests/test_stasis.c, res/parking/parking_manager.c, res/ari/resource_bridges.c, res/ari/resource_endpoints.c: ao2_iterator: Mini-audit of the ao2_iterator loops in the new code files. * Fixed several places where ao2_iterator_destroy() was not called. * Fixed several iterator loop object variable reference problems. * Fixed res_parking AMI actions returning non-zero. Only the AMI logoff action can return non-zero. Review: https://reviewboard.asterisk.org/r/3087/ 2013-12-20 19:17 +0000 [r404421] Matthew Jordan * include/asterisk/manager.h: manager: bump version to 2.0.0 AMI has received substantial updates over the past year. Not only has the syntax been vastly improved and made consistent (which entails many event changes), but the underlying things that those events convey have changed substantially as well. After some conversation in #asterisk-dev, it was agreed that this is a good time to jump to 2. At the same time, since ARI will most likely use semantic versioning, we might as well use that for AMI as well. That also affords us greater meaning for the AMI version. 2013-12-20 19:06 +0000 [r404419] Richard Mudgett * main/sounds_index.c: Whitespace fixes. 2013-12-20 17:21 +0000 [r404405] Rusty Newton * configs/pjsip.conf.sample: Documentation: Updates for info about NAT-related settings and fixes for pjsip.conf.sample Added another NAT example to pjsip.conf.sample. We had a few mentions of NAT configuration throughout the sample, but I added another for a little bit more clarity. Additionally many pjsip options were affected by the change to snake case, so I fixed any instances of those options in pjsip.conf. I regenerated the config option list (at the bottom of the file) from a new xml config doc dump, so all the snake case changes should be reflected there, as well as any other changes to those options. (issue ASTERISK-23004) (closes issue ASTERISK-23004) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3086/ 2013-12-19 18:15 +0000 [r404375] Richard Mudgett * CHANGES: Put notice in CHANGES as well as UPGRADE.txt. 2013-12-19 17:58 +0000 [r404369-404371] Joshua Colp * res/res_pjsip/pjsip_outbound_auth.c: res_pjsip: Ignore 401/407 responses for transactions and dialogs we don't know about. Under normal conditions it is unlikely we will ever receive a response for a transaction or dialog we don't know about but if any are received ignore them. * res/res_pjsip_session.c: res_pjsip_session: Fix SDP negotiation when resending an INVITE with authentication. The process for resending an INVITE with authentication involves restarting the UAC session. We were incorrectly passing in that a new offer is being sent, causing the SDP negotiation to get into a (technically speaking) funky state. 2013-12-19 17:15 +0000 [r404356] Mark Michelson * include/asterisk/channel.h, res/res_pjsip.c, main/channel.c, include/asterisk/autochan.h: Fix a deadlock that occurred due to a conflict of masquerades. For the explanation, here is a copy-paste of the review board explanation: Initially, it was discovered that performing an attended transfer of a multiparty bridge with a PJSIP channel would cause a deadlock. A PBX thread started a masquerade and reached the point where it was calling the fixup() callback on the "original" channel. For chan_pjsip, this involves pushing a synchronous task to the session's serializer. The problem was that a task ahead of the fixup task was also attempting to perform a channel masquerade. However, since masquerades are designed in a way to only allow for one to occur at a time, the task ahead of the fixup could not continue until the masquerade already in progress had completed. And of course, the masquerade in progress could not complete until the task ahead of the fixup task had completed. Deadlock. The initial fix was to change the fixup task to be asynchronous. While this prevented the deadlock from occurring, it had the frightful side effect of potentially allowing for tasks in the session's serializer to operate on a zombie channel. Taking a step back from this particular deadlock, it became clear that the problem was not really this one particular issue but that masquerades themselves needed to be addressed. A PJSIP attended transfer operation calls ast_channel_move(), which attempts to both set up and execute a masquerade. The problem was that after it had set up the masquerade, the PBX thread had swooped in and tried to actually perform the masquerade. Looking at changes that had been made to Asterisk 12, it became clear that there never is any time now that anyone ever wants to set up a masquerade and allow for the channel thread to actually perform the masquerade. Everyone always is calling ast_channel_move(), performs the masquerade itself before returning. In this patch, I have removed all blocks of code from channel.c that will attempt to perform a masquerade if ast_channel_masq() returns true. Now, there is no distinction between setting up a masquerade and performing the masquerade. It is one operation. The only remaining checks for ast_channel_masq() and ast_channel_masqr() are in ast_hangup() since we do not want to interrupt a masquerade by hanging up the channel. Instead, now ast_hangup() will wait for a masquerade to complete before moving forward with its operation. The ast_channel_move() function has been modified to basically in-line the logic that used to be in ast_channel_masquerade(). ast_channel_masquerade() has been killed off for real. ast_channel_move() now has a lock associated with it that is used to prevent any simultaneous moves from occurring at once. This means there is no need to make sure that ast_channel_masq() or ast_channel_masqr() are already set on a channel when ast_channel_move() is called. It also means the channel container lock is not pulling double duty by both keeping the container locked and preventing multiple masquerades from occurring simultaneously. The ast_do_masquerade() function has been renamed to do_channel_masquerade() and is now internal to channel.c. The function now takes explicit arguments of which channels are involved in the masquerade instead of a single channel. While it probably is possible to do some further refactoring of this method, I feel that I would be treading dangerously. Instead, all I did was change some comments that no longer are true after this changeset. The other more minor change introduced in this patch is to res_pjsip.c to make ast_sip_push_task_synchronous() run the task in-place if we are already a SIP servant thread. This is related to this patch because even when we isolate the channel masquerade to only running in the SIP servant thread, we would still deadlock when the fixup() callback is reached since we would essentially be waiting forever for ourselves to finish before actually running the fixup. This makes it so the fixup is run without having to push a task into a serializer at all. (closes issue ASTERISK-22936) Reported by Jonathan Rose Review: https://reviewboard.asterisk.org/r/3069 2013-12-19 17:03 +0000 [r404354] Richard Mudgett * main/udptl.c, addons/chan_ooh323.c, channels/chan_sip.c, include/asterisk/udptl.h: udptl: Dead code elimination. ast_udptl_bridge was not used. Removing dead code starting with ast_udptl_bridge() eliminated the code in this change. Note: This code has actually been dead since Asterisk v1.4 when it was first put in. Review: https://reviewboard.asterisk.org/r/3079/ 2013-12-19 17:02 +0000 [r404352] Scott Griepentrog * /, res/res_fax.c: res_fax.c: crash on framehook with no dsp in fax detect In fax_detect_framehook() a null pointer reference can occur where a voice frame is processed but no dsp is attached to the fax detection structure. The code block that rejects frames that detection cannot be processed on is checking for dsp but falls through when it should instead return, as this change implements. (closes issue ASTERISK-22942) Reported by: adomjan Review: https://reviewboard.asterisk.org/r/3076/ ........ Merged revisions 404351 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-19 16:37 +0000 [r404348] Richard Mudgett * channels/chan_dahdi.h, channels/chan_h323.c, main/app.c, configs/sip.conf.sample, channels/sip/include/sip.h, channels/chan_mgcp.c, apps/app_voicemail.c, channels/chan_unistim.c, configs/chan_dahdi.conf.sample, channels/chan_sip.c, configs/voicemail.conf.sample, funcs/func_vmcount.c, UPGRADE.txt, res/res_xmpp.c, configs/skinny.conf.sample, res/res_jabber.c, CHANGES, channels/chan_iax2.c, channels/h323/chan_h323.h, channels/sig_pri.c, configs/iax.conf.sample, channels/sig_pri.h, include/asterisk/app.h, channels/chan_dahdi.c, channels/chan_skinny.c: Voicemail: Remove mailbox identifier format (box@context) assumptions in the system. This change is in preparation for external MWI support. Removed code from the system for normal mailbox handling that appends @default to the mailbox identifier if it does not have a context. The only exception is the legacy hasvoicemail users.conf option. The legacy option will only work for app_voicemail mailboxes. The system cannot make any assumptions about the format of the mailbox identifer used by app_voicemail. chan_sip and chan_dahdi/sig_pri had the most changes because they both tried to interpret the mailbox identifier. chan_sip just stored and compared the two components. chan_dahdi actually used the box information. The ISDN MWI support configuration options had to be reworked because chan_dahdi was parsing the box@context format to get the box number. As a result the mwi_vm_boxes chan_dahdi.conf option was added and is documented in the chan_dahdi.conf.sample file. Review: https://reviewboard.asterisk.org/r/3072/ 2013-12-19 16:31 +0000 [r404345] Scott Griepentrog * /, main/db.c: astdb: crash in sqlite3 during shutdown When Asterisk is shut down, the astdb_atexit() function releases (finalize) the previously initiated (prepared) SQL statements in sqlite3. Another thread making a subsequent request can cause a crash in sqlite3. This patch eliminates that issue by resetting the statement pointer after it is released/cleared. The sqlite3 code detects the null pointer, and aborts the operation cleanly. (closes issue AST-1265) Reported by: Alexander Hömig (closes issue ASTERISK-22350) Reported by: Birger "WIMPy" Harzenetter Review: https://reviewboard.asterisk.org/r/3078/ ........ Merged revisions 404344 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-19 12:17 +0000 [r404332] Joshua Colp * main/channel.c: channel: Add a missing ast_channel_unlock when allocating a Surrogate channel. 2013-12-19 08:19 +0000 [r404320] Alexandr Anikin * addons/ooh323c/src/oochannels.c, addons/ooh323c/src/ooGkClient.c, addons/chan_ooh323.c, /, addons/ooh323c/src/ooGkClient.h: Handle temporary failures on gk registration Introduce new 'stopped' state for gk client and restart gk client on failures Remove ooh323 stack command lock as it is not need now. (closes issue ASTERISK-21960) Reported by: Dmitry Melekhov Patches: ASTERISK-21960.patch ASTERISK-21960-stacklockup-2.patch Tested by: Dmitry Melekhov ........ Merged revisions 404318 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-19 02:53 +0000 [r404306] Damien Wedhorn * channels/chan_skinny.c: Fixup some skinny bugs causing Fracks and ao2 cleanup issues. Moved channel locking into setsubstate so that a process can complete working on a sub before another starts changing it. The existing code was causing some Fracks with schedule deletion. Removed multiple rtp cleanup. Now only cleansup up once, fixing ao2 object cleanup issues. 2013-12-19 00:47 +0000 [r404294] Matthew Jordan * apps/app_cdr.c, main/cdr.c, apps/app_forkcdr.c, main/pbx.c, funcs/func_cdr.c, apps/app_disa.c, UPGRADE.txt, include/asterisk/cdr.h, CHANGES: app_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state When doing the rework of the CDR engine that pushed all of the logic into cdr.c and made it respond to changes in channel state over Stasis, we knew that accessing the CDR engine from the dialplan would be "slightly" non-deterministic. Dialplan threads would be accessing CDRs while Stasis threads would be updating the state of said CDRs - whereas in the past, everything happened on the dialplan threads. Tests have shown that "slightly" is in reality "very". This patch synchronizes things by making the dialplan applications/functions that manipulate CDRs do so over Stasis. ForkCDR, NoCDR, ResetCDR, CDR, and CDR_PROP now all use Stasis to send their requests over to the CDR engine, and synchronize on the channel Stasis topic via a subscription so that they return their values/control to the dialplan at the appropriate time. While going through this, the following changes were also made: * DISA, which can reset the CDR when a user successfully authenticates, now just uses the ResetCDR app to do this. This prevents having to duplicate the same Stasis synchronization logic in that application. * Answer no longer disables CDRs. It actually didn't work anyway - calling DISABLE on the channel's CDR doesn't stop the CDR from getting the Answer time - it just kills all CDRs on that channel, which isn't what the caller would intend. (closes issue ASTERISK-22884) (closes issue ASTERISK-22886) Review: https://reviewboard.asterisk.org/r/3057/ 2013-12-19 00:29 +0000 [r404292] Damien Wedhorn * channels/chan_skinny.c: Fixup skinny registration following network issues. On session registration, if device is already reporting that it is connected to a device, an innocuous packet (update time) is sent to the already connected device. If the tcp connection is down, the device will be unregistered and the new connection allowed. Without this patch, network issues can see a situation where a device can not reregister until after 3*timeout. 2013-12-18 22:50 +0000 [r404279] Jason Parker * main/manager.c, /: Add AMI event for presence state. Review: https://reviewboard.asterisk.org/r/3039/ ........ Merged revisions 404275 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-18 20:57 +0000 [r404263] Richard Mudgett * addons/ooh323c/src/ooTimer.c, /: ooh323c: Fix gcc 4.6.3 compiler warnings. ........ Merged revisions 404212 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404219 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-18 20:46 +0000 [r404237-404261] Kevin Harwell * channels/chan_oss.c: chan_oss.c: channel being locked twice and unlocked once Removed channel lock as it is now being down in ast_channel_alloc * main/pickup.c, include/asterisk/aoc.h, include/asterisk/stasis_bridges.h, apps/app_disa.c, apps/app_userevent.c, include/asterisk/channelstate.h, channels/chan_console.c, main/core_local.c, channels/chan_iax2.c, main/endpoints.c, channels/chan_oss.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, main/channel.c, channels/chan_misdn.c, channels/chan_skinny.c, pbx/pbx_realtime.c, channels/chan_alsa.c, main/stasis_channels.c, main/bridge_channel.c, addons/chan_mobile.c, res/parking/parking_manager.c, channels/chan_pjsip.c, tests/test_cdr.c, channels/chan_mgcp.c, channels/chan_unistim.c, main/pbx.c, funcs/func_timeout.c, apps/app_meetme.c, main/bridge.c, tests/test_stasis_channels.c, include/asterisk/channel.h, channels/chan_gtalk.c, main/cel.c, apps/app_queue.c, channels/sig_pri.c, main/stasis_bridges.c, channels/chan_jingle.c, main/dial.c, channels/chan_dahdi.c, channels/chan_phone.c, include/asterisk/stasis_channels.h, channels/sig_analog.c, res/res_agi.c, channels/chan_motif.c, tests/test_cel.c, apps/app_confbridge.c, res/res_stasis.c, res/res_pjsip_refer.c, apps/app_voicemail.c, apps/app_dial.c, channels/chan_vpb.cc, addons/chan_ooh323.c: channel locking: Add locking for channel snapshot creation Original commit message by mmichelson (asterisk 12 r403311): "This adds channel locks around calls to create channel snapshots as well as other functions which operate on a channel and then end up creating a channel snapshot. Functions that expect the channel to be locked prior to being called have had their documentation updated to indicate such." The above was initially committed and then reverted at r403398. The problem was found to be in core_local.c in the publish_local_bridge_message function. The ast_unreal_lock_all function locks and adds a reference to the returned channels and while they were being unlocked they were not being unreffed when no longer needed. Fixed by unreffing the channels. Also in bridge.c a lock was obtained on "other->chan", but then an attempt was made to unlock "other" and not the previously locked channel. Fixed by unlocking "other->chan" (closes issue ASTERISK-22709) Reported by: John Bigelow 2013-12-18 19:20 +0000 [r404204] Joshua Colp * main/channel.c, channels/chan_dahdi.c, channels/chan_phone.c, channels/chan_skinny.c, res/parking/parking_tests.c, tests/test_voicemail_api.c, channels/chan_motif.c, channels/chan_alsa.c, main/message.c, addons/chan_mobile.c, tests/test_cdr.c, channels/chan_mgcp.c, main/pbx.c, channels/chan_sip.c, tests/test_app.c, apps/confbridge/conf_chan_record.c, tests/test_stasis_channels.c, main/core_unreal.c, include/asterisk/channel.h, channels/chan_console.c, channels/chan_oss.c, channels/chan_jingle.c, channels/chan_misdn.c, channels/chan_h323.c, tests/test_cel.c, channels/chan_nbs.c, channels/chan_pjsip.c, apps/app_voicemail.c, res/res_calendar.c, channels/chan_unistim.c, tests/test_substitution.c, addons/chan_ooh323.c, channels/chan_vpb.cc, channels/chan_multicast_rtp.c, apps/app_meetme.c, res/res_stasis_snoop.c, channels/chan_gtalk.c, channels/chan_iax2.c: channels: Return allocated channels locked. This change makes ast_channel_alloc return allocated channels locked. By doing so no other thread can acquire, lock, and manipulate the channel before it is completely set up. (closes issue AST-1256) Review: https://reviewboard.asterisk.org/r/3067/ 2013-12-18 12:36 +0000 [r404184] Matthew Jordan * rest-api/api-docs/bridges.json, rest-api/api-docs/recordings.json, rest-api/api-docs/deviceStates.json, rest-api/api-docs/endpoints.json, rest-api/api-docs/events.json, rest-api/api-docs/asterisk.json, rest-api/api-docs/applications.json, rest-api/api-docs/playbacks.json, rest-api/api-docs/channels.json, rest-api/api-docs/sounds.json, rest-api/resources.json: ari: Bump the version of ARI to 1.0.0 (closes issue ASTERISK-23007) 2013-12-18 12:00 +0000 [r404137] Joshua Colp * res/res_calendar.c, /: res_calendar: Protect channel when adding datastore. This change adds a missing channel lock when adding a datastore to a channel. ........ Merged revisions 404135 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404136 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-18 00:35 +0000 [r404099] Rusty Newton * /, funcs/func_strings.c: func_strings: Documentation fix for QUOTE() Example output was inaccurate. (issue ASTERISK-22970) (closes issue ASTERISK-22970) Reported by: Gareth Palmer Patches: func_strings.patch uploaded by Gareth Palmer (license 5169) ........ Merged revisions 404081 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 404087 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-18 00:16 +0000 [r404050] Matthew Jordan * LICENSE: LICENSE: Update language to include ARI 2013-12-17 23:50 +0000 [r404048] Jonathan Rose * tests/test_cel.c, tests/test_cdr.c: tests: fix ast_bridge_base_new calls not using the additional arguments r404042 gave ast_bridge_base_new two new arguments for setting a bridge creator and name. Unfortunately since a couple test modules aren't compiled by default, I missed the fact that this change impacted those tests and caused compilation failures against them. 2013-12-17 23:36 +0000 [r404046] Rusty Newton * include/asterisk/test.h, main/channel.c, main/rtp_engine.c, channels/chan_iax2.c, apps/app_chanspy.c, apps/app_mixmonitor.c: Several components: fixing Typos in comments and code, "avaliable" instead of "available" (issue ASTERISK-23021) (closes issue ASTERISK-23021) Reported by: Jeremy Lainé Tested by: Rusty Newton Patches: available.patch uploaded by Jeremy Lainé (license 6561) 2013-12-17 23:17 +0000 [r404042] Jonathan Rose * include/asterisk/bridge_internal.h, apps/app_confbridge.c, res/res_stasis.c, include/asterisk/bridge.h, res/res_ari_bridges.c, main/bridge.c, main/bridge_basic.c, include/asterisk/stasis_bridges.h, include/asterisk/stasis_app.h, apps/app_bridgewait.c, res/ari/ari_model_validators.c, doc/appdocsxml.xslt, main/stasis_bridges.c, rest-api/api-docs/bridges.json, res/ari/resource_bridges.c, apps/app_agent_pool.c, res/parking/parking_bridge.c, res/ari/ari_model_validators.h, main/manager_bridges.c, res/ari/resource_bridges.h: bridging: Give bridges a name and a known creator Bridges have two new optional properties, a creator and a name. Certain consumers of bridges will automatically provide bridges that they create with these properties. Examples include app_bridgewait, res_parking, app_confbridge, and app_agent_pool. In addition, a name may now be provided as an argument to the POST function for creating new bridges via ARI. (closes issue AFS-47) Review: https://reviewboard.asterisk.org/r/3070/ 2013-12-17 18:34 +0000 [r404027-404029] Joshua Colp * res/res_sorcery_config.c: res_sorcery_config: Output an error message when an object can't be created. If object creation fails an error message will now be output with the id, type, and configuration file. * main/framehook.c: framehooks: Re-iterate if framehook provides different frame. Framehooks can be used in a reactive manner to execute specific logic when a frame is received with a certain type and payload. Since it is possible for framehooks to provide frames it was possible for this reactive framehook to be unaware of frames it is looking for. This change makes it so that when framehooks return a modified frame the code will now re-iterate (from the beginning) and call any previous framehooks that have not provided a modified frame themselves. Review: https://reviewboard.asterisk.org/r/3046/ 2013-12-17 14:33 +0000 [r404006] David M. Lee * configs/asterisk.conf.sample, main/asterisk.c: Changed the default for live_dangerously to no 2013-12-17 12:51 +0000 [r403993] Matthew Jordan * res/ari/resource_channels.c: ari/resource_channels: When creating a channel, specify a default format (SLIN) When creating channels via ARI, the current code fails to provide any default format capabilities. For non-virtual channels this isn't really a problem - the channels typically receive their capabilities as a result of the underlying channel driver configuration. For virtual channels (such as Local channels), the lack of any format capabilities causes the Asterisk core to make some 'odd' choices with respect to the translation paths. The issue reporter had some paths that had 3 hops on each channel leg, causing multiple transcodings and some really crappy audio/performance. By specifying a baseline of SLIN, we prevent that from occurring. Note that this is what AMI does when it performs an Originate, as does res_clioriginate. Review: https://reviewboard.asterisk.org/r/3068/ (issue ASTERISK-22962) Reported by: Matt DiMeo 2013-12-16 18:31 +0000 [r403959] David M. Lee * UPGRADE.txt, include/asterisk/pbx.h, main/asterisk.c, funcs/func_realtime.c, main/pbx.c, main/tcptls.c, funcs/func_db.c, /, README-SERIOUSLY.bestpractices.txt, configs/asterisk.conf.sample, funcs/func_shell.c, funcs/func_env.c, funcs/func_lock.c: security: Inhibit execution of privilege escalating functions This patch allows individual dialplan functions to be marked as 'dangerous', to inhibit their execution from external sources. A 'dangerous' function is one which results in a privilege escalation. For example, if one were to read the channel variable SHELL(rm -rf /) Bad Things(TM) could happen; even if the external source has only read permissions. Execution from external sources may be enabled by setting 'live_dangerously' to 'yes' in the [options] section of asterisk.conf. Although doing so is not recommended. Also, the ABI was changed to something more reasonable, since Asterisk 12 does not yet have a public release. (closes issue ASTERISK-22905) Review: http://reviewboard.digium.internal/r/432/ ........ Merged revisions 403913 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 403917 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-16 18:22 +0000 [r403957] Jonathan Rose * main/bridge.c: transfers: Fix bug setting both BLINDTRANSFER and ATTENDEDTRANSFER The ast_bridge_set_transfer_variables function is supposed to wipe whichever variable isn't being set. Instead it was setting both to the new value. Oops. (issue AFS-24) 2013-12-16 16:11 +0000 [r403856-403864] Scott Griepentrog * main/pbx.c, /: pbx.c: put copy of ast_exten.data on stack to prevent memory corruption During dialplan execution in pbx_extension_helper(), the contexts global read lock prevents link list corruption, but was released with a pointer to the ast_exten and data later used in variable substitution. Instead, this patch removes pbx_substitute_variables() and locates a copy of the ast_exten data on the stack before releasing the lock, where ast_exten could get free'd by another thread performing a module reload. (issue AST-1179) Reported by: Thomas Arimont (issue AST-1246) Reported by: Alexander Hömig Review: https://reviewboard.asterisk.org/r/3055/ ........ Merged revisions 403862 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 403863 from http://svn.asterisk.org/svn/asterisk/branches/11 * apps/app_sms.c: app_sms: BufferOverflow when receiving odd length 16 bit message This patch prevents an infinite loop overwriting memory when a message is received into the unpacksms16() function, where the length of the message is an odd number of bytes. (closes issue ASTERISK-22590) Reported by: Jan Juergens Tested by: Jan Juergens 2013-12-15 01:38 +0000 [r403823] Matthew Jordan * channels/pjsip/dialplan_functions.c: pjsip/dialplan_functions: Use the right buffer length when printing URIs While entertaining, sizeof(buflen) is not the same as buflen. Doh. 2013-12-14 17:25 +0000 [r403808-403811] Joshua Colp * include/asterisk/res_pjsip.h, res/res_pjsip/location.c, res/res_pjsip/pjsip_options.c, res/res_pjsip.c: res_pjsip: Apply outbound proxy to all SIP requests. Objects which are involved in SIP request creation and sending now allow an outbound proxy to be specified. For cases where an endpoint is used the outbound proxy specified there will be applied. (closes issue ASTERISK-22673) Reported by: Antti Yrjola Review: https://reviewboard.asterisk.org/r/3022/ * main/stasis_channels.c, apps/app_queue.c, res/ari/ari_model_validators.c, apps/app_dial.c, res/ari/ari_model_validators.h, main/dial.c, include/asterisk/stasis_channels.h, rest-api/api-docs/events.json, res/stasis/app.c: res_stasis: Expose event for call forwarding and follow forwarded channel. This change adds an event for when an originated call is redirected to another target. This event contains the original channel and the newly created channel. If a stasis subscription exists on the original originated channel for a stasis application then a new subscription will also be created on the stasis application to the redirected channel. This allows the application to follow the call path completely. (closes issue ASTERISK-22719) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/3054/ 2013-12-13 21:24 +0000 [r403796] Jonathan Rose * res/res_pjsip_messaging.c, main/message.c: documentation: Add PJSIP technology to messaging documentation 2013-12-13 20:06 +0000 [r403782] Richard Mudgett * main/test.c: test.c: Fix too sticky unit test failed status. Rerunning a failed unit test after loading any required modules should allow the test to report a pass status if it now passes. 2013-12-13 20:04 +0000 [r403781] Jonathan Rose * include/asterisk/bridge.h, res/parking/parking_bridge_features.c, res/parking/parking_manager.c, main/bridge.c, main/bridge_basic.c: Transfers: Make Asterisk set ATTENDEDTRANSFER/BLINDTRANSFER more reliably There were still a few cases in which ATTENDEDTRANSFER and BLINDTRANSFER wouldn't be set on channels involved with blind and attended transfers. This would happen with features that were initialized by channel driver specific mechanisms in multiparty calls. This patch resolves those cases while attempted to keep the behavior for setting those variables as consistent as possible. (closes issue AFS-24) Review: https://reviewboard.asterisk.org/r/3040/ 2013-12-13 19:55 +0000 [r403779-403780] Richard Mudgett * include/asterisk/app.h, tests/test_voicemail_api.c, main/app.c: test_voicemail_api: Add check for a registered voicemail provider before tests. It is much nicer diagnosing a test failure if app_voicemail is actually loaded. ........ Merged revisions 403726 from http://svn.asterisk.org/svn/asterisk/trunk * main/app.c, apps/app_voicemail.c, include/asterisk/app.h, include/asterisk/doxyref.h: app_voicemail: Voicemail callback registration/unregistration function improvements. * The voicemail registration/unregistration functions now take a struct of callbacks instead of a lengthy parameter list of callbacks. * The voicemail registration/unregistration functions now prevent a competing module from interfering with an already registered callback supplying module. ........ Merged revisions 403643 from http://svn.asterisk.org/svn/asterisk/trunk 2013-12-13 18:24 +0000 [r403749-403767] Kevin Harwell * channels/chan_sip.c, include/asterisk/channel.h, bridges/bridge_native_rtp.c, channels/chan_pjsip.c, main/channel.c: bridge_native_rtp: Deadlock during 4-way conference creation The change contains a slightly adjusted patch that was on the issue (submitted by kmoore). A fix was made by adding in a bridge lock while calling bridge_start/stop from the framehook callback. Since the framehook callback is not called from the bridging core the bridge is not locked, but needs to be before calling bridge_start. (closes issue ASTERISK-22749) Reported by: Kinsey Moore Review: https://reviewboard.asterisk.org/r/3066/ Patches: lock_inversion.diff uploaded by kmoore (license 6273) * main/http.c, rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c, res/ari/resource_channels.h: ARI: Allow specifying channel variables during a POST /channels Added the ability to specify channel variables when creating/originating a channel in ARI. The variables are sent in the body of the request and should be formatted as a single level JSON object. No nested objects allowed. For example: {"variable1": "foo", "variable2": "bar"}. (closes issue ASTERISK-22872) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3052/ * res/res_ari_bridges.c, res/stasis/command.c, res/res_stasis_playback.c, res/stasis/control.c, res/stasis/command.h, include/asterisk/stasis_app.h, include/asterisk/stasis_app_impl.h, res/res_stasis_recording.c, res/res_stasis_answer.c, rest-api/api-docs/bridges.json, res/ari/resource_bridges.c: ARI: Adding a channel to a bridge while a live recording is active blocks Added the ability to have rules that are checked when adding and/or removing channels to/from a bridge. In this case, if a channel is currently recording and someone attempts to add it to a bridge an "is recording" rule is checked, fails, and a 409 conflict is returned. Also command functions now return an integer value that can be descriptive of what kind of problems, if any, occurred before or during execution. (closes issue ASTERISK-22624) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/2947/ 2013-12-13 16:27 +0000 [r403748] David M. Lee * channels/pjsip: Setting svn:ignore 2013-12-13 05:00 +0000 [r403736] Matthew Jordan * channels/Makefile: channels/Makefile: clean pjsip directory 2013-12-12 19:44 +0000 [r403713] Scott Griepentrog * contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py (added): realtime: Create extensions in alembic ast-db-manage contribution When the alembic scripts were written for creating Asterisk realtime databases the extensions table for dialplan wasn't included. This update creates the extensions table. (closes issue ASTERISK-22815) Reported by: Zone Conkle Review: https://reviewboard.asterisk.org/r/3064/ 2013-12-12 19:12 +0000 [r403705] Jonathan Rose * channels/chan_pjsip.c: chan_pjsip: Revert r403587 This patch was intended to eliminate a deadlock that occurs when masquerades occur in pjsip channels, but has some potential side effects. Mark Michelson is currently working on addressing this problem from another angle. (issue ASTERISK-22936) Reported by: Jonathan Rose 2013-12-11 20:11 +0000 [r403680] Kevin Harwell * res/res_pjsip/pjsip_configuration.c, res/res_pjsip_messaging.c, res/res_pjsip/include/res_pjsip_private.h, res/res_pjsip.c, include/asterisk/res_pjsip.h, res/res_pjsip/config_global.c, configs/pjsip.conf.sample: res_pjsip_messaging: send message to a default outbound endpoint In some cases messages need to be sent to a direct URI (sip:). This patch adds in that support by using a default outbound endpoint. When sending messages, if no endpoint can be found then the default one is used. To facilitate this a new default_outbound_endpoint option was added to the globals section for pjsip.conf. Review: https://reviewboard.asterisk.org/r/2944/ 2013-12-11 19:18 +0000 [r403639] Russell Bryant * /, channels/chan_sip.c: Reset peer outboundproxy on sip.conf reload If you set a peer's outboundproxy and then removed it from the config, this would not get picked up in a config reload. This patch fixes that by resetting it in set_peer_defaults(). Closes ASTERISK-19454 Review: https://reviewboard.asterisk.org/r/3065/ ........ Merged revisions 403634 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 403635 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-11 13:05 +0000 [r403616-403618] Matthew Jordan * funcs/func_channel.c, channels/pjsip/include (added), channels/pjsip/include/dialplan_functions.h (added), res/res_pjsip_t38.c, channels/pjsip/include/chan_pjsip.h (added), channels/Makefile, channels/chan_pjsip.c, main/xmldoc.c, channels/pjsip/dialplan_functions.c (added), include/asterisk/res_pjsip_session.h, channels/pjsip (added): func_channel, chan_pjsip: Add CHANNEL read function support for chan_pjsip This patch adds CHANNEL read support for chan_pjsip. This allows the dialplan to use the CHANNEL function on a chan_pjsip channel to obtain run-time information about the channel from the PJSIP channel driver and the PJSIP stack. This includes: * RTP information, including source/destination media addresses, whether or not the media is secure, held, and other properties. * RTCP information. This includes sets of parseable information, as well as individual statistic attriutes. * PJSIP information. This includes URIs, local/remote signalling addresses, whether or not the signalling is secure, and other properties. * The endpoint name. This can be used in conjunction with the PJSIP_ENDPOINT function to obtain more detailed endpoint information. Review: https://reviewboard.asterisk.org/r/3038/ * Makefile, funcs/func_pjsip_endpoint.c (added), doc/snapshots.xslt (removed), doc/appdocsxml.xslt (added), doc/appdocsxml.dtd, main/sorcery.c: func_pjsip_endpoint: Add PJSIP_ENDPOINT function for querying endpoint details This patch adds a new function, PJSIP_ENDPOINT, which lets the dialplan query, for any endpoint, any property configured on an endpoint. This function is a companion to the CHANNEL function, which can be used to extract the endpoint name for a channel. Review: https://reviewboard.asterisk.org/r/3035 2013-12-09 22:47 +0000 [r403587] Jonathan Rose * channels/chan_pjsip.c: chan_pjsip: Fix a sticking channel lock caused by channel masquerades (closes issue ASTERISK-22936) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/3042/ 2013-12-09 19:23 +0000 [r403545-403559] Richard Mudgett * res/res_sorcery_astdb.c: Reverting regex part of -r403545 at request of file. res_sorcery_astdb.c: Fix get multiple records by regex. * Fix sorcery_astdb_retrieve_regex() pattern matching. Let the regexec() function match the stored key values instead of having astdb prefilter them. Previoiusly you could only use a simple regex pattern when the pattern began with '^'. * res/res_sorcery_astdb.c: res_sorcery_astdb.c: Fix get multiple records by regex. * Fix sorcery_astdb_retrieve_regex() pattern matching. Let the regexec() function match the stored key values instead of having astdb prefilter them. Previoiusly you could only use a simple regex pattern when the pattern began with '^'. * Fix off nominal memory leak in sorcery_astdb_retrieve_regex(). 2013-12-09 18:31 +0000 [r403542] Joshua Colp * main/endpoints.c: endpoints: Keep a reference to channel ids when creating snapshot. The snapshot process for endpoints uses the channel ids present on the endpoint itself. Without keeping a reference it was possible for the strings to be freed underneath any consumer of an endpoint snapshot. A reference is now held by the snapshot to the channel ids and released when the snapshot is destroyed. (issue ASTERISK-22801) Reported by: Matt Jordan 2013-12-09 18:31 +0000 [r403527-403541] Richard Mudgett * main/sorcery.c: sorcery: Eliminate shadowing a varaible that caused confusion. * Eliminated shadowing of the __ast_sorcery_apply_config() name parameter causing confusion. * Fix potential crash from sorcery.conf user input in __ast_sorcery_apply_config() if the user supplied a malformed config line that is missing the sorcery object type name. * Remove redundant test in __ast_sorcery_apply_config(). !config and config == CONFIGS_STATUS_FILEMISSING are identical. * main/sorcery.c: sorcery: Whitespace You would think that a new file would start off without any whitespace oddities. 2013-12-09 16:40 +0000 [r403510] Joshua Colp * res/res_pjsip_nat.c: res_pjsip_nat: Add NAT module to session dialogs. Due to the way pjproject internally works it was possible for the NAT module to not be invoked on messages with-in a session dialog. This means that the various parts of the message would not get rewritten with the source IP address and port. This change uses a session supplement to add the NAT module to the dialog on the first incoming or outgoing INVITE. (closes issue ASTERISK-22941) Reported by: Leif Madsen 2013-12-09 03:19 +0000 [r403435-403458] Matthew Jordan * res/res_fax_spandsp.c, /: res_fax_spandsp: Always init T.38 session to avoid crashes during state change Prior to this patch, res_fax_spandsp was conservative with how it initialized the spandsp T.38 context. It would only initialize it if the driver thought the current state was a T.38 fax. While this works fine in nominal situations, in certain off nominal situations, res_fax_spandsp can believe that a T.38 fax will not occur when in fact one has started. In particular, this was discovered when res_fax would fall back to audio after timing out on a T.38 upgrade. The SIP channel driver would continue to retry the re-INVITE and - if the remote end responded after res_fax timed out with a 200 OK - a T.38 frame would be delivered to the res_fax stack when it no longer expected it. As it turns out, there does not appear to be any downside to always initializing the T.38 context, other than the actual memory allocation. Since that avoids this off nominal situation (and others which are equally likely hard to predict), this is the safest way to avoid this problem. Much thanks to Torrey as well for providing a scenario that reproduces this issue. (closes issue ASTERISK-21242) Reported by: Ashley Winters Tested by: Torrey Searle patches: always-init-t38.patch uploaded by awinters (License 6477) A_PARTY.xml uploaded by tsearle (License 5334) ........ Merged revisions 403449 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 403450 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_config_sqlite.c: res_config_sqlite: Check for CDR unregistration failures If the CDR unregistration fails due to an inflight CDR, the res_config_sqlite module needs to bail on unloading itself. Otherwise, the config could be unloaded (including the CDR table name) while the CDR engine posts a CDR to the still registered backend, resulting in a crash. 2013-12-05 20:49 +0000 [r403398] David M. Lee * main/core_unreal.c, tests/test_stasis_channels.c, include/asterisk/channel.h, channels/chan_gtalk.c, channels/sig_pri.c, apps/app_queue.c, main/cel.c, main/stasis_bridges.c, channels/chan_jingle.c, channels/chan_phone.c, channels/chan_dahdi.c, main/dial.c, include/asterisk/stasis_channels.h, channels/sig_analog.c, channels/chan_motif.c, res/res_agi.c, channels/chan_h323.c, tests/test_cel.c, apps/app_confbridge.c, res/res_stasis.c, res/res_pjsip_refer.c, apps/app_voicemail.c, apps/app_dial.c, channels/chan_vpb.cc, addons/chan_ooh323.c, channels/chan_sip.c, main/pickup.c, include/asterisk/aoc.h, include/asterisk/stasis_bridges.h, apps/app_disa.c, apps/app_userevent.c, main/core_local.c, channels/chan_console.c, include/asterisk/channelstate.h, channels/chan_iax2.c, main/endpoints.c, channels/chan_oss.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, main/channel.c, channels/chan_misdn.c, channels/chan_skinny.c, channels/chan_alsa.c, pbx/pbx_realtime.c, main/stasis_channels.c, channels/chan_nbs.c, main/bridge_channel.c, addons/chan_mobile.c, channels/chan_pjsip.c, tests/test_cdr.c, res/parking/parking_manager.c, channels/chan_mgcp.c, channels/chan_unistim.c, main/pbx.c, funcs/func_timeout.c, apps/app_meetme.c, main/bridge.c: Reverting r403311. It's causing ARI tests to hang. 2013-12-04 21:41 +0000 [r403377] Kevin Harwell * res/res_pjsip_registrar.c: res_pjsip_registrar: undefined function pointer symbol Used a static wrapper around the offending function to alleviate the issue. Reported by: rmudgett 2013-12-04 20:53 +0000 [r403364] Joshua Colp * res/res_pjsip_t38.c: res_pjsip_t38: Don't pass T.38 control frames through to other hooks. This crept up during gateway testing where the gateway would receive the request to negotiate and assume it came from the remote side, causing the gateway state machine to go a little, to a use a technical term, "wonky". 2013-12-04 18:40 +0000 [r403349] Mark Michelson * res/res_pjsip.c: Initialize the hash value argument to pj_hash_get() to 0. Passing a non-zero value causes PJLIB to use the given input as the hash value. Passing zero causes the parameter to become an output parameter that receives the hash value that was computed based on the given key. This change essentially makes ast_sip_dict_get() properly retrieve the desired value. 2013-12-03 20:17 +0000 [r403342] David M. Lee * res/stasis/control.c: ari: Fix deadlock problem with functions that use autoservice. The code for getting channel variables from ARI assumed that you needed to lock the channel in order to properly execute functions and read channel variables. Apparently, this is not the case, since any dialplan function that puts the channel into autoservice deadlocks when attempting to remove the channel from autoservice. 2013-12-03 17:59 +0000 [r403329] Joshua Colp * res/res_pjsip_session.c, configure, include/asterisk/autoconfig.h.in, configure.ac: res_pjsip_session: Add support for PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE flag. Newer versions of PJSIP have changed to using a flag for the PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE instead of a define. This adds a configure check to detect the presence of the flag and use it if found. 2013-12-03 17:23 +0000 [r403324] Richard Mudgett * main/bucket.c, include/asterisk/sorcery.h, res/res_pjsip/pjsip_configuration.c, res/res_pjsip_registrar_expire.c, res/res_pjsip/pjsip_options.c, tests/test_sorcery.c, include/asterisk/bucket.h, main/sorcery.c: sorcery, bucket: Change observer remove calls to take const callbacks struct. * Make ast_sorcery_observer_remove() accept a const callbacks struct. * Make ast_sorcery_observer_remove() tolerant of the sorcery parameter being NULL. Now it can be called within a module unload routine if the sorcery initialization fails. * Fix ast_sorcery_observer_add() to fail if the container link fails. 2013-12-03 16:37 +0000 [r403312] Joshua Colp * main/media_index.c: media_index: Make media indexing tolerable of bad symlinks. Media indexing will now skip over files and directories that stat will not return information about. This can occur under normal conditions when a symbolic link points to a location that no longer exists. 2013-12-03 16:33 +0000 [r403311] Mark Michelson * include/asterisk/stasis_bridges.h, apps/app_disa.c, apps/app_userevent.c, main/core_local.c, include/asterisk/channelstate.h, channels/chan_console.c, channels/chan_iax2.c, main/endpoints.c, channels/chan_oss.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, main/channel.c, channels/chan_misdn.c, channels/chan_skinny.c, channels/chan_alsa.c, pbx/pbx_realtime.c, main/stasis_channels.c, channels/chan_nbs.c, main/bridge_channel.c, addons/chan_mobile.c, channels/chan_pjsip.c, tests/test_cdr.c, res/parking/parking_manager.c, channels/chan_mgcp.c, channels/chan_unistim.c, main/pbx.c, funcs/func_timeout.c, apps/app_meetme.c, main/bridge.c, tests/test_stasis_channels.c, main/core_unreal.c, include/asterisk/channel.h, channels/chan_gtalk.c, channels/sig_pri.c, apps/app_queue.c, main/cel.c, main/stasis_bridges.c, channels/chan_jingle.c, channels/chan_phone.c, channels/chan_dahdi.c, main/dial.c, include/asterisk/stasis_channels.h, channels/sig_analog.c, channels/chan_motif.c, res/res_agi.c, channels/chan_h323.c, tests/test_cel.c, apps/app_confbridge.c, res/res_stasis.c, res/res_pjsip_refer.c, apps/app_voicemail.c, apps/app_dial.c, channels/chan_vpb.cc, addons/chan_ooh323.c, main/pickup.c, channels/chan_sip.c, include/asterisk/aoc.h: Add channel locking for channel snapshot creation. This adds channel locks around calls to create channel snapshots as well as other functions which operate on a channel and then end up creating a channel snapshot. Functions that expect the channel to be locked prior to being called have had their documentation updated to indicate such. 2013-12-03 16:32 +0000 [r403310] Joshua Colp * res/res_ari.c: Revert revision 403304: Fixed the filename for the ari.conf docs The changed value refers to the name of the module. The name of the configuration file is specified in the configFile section. 2013-12-02 18:34 +0000 [r403304] David M. Lee * res/res_ari.c: Fixed the filename for the ari.conf docs 2013-12-02 18:03 +0000 [r403290-403291] Alexandr Anikin * /: remove unwanted property svn:mergeinfo * /, addons/chan_ooh323.c: Check and reject non-digits e164 values on peers and general sections in ooh323.conf Regenerate e164 endpoint list on reload ooh323 (issue ASTERISK-22901) Reported by: Cyril CONSTANTIN Patches: ASTERISK-22901.patch ........ Merged revisions 403288 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-12-01 21:12 +0000 [r403256-403271] Joshua Colp * res/res_pjsip_session.c: res_pjsip_session: Apply fromuser and fromdomain to all requests as documented. * res/res_pjsip_t38.c: res_pjsip_t38: Add the framehook to the channel only on first INVITE. The check for determining whether the T.38 framehook should be added to the channel or not has now been changed to guarantee adding only occurs on the first incoming or outgoing INVITE. * res/res_pjsip_transport_websocket.c, include/asterisk/res_pjsip.h, res/res_pjsip/location.c, res/res_pjsip/security_events.c, res/res_pjsip/pjsip_options.c, res/res_pjsip.c: res_pjsip_transport_websocket: Fix security events and simplify implementation. Transport type determination for security events has been simplified to use the type present on the message itself instead of searching through configured transports to find the transport used. The actual WebSocket transport has also been simplified. It now leverages the existing PJSIP transport manager for finding the active WebSocket transport for outgoing messages. This removes the need for res_pjsip_transport_websocket to store a mapping itself. (closes issue ASTERISK-22897) Reported by: Max E. Reyes Vera J. Review: https://reviewboard.asterisk.org/r/3036/ 2013-11-30 14:11 +0000 [r403240] Joshua Colp * res/ari/ari_model_validators.c, res/ari/ari_model_validators.h, rest-api/api-docs/events.json: res_ari: Add Recording events to the validator. 2013-11-28 02:12 +0000 [r403179-403223] Joshua Colp * res/res_pjsip_sdp_rtp.c: res_pjsip_sdp_rtp: Don't produce an invalid media stream with no formats. Depending on configuration it was possible for a media stream to be created without any media formats. The produced SDP would fail internal validation and cause a crash. The code will now no longer add media streams with no formats to the SDP, allowing it to pass validation and work. (closes issue ASTERISK-22858) Reported by: Anthony Messina * res/res_pjsip_header_funcs.c: res_pjsip_header_funcs: Don't add headers to re-INVITEs. When sending a re-INVITE to an endpoint it was possible for received headers to be added as well (since they are stored for retrieval using the PJSIP_HEADER dialplan function). This caused a broken (and potentially large) SIP INVITE to be produced and sent. This changes the module so it will no longer add headers to re-INVITEs. (closes issue ASTERISK-22882) Reported by: David M. Lee * res/res_stasis_playback.c: res_stasis_playback: Add 'number', 'digits', and 'characters' URI scheme implementations. This change adds new URI scheme implementations for playing numbers, digits, and characters. This is done as part of the normal playback mechanism and can be used with queueing to create a combined sentence. Review: https://reviewboard.asterisk.org/r/3028/ * res/res_pjsip/pjsip_configuration.c, res/res_pjsip.c, res/res_pjsip_session.c, include/asterisk/res_pjsip.h: res_pjsip_session: Add configurable behavior for redirects. The action taken when a redirect occurs is now configurable on a per-endpoint basis. The redirect can either be treated as a redirect to a local extension, to a URI that is dialed through the Asterisk core, or to a URI that is dialed within PJSIP itself. (closes issue ASTERISK-21710) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2963/ * res/res_pjsip/pjsip_configuration.c: res_pjsip: Fix crash when reloading certain configurations. Certain options available that specify a SIP URI perform validation on the provided URI using the PJSIP URI parser. This operation requires that the thread executing it be registered with the PJLIB library. During reloads this was done on a thread which was NOT registered with it. This fixes the problem by creating a task which reloads the configuration on a PJSIP thread. (closes issue ASTERISK-22923) Reported by: Anthony Messina 2013-11-27 15:36 +0000 [r403175] David M. Lee * res/res_ari_channels.c, include/asterisk/ari.h, rest-api-templates/param_parsing.mustache, include/asterisk/http.h, res/res_ari_recordings.c, res/res_ari_endpoints.c, main/http.c, rest-api-templates/swagger_model.py, res/res_ari_playbacks.c, res/res_ari_sounds.c, rest-api-templates/asterisk_processor.py, res/res_ari_bridges.c, tests/test_ari.c, res/res_ari.c, res/res_ari_device_states.c, res/res_ari_asterisk.c, rest-api-templates/res_ari_resource.c.mustache, res/res_ari_applications.c: ari:Add application/json parameter support The patch allows ARI to parse request parameters from an incoming JSON request body, instead of requiring the request to come in as query parameters (which is just weird for POST and DELETE) or form parameters (which is okay, but a bit asymmetric given that all of our responses are JSON). For any operation that does _not_ have a parameter defined of type body (i.e. "paramType": "body" in the API declaration), if a request provides a request body with a Content type of "application/json", the provided JSON document is parsed and searched for parameters. The expected fields in the provided JSON document should match the query parameters defined for the operation. If the parameter has 'allowMultiple' set, then the field in the JSON document may optionally be an array of values. (closes issue ASTERISK-22685) Review: https://reviewboard.asterisk.org/r/2994/ 2013-11-27 15:31 +0000 [r403160-403173] Joshua Colp * res/res_pjsip/pjsip_configuration.c: res_pjsip: Update handling of some options to work with new option names. Some options (such as call_group and pickup_group) share the same configuration handler and decide what logic to use based on the name of the option. These handlers were not updated to check for the new option names and were treating the options as invalid. This change simply updates the handlers with the proper names of the options. (closes issue ASTERISK-22922) Reported by: Anthony Messina * configure, include/asterisk/autoconfig.h.in, configure.ac: Fix a configure issue with PJSIP transaction group lock detection. The configure check did not use the provided paths for pjproject if provided when looking for transaction group lock support. 2013-11-23 17:38 +0000 [r403131-403134] Kevin Harwell * include/asterisk/stasis_app.h, main/devicestate.c, res/stasis/app.h, rest-api/resources.json, res/res_stasis_device_state.c (added), res/ari/ari_model_validators.c, res/ari/ari_model_validators.h, res/ari/resource_device_states.c (added), rest-api/api-docs/deviceStates.json (added), rest-api-templates/ari.make.mustache, res/ari.make, rest-api/api-docs/applications.json, include/asterisk/stasis_app_device_state.h (added), res/ari/resource_device_states.h (added), res/ari/resource_applications.h, res/res_stasis.c, include/asterisk/devicestate.h, res/res_stasis_device_state.exports.in (added), rest-api/api-docs/events.json, res/res_ari_device_states.c (added), res/stasis/app.c: ARI: Implement device state API Created a data model and implemented functionality for an ARI device state resource. The following operations have been added that allow a user to manipulate an ARI controlled device: Create/Change the state of an ARI controlled device PUT /deviceStates/{deviceName}&{deviceState} Retrieve all ARI controlled devices GET /deviceStates Retrieve the current state of a device GET /deviceStates/{deviceName} Destroy a device-state controlled by ARI DELETE /deviceStates/{deviceName} The ARI controlled device must begin with 'Stasis:'. An example controlled device name would be Stasis:Example. A 'DeviceStateChanged' event has also been added so that an application can subscribe and receive device change events. Any device state, ARI controlled or not, can be subscribed to. While adding the event, the underlying subscription control mechanism was refactored so that all current and future resource subscriptions would be the same. Each event resource must now register itself in order to be able to properly handle [un]subscribes. (issue ASTERISK-22838) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3025/ * res/res_pjsip_exten_state.c, include/asterisk/res_pjsip_pubsub.h, res/res_pjsip/location.c, res/res_pjsip_outbound_registration.c, res/res_pjsip_mwi.c, include/asterisk/sorcery.h, res/res_pjsip/pjsip_configuration.c, include/asterisk/strings.h, res/res_pjsip_pubsub.c, res/res_pjsip/include/res_pjsip_private.h, res/res_pjsip/config_transport.c, res/res_pjsip_registrar.c, main/sorcery.c, include/asterisk/res_pjsip.h, include/asterisk/acl.h, res/res_pjsip/config_auth.c, include/asterisk/utils.h, res/res_pjsip.exports.in, res/res_pjsip_endpoint_identifier_ip.c, main/acl.c, main/utils.c, res/res_pjsip.c: res_pjsip: AMI commands and events. Created the following AMI commands and corresponding events for res_pjsip: PJSIPShowEndpoints - Provides a listing of all pjsip endpoints and a few select attributes on each. Events: EndpointList - for each endpoint a few attributes. EndpointlistComplete - after all endpoints have been listed. PJSIPShowEndpoint - Provides a detail list of attributes for a specified endpoint. Events: EndpointDetail - attributes on an endpoint. AorDetail - raised for each AOR on an endpoint. AuthDetail - raised for each associated inbound and outbound auth TransportDetail - transport attributes. IdentifyDetail - attributes for the identify object associated with the endpoint. EndpointDetailComplete - last event raised after all detail events. PJSIPShowRegistrationsInbound - Provides a detail listing of all inbound registrations. Events: InboundRegistrationDetail - inbound registration attributes for each registration. InboundRegistrationDetailComplete - raised after all detail records have been listed. PJSIPShowRegistrationsOutbound - Provides a detail listing of all outbound registrations. Events: OutboundRegistrationDetail - outbound registration attributes for each registration. OutboundRegistrationDetailComplete - raised after all detail records have been listed. PJSIPShowSubscriptionsInbound - A detail listing of all inbound subscriptions and their attributes. Events: SubscriptionDetail - on each subscription detailed attributes SubscriptionDetailComplete - raised after all detail records have been listed. PJSIPShowSubscriptionsOutbound - A detail listing of all outboundbound subscriptions and their attributes. Events: SubscriptionDetail - on each subscription detailed attributes SubscriptionDetailComplete - raised after all detail records have been listed. (issue ASTERISK-22609) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2959/ 2013-11-23 12:51 +0000 [r403117-403119] Joshua Colp * res/ari/ari_model_validators.h, res/res_stasis_playback.c, rest-api/api-docs/events.json, res/res_stasis_recording.c, res/ari/ari_model_validators.c, rest-api/api-docs/recordings.json: ari: Add events for playback and recording. While there were events defined for playback and recording these were not actually sent. This change implements the to_json handlers which produces them. (closes issue ASTERISK-22710) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/3026/ * main/audiohook.c, res/ari/resource_channels.c, res/res_stasis_snoop.c (added), res/res_ari_channels.c, res/ari/resource_channels.h, res/res_stasis_snoop.exports.in (added), include/asterisk/stasis_app_snoop.h (added), rest-api/api-docs/channels.json: ari: Add Snoop operation for spying/whispering on channels. The Snoop operation can be invoked on a channel to spy or whisper on it. It returns a channel that any channel operations can then be invoked on (such as record to do monitoring). (closes issue ASTERISK-22780) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3003/ 2013-11-22 23:44 +0000 [r403094] Kinsey Moore * tests/test_stasis.c, tests/test_stasis_channels.c: Make sure unit tests compile This fixes the unit tests that were broken by r403069 and several functions requiring a new parameter for sanitization of JSON messages generated from object snapshots. 2013-11-22 22:24 +0000 [r403082] Kevin Harwell * contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py, res/res_pjsip/pjsip_configuration.c: res_pjsip: convert configuration settings names to snake case some more Updated the alembic script for pjsip. Also, the dtls config parsing stuff was expecting strings with no underscores, so removed the underscores from the option name before passing it to the parser. 2013-11-22 20:01 +0000 [r403069] Kinsey Moore * main/stasis_endpoints.c, res/ari/resource_endpoints.c, main/rtp_engine.c, res/stasis/app.c, include/asterisk/stasis_bridges.h, include/asterisk/stasis_app.h, include/asterisk/stasis.h, main/stasis_bridges.c, res/ari/resource_bridges.c, main/json.c, main/stasis_message.c, include/asterisk/stasis_channels.h, main/stasis_channels.c, res/ari/resource_channels.c, include/asterisk/stasis_endpoints.h, res/res_stasis.c: ARI: Don't leak implementation details This change prevents channels used as implementation details from leaking out to ARI. It does this by preventing creation of JSON blobs of channel snapshots created from those channels and sanitizing JSON blobs of bridge snapshots as they are created. This introduces a framework for excluding information from output targeted at Stasis applications on a consumer-by-consumer basis using channel sanitization callbacks which could be extended to bridges or endpoints if necessary. This prevents unhelpful error messages from being generated by ast_json_pack. This also corrects a bug where BridgeCreated events would not be created. (closes issue ASTERISK-22744) Review: https://reviewboard.asterisk.org/r/2987/ Reported by: David M. Lee 2013-11-22 17:19 +0000 [r403022] Kevin Harwell * res/res_pjsip_acl.c, res/res_pjsip.c, res/res_pjsip/config_transport.c, res/res_pjsip/config_global.c, configs/pjsip.conf.sample, res/res_pjsip/config_system.c, contrib/scripts/sip_to_pjsip/sip_to_pjsip.py, res/res_pjsip/pjsip_configuration.c: res_pjsip: convert configuration settings names to snake case Renamed, where appropriate, the configuration options for chan/res_pjsip to use snake case (compound words separated by an underscore). For example, faxdetect will become fax_detect, recordofffeature will become record_off_feature, etc... Review: https://reviewboard.asterisk.org/r/3002/ 2013-11-22 17:11 +0000 [r403016] Joshua Colp * /, main/translate.c: translate: Move freeing of frame to after it is used. When translating from one format to another it is possible to inform the translation function that the source frame should be freed. This was previously done immediately but shortly afterwards the frame that was freed was accessed and used again. This change moves code around a bit so that the frame is now freed after it has been completely used. (closes issue ASTERISK-22788) Reported by: Corey Farrell Patches: translate-access-after-free-11up.patch uploaded by coreyfarrell (license 5909) translate-access-after-free-1.8.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 403014 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 403015 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-11-21 22:35 +0000 [r402981-402993] David M. Lee * rest-api-templates/ari_resource.c.mustache, rest-api-templates/res_ari_resource.c.mustache: ari: Fix #include to match generated headers for snakeCase resource files * rest-api-templates/make_ari_stubs.py: ari: Fix generators for resources with camelCase names. For the new deviceState resource, we need to properly generate device_state.[ch] files. 2013-11-21 19:21 +0000 [r402968] Matthew Jordan * res/res_pjsip_session.c: res_pjsip_session: Fix memory leak of direct media format capabilities The direct media format capabilities are always allocated in ast_sip_session_alloc and were not freed in the session destructor. Whoops. (This being the third whoops caught by Scott and Nitesh's valgrind work for the Asterisk Test Suite. Nifty!) 2013-11-21 19:08 +0000 [r402944-402956] Richard Mudgett * include/asterisk/app.h: voicemail: Fixup some doxygen comments. * main/bucket.c: bucket: Fix scheme ref leak in __ast_bucket_scheme_register(). 2013-11-21 17:52 +0000 [r402940-402941] Matthew Jordan * res/res_pjsip_sdp_rtp.c: res_pjsip_sdp_rtp: Fix use of uninitialized value in PJSIP In PJMEDIA, pjmedia_sdp_rtpmap_to_attr will attempt to use the string rtpmap.param regardless of its length value. Simply setting the length to 0 does not prevent the garbage on the stack in rtpmap.param.ptr from being formatted in a sprintf call. This patch initializes the string to NULL so that at the very least, something is provided to the function that is predictable. * res/res_pjsip_mwi.c: res_pjsip_mwi: Fix memory leak of MWI subscriptions container This patch fixes a reference counting memory leak on the ao2_container created as part of create_mwi_subscriptions. When we create the container in this routine, the intent is to hand lifetime ownership over to the global container unsolicited_mwi. When ao2_global_obj_replace_unref is called, the reference count on mwi_subscriptions (the container) will be bumped by 1; however, the function does not decrement the reference count on mwi_subscriptions when this occurs. This will prevent the container from being fully disposed of when Asterisk exits (or on any subsequent call to this operation, such as during a reload). 2013-11-21 15:55 +0000 [r402926] David M. Lee * res/stasis/control.c, include/asterisk/stasis_app.h, rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c, res/ari/resource_channels.h: ari: Add silence generator controls This patch adds the ability to start a silence generator on a channel via ARI. This generator will play silence on the channel (avoiding audio timeouts on the peer) until it is stopped, or some other media operation is started (like playing media, starting music on hold, etc.). (closes issue ASTERISK-22514) Review: https://reviewboard.asterisk.org/r/3019/ 2013-11-19 23:17 +0000 [r402891] Joshua Colp * res/res_pjsip_caller_id.c: res_pjsip_caller_id: Don't overwrite user portion of the From header when fromuser is set. The fromuser option is used to explicitly set the user within the From header. The res_pjsip_caller_id module did not take this setting into account when determining if the From header could be modified or not. (closes issue ASTERISK-22866) Reported by: Anthony Messina 2013-11-16 13:44 +0000 [r402864] Joshua Colp * res/res_pjsip/pjsip_distributor.c, configure, include/asterisk/autoconfig.h.in, configure.ac: res_pjsip: Add support for building against pjproject with SIP transaction group lock support. SIP transaction group lock support has been backported into our pjproject. Since the code now internally uses a group lock the code is now changed to unlock it if present. Note that the act of finding the transaction is what actually returns it locked. For further information about group locks check out the wiki page at: http://trac.pjsip.org/repos/wiki/Group_Lock (issue ASTERISK-22818) Reported by: Matt Jordan 2013-11-15 14:35 +0000 [r402838] Kinsey Moore * main/cel.c: CEL: Fix crash when using CELGenUserEvent This fixes a crash when CELGenUserEvent is called from the dialplan while CEL is disabled. Currently, CEL does not create its topics and forwards if it is not enabled and external entities may depend on these topics blindly since they should always be available. This patch breaks up route creation and topic/forward creation such that the CEL topics and forwards will always exist while the router and its associated routes will be torn down and recreated as necessary. (closes issue ASTERISK-22799) Review: https://reviewboard.asterisk.org/r/3010/ Reported by: Matt Jordan 2013-11-14 15:01 +0000 [r402817] David M. Lee * res/res_stasis.c: stasis: Fixed scoping problem with bridge tracking. 2013-11-13 23:09 +0000 [r402804] Joshua Colp * res/stasis/control.c, include/asterisk/stasis_app.h, rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c, res/ari/resource_channels.h: res_ari_channels: Add the ability to stop locally generated ringing on a channel. Using the 'ring' operation it is possible to start locally generated ringback if the channel is answered. This change adds the ability to stop it by using DELETE. 2013-11-12 23:16 +0000 [r402787-402793] Kevin Harwell * res/ari/resource_endpoints.c: ari endpoints: GET /ari/endpoints/{invalid-tech} should return a 404 Was returning a 404 on a valid technology with an empty list of endpoints. Now checking against the channel tech to make sure the tech itself is valid and not just an empty list of endpoints. (issue ASTERISK-22803) Reported by: David M. Lee * rest-api/api-docs/endpoints.json, res/ari/resource_endpoints.c, res/res_ari_endpoints.c: ari endpoints: GET /ari/endpoints/{invalid-tech} should return a 404 Implementation listing endpoints by technology returned an empty array if no matching endpoints were found. Fixed so a "404 Not Found" will be returned instead. (closes issue ASTERISK-22803) Reported by: David M. Lee 2013-11-12 19:11 +0000 [r402767-402769] Mark Michelson * main/channel.c: Switch to a scoped lock to avoid missing unlocks in failure returns. * main/channel.c: Move a NULL check to a place that makes more sense. Two variables were being checked for NULLity immediately after being declared NULL. I moved the NULL check until after the variables are allocated. This allows for the "channelvars" option in manager.conf to work as intended again. 2013-11-12 16:45 +0000 [r402757] Kevin Harwell * res/res_pjsip_messaging.c, res/res_pjsip_header_funcs.c: pjsip_messaging, pjsip_header_funcs: Crashes due to NULL pointer dereferences Both res_pjsip_messaging and res_pjsip_header_funcs were causing asterisk to crash because they were trying to dereference a NULL pointer. In the case of res_pjsip_messaging it was attempting to "print" a contact header that did not exist. In fact contact headers should not be part of a SIP MESSAGE, so the offending code was simply removed. In the case of res_pjsip_header_funcs a null private channel tech was being passed to the function and then later dereferenced. Added null checks (and error logging) to the read/write function handlers to guard against crashing. (closes issue ASTERISK-22821) Reported by: Anthony Messina 2013-11-12 16:33 +0000 [r402755] Kinsey Moore * apps/app_celgenuserevent.c: CELGenUserEvent: Fix error message from ast_json_pack This prevents NULL from being passed into an ast_json_pack call when no extra information is passed to the application which prevents an error message about NULL arguments from being generated. 2013-11-12 15:26 +0000 [r402738] David M. Lee * res/ari/ari_model_validators.h, rest-api/api-docs/events.json: Fixed a typ. 2013-11-12 15:02 +0000 [r402710] Kinsey Moore * channels/chan_dahdi.c, /: chan_dahdi: Fix crash during caller ID read Asterisk will sometimes core dump during caller id read on analog channels due to a negative return value from the read() in my_get_callerid that slips through as a negative length argument to callerid_feed() if the errno returned by DAHDI is ELAST. This change ensures that the negative return is treated properly even when it is ELAST. (closes issue ASTERISK-22746) Reported by: Michael Walton Patches: chan_dahdi_cid_crash_fix.r401410.patch uploaded by Michael Walton (License 6502) ........ Merged revisions 402708 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 402709 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-11-11 19:26 +0000 [r402687] Mark Michelson * /, apps/app_confbridge.c: Get rid of some inaccurate comments. I'm doing some unrelated work in app_confbridge and finding these "invalid pin" comments to be annoying. Get out! ........ Merged revisions 402686 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-11-11 15:36 +0000 [r402647] Kinsey Moore * apps/app_queue.c, /: app_queue: Honor penalty limits of 0 In the current app_queue code from 1.8 up to trunk the upper and lower penalties can be set to 0 but the value is interpreted to be disabled instead of actually setting limits. This is especially evident if min and max limits are set to 0 and members with penalties of 0 and 1 are in the queue since the member with penalty 1 will still receive calls. This patch adjusts the special disabled value to be INT_MAX instead of 0. (closes issue ASTERISK-20862) Review: https://reviewboard.asterisk.org/r/2995/ Reported by: Schmooze Com ........ Merged revisions 402645 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 402646 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-11-08 23:04 +0000 [r402606] Scott Griepentrog * /, channels/chan_sip.c, channels/sip/include/sip.h: chan_sip: keep same local (from) tag for outgoing register requests For outbound register requests the tag on the From line was updated every 20 seconds prior to a successful registration and also once for each registration renewal. That behavior can possibly cause the registration to be denied because of the different tag, and is not aligned with the intention of RFC 3261 8.1.3.5 "... request constitutes a new transaction and SHOULD have the same value of the Call-ID, To, and From of the previous request...". This updates chan_sip to have a field to keep the local tag in the registration structure and use that tag for registration requests where the callid is also unchanged. (closes issue ASTERISK-12117) Reported by: Pawel Pierscionek Review: https://reviewboard.asterisk.org/r/2988/ ........ Merged revisions 402604 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 402605 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-11-08 20:20 +0000 [r402593] Richard Mudgett * res/res_stasis.c: res_stasis.c: Fix locking issues with the app_bridge_moh container. * Fix unlinking from the app_bridges_moh container in remove_bridge_moh() without a lock under normal circumstances. * Made check ast_bridge_set_after_callback() return value in bridge_moh_create() to handle failure. * Fixed SCOPED_AO2LOCK() locking over too much scope in stasis_app_bridge_moh_channel() and stasis_app_bridge_moh_stop(). * Fixed unusual usage of ao2_unlink_flag() in control_unlink(). * Fixed orphaned bridge from off nominal path in stasis_app_bridge_create(). * Fixed strange construct in stasis_app_unsubscribe(). From a bad merge? * Made load_module() cleanup on failure. Review: https://reviewboard.asterisk.org/r/2962/ 2013-11-08 19:28 +0000 [r402584] Jonathan Rose * configs/manager.conf.sample, CHANGES, include/asterisk/manager.h, main/manager.c, main/security_events.c: security_events: Push out security events over AMI events Security Events will now be written to any listener of the new 'security' class Review: https://reviewboard.asterisk.org/r/2998/ 2013-11-08 19:22 +0000 [r402582] Mark Michelson * res/res_pjsip.c: Clarify an ambiguous error message. 2013-11-08 18:48 +0000 [r402561-402570] David M. Lee * res/res_pjsip/config_system.c: res_pjsip: Print a helpful error message if sorcery registration fails * res/ari/resource_playbacks.h: Changes from make ari-stubs after r402560 2013-11-08 17:39 +0000 [r402560] Kevin Harwell * res/ari/resource_playbacks.h (added), res/ari.make, rest-api/api-docs/playback.json (removed), res/ari/resource_playback.c (removed), res/res_ari_playback.c (removed), rest-api/api-docs/playbacks.json (added), res/ari/resource_playbacks.c (added), rest-api/resources.json, res/ari/resource_playback.h (removed), res/res_ari_playbacks.c (added): ARI playback: Rename ARI Playback to Playbacks Before playback was the only non plural resource. It has been renamed to playbacks for consistency. (closes issue ASTERISK-22737) Reported by: Paul Belanger 2013-11-08 17:28 +0000 [r402555] David M. Lee * res/res_ari.c, main/manager.c, main/http.c: ari: Add application/x-www-form-urlencoded parameter support ARI POST calls only accept parameters via the URL's query string. While this works, it's atypical for HTTP API's in general, and specifically frowned upon with RESTful API's. This patch adds parsing for application/x-www-form-urlencoded request bodies if they are sent in with the request. Any variables parsed this way are prepended to the variable list supplied by the query string. (closes issue ASTERISK-22743) Review: https://reviewboard.asterisk.org/r/2986/ 2013-11-07 23:16 +0000 [r402537] Jonathan Rose * res/res_pjsip_authenticator_digest.c: PJSIP: Improve error handling in digest authenticator Previously, regardless of whether failure to authenticate was due to lacking any authentication or actually failing authentication, the Digest Authenticator would simply return that a challenge was still needed. It will continue to do that when no authentication information is in the received SIP digest, but when authentication information is present and does not pass authentication, that will be treated as an authentication error. This is to ensure that PJSIP will issue security events indicated failed auths. 2013-11-07 21:09 +0000 [r402528] David M. Lee * rest-api-templates/swagger_model.py, res/ari/resource_asterisk.h, rest-api-templates/ari_resource.c.mustache, rest-api-templates/asterisk_processor.py, res/res_ari_bridges.c, rest-api/api-docs/endpoints.json, res/ari/resource_endpoints.c, res/ari/resource_endpoints.h, res/res_ari_applications.c, res/res_ari_playback.c, res/res_ari_channels.c, rest-api/api-docs/bridges.json, res/ari/resource_bridges.c, res/res_ari_recordings.c, res/ari/resource_bridges.h, res/res_ari_events.c, res/ari/resource_applications.c, res/ari/resource_playback.c, rest-api/api-docs/channels.json, res/ari/resource_applications.h, res/ari/resource_channels.c, res/ari/resource_playback.h, res/res_ari_sounds.c, rest-api/api-docs/recordings.json, res/ari/resource_recordings.c, res/ari/resource_channels.h, rest-api-templates/ari_resource.h.mustache, res/ari/resource_events.c, res/ari/resource_recordings.h, rest-api-templates/rest_handler.mustache, res/res_ari_asterisk.c, rest-api-templates/res_ari_resource.c.mustache, res/ari/resource_events.h, rest-api/api-docs/sounds.json, res/ari/resource_sounds.c, res/ari/resource_sounds.h, rest-api/api-docs/asterisk.json, rest-api/api-docs/applications.json, res/res_ari_endpoints.c, res/ari/resource_asterisk.c, rest-api/api-docs/playback.json: ari: User better nicknames for ARI operations While working on building client libraries from the Swagger API, I noticed a problem with the nicknames. channel.deleteChannel() channel.answerChannel() channel.muteChannel() Etc. We put the object name in the nickname (since we were generating C code), but it makes OO generators redundant. This patch makes the nicknames more OO friendly. This resulted in a lot of name changing within the res_ari_*.so modules, but not much else. There were a couple of other fixed I made in the process. * When reversible operations (POST /hold, POST /unhold) were made more RESTful (POST /hold, DELETE /unhold), the path for the second operation was left in the API declaration. This worked, but really the two operations should have been on the same API. * The POST /unmute operation had still not been REST-ified. Review: https://reviewboard.asterisk.org/r/2940/ 2013-11-06 21:57 +0000 [r402517] Kevin Harwell * apps/app_queue.c: app_queue: crash if first agent is "busy" If the first agent/member (via CLI "queue show") in a queue is "busy" (dnd, circuit busy, etc...) and no agents answered then app_queue would crash. This occurred because while the calling of agent(s) remained valid the channel on "busy" agent would be set to NULL and then later dereferenced upon a second "rna" function call. The original intention of the code is to have only valid "call attempt" objects (channels != NULL) checked while attempting to call agent(s). It does this by building a "call_next" list of valid "call attempt" objects. In the case of the "busy" agent subsequent builds of the valid "call attempt" list would sometimes include (the case mentioned above) an invalid "call attempt" object. The fix was to make sure the "call attempt" list was appropriately built on every iteration. A NULL sanity check was also added at the original offending spot of the crash just in case another one slipped by somehow. (closes issue ASTERISK-22644) Reported by: Marco Signorini Review: https://reviewboard.asterisk.org/r/2983/ 2013-11-05 21:16 +0000 [r402501-402507] Matthew Jordan * channels/chan_sip.c: chan_sip: Use AST_AF* defined constant when calling ast_get_ip While the structure passed to ast_get_ip should be set memset to 0, thus initializing the ss_family member to 0, explicitly setting it to AST_AF_UNSPEC is more portable. * channels/chan_iax2.c: chan_iax2: Fix incorrect usage of ast_get_ip involving uninitialized struct This started off as a fix for the failing IAX2 acl_call test in the Asterisk Test Suite. When inspecting why that test was failing, it became clear that all attempts to bind to any local loopback address was failing: [Nov 2 15:56:28] VERBOSE[15787] chan_iax2.c: == Binding IAX2 to address 127.0.0.1:4569 [Nov 2 15:56:28] DEBUG[15787] netsock2.c: Splitting '127.0.0.1' into... [Nov 2 15:56:28] DEBUG[15787] netsock2.c: ...host '127.0.0.1' and port ''. [Nov 2 15:56:28] ERROR[15787] netsock2.c: getaddrinfo("127.0.0.1", "(null)", ...): ai_family not supported [Nov 2 15:56:28] WARNING[15787] acl.c: Unable to lookup '127.0.0.1' While there's conceivably other ways for getaddrino to return EAI_FAMILY, the most common way is if AF_INET, AF_INET6, or AF_UNSPEC is not provided as the desired family. The culprit was the call to ast_get_ip, defined in acl.h. This function uses the family from the passed in addr object (which it will also populate when it returns!) when it eventually calls getaddrinfo. This patch fixes the use of ast_get_ip that were not specifying the family in chan_iax2. This prevents uninitialized use of the structure, so that the addresses resolve correctly. Review: https://reviewboard.asterisk.org/r/2991 * include/asterisk/netsock2.h, include/asterisk/acl.h: netsock2: Define AST_AF_* enum constants to their AF_* equivalents This patch explicitly defines AST_AF_* enum constants to their sys/socket.h defined equivalents. It is certainly unclear why these constants actually have to exist, given that netsock2.h includes sys/socket.h; however, since the code base is already liberally sprinkled with the usage of AST_AF_* (as well as with direct calls to AF_*), this will at least keep the semantics consistent between their usage across systems. * main/stasis_channels.c: stasis_channels: Don't give preference to ANI info in channel snapshots When publishing channel snapshots, we currently compute the caller ID name and number by giving preference first to ani.{name|number}, then to id.{name|number}. However, when a channel driver (such as chan_sip) updates the caller ID, it typically only updates the caller ID stored in id.{name|number}. This means that we are currently giving preference to stale information. When looking at the rest of the code base, the only other place where we appear to use this same logic is in app_amd. Everywhere else, we treat the party information in ani as being separate to the party information in id. This patch publishes only the caller ID name and number in the snapshot field for caller_name and caller_num. Note that the information in ANI is still available in caller_ani. Review: https://reviewboard.asterisk.org/r/2992/ 2013-11-04 20:56 +0000 [r402452] Kevin Harwell * /, channels/chan_sip.c: chan_sip: notify dialog info ignores presentation indicator in callerid The presentation indicator in a callerid (e.g. set by dialplan function Set(CALLERID(name-pres)= ...)) is not checked when SIP Dialog Info Notifies are generated during extension monitoring. Added a check to make sure the name and/or number presentations on the callee (remote identity) are set to allow. If they are restricted then "anonymous" is used instead. (closes issue AST-1175) Reported by: Thomas Arimont Review: https://reviewboard.asterisk.org/r/2976/ ........ Merged revisions 402450 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-11-02 04:30 +0000 [r402398-402438] Richard Mudgett * main/stasis.c, main/stasis_message_router.c, include/asterisk/vector.h: vector: Uppercase API to follow C convention. C does not support templates like C++. * main/stasis.c, main/stasis_message_router.c, include/asterisk/vector.h, include/asterisk/lock.h: vector: Update API to be more flexible. Made the vector macro API be more like linked lists. 1) Added a name parameter to ast_vector() to name the vector struct. 2) Made the API take a pointer to the vector struct instead of the struct itself. 3) Added an element cleanup macro/function parameter when removing an element from the vector for ast_vector_remove_cmp_unordered() and ast_vector_remove_elem_unordered(). 4) Added ast_vector_get_addr() in case the vector element is not a simple pointer. * Converted an inline vector usage in stasis_message_router to use the vector API. It needed the API improvements so it could be converted. * Fixed topic reference leak in router_dtor() when the stasis_message_router is destroyed. * Fixed deadlock potential in stasis_forward_all() and stasis_forward_cancel(). Locking two topics at the same time requires deadlock avoidance. * Made internal_stasis_subscribe() tolerant of a NULL topic. * Made stasis_message_router_add(), stasis_message_router_add_cache_update(), stasis_message_router_remove(), and stasis_message_router_remove_cache_update() tolerant of a NULL message_type. * Promoted a LOG_DEBUG message to LOG_ERROR as intended in dispatch_message(). Review: https://reviewboard.asterisk.org/r/2903/ * apps/confbridge/conf_state_single.c, apps/confbridge/conf_state_inactive.c, apps/confbridge/conf_state_single_marked.c, /, apps/confbridge/include/confbridge.h, apps/confbridge/conf_state_multi.c, apps/app_confbridge.c, apps/confbridge/conf_state_multi_marked.c, apps/confbridge/conf_state.c: confbridge: Separate user muting from system muting overrides. The system overrides the user muting requests when MOH is playing or a waitmarked user is waiting for a marked user to join. System muting overrides interfere with what the user may wish the muting to be when the system override ends. * User muting requests are now independent of the system muting overrides. The effective muting is now the logical or of the user request and system override. * Added a Muted flag to the CLI "confbridge list " command. * Added a Muted header to the AMI ConfbridgeList action ConfbridgeList event. (closes issue AST-1102) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/2960/ ........ Merged revisions 402425 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, main/config.c, apps/confbridge/conf_config_parser.c, configs/confbridge.conf.sample: config: Allow ConfBridge DTMF menus to have '#' as the first digit. ConfBridge allows custom DTMF menus to be created in the confbridge.conf file by assigning a DTMF key sequence to a sequence of actions as follows: DTMF-sequence = action,action... Unfortunately, the normal config file processing code interprets an initial '#' character as starting a directive such as #include. * Add the ability to escape the first non-blank character in a config line so the '#' character can be used without triggering the directive processing code. (closes issue AFS-2) (closes issue ASTERISK-22478) Reported by: Nicolas Tanski Patches: jira_asterisk_22478_v11.patch (license #5621) patch uploaded by rmudgett (modified) Review: https://reviewboard.asterisk.org/r/2969/ ........ Merged revisions 402407 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/app.c, include/asterisk/app.h: voicemail: Simplify callback pointer declarations and add doxygen. * Typedefed and added doxegen for the voicemail callback functions. * Simplified the prototypes for ast_install_vm_functions() and ast_install_vm_test_functions() to use the new function typedefs. * Simplified the voicemail callback function pointer variable declarations to use the new function typedefs. 2013-11-01 21:49 +0000 [r402387] Scott Griepentrog * main/bridge.c, include/asterisk/bridge.h, main/manager_bridges.c: Manager: Add equivalent AMI actions for the bridge CLI commands. Adds the following AMI events, closely following their CLI counterparts: BridgeDestroy BridgeKick BridgeTechnologyList BridgeTechnologySuspend BridgeTechnologyUnsuspend BridgeDestroy kicks an entire bridge, where BridgeKick kicks just one channel off the bridge. When kicking a channel, specifying the bridge also (optional) insures it is not removed from the wrong bridge. The BridgeTechnology events allow viewing and changing suspension status, which affects only subsequent not active bridging. (closes ASTERISK-22356) Reported by: Richard Mudgett Review: https://reviewboard.asterisk.org/r/2973/ 2013-11-01 16:31 +0000 [r402367] David M. Lee * rest-api-templates/api.wiki.mustache: ari wiki docs: add notes about allowMultiple parameters. This patch adds a note to any parameter that has 'allowMultiple' set in the Swagger documentation. (closes issue ASTERISK-22704) 2013-11-01 14:37 +0000 [r402358] Joshua Colp * include/asterisk/stasis_app.h, rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c, res/ari/resource_channels.h, res/res_stasis_playback.c, res/stasis/control.c: res_ari_channels: Add ring operation, dtmf operation, hangup reasons, and tweak early media. The ring operation sends ringing to the specified channel it is invoked on. The dtmf operation can be used to send DTMF digits to the specified channel of a specific length with a wait time in between. Finally hangup reasons allow you to specify why a channel is being hung up (busy, congestion). Early media behavior has also been tweaked slightly. When playing media to a channel it will no longer automatically answer. If it has not been answered a progress indication is sent instead. (closes issue ASTERISK-22701) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2916/ 2013-11-01 12:38 +0000 [r402348] Kinsey Moore * include/asterisk/rtp_engine.h, res/res_rtp_asterisk.c, /, channels/chan_sip.c: chan_sip: Fix RTCP port for SRFLX ICE candidates This corrects one-way audio between Asterisk and Chrome/jssip as a result of Asterisk inserting the incorrect RTCP port into RTCP SRFLX ICE candidates. This also exposes an ICE component enumeration to extract further details from candidates. (closes issue ASTERISK-21383) Reported by: Shaun Clark Review: https://reviewboard.asterisk.org/r/2967/ ........ Merged revisions 402345 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-11-01 12:31 +0000 [r402336-402346] Joshua Colp * include/asterisk/stasis_app.h, res/ari/resource_channels.c: res_ari_channels: Fix a deadlock when originating multiple channels close to eachother. If a Stasis application is specified an implicit subscription is done on the originated channel. This was previously done with the channel lock held which is dangerous as the underlying code locks the container and iterates items. This change releases the lock on the originated channel before subscribing occurs. (closes issue ASTERISK-22768) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2979/ * res/stasis/control.c: res_stasis: Ensure the channel is always departed from the bridge when it leaves. This change adds a command to the command queue to explicitly depart the channel from the bridge when it is told it has left. If the channel has already been departed or has entered a different bridge this command will become a no-op. (closes issue ASTERISK-22703) Reported by: John Bigelow (closes issue ASTERISK-22634) Reported by: Kevin Harwell Review: https://reviewboard.asterisk.org/r/2965/ 2013-10-31 22:08 +0000 [r402327] Mark Michelson * contrib/scripts/sip_to_res_sip (removed), contrib/scripts/sip_to_pjsip (added), contrib/scripts/sip_to_pjsip/astconfigparser.py, contrib/scripts/sip_to_pjsip/astdicts.py, contrib/scripts/sip_to_pjsip/sip_to_pjsip.py: Update the conversion script from sip.conf to pjsip.conf (closes issue ASTERISK-22374) Reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2846 2013-10-31 16:04 +0000 [r402285-402289] Matthew Jordan * main/loader.c, /: core/loader: Don't call dlclose in a while loop For awhile now, we've noticed continuous integration builds hanging on CentOS 6 64-bit build agents. After resolving a number of problems with symbols, strange locks, and other shenanigans, the problem has persisted. In all cases, gdb shows the Asterisk process stuck in loader.c on one of the infinite while loops that calls dlclose repeatedly until success. The documentation of dlclose states that it returns 0 on success; any other value on error. It does not state that repeatedly calling it will eventually clear those errors. Most likely, the repeated calls to dlclose was to force a close by exhausting the references on the library; however, that will never succeed if: (a) There is some fundamental error at work in the loaded library that precludes unloading it (b) Some other loaded module is referencing a symbol in the currently loaded module This results in Asterisk sitting forever. Since we have matching pairs of dlopen/dlclose, this patch opts to only call dlclose once, and log out as an ERROR if dlclose fails to return success. If nothing else, this might help to determine why on the CentOS 6 64-bit build agent things are not closing successfully. Review: https://reviewboard.asterisk.org/r/2970 ........ Merged revisions 402287 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 402288 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/media_index.c: medix_index: Display errors when library calls fail Based on feedback from ipengineer in #asterisk, when the media indexer cannot access a sound file on the system (or otherwise fails) Asterisk displays a "Cannot frob file" error but fails to tell you why. This is especially problematic as the media_indexer failing will rpevent Asterisk from starting, as it is in the core. We now display the errno error messages so folks can figure out what they've done wrong. 2013-10-31 14:43 +0000 [r402276] David M. Lee * res/stasis/app.c: stasis: add functions embarrassingly missing from r400522 I neglected to implement two of the endpoint subscription functions when I did the work. Normally, you'll only hit that when you unsubscribe from a specific endpoint. 2013-10-30 17:52 +0000 [r402265] Kevin Harwell * res/res_pjsip_messaging.c, channels/chan_pjsip.c: pjsip_messaging: Added debug for in dialog messaging (issue ASTERISK-22777) Reported by: Matt Jordan 2013-10-29 23:43 +0000 [r402226] Rusty Newton * sounds/Makefile, /: Updates for 1.4.25 core sounds and 1.4.14 extra sounds, plus new en_GB language set The new sound packages relate to issues: ASTERISK-22544, ASTERISK-22411, ASTERISK-21413, ASTERISK-20782 Modified sounds/Makefile for the new sound versions and to account for the new en_GB language set. (issue ASTERISK-22659) (closes issue ASTERISK-22659) (closes issue ASTERISK-22411) (closes issue ASTERISK-22544) ........ Merged revisions 402224 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 402225 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-29 12:53 +0000 [r402154] Matthew Jordan * /, main/translate.c, main/xmldoc.c, main/channel.c, main/pbx.c: Remove some spammy debug messages; improve clarity of others Debug messages aren't free. Even when the debug level is sufficiently low such that the messages are never evaluated, there is a cost to having to parse Asterisk logs that contain debug messages that (a) fail to convey sufficient information or (b) occur so frequently as to be next to meaningless. Based on having to stare at lots of DEBUG messages, this patch makes the following changes: * channel.c: When copying variables from a parent channel to a child channel, specify the channels involved. Do not log anything for a variable that is not inherited; the fact that it doesn't have an _ or __ already signifies that it won't be inherited. * pbx.c: Specify what function evaluation has occurred that created the result. * translate.c: Bump up the translator path messages to 10. I've never once had to use these debug messages, and for each format that is registered (on startup) and unregistered (on shutdown) the entire f^2 matrix is logged out. For short tests in the Asterisk Test Suite, this should make finding the actual test much easier. * xmldoc.c: The debug message that 'blah' is not found in the tree is expected. Often, description elements - which are not required - are not provided. This debug message adds no additional value, as it is not indicative of an error or helpful in debugging which element did not contain a 'blah' element as a child. If an element is supposed to contain a child element, then that XML tree should have failed validation in the first place. Review: https://reviewboard.asterisk.org/r/2966/ ........ Merged revisions 402150 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 402151 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-29 12:51 +0000 [r402148-402152] Kinsey Moore * res/ari/resource_channels.h, rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c: ARI: Remove channels/{channelId}/dial This removes the /ari/channels/{channelId}/dial URI since it is redundant, overly complex, is likely to become more externally complex over time, and is too high-level compared with other ARI operations. See the following for further information: http://lists.digium.com/pipermail/asterisk-app-dev/2013-October/000002.html (closes issue ASTERISK-22784) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2968/ * bridges/bridge_native_rtp.c: bridge_native_rtp: Ensure bridge is torn down When a bridge transitions away from one tech to another, the tech going away is provided a dummy bridge with no channels in it to tear down. Currently this means that the teardown code exits prematurely and does not tear anything down. This change tears down RTP bridging for the channel provided in the leave bridge tech callback. This also reverts the majority of r400403 since it is now redundant. (closes issue ASTERISK-22628) (closes issue ASTERISK-22676) Reported by: John Bigelow Reported by: Kevin Harwell Tested by: John Bigelow Review: https://reviewboard.asterisk.org/r/2905/ Patches: native_rtp_fix.diff uploaded by Kinsey Moore (License 6273) 2013-10-29 11:15 +0000 [r402139] Joshua Colp * res/res_ari_playback.c, rest-api/api-docs/playback.json: res_ari_playback: Add missing 404 error response for GET and DELETE. (closes issue ASTERISK-22722) Reported by: Richard Mudgett 2013-10-28 21:30 +0000 [r402127] David M. Lee * doc: Ignore full docs 2013-10-28 15:05 +0000 [r402112-402115] Michael L. Young * UPGRADE-11.txt, UPGRADE.txt: Fix UPGRADE.txt Due To Merging From Branch 11 When merging in the patch for ASTERISK-22728, the UPGRADE.txt file was changed incorrectly. That change should have gone into ASTERISK-11.txt. This commit is to fix that. Also, another comment in the UPGRADE-11.txt was missing and this commit adds that as well. * UPGRADE.txt, /, channels/chan_sip.c: chan_sip: Clarify 'Forcerport' Setting Displayed When Running "sip show peers" While looking at ASTERISK-22236, Walter Doekes pointed out that when running "sip show peers", the setting being displayed can be confusing. The display of "N" used to mean NAT (i.e. yes). The NAT setting has gone through many different changes resulting in the display of different characters to try and convey what the current setting is for 'Forcerport' (A for Auto and Forcerport is currently on, a for Auto but Forcerport is off, Y for yes, and N for no). During the initial code review to try and clarify these settings (especially since "N" no longer meant what it used to mean in prior versions of Asterisk), Mark Michelson suggested using the full space available to display the settings which helped to make the settings very clear. That was a great suggestion. Therefore, this patch does the following: * The column for 'Forcerport' now will show: Auto (Yes), Auto (No), Yes, or No. * A column for the 'Comedia' setting has been added. It too will display the setting in a non-cryptic way: Auto (Yes), Auto (No), Yes, or No. * UPGRADE.txt has been updated to document this change. (closes issue ASTERISK-22728) Reported by: Walter Doekes Tested by: Michael L. Young Patches: asterisk-forcerport-display-clarification_v3.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2941 ........ Merged revisions 402111 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-27 23:22 +0000 [r402081-402090] Matthew Jordan * main/cdr.c: Filter out internal channels from dial message handling Surrogate channels would pop up from time to time in dial message handling. This would cause a WARNING message to appear, indicating that the Surrogate channel had no CDR. This patch filters out those channels that have the internal implementation flag set, such that the WARNING message isn't displayed. * main/cdr.c, cdr/cdr_sqlite3_custom.c, cdr/cdr_syslog.c, cdr/cdr_sqlite.c, UPGRADE.txt, cdr/cdr_adaptive_odbc.c, addons/cdr_mysql.c, include/asterisk/cdr.h, cdr/cdr_pgsql.c, cdr/cdr_odbc.c, cdr/cdr_radius.c, cdr/cdr_custom.c, cdr/cdr_manager.c, cdr/cdr_tds.c, cdr/cdr_csv.c: Prevent CDR backends from unregistering while billing data is in flight This patch makes it so that CDR backends cannot be unregistered while active CDR records exist. This helps to prevent billing data from being lost during restarts and shutdowns. Review: https://reviewboard.asterisk.org/r/2880/ 2013-10-26 12:55 +0000 [r402064] Joshua Colp * include/asterisk/res_pjsip_session.h, channels/chan_pjsip.c: chan_pjsip: Fix a crash when direct media is enabled and an ACK is received after the channel is hung up. (closes issue ASTERISK-22731) Reported by: Kinsey Moore 2013-10-26 00:34 +0000 [r402044-402055] Richard Mudgett * res/res_stasis.c: res_stasis.c: Made use the ao2_container callback templates. * Made res_stasis.c use the OBJ_SEARCH_XXX defines. * main/taskprocessor.c: taskprocessor: Made use pthread_equal() to compare thread ids. * Removed another silly use of RAII_VAR(). RAII_VAR() and SCOPED_LOCK() are not silver bullets that allow you to turn off your brain. 2013-10-25 23:48 +0000 [r402043] Scott Griepentrog * include/asterisk/rtp_engine.h, main/rtp_engine.c, /: rtp_engine: fix rtp payloads copy and improve argument names In function ast_rtp_instance_early _bridge_make_compatible the use of instance 0/1 as arguments doesn't clearly communicate a direction that the copying of payloads from the source channel to the destination channel will occur, making it more probable to have the arguments to ast_rtp_codecs_payloads_copy() put in the reverse order. This patch renames the arguments with _dst and _src suffixes and corrects the copy direction. (closes issue ASTERISK-21464) Reported by: Kevin Stewart Review: https://reviewboard.asterisk.org/r/2894/ ........ Merged revisions 402000 from http://svn.asterisk.org/svn/asterisk/branches/1.8 Test shows rtpmap:119 being copied per this change, but is not in sip invite ........ Merged revisions 402042 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-25 22:02 +0000 [r402003] Richard Mudgett * res/stasis/app.c: You'd think that new files would be free of whitespace issues. But you would be wrong. 2013-10-25 21:53 +0000 [r401973-402001] Jonathan Rose * rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c, rest-api/api-docs/bridges.json, res/ari/resource_bridges.c, res/res_ari_bridges.c: ARI: channel/bridge recording errors when invalid format specified Asterisk will now issue 422 if recording is requested against channels or bridges with an unknown format (closes issue ASTERISK-22626) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/2939/ * res/res_ari_channels.c, rest-api/api-docs/bridges.json, rest-api/api-docs/recordings.json, res/ari/resource_bridges.c, res/ari/ari_model_validators.h, res/res_ari_bridges.c, rest-api/api-docs/events.json, res/res_stasis_recording.c, rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/ari/ari_model_validators.c: ARI recordings: Issue HTTP failures for recording requests with file conflicts If a file already exists in the recordings directory with the same name as what we would record, issue a 422 instead of relying on the internal failure and issuing success. (closes issue ASTERISK-22623) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/2922/ 2013-10-25 20:47 +0000 [r401961] Scott Griepentrog * include/asterisk/pbx.h, main/pbx.c, /: pbx.c: fix confused match caller id that deleted exten still in hash This fixes a bug where a zero length callerid match adjacent to a no match callerid extension entry would be deleted together, which then resulted in hashtable references to free'd memory. A third state of the matchcid value has been added to indicate match to any extension which allows enforcing comparison of matchcid on/off without errors. (closes issue AST-1235) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/2930/ ........ Merged revisions 401959 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401960 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-25 17:34 +0000 [r401897-401938] Jonathan Rose * res/res_pjsip/pjsip_distributor.c, res/res_pjsip_endpoint_identifier_user.c: PJSIP: Add log messages when requests are received for non-existent endpoints (closes issue ASTERISK-22552) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2934/ * utils/clicompat.c, utils/refcounter.c, /: Put clicompat-r2.patch back in We've figured out how to resolve the problems this was causing in 12/trunk, so this can go back in now. (issue ASTERISK-22467) Reported by: Corey Farrell Patches: clicompat-r2.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 401914 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401935 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, utils/clicompat.c: revert clicompat-r2.patch from r401704 Patch caused the following build errors against testsuite https://bamboo.asterisk.org/bamboo/browse/AST-ATRUNKBUILD4-244 (issue ASTERISK-22467) Reported by: Corey Farrell ........ Merged revisions 401895 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401896 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-25 16:07 +0000 [r401885] Kevin Harwell * /, channels/chan_sip.c: chan_sip: Allow a sip peer to accept both AVP and AVPF calls Adapts the behaviour of avpf to only impact the format of outgoing calls. For inbound calls, both AVP and AVPF calls will be accepted regardless of the value of avpf in the configuration. (closes issue ASTERISK-22005) Reported by: Torrey Searle Patches: optional_avpf_trunk.patch uploaded by tsearle (license 5334) ........ Merged revisions 401884 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-25 13:48 +0000 [r401872] David M. Lee * tests/test_json.c: test_json: Fix deprecation warnings After a series of upgrades over recent weeks, I've discovered that test_json.c won't compile in dev mode any more for me. One of gcc-4.8.2, OS X Mavericks or Xcode 5 has decided to deprecate tempnam. Which, in general, is a good thing. But for test code that just needs a temporary file, it's just annoying. This patch replaces usage of tempname with mkstemp, avoiding the deprecation warning. It also removes the temporary files when the test is complete, which apparently we weren't doing before (oops). Review: https://reviewboard.asterisk.org/r/2957/ 2013-10-24 20:56 +0000 [r401835] Kevin Harwell * /, main/logger.c: Logging: Logging types ignored after specifying a verbose level If one specified a verbose level within a logging facility in logger.conf then any component after it was ignored. Fixed so all values are correctly read. (closes issue ASTERISK-22456) Reported by: Kevin Harwell ........ Merged revisions 401833 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-24 20:34 +0000 [r401706-401831] Jonathan Rose * main/utils.c, /: utils: Fix memory leaks and missed unregistration of CLI commands on shutdown Final set of patches in a series of memory leak/cleanup patches by Corey Farrell (closes issue ASTERISK-22467) Reported by: Corey Farrell Patches: main-utils-1.8.patch uploaded by coreyfarrell (license 5909) main-utils-11.patch uploaded by coreyfarrell (license 5909) main-utils-12up.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 401829 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401830 from http://svn.asterisk.org/svn/asterisk/branches/11 * tests/test_linkedlists.c, /: test_linkedlists: Fix memory leak (issue ASTERISK-22467) Reported by: Corey Farrell Patches: test_linkedlists-1.8.patch uploaded by coreyfarrell (license 5909) test_linkedlists-11up.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 401790 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401791 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, main/jitterbuf.c: jitterbuf: Fix memory leak on jitter buffer reset (issue ASTERISK-22467) Reported by: Corey Farrell Patches: jitterbuf-jb_reset-leak-1.8.patch jitterbuf-jb_reset-leak-11up.patch ........ Merged revisions 401786 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401787 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, main/astobj2.c: astobj2: Unregister debug CLI commands at exit (issue ASTERISK-22467) Reported by: Corey Farrell Patches: astobj2-clean-debug-cli-1.8-11.patch uploaded by coreyfarrell (license 5909) astobj2-clean-debug-cli-12up.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 401781 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401783 from http://svn.asterisk.org/svn/asterisk/branches/11 * apps/app_voicemail.c, /: app_voicemail: Memory Leaks against tests (issue ASTERISK-22467) Reported by: Corey Farrell Patches: app_voicemail-1.8.patch uploaded by coreyfarrell (license 5909) app_voicemail-11up.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 401743 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401744 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/app.c, main/asterisk.c, utils/clicompat.c, channels/chan_dahdi.c, codecs/ilbc/doCPLC.c, main/data.c, /: memory leaks: Memory leak cleanup patch by Corey Farrell (second set) Also covers ast_app_parse_timelen-fail-zero-length.patch, but the patch was replaced with one of my own. (issue ASTERISK-22467) Reported by: Corey Farrell Patches: chan_dahdi-cleanup_push.patch uploaded by coreyfarrell (license 5909) clicompat-r2.patch uploaded by coreyfarrell (license 5909) codecs-ilbc-doCPLC.patch uploaded by coreyfarrell (license 5909) data-cleanup-test-registration.patch uploaded by coreyfarrell (license 5909) main-asterisk-kill-listener.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 401704 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401705 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-24 03:12 +0000 [r401701] David M. Lee * rest-api-templates/ari_model_validators.c.mustache, rest-api-templates/models.wiki.mustache, rest-api/api-docs/events.json, rest-api-templates/swagger_model.py: The Swagger 1.2 specification for type extension ended up being slightly different than my proposal. Instead of putting an 'extends' field on the subtype, the base type has a 'subTypes' field, which is a list of the subTypes. Given that its a messaging model and not an object model, kinda makes sense. This patch changes the events.json api-doc, and the python translators to take the new format into account. Other changes that are in Swagger 1.2 were not adopted, since the spec is still in flux, and could change before it's finalized. A summary of changes to the Swagger-1.2 spec can be found at https://github.com/wordnik/swagger-core/wiki/1.2-transition. (closes issue ASTERISK-22440) Review: https://reviewboard.asterisk.org/r/2909/ 2013-10-23 20:02 +0000 [r401621-401662] Jonathan Rose * /, tests/test_dlinklists.c, funcs/func_math.c, channels/sip/reqresp_parser.c, main/test.c, main/editline/readline.c: memory leaks: Memory leak cleanup patch by Corey Farrell (first set) (issue ASTERSIK-22467) Reported by: Corey Farrell Patches: chan_sip-parse_contact_header_test-free-contacts.patch uploaded by coreyfarrell (license 5909) cli-filename-completion-leak.patch uploaded by coreyfarrell (license 5909) func_math.patch uploaded by corefarrell (license 5909) main-test-cleanup.patch uploaded by coreyfarrell (license 5909) test_dlinklists.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 401660 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401661 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_rtp_asterisk.c, /, main/translate.c: res_rtp_asterisk: Address jittery DTMF events in RTP streams (closes issue ASTERISK-21170) Reported by: NITESH BANSAL Patches: dtmf-timestamp.patch uploaded by NITESH BANSAL (license 6418) Review: https://reviewboard.asterisk.org/r/2938/ ........ Merged revisions 401619 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401620 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-23 16:49 +0000 [r401581] Richard Mudgett * cdr/cdr_adaptive_odbc.c, /: cdr_adaptive_odbc: Also apply a filter when the CDR value is empty. Extra CDR records are written if a filtered CDR value is empty because the filter is not checked. (closes issue ASTERISK-22272) Reported by: Jordi Llull Chavarria ........ Merged revisions 401577 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401579 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-23 16:37 +0000 [r401578] John Bigelow * main/bridge_channel.c: Add a test suite event to indicate when the atxfer 3-way feature is detected This adds a test suite event that indicates to tests when the attended transfer three-way call feature is detected. Review: https://reviewboard.asterisk.org/r/2912/ 2013-10-23 15:23 +0000 [r401539] Kinsey Moore * channels/chan_mgcp.c, /: chan_mgcp: Properly handle malformed media lines This corrects a situation in which a media line was not parsed properly and resulted in a crash. (closes issue ASTERISK-21190) Reported by: adomjan Patches: chan_mgcp.c-sscnaf_fix uploaded by adomjan (License 5448) ........ Merged revisions 401537 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401538 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-23 11:14 +0000 [r401499] Joshua Colp * /, channels/chan_sip.c: chan_sip: Fix an issue where an incompatible audio format may be added to SDP. If preferred codecs included any non-audio format the code would mistakenly add the audio format, even if it was not a joint capability with the remote side. (closes issue ASTERISK-21131) Reported by: nbougues Patches: patch_unsupported_codec_1.8.patch uploaded by nbougues (license 6470) ........ Merged revisions 401497 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401498 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-23 02:31 +0000 [r401488] Michael L. Young * channels/chan_iax2.c, configs/iax.conf.sample: chan_iax2: Fix Binding To Multiple Addresses Again When reworking chan_iax2 for IPv6, the ability to bind to multiple addresses was removed by mistake. This patch restores this functionality and adds notes about IPv6 addresses in the sample config. (closes issue ASTERISK-22741) Reported by: Joshua Colp Tested by: Michael L. Young Patches: asterisk-22741-fix-binding-multiple-addr.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2945/ 2013-10-22 22:50 +0000 [r401447] Matthew Jordan * res/res_rtp_asterisk.c, /: res_rtp_asterisk: Fix crash when RTCP is not available during SSRC change In r400089, a patch was put in to correct erroneous RTCP statistic resets. Unfortunately, ast_rtp_read can be called on an RTP instance that does not have RTCP information. This patch prevents that crash by only resetting the statistics if we do actually have an RTCP instance. (issue AST-1174) (closes issue ASTERISK-22667) Reported by: John Bigelow ........ Merged revisions 401445 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401446 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-22 19:03 +0000 [r401420-401434] Richard Mudgett * apps/app_queue.c, /: app_queue: Fix CLI "queue remove member" queue_log entry. The queue_log entry resulting from CLI "queue remove member" when log_membername_as_agent is enabled is wrong. It always uses the interface name instead of the member name in the queue_log entry. * Get the queue member before removing it from the queue so the member name is available for the queue_log entry. (closes issue ASTERISK-21826) Reported by: Oscar Esteve Patches: fix_membername.diff (license #6505) patch uploaded by Oscar Esteve (modified to fix potential ref leak) ........ Merged revisions 401433 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/bridge_channel.c, include/asterisk/bridge_channel_internal.h, main/bridge.c: Bridging: Fix orphaned bridge if neither of the joining channels can join. The original issue noted that the bridge is orphaned when res_parking.so is not loaded and a call uses the dial kK flags. A similar issue happens when only one of the park flags is used. In this case you have the bridge with one or the other channel left in it. The channel and bridge will stay around until the channel hangs up. * Fixed the initial bridge channel push failure to act as if the channel were kicked out of the bridge. The bridge then decides if it needs to be dissolved. (closes issue ASTERISK-22629) Reported by: Kevin Harwell Review: https://reviewboard.asterisk.org/r/2928/ * res/parking/parking_bridge_features.c, res/parking/parking_bridge.c: res_parking: Give parking timeout comebacktoorigin channel DTMF features. Parking timeouts did not set any DTMF features for the channel calling the parker back. * Added code to set the parkedcalltransfers, parkedcallreparking, parkedcallhangup, and parkedcallrecording options appropriately for the channels when a parking timeout occurs. The recall channel DTMF options are set using the BRIDGE_FEATURES channel variable to allow the other timeout options to have the DTMF features available. (closes issue ASTERISK-22630) Reported by: Kevin Harwell Review: https://reviewboard.asterisk.org/r/2942/ * res/res_parking.c: res_parking: Update XML documention for DTMF features after parking timeout. * Updated the XML documentation to indicate that the parkedcalltransfers, parkedcallreparking, parkedcallhangup, and parkedcallrecording configuration options also apply to parking timeouts. (issue ASTERISK-22630) Reported by: Kevin Harwell Review: https://reviewboard.asterisk.org/r/2942/ 2013-10-21 21:05 +0000 [r401364] Mark Michelson * main/bridge_channel.c: Remove a noisy debug message from bridging code. This particular debug message, during a stress test, was logged so often that it appeared that there may be a memory leak in the logger code. In actuality, there was no memory leak, but the logger thread was having a hard time keeping up with the demands of the rest of the system. Since this debug message has no value at all, the best way to fix the problem was to just remove the message. (closes issue AST-1225) reported by John Bigelow Patches: spammy_log.diff uploaded by Mark Michelson (License #5049) 2013-10-21 19:48 +0000 [r401327] Kevin Harwell * main/editline/term.c, /: Segfault in LIBEDIT_INTERNAL after tgetstr(), when libncurses5-dev isn't installed Include the appropriate declarations when not using termcap, but term+curses and [n]curses do not exist. (closes issue ASTERISK-22351) Reported by: A. Iglesias Patches: issueA22351_libedit_internal_without_ncurses_dev.patch uploaded by wdoekes (license 5674) ........ Merged revisions 401325 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401326 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-21 18:58 +0000 [r401315] David M. Lee * rest-api/api-docs/channels.json: Fixing r401281; the model name is Channel, with a capital C 2013-10-19 21:53 +0000 [r401291] Kinsey Moore * channels/chan_iax2.c: Fix IAX2 incoming call address lookups This fixes address lookup for incoming calls without a peer definition. The address family was unset instead of being set to AST_AF_UNSPEC which was causing lookup failures on "127.0.0.1". This is one of the causes of the current failure of the app_page integration test. Review: https://reviewboard.asterisk.org/r/2933/ 2013-10-19 14:43 +0000 [r401281] Joshua Colp * res/res_ari_channels.c, res/ari/resource_channels.h, main/pbx.c, rest-api/api-docs/channels.json, res/ari/resource_channels.c: Return a channel snapshot when originating using ARI, and subscribe the Stasis application to it. This change allows a user of ARI to know what channel it has originated and also follow any progress. If a Stasis application is provided it will be automatically subscribed to the originated channel immediately. (closes issue ASTERISK-22485) Reported by: David Lee Review: https://reviewboard.asterisk.org/r/2910/ 2013-10-18 22:51 +0000 [r401271] Richard Mudgett * res/parking/parking_controller.c: res_parking: Remove setting useless flag. 2013-10-18 21:49 +0000 [r401261] David M. Lee * contrib/scripts/get_swagger_ui.sh (added), Makefile, static-http: This is just a quick script for dumping swagger-ui into static-http, so that it can be served by the Asterisk web server. I had to change the Makefile in order to recursively install content from the static-http directory, hence the code review instead of just putting it in. Review: https://reviewboard.asterisk.org/r/2924/ 2013-10-18 18:33 +0000 [r401248] Mark Michelson * main/manager.c, main/bridge.c, main/bucket.c, main/sorcery.c, main/cli.c: Resolve some memory leaks due to incorrect for loop / ao2 ref usage. A common idiom in Asterisk is to due something like: for (ao2_obj = list_beginning; ao2_obj = next_item; ao2_ref(ao2_obj, -1)) { ...do stuff... } This is nice because it automatically takes care of the object references for you. However, there is a pitfall here. If a break statement is in the for loop, then the current reference is not cleaned up. In some cases, this is on purpose, but in others there is a leak. This commit fixes the leak cases. 2013-10-18 16:52 +0000 [r401232-401239] Richard Mudgett * apps/app_dial.c, main/channel.c, res/res_fax.c, include/asterisk/channel.h: Add channel lock protection around translation path setup. Most callers of ast_channel_make_compatible() happen before the channels enter a two party bridge. With the new bridging framework, two party bridging technologies may also call ast_channel_make_compatible() when there is more than one thread involved with the two channels. * Added channel lock protection in set_format() and ast_channel_make_compatible_helper() when dealing with the channel's native formats while setting up a translation path. * Fixed best_src_fmt and best_dst_fmt usage consistency in ast_channel_make_compatible_helper(). The call to ast_translator_best_choice() got them backwards. * Updated some callers of ast_channel_make_compatible() and the function documentation. There is actually a difference between the two channels passed in. * Fixed the deadlock potential in res_fax.c dealing with ast_channel_make_compatible(). The deadlock potential was already there anyway because res_fax called ast_channel_make_compatible() with chan locked. (closes issue ASTERISK-22542) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2915/ * include/asterisk/bridge.h: Tweak ast_bridge_depart() doxygen. 2013-10-18 16:05 +0000 [r401212-401223] Mark Michelson * include/asterisk/bridge.h: Remove the bit about requiring ast_bridge_depart() to be called before ast_bridge_destroy(). * include/asterisk/bridge.h: Clarify in ast_bridge_destroy() about how departable channels must be handled. 2013-10-18 15:13 +0000 [r401183] Michael L. Young * /, channels/chan_sip.c: Remove Port Restriction When Checking For NAT When trying to determine if a peer is behind NAT, we should not be using the ports when comparing addresses. This patch removes the port from being checked and just useds the addresses now. (closes issue ASTERISK-22729) Reported by: Michael L. Young Tested by: Michael L. Young Patches: asterisk-remove-using-port-for-nat-check.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2927/ ........ Merged revisions 401182 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-18 14:47 +0000 [r401180] Walter Doekes * main/channel.c, /: Properly copy/remove the device state cache flag over a masquerade. In r378303 the AST_FLAG_DISABLE_DEVSTATE_CACHE flag was added that tells the devstate system to not cache states for non-real devices. However, when optimizing away channels (ast_do_masquerade), that flag wasn't copied. In my case, using Local devices as queue members created a situation where the endpoint was considered in use, but the state change of the device being available again was ignored (not cached). The endpoint channel was optimized into the (previously) Local channel, but kept the do-not-cache flag. The end result being that the queue member apparently stayed in use forever. (closes issue ASTERISK-22718) Reported by: Walter Doekes Review: https://reviewboard.asterisk.org/r/2925/ ........ Merged revisions 401178 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401179 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-17 20:37 +0000 [r401168] Michael L. Young * /, channels/chan_sip.c: Fix Setting A chan_sip Dialog's SIP_NAT_FORCE_RPORT Flag A condition was added in a commit to fix ASTERISK-21374, that, if the SIP_PAGE3_NAT_AUTO_RPORT flag was set, to then copy a peer's SIP_NAT_FORCE_RPORT flag to the dialog. This condition should not have been there since it assumed that if Asterisk is in an environment where NAT is involved, that the auto_* nat settings or force_rport setting would be on in the global settings. If the nat setting in the global setting is set to 'nat=no' and then turned on for peers (which is not quite the recommended way, although it is allowed) this flag is never copied to the dialog resulting in problems like, REGISTER replies going to the wrong port. This patch removes this conditional check and will now always use the peer's flag which by this point in the code the checks on whether the peer is behind NAT or not (if using auto_force_rport) have already been run. (closes issue ASTERISK-22236) Reported by: Filip Frank Tested by: Michael L. Young Patches: asterisk-2236-always-set-rport.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2919/ ........ Merged revisions 401167 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-17 18:16 +0000 [r401158] Jonathan Rose * res/res_parking.c: res_parking: Fix bug where reloading immediately wipes new parkpos extensions (closes issue ASTERISK-22631) Reported by: Kevin Harwell 2013-10-17 15:40 +0000 [r401121] Kinsey Moore * /, res/res_xmpp.c, res/res_jabber.c: Reduce log level of a non-pubsub error message Drop an error log message to debug level 1 since distributed device state functions correctly when receiving this message and it spams the logs. (closes issue ASTERISK-22410) Reported by: abelbeck Patches: asterisk-1.8-res_jabber-log-nonpubsub-error-to-debug.patch uploaded by abelbeck (License 5903) asterisk-11-res_xmpp-log-nonpubsub-error-to-debug.patch uploaded by abelbeck (License 5903) ........ Merged revisions 401119 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401120 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-16 21:20 +0000 [r401107] Richard Mudgett * res/ari/resource_playback.c: ARI: Fix crash when POST /playback/{id}/control does not have an operation parameter. (closes issue ASTERISK-22680) Reported by: John Bigelow 2013-10-16 21:17 +0000 [r401096-401106] David M. Lee * res/res_ari.c: Fixed malformed Access-Control-Allow-Methods header. Was causing Safari to barf on POST and DELETE. * rest-api/resources.json: Oops. Leftover /stasis reference 2013-10-16 14:01 +0000 [r401087] Kinsey Moore * res/ari/resource_bridges.h, rest-api/api-docs/channels.json, rest-api/api-docs/bridges.json, res/ari/resource_channels.h: Clarify documentation for channel and bridge list This makes it clear that the ARI API calls for listing channels and bridges will list all channels or bridges in the system and not just those that are in or are controlled by a Stasis application. (closes issue ASTERISK-22635) Reported by: Kevin Harwell 2013-10-16 12:12 +0000 [r401077] Walter Doekes * apps/app_queue.c, /: Don't check all realtime queues when doing "queue show some_queue". When using realtime queues, queues have to be fetched from the database every now and then to see if any info has been changed or to see if the queue has been removed. When fetching info for an individual queue, the pruning of other queues is unnecessarily costly. Review: https://reviewboard.asterisk.org/r/2907/ ........ Merged revisions 401049 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401076 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-16 00:02 +0000 [r401040] Paul Belanger * res/res_ari_bridges.c, rest-api/api-docs/bridges.json: Use POST / DELETE to toggle ARI bridge moh Review: https://reviewboard.asterisk.org/r/2911/ 2013-10-15 20:25 +0000 [r401030] Richard Mudgett * channels/dahdi/bridge_native_dahdi.c: bridge_native_dahdi: Return channel join failure if could not make the channels compatible. 2013-10-15 20:02 +0000 [r401018] Kinsey Moore * rest-api/api-docs/bridges.json, res/res_ari_bridges.c: Ensure bridge record error responses validate This adds the list of expected errors to the /bridges/{bridgeId}/record ARI documentation so that outbound 4xx errors validate properly. Previously, this would result in a response validation failure. (closes issue ASTERISK-22627) Reported by: Joshua Colp 2013-10-15 20:01 +0000 [r401017] Richard Mudgett * /, channels/chan_iax2.c: chan_iax2: Fix channel left locked in off nominal code path. ........ Merged revisions 401016 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-15 15:26 +0000 [r400999] Paul Belanger * rest-api/api-docs/channels.json, res/res_ari_channels.c: Use POST / DELETE to toggle hold / moh for ARI channels This change updates how we handle toggle events, rather then create two different function names, we'll just use POST / DELETE from HTTP to handle it. Review: https://reviewboard.asterisk.org/r/2906/ 2013-10-15 15:21 +0000 [r400984] Mark Michelson * /, channels/chan_sip.c: Prevent chan_sip from sending duplicate BYEs. When a 200 OK for an initial INVITE is received, we were doing the right thing by ACKing and sending an immediate BYE. However, we also were doing the wrong thing and queuing an answer frame, thus causing the call to be answered. This would cause the call to be hung up by the channel thread, thus resulting in a second BYE being sent out. In this fix, I also have set the hangupcause to be correct since the initial BYE being sent by Asterisk had an unknown hangup cause. I have changed to using "Bearer capabilty not available" since the call was hung up due to an SDP offer/answer error. (closes issue ASTERISK-22621) reported by Kinsey Moore ........ Merged revisions 400970 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400971 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-15 13:43 +0000 [r400958] David M. Lee * rest-api-templates/asterisk_processor.py: My doc correction in r400842 had a silly bug. Because I added a wiki_description to models and not their properties, the rendered wiki page had the model description instead of the property descriptions, which looks very silly indeed. (closes issue ASTERISK-22705) 2013-10-14 21:55 +0000 [r400911] Richard Mudgett * /, channels/chan_dahdi.h, channels/chan_dahdi.c: chan_dahdi: Reflect the set software gain in the CLI "dahdi show channel" output. * Remember the swgain setting from CLI "dahdi set swgain" command so the CLI "dahdi show channel" output will reflect the current setting. * Updated CLI "dahdi set hwgain" and "dahdi set swgain" documentation. (issue ASTERISK-22429) Reported by: Jaco Kroon Patches: jira_asterisk_22429_v1.8_v2.patch (license #5621) patch uploaded by rmudgett ........ Merged revisions 400907 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400909 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-14 21:52 +0000 [r400910] Mark Michelson * /, channels/chan_sip.c: chan_sip: Do not increment the SDP version between 183 and 200 responses. Bumping the SDP version number can cause interoperability problems since receivers of the responses will expect that a 200 SDP will be identical to a previous 183 SDP. (closes issue ASTERISK-21204) reported by NITESH BANSAL Patches: dont-increment-session-version-in-2xx-after-183.patch uploaded by NITESH BANSAL (License #6418) ........ Merged revisions 400906 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400908 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-14 15:52 +0000 [r400890] Kevin Harwell * res/res_pjsip_outbound_registration.c: pjsip outbound registration: Log message says received a 408 when we didn't If the server didn't exist that we are trying to register to the log message would say that a 408 was received from that server when in reality one wasn't. Added log messages stating no response was received if the response does not exist. (closes issue ASTERISK-22554) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2893/ 2013-10-14 14:57 +0000 [r400881] Matthew Jordan * res/res_pjsip_mwi.c: Remove duplicate module info block The module info block was repeated twice. Once is sufficient. 2013-10-13 15:41 +0000 [r400872] Joshua Colp * res/res_pjsip_session.c: Fix a race condition in res_pjsip_session with rapidly terminating the session. The INVITE session state callback wrongly assumes that a session will always exist, but when rapidly terminating the session this assumption goes out the window. As all handler code for the INVITE session state callback requires the session it will now just exit immediately if no session exists. (closes issue ASTERISK-22668) Reported by: John Bigelow 2013-10-12 16:49 +0000 [r400863] Kinsey Moore * res/res_pjsip_outbound_authenticator_digest.c: Fix realm comparison for outbound auth When generating the list of authentication credentials to pass to PJSIP, Asterisk was using the raw pointer of a pj_str_t which is not always NULL-terminated. This sometimes resulted in incorrect text for the realm and a failure to match the realm for authentication purposes which was causing the outbound nominal auth pjsip basic call test to bounce. This now uses the pj_str_t that contains the realm instead of generating a new one. Thanks to John Bigelow for helping to narrow this down. 2013-10-11 16:53 +0000 [r400849-400854] Richard Mudgett * include/asterisk/channel.h: channel.h: whitespace changes. * bridges/bridge_softmix.c: Softmix: Fix crash when switching from softmix to another bridge technology. The crash is caused by a race condition when switching between native RTP and softmix bridging technologies. In this situation, the bridging technology is switched from native RTP to softmix, and then back to native RTP fast enough that the softmix private data gets destroyed before the softmix mixing thread gets started. Thanks to Kinsey Moore for the crash analysis. * Fix race condition when starting the softmix mixing thread and switching to another bridge technology. (closes issue ASTERISK-22678) Reported by: John Bigelow Patches: jira_asterisk_22678_v12.patch (license #5621) patch uploaded by rmudgett Tested by: John Bigelow 2013-10-11 16:18 +0000 [r400842-400848] David M. Lee * res/ari/resource_playback.h, rest-api/api-docs/playback.json: Fix a stupid copy/paste error in ARI docs. Patches: ari-doc-patch.txt uploaded by jbigelow (license 5091) * res/ari/resource_bridges.h, rest-api/api-docs/channels.json, rest-api/api-docs/bridges.json, res/ari/resource_channels.h: Updated /play resource docs. The playback of http: resources isn't implemented... yet * rest-api-templates/models.wiki.mustache, rest-api-templates/api.wiki.mustache, rest-api-templates/asterisk_processor.py: Correct some ARI wiki rendering errors 2013-10-10 18:21 +0000 [r400824-400833] Joshua Colp * res/res_pjsip/location.c: Perform validation of permanent contacts on AORs in res_pjsip. * res/res_pjsip/pjsip_configuration.c, res/res_pjsip.c: Fix an assertion in res_pjsip when specifying an invalid outbound proxy. This change fixes two issues when setting an outbound proxy: 1. The outbound proxy URI was not parsed and validated during configuration. 2. If an outgoing dialog was created and the outbound proxy could not be set an assertion would occur because the usage count on the dialog was not decremented. The documentation has also been updated to specify that a full URI must be specified for the outbound proxy. (closes issue ASTERISK-22672) Reported by: Antti Yrjola 2013-10-09 11:00 +0000 [r400771-400812] Matthew Jordan * res/res_pjsip_header_funcs.c: Use 'z' as the format specifier for size_t Using 'lu' will produce a compiler warning for some versions of gcc and on some architectures. 'z' should be portable as a format specifier for size_t. * res/res_pjsip_header_funcs.c (added): Add PJSIP_HEADER function for manipulation of SIP headers in the PJSIP stack This patch adds support to the PJSIP stack in Asterisk for SIP header manipulation. Note that this is analagous to SIPAddHeader/SIPRemoveHeader. For PJSIP_HEADER, an incoming supplemental session callback is registered that takes the pjsip_hdrs from the incoming session and stores them in a linked list in the session datastore. Calls to PJSIP_HEADER traverse over the list and return the nth matching header where 'n' is the 'number' argument to the function. When adding a header, the first call creates a datastore and linked list and adds the datastore to the session. The header is then created as a pjsip_hdr and added to the list. An outgoing supplemental session callback then traverses the list and adds the headers to the outgoing pjsip_msg. When removing a header, the list created with PJSIP_HEADER(add,...) is traversed and all matching entries are removed. (closes issue ASTERISK-22498) Reported by: George Joseph patch: res_pjsip_header_funcs_v1.patch uploaded by george.joseph (License 6322) 2013-10-08 22:30 +0000 [r400769] Kinsey Moore * /, configure, configure.ac: Add warning when compiling with iODBC support When running configure, libiodbc2 development headers will fulfill the requirement for ODBC development headers, but will not function properly. This adds a warning when libiodbc2 development headers are detected instead of unixodbc development headers. (closes issue ASTERISK-22459) Reported by: Patrick Maille Tested by: Walter Doekes Patches: issueA22459_warn_when_using_iodbc.patch uploaded by Walter Doekes (License 5674) ........ Merged revisions 400767 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400768 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-08 21:19 +0000 [r400754] Richard Mudgett * apps/app_agent_pool.c: app_agent_pool: Fix AMI/CLI AgentLogoff soft preventing agents from logging back in. * Clear the deferred_logoff flag when an agent logs in. (closes issue ASTERISK-22669) Reported by: John Bigelow 2013-10-08 20:51 +0000 [r400749] Mark Michelson * res/res_pjsip.c, res/res_pjsip/config_transport.c: Switch from using pjsip_strerror to pj_strerror. pjsip_strerror is only aware of PJSIP-specific error codes. pj_strerror() is aware of all PJProject error codes and OS-specific error codes. This specifically fixes an oft-seen error in transport configuration code where EADDRINUSE would result in "Unknown PJSIP error 120098" instead of a useful message. 2013-10-08 20:16 +0000 [r400724-400742] Richard Mudgett * apps/app_confbridge.c, CHANGES, apps/confbridge/conf_config_parser.c, configs/confbridge.conf.sample, /, apps/confbridge/include/confbridge.h: app_confbridge: Can now set the language used for announcements to the conference. ConfBridge now has the ability to set the language of announcements to the conference. The language can be set on a bridge profile in confbridge.conf or by the dialplan function CONFBRIDGE(bridge,language)=en. (closes issue ASTERISK-19983) Reported by: Jonathan White Patches: M19983_rev2.diff (license #5138) patch uploaded by junky (modified) Tested by: rmudgett ........ Merged revisions 400741 from http://svn.asterisk.org/svn/asterisk/branches/11 * apps/confbridge/conf_config_parser.c, /: app_confbridge: Fix duplicate default_user profile. * Fixed looking in the wrong profiles container to see if the default_user profile is already created in verify_default_profiles(). The bridge profile container is never going to hold user profiles. :) ........ Merged revisions 400723 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-08 18:19 +0000 [r400682-400701] Kinsey Moore * funcs/func_config.c, /: Fix func_config list entry allocation The AST_CONFIG dialplan function defined in func_config.c allocates its config file list entries using ast_malloc. List entry allocations destined for use with Asterisk's linked list API must be ast_calloc()d or otherwise initialized so that list pointers are set to NULL. These uses of ast_malloc have been replaced by ast_calloc to prevent dereferencing of uninitialized pointer values when traversing the list. (closes issue ASTERISK-22483) Reported by: Brian Scott ........ Merged revisions 400694 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400697 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_rtp_asterisk.c, /: Fix STUN crash when using IPv6 any address Ensure that when chan_sip binds to the IPv6 any address ([::]), IPv4 candidates are also added. (closes issue ASTERISK-21917) Reported by: Torrey Searle Patches: 0023_ipv6_stun_crash.patch uploaded by Torrey Searle (License 5334) ........ Merged revisions 400681 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-08 15:36 +0000 [r400680] Mark Michelson * res/res_pjsip/pjsip_options.c: Push CLI qualify into the threadpool. If you run Asterisk in the background and then connect to it through a separate console, the thread that runs CLI commands is not registered with PJLIB. Thus PJLIB does not like it when you attempt to send OPTIONS requests from that thread. So now we push the task into the threadpool, which we know to be registered with PJLIB. Thanks to Antti Yrjola for reporting this. 2013-10-08 15:11 +0000 [r400661-400671] Richard Mudgett * res/res_agi.c, apps/app_queue.c: Make app_queue and res_agi independent of AMI being enabled. The https://reviewboard.asterisk.org/r/2888/ review changes manager to not subscribe to stasis when it is disabled for performance reasons. When manager is disabled app_queue and res_agi decline to load and fail to clean up what they have already allocated. * Made app_queue and res_agi clean up allocated resources when they decline to load. * Made app_queue and res_agi use their own subscriptions to the stasis topics instead of borrowing manager's message router structure inappropriately. (closes issue ASTERISK-22604) Reported by: rmudgett Review: https://reviewboard.asterisk.org/r/2902/ * include/asterisk/stasis.h, apps/app_queue.c, include/asterisk/manager.h: Miscellaneous stand alone comment cleanups. 2013-10-06 17:11 +0000 [r400624] Michael L. Young * apps/app_queue.c, /: app_queue: Fix Queuelog EXITWITHKEY only logging two of four fields Commit r62462 added two extra fields for logging "the original position the caller entered the queue at, and the amount of time the caller was waiting in the queue." But when r75969 was merged from 1.4 into trunk (r75977), these two fields disappeared. Those two extra fields were not logged in 1.4 and when the patch was merged, those fields went away. Therefore, this is a regression and was caught by the reporter because he was reading the awesome "Asterisk: The Definitive Guide" book. (closes issue ASTERISK-22197) Reported by: Dalius M. Tested by: Dalius M. Patches: asterisk-22197-q-log-exitwithkey.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2901/ ........ Merged revisions 400622 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400623 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-05 00:41 +0000 [r400588] Richard Mudgett * channels/iax2/include/parser.h: chan_iax2: Fix compile error. 2013-10-04 21:40 +0000 [r400567] Michael L. Young * channels/iax2/include/parser.h, main/acl.c, include/asterisk/netsock2.h, CHANGES, channels/chan_iax2.c, channels/iax2/parser.c, main/netsock.c, main/netsock2.c: Add IPv6 Support To chan_iax2 This patch adds IPv6 support to chan_iax2. Yay! (closes issue ASTERISK-22025) Patches: iax2-ipv6-v5-reviewboard.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2660/ 2013-10-04 19:31 +0000 [r400552] David M. Lee * rest-api/api-docs/applications.json (added): Added missing file from r400522 2013-10-04 18:42 +0000 [r400532-400542] Jonathan Rose * res/res_pjsip_logger.c: chan_pjsip: Make logger togglable without loading/unloading This patch makes the res_pjsip_logger do a few things... First, it will be built and installed by default now, so end users won't need to enable it in menuselect. Second, while it is loaded, it no longer will immediately issue log messages. Upon loading, it is in the disabled state and must be turned on with the new CLI command. The CLI command 'pjsip set logger has been added and can be used to do the following: pjsip set logger on: Enables logger for all PJSIP traffic pjsip set logger off: Disables logger for all PJSIP traffic pjsip set logger host : Enables logger for the specific host Review: https://reviewboard.asterisk.org/r/2900/ * contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py, configs/extconfig.conf.sample, configs/sorcery.conf.sample, contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py (added): chan_pjsip: Add alembic scripts for generating db tables for PJSIP Also updates sample configurations for sorcery and extconfig to demonstrate how to use databases created by that alembic script. (closes issue ASTERISK-22133) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2892/ 2013-10-04 15:54 +0000 [r400522] Matthew Jordan * res/stasis/app.h, rest-api/resources.json, include/asterisk/_private.h, main/endpoints.c, res/ari/ari_model_validators.c, res/ari/ari_model_validators.h, res/res_ari_model.c, main/json.c, res/ari.make, res/ari/resource_applications.c (added), res/ari/resource_applications.h (added), res/res_stasis.c, main/asterisk.c, rest-api/api-docs/endpoints.json, rest-api/api-docs/events.json, res/stasis/app.c, include/asterisk/endpoints.h, rest-api-templates/ari_model_validators.h.mustache, res/res_ari_applications.c (added), res/ari/resource_endpoints.h, include/asterisk/stasis_app.h: ARI: Add subscription support This patch adds an /applications API to ARI, allowing explicit management of Stasis applications. * GET /applications - list current applications * GET /applications/{applicationName} - get details of a specific application * POST /applications/{applicationName}/subscription - explicitly subscribe to a channel, bridge or endpoint * DELETE /applications/{applicationName}/subscription - explicitly unsubscribe from a channel, bridge or endpoint Subscriptions work by a reference counting mechanism: if you subscript to an event source X number of times, you must unsubscribe X number of times to stop receiveing events for that event source. Review: https://reviewboard.asterisk.org/r/2862 (issue ASTERISK-22451) Reported by: Matt Jordan 2013-10-04 15:48 +0000 [r400510-400520] Joshua Colp * res/res_pjsip.c: Enclose the To URI and update its user portion if a request user has been specified. * res/res_pjsip_session.c: Replace the connection address at the SDP level if altering the SDP with the external media address. 2013-10-04 04:54 +0000 [r400508] David M. Lee * rest-api/api-docs/playback.json, res/res_ari_playback.c: Corrected response class for stopPlayback 2013-10-03 23:11 +0000 [r400471] Jonathan Rose * /, channels/chan_sip.c: chan_sip: Don't ignore expires value in contact header if it lacks semicolon (closes issue ASTERISK-22574) Reported by: Filip Jenicek Patches: chan_sip_expires.patch uploaded by Filip Jenicek (license 6277) ........ Merged revisions 400469 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400470 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-03 21:40 +0000 [r400460] Matthew Jordan * main/channel_internal_api.c: Remove publication of a channel snapshot when the technology is set This patch removes said publication for a few reasons: (1) It is unnecessary. Association of the channel technology with a specific channel is an implementation detail that should be assumed to "just happen", and consumers of Stasis don't need to be informed about it. (2) Publication of said message can now cause crashes, as the actual creation of a channel in normal locations now stages its messages. As a result, things that create dummy channels (such as the SIP RTP QOS unit test) and associate them with a channel technology were now crashing, as the channel itself was not known by Stasis. 2013-10-03 19:31 +0000 [r400442] Joshua Colp * main/cdr.c: When serializing CDR variables (like for "core show channels") don't output an error if CDRs aren't enabled. 2013-10-03 19:29 +0000 [r400440] Kinsey Moore * /, main/security_events.c: Fix security events for AMI invalid password In r337595, additional security events were added for chan_sip authentication failures. The new IEs added to the existing invalid password event were defined as required IEs, but existing users of the event did not set the new IEs and could not since they didn't apply to existing uses. They are now marked as optional IEs. (closes issue ASTERISK-22578) Reported by: Matt Jordan ........ Merged revisions 400421 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-03 19:11 +0000 [r400403] Mark Michelson * include/asterisk/bridge_technology.h, bridges/bridge_native_rtp.c: Fix assumption in bridge_native_rtp.c regarding number of participants in a bridge. When a party leaves a bridge, there may be more participants in the bridge than expected. As such, it is important not to make assumptions regarding the list of channels in a bridge. This change makes it so that when a party leaves a native RTP bridge, we unbridge it and the party it was bridged with. Previously, the first and last channels in the list were unbridged since it was assumed that these were the two channels that had been bridged. As previously stated, a new party had been inserted into the bridge, so this logic did not work properly. (closes issue ASTERISK-22615) reported by Matt Jordan (closes issue ASTERISK-22532) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2899 2013-10-03 19:05 +0000 [r400401] Joshua Colp * res/ari/resource_channels.c: Fix a crash caused by muting and unmuting a channel in ARI without specifying a direction. (closes issue ASTERISK-22637) Reported by: Scott Griepentrog Patch by Matt Jordan, whose office I have taken over in the name of Canada. 2013-10-03 18:44 +0000 [r400398] Richard Mudgett * main/cel.c: cel: Some whitespace cleanups 2013-10-03 18:28 +0000 [r400384-400395] Kinsey Moore * res/res_rtp_multicast.c, /: res_rtp_multicast: Ensure SSRC is set properly This fixes a bug where the SSRC field on multicast RTP can be stuck at 0 which can cause problems for endpoints trying to make sense of incoming streams. (closes issue ASTERISK-22567) Reported by: Simone Camporeale Patches: 22567_res_mulitcast_ssrc.patch uploaded by Simone Camporeale (License 6536) ........ Merged revisions 400393 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400394 from http://svn.asterisk.org/svn/asterisk/branches/11 * configure, include/asterisk/autoconfig.h.in, configure.ac, main/xml.c: Detect and use xsltCleanupGlobals when available This introduces usage of an additional libxslt cleanup function, xsltCleanupGlobals, when the configure script detects that it is available. Early versions of the library did not include this function. (closes issue ASTERISK-22570) Reported by: Corey Farrell Patches: xsltCleanupGlobals.patch uploaded by Corey Farrell (License 5909) 2013-10-03 17:55 +0000 [r400383] Matthew Jordan * contrib/ast-db-manage/config/env.py, contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py, contrib/ast-db-manage/voicemail/env.py: Update Alembic database scripts for external scripting and PostgreSQL, Oracle This patch does the following: 1) The env scripts have been updated to be tolerant of a NULL configuration file. This occurs when configuration is provided by an external script, such that the actual config.ini file is not used. 2) Enum types have all been given names. This is needed for PostgreSQL script generation. 3) The identifier meetme_confno_starttime_endtime is greater than 30 characters, and hence invalid for Oracle databases. This has been truncated down to meetme_confno_start_end. 2013-10-03 16:22 +0000 [r400373] Richard Mudgett * channels/chan_vpb.cc: chan_vpb: Make compile again. 2013-10-03 14:56 +0000 [r400362] Mark Michelson * tests/test_cel.c: Get rid of uses of stasis_topic_wait() 2013-10-03 14:51 +0000 [r400360] Joshua Colp * res/res_pjsip_sdp_rtp.c, res/res_pjsip_t38.c: Fix crashes in res_pjsip_sdp_rtp and res_pjsip_t38 when a stream is rejected and external_media_address is set. The callback function for changing the media address in streams wrongly assumes that a connection line will always be present. This is false as no line is present if a stream has been rejected. (closes issue ASTERISK-22645) Reported by: Rusty Newton 2013-10-02 22:34 +0000 [r400318-400356] Mark Michelson * main/rtp_engine.c, addons/chan_ooh323.c, channels/chan_multicast_rtp.c, main/ccss.c, apps/app_meetme.c, bridges/bridge_holding.c, main/bridge_basic.c, bridges/bridge_softmix.c, channels/chan_gtalk.c, channels/chan_iax2.c, main/media_index.c, main/channel.c, channels/chan_phone.c, channels/chan_dahdi.c, main/dial.c, main/manager.c, pbx/pbx_spool.c, channels/chan_skinny.c, main/format_cap.c, channels/chan_motif.c, res/res_agi.c, channels/chan_alsa.c, apps/app_confbridge.c, addons/chan_mobile.c, channels/chan_mgcp.c, res/res_clioriginate.c, channels/chan_sip.c, channels/chan_bridge_media.c, res/res_pjsip_sdp_rtp.c, tests/test_format_api.c, bridges/bridge_simple.c, apps/app_originate.c, res/parking/parking_applications.c, main/core_local.c, channels/chan_console.c, channels/chan_oss.c, include/asterisk/format_cap.h, res/res_pjsip_session.c, res/ari/resource_bridges.c, channels/chan_jingle.c, channels/chan_misdn.c, channels/dahdi/bridge_native_dahdi.c, channels/chan_h323.c, main/file.c, res/res_pjsip/pjsip_configuration.c, tests/test_config.c, channels/chan_nbs.c, bridges/bridge_native_rtp.c, res/res_stasis.c, channels/chan_pjsip.c, channels/chan_unistim.c: Cache string values of formats on ast_format_cap() to save processing. Channel snapshots have string representations of the channel's native formats. Prior to this change, the format strings were re-created on ever channel snapshot creation. Since channel native formats rarely change, this was very wasteful. Now, string representations of formats may optionally be stored on the ast_format_cap for cases where string representations may be requested frequently. When formats are altered, the string cache is marked as invalid. When strings are requested, the cache validity is checked. If the cache is valid, then the cached strings are copied. If the cache is invalid, then the string cache is rebuilt and copied, and the cache is marked as being valid again. Review: https://reviewboard.asterisk.org/r/2879 * /: Remove svn:mergeinfo property. * main/stasis_endpoints.c, main/stasis_wait.c (removed), res/ari/resource_endpoints.c, /, include/asterisk/stasis.h, tests/test_cel.c, include/asterisk/stasis_endpoints.h, channels/chan_pjsip.c, main/stasis.c: Remove unnecessary waits from stasis. Since caches are updated on publisher threads, there is no need to wait for the cache updates to occur after a stasis message is published. In the case of chan_pjsip device state changes, this set of changes caused an improvement to performance. Review: https://reviewboard.asterisk.org/r/2890 2013-10-02 21:32 +0000 [r400316] Michael L. Young * /, channels/chan_iax2.c: Cast Integer Argument To Unsigned Char The member reg in the peercnt structure is an unsigned char and peercnt_modify() is expecting an unsigned char argument which gets assigned to peercnt->reg. This patch fixes that by casting the integer argument being passed to peercnt_modify to unsigned char. ........ Merged revisions 400314 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400315 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-02 21:25 +0000 [r400312] Matthew Jordan * main/cel.c, main/cdr.c, main/manager.c: Only create Stasis subscriptions when enabled Subscribing to Stasis isn't free. As such, this patch makes AMI, CDR, and CEL - the "big 3" - only subscribe when enabled. Toggling their availability via a .conf file will unsubscribe/subscribe as appropriate. Review: https://reviewboard.asterisk.org/r/2888/ 2013-10-02 20:30 +0000 [r400303] Richard Mudgett * main/pbx.c: Originate: Make setting caller id on outgoing call use either name or number. Previous code was requiring both name and number to be available. Also restored a comment block on why caller id is also set on an outgoing call leg in addition to connected line from earlier versions of Asterisk. 2013-10-02 19:19 +0000 [r400291] Kinsey Moore * rest-api/api-docs/asterisk.json: Correct allowable values for ARI general information filter 2013-10-02 18:57 +0000 [r400286] Matthew Jordan * main/cdr.c: Fix the CDR CLI command 'cdr show active {channel}' When the switch from channel names to channel unique IDs happened, the poor CLI command got left in the dust. This fixes the command so that users can once again see how Asterisk is messing up your billing information. 2013-10-02 18:42 +0000 [r400284] Joshua Colp * res/res_pjsip_t38.c: Fix a crash in res_pjsip_t38 caused by the wrong assumption that a session will always have a channel. When starting up or shutting down this assumption is false. 2013-10-02 18:25 +0000 [r400281] Tzafrir Cohen * Makefile, doc/astdb2sqlite3.8 (added), /, doc/astdb2bdb.8 (added): man pages for astdb2bdb and astdb2sqlite3 Review: https://reviewboard.asterisk.org/r/2898/ ........ Merged revisions 400279 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-10-02 17:11 +0000 [r400268-400270] Richard Mudgett * main/utils.c, apps/app_stack.c, res/stasis_recording/stored.c, main/json.c, main/stasis_cache.c, res/res_ari.c: MALLOC_DEBUG: Fix some misuses of free() when MALLOC_DEBUG is enabled. * There were several places in ARI where an external library was mallocing memory that must always be released with free(). When MALLOC_DEBUG is enabled, free() is redirected to the MALLOC_DEBUG version. Since the external library call still uses the normal malloc(), MALLOC_DEBUG complains that the freed memory block is not registered and will not free it. These cases must use ast_std_free(). * Changed calls to asprintf() and vasprintf() to the equivalent ast_asprintf() and ast_vasprintf() versions respectively. * channels/sig_ss7.c: sig_ss7: Fix compiler warnings. 2013-10-02 16:20 +0000 [r400245-400265] Joshua Colp * channels/chan_jingle.c, main/channel.c, main/dial.c, channels/chan_dahdi.c, include/asterisk/stasis_channels.h, channels/chan_skinny.c, channels/chan_motif.c, channels/chan_alsa.c, main/stasis_channels.c, channels/chan_pjsip.c, channels/sig_ss7.c, channels/chan_mgcp.c, channels/chan_unistim.c, apps/app_dial.c, main/pbx.c, channels/chan_sip.c, main/bridge.c, include/asterisk/channel.h, channels/chan_gtalk.c, channels/chan_console.c, channels/sig_pri.c, channels/chan_iax2.c: Reduce channel snapshot creation and publishing by up to 50%. This change introduces the ability to stage channel snapshot creation and publishing by suppressing the implicit creation and publishing that some functions have. Once all operations are executed the staging is marked as done and a single snapshot is created and published. Review: https://reviewboard.asterisk.org/r/2889/ * res/res_pjsip_session.c: Fix a random one way audio issue in PJSIP. Due to the asynchronous design of the PJMEDIA SDP negotiator it was possible for the SDP to be negotiated *after* a channel was created and after it was being wait on by an application. It is only after negotiation occurs that the file descriptors for RTP are placed on the channel. Since the channel was already being waited on these file descriptors were not monitored, causing incoming media to never be read. This change wakes up any application waiting on the channel so that added file descriptors end up being monitored. (closes issue AST-1227) Reported by: John Bigelow * res/stasis/control.c, include/asterisk/stasis_app.h, res/ari/resource_channels.c: Allow specifying a channel to dial an extension and context in an ARI dial operation. (issue ASTERISK-22625) Reported by: Scott Griepentrog * res/res_pjsip_session.c: Retrieve and store the hostname only once so multiple threads do not potentially initialize it at the same time. 2013-10-01 21:17 +0000 [r400227-400236] Richard Mudgett * channels/chan_dahdi.c, channels/sig_analog.c: chan_dahdi: Fix analog parking using flash-hook. Transferring an analog call using a flash-hook to parking would fail to park the call and result in an invalid ao2 object unref. * Park the correct bridged channel. * main/features_config.c: Features: Rearm the parking config options have moved warning for each reload. 2013-10-01 15:48 +0000 [r400217] Matthew Jordan * main/cdr.c: Filter out internal channels for bridge leave messages and parked call messages Granted, if you manage to park a Conference announcer channel, something has gone horrifically wrong. 2013-09-30 21:31 +0000 [r400205] Jonathan Rose * configs/res_parking.conf.sample, configs/features.conf.sample: configuration samples: Pull all parking related stuff out of features.conf This patch also adds documentation for parking from features.conf to res_parking.conf 2013-09-30 19:57 +0000 [r400194-400196] Matthew Jordan * funcs/func_cdr.c: Parse arguments passed to the CDR_PROP function correctly I can only blame this on a bad merge, because this in no way worked properly the way it was written. Mea culpa. The function should now parse its arguments correctly and function properly. (Note that the API used by the CDR_PROP function has working unit tests... this was merely bad coding of the actual registered function) (closes issue ASTERISK-22613) Reported by: Private Name * main/cdr.c: Remove spurious event raised when CDRs are reloaded The Reload event is now raised by the module loading core. As such, the Reload event in the CDR engine was a duplicate and not needed. 2013-09-30 18:48 +0000 [r400178-400181] David M. Lee * include/asterisk/stasis.h, main/devicestate.c, res/res_xmpp.c, main/taskprocessor.c, main/sounds_index.c, main/endpoints.c, channels/chan_iax2.c, res/res_jabber.c, res/parking/parking_bridge_features.c, res/res_chan_stats.c, main/cdr.c, main/manager_bridges.c, main/manager.c, channels/chan_skinny.c, tests/test_devicestate.c, res/res_pjsip_mwi.c, tests/test_taskprocessor.c, tests/test_stasis.c, res/parking/parking_manager.c, channels/chan_mgcp.c, res/res_security_log.c, main/pbx.c, main/ccss.c, apps/app_meetme.c, include/asterisk/taskprocessor.h, res/parking/parking_applications.c, channels/sig_pri.c, apps/app_queue.c, main/cel.c, main/stasis.c, channels/chan_dahdi.c, main/stasis_message_router.c, funcs/func_presencestate.c, apps/confbridge/confbridge_manager.c, res/res_agi.c, res/res_stasis_test.c, main/manager_channels.c, main/manager_mwi.c, res/res_pjsip_refer.c, apps/app_voicemail.c, main/stasis_cache.c, main/stasis_wait.c, res/stasis/app.c, include/asterisk/stasis_internal.h, channels/chan_sip.c, main/manager_endpoints.c: Remove dispatch object allocation from Stasis publishing While looking for areas for performance improvement, I realized that an unused feature in Stasis was negatively impacting performance. When a message is sent to a subscriber, a dispatch object is allocated for the dispatch, containing the topic the message was published to, the subscriber the message is being sent to, and the message itself. The topic is actually unused by any subscriber in Asterisk today. And the subscriber is associated with the taskprocessor the message is being dispatched to. First, this patch removes the unused topic parameter from Stasis subscription callbacks. Second, this patch introduces the concept of taskprocessor local data, data that may be set on a taskprocessor and provided along with the data pointer when a task is pushed using the ast_taskprocessor_push_local() call. This allows the task to have both data specific to that taskprocessor, in addition to data specific to that invocation. With those two changes, the dispatch object can be removed completely, and the message is simply refcounted and sent directly to the taskprocessor. Review: https://reviewboard.asterisk.org/r/2884/ * main/manager_system.c, tests/test_stasis.c, main/manager_channels.c, main/manager_mwi.c, main/stasis_cache_pattern.c, include/asterisk/vector.h (added), res/stasis/app.c, main/channel_internal_api.c, include/asterisk/stasis.h, apps/app_queue.c, main/cel.c, main/stasis.c, tests/test_stasis_endpoints.c, main/cdr.c, main/manager_bridges.c, main/manager.c: Optimize how Stasis forwards are dispatched This patch optimizes how forwards are dispatched in Stasis. Originally, forwards were dispatched as subscriptions that are invoked on the publishing thread. This did not account for the vast number of forwards we would end up having in the system, and the amount of work it would take to walk though the forward subscriptions. This patch modifies Stasis so that rather than walking the tree of forwards on every dispatch, when forwards and subscriptions are changed, the subscriber list for every topic in the tree is changed. This has a couple of benefits. First, this reduces the workload of dispatching messages. It also reduces contention when dispatching to different topics that happen to forward to the same aggregation topic (as happens with all of the channel, bridge and endpoint topics). Since forwards are no longer subscriptions, the bulk of this patch is simply changing stasis_subscription objects to stasis_forward objects (which, admittedly, I should have done in the first place.) Since this required me to yet again put in a growing array, I finally abstracted that out into a set of ast_vector macros in asterisk/vector.h. Review: https://reviewboard.asterisk.org/r/2883/ * configure, include/asterisk/autoconfig.h.in, configs/stasis.conf.sample (removed), include/asterisk/sem.h (added), configure.ac, include/asterisk/stasis.h, main/taskprocessor.c, main/sem.c (added), main/stasis.c, main/stasis_config.c (removed), include/asterisk/taskprocessor.h: Taskprocessor optimization; switch Stasis to use taskprocessors This patch optimizes taskprocessor to use a semaphore for signaling, which the OS can do a better job at managing contention and waiting that we can with a mutex and condition. The taskprocessor execution was also slightly optimized to reduce the number of locks taken. The only observable difference in the taskprocessor implementation is that when the final reference to the taskprocessor goes away, it will execute all tasks to completion instead of discarding the unexecuted tasks. For systems where unnamed semaphores are not supported, a really simple semaphore implementation is provided. (Which gives identical performance as the original taskprocessor implementation). The way we ended up implementing Stasis caused the threadpool to be a burden instead of a boost to performance. This was switched to just use taskprocessors directly for subscriptions. Review: https://reviewboard.asterisk.org/r/2881/ 2013-09-30 15:55 +0000 [r400141] Kinsey Moore * configs/pjsip.conf.sample, res/res_pjsip_outbound_registration.c, configs/sip.conf.sample, CHANGES, /, channels/chan_sip.c: chan_sip: Allow Asterisk to retry after 403 on register This adds a global option in chan_sip to allow it to continue attempting registration if a 403 is received, clearing the cached nonce and treating it as a non-fatal response. Normally, this would cause registration attempts to that endpoint to stop. This also adds a similar per-outbound-registration option to chan_pjsip which allows the retry interval to be altered for 403 responses to REGISTER requests. (closes issue ASTERISK-17138) Review: https://reviewboard.asterisk.org/r/2874/ Reported by: Rudi ........ Merged revisions 400137 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400140 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-30 15:24 +0000 [r400138] David M. Lee * main/astobj2.c, main/stasis.c, main/stasis_message_router.c, main/taskprocessor.c, include/asterisk/stasis_message_router.h, res/res_pjsip/include/res_pjsip_private.h, tests/test_stasis.c: Stasis performance improvements This patch addresses several performance problems that were found in the initial performance testing of Asterisk 12. The Stasis dispatch object was allocated as an AO2 object, even though it has a very confined lifecycle. This was replaced with a straight ast_malloc(). The Stasis message router was spending an inordinate amount of time searching hash tables. In this case, most of our routers had 6 or fewer routes in them to begin with. This was replaced with an array that's searched linearly for the route. We more heavily rely on AO2 objects in Asterisk 12, and the memset() in ao2_ref() actually became noticeable on the profile. This was #ifdef'ed to only run when AO2_DEBUG was enabled. After being misled by an erroneous comment in taskprocessor.c during profiling, the wrong comment was removed. Review: https://reviewboard.asterisk.org/r/2873/ 2013-09-28 22:56 +0000 [r400058-400121] Matthew Jordan * res/res_pjsip_notify.c, configs/pjsip_notify.conf.sample (added): res_pjsip_notify: Add documentation We forgot to add documentation for res_pjsip_notify, which would prevent it from being loaded. Whoops. This patch also updates res_pjsip_notify to use pjsip_notify.conf, which now has its own sample file in the configs directory as well. Review: https://reviewboard.asterisk.org/r/2835/ * res/res_rtp_asterisk.c, /: res_rtp_asterisk: Correct erroneous lost packet information in RTCP reports RTCP's calculation of the number of lost packets in an RTP stream is based on that stream's sequence number count, the number of received packets, and how many packets we expect to receive. When the SSRC for an RTP stream changes, there can - and almost always will be - a large jump in the next packet's timestamp and sequence number. If we don't reset the number of received packets, sequence number count, and other metrics used by RTCP, the next RR/SR report will use the previous SSRC's values to calculate the lost packet count for the new SSRC - resulting in a very large number of lost packets. This patch modifies res_rtp_asterisk such that, if it detects a SSRC change, it will reset the various values used by the RTCP calculations. From the perspective of RTCP, this appears as a new media stream - which is what it is. Review: https://reviewboard.asterisk.org/r/2886/ (closes issue AST-1174) Reported by: Thomas Arimont ........ Merged revisions 400089 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400093 from http://svn.asterisk.org/svn/asterisk/branches/11 * configure.ac, /, configure: Add check for openSUSE when detecting bfd library In ASTERISK-17842, some additional library checks were added to the configure script so that the bfd library could be found on CentOS and Fedora systems. As it turns out, openSUSE requires an additional library. This patch adds another check to the configure script for openSUSE that will add that library. Review: https://reviewboard.asterisk.org/r/2885/ (closes issue AST-1169) Reported by: Guenther Kelleter ........ Merged revisions 400073 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400075 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/cdr.c: CDR: Improve handling of parking; resolve assertion when originating into park This patch covers two problems: 1) Currently, when a call is transferred into a parking lot from a bridge (using either the blind transfer or one touch parking mechanisms), the application fails to be set to "Park" in the resulting CDR record for the parked channel. This is due to the ParkedCall message arriving before the BridgeEnter for the channel entering the parking bridge. The ParkedCall message isn't handled as the CDR for the channel has already been finalized (due to the channel having left its two party bridge), and the BridgeEnter - which creates the new CDR - doesn't have the parking information. This patch modifies the behavior so that reception of a ParkedCall message will - if not handled by a CDR chain - cause a new CDR to be created and put into the Parking state. 2) It fixes a FRACK that occurred when a channel is originated into a parking space. The DialedPending state - which occurs for both Dialed and Originated channels - assumed that it couldn't handle the parking transitions due to it having a Party B; however, Originated channels don't have a Party B. As such, the existing CDR needs to transition into the parking state - this patch does that. Review: https://reviewboard.asterisk.org/r/2877/ (closes issue ASTERISK-22482) Reported by: Richard Mudgett * apps/app_queue.c: app_queue: Make manager events tolerant of Local channel shenanigans app_queue currently attempts to handle Local channel optimizations in an effort to provide accurate information in Stasis messages (and their corresponding AMI events) as well as the Queue log. Sometimes, however, things don't go as planned. Consider the following scenario: SIP/foo <-> L;1 <-> L;2 <-> SIP/agent SIP/agent answers, triggering a Local channel optimization. app_queue will normally do the following: * Listen for the Local optimization events and update our agent accordingly to SIP/agent in the queue log and messages * When we get a hangup, publish the AgentComplete event based on our information (SIP/foo and SIP/agent) However, as with all things that depend on sanity from something as capricious as Local channels, things can go wrong: (1) SIP/agent immediately hangs up upon answering. This triggers a race condition between termination messages coming from SIP/agent and the ongoing Local channel optimization messages. (Note that this can also occur with SIP/foo) (2) In a race condition, Asterisk can (rarely) deliver the hangup messages prior to the Local channel optimization. In that case, the messages *may* arrive to app_queue in the following order: * Hangup SIP/Agent * Hangup SIP/foo * Optimize L;1/L;2 * Hangup L;2 * Hangup L;1 When app_queue receives the hangup of the agent or the caller, it will attempt to publish the AgentComplete event. However, it now has a problem - it thinks its agent is the ;1 side of the Local channel, as it never received the optimization event. At the same time, that channel is already gone. This results in getting NULL from the Stasis cache. What's more, we can't really wait for the optimization message, as we are currently handling the hangup of the channel that the optimization event would tell us to use. This patch modifies the behavior in app_queue such that, since we still have a lot of pertinent queue information (interface, queue name, etc.), we now raise the event with what information we know. The channels involved now may or may not be present. Users will still at least get the "AgentComplete" event, which "completes" the known Agent information. Review: https://reviewboard.asterisk.org/r/2878/ (closes issue ASTERISK-22507) Reported by: Richard Mudgett * main/manager.c: manager: Fix crash when appending a manager channel variable In r399887, a minor performance improvement was introduced by not allocating the manager variable struct if it wasn't used. Unfortunately, when directly accessing an ast_channel struct, manager assumed that the struct was always allocated. Since this was no longer the case, things got a bit crashy. This fixes that problem by simply bypassing appending variables if the manager channel variable struct isn't there. 2013-09-27 21:56 +0000 [r400015-400020] Richard Mudgett * apps/app_cdr.c, res/res_parking.c: app_cdr and res_parking: Fix some resource leaks. * app_cdr left the ResetCDR application registered. * res_parking leaked a ref to config global. (closes issue ASTERISK-22566) Reported by: Corey Farrell Patches: ASTERISK-22566-r2.patch (license #5909) patch uploaded by Corey Farrell * /, channels/chan_sip.c, channels/sip/reqresp_parser.c: chan_sip: Increase some scratch buffer sizes dealing with caller id. * Eliminated an unnecessary initialization in check_user_full(). (closes issue ASTERISK-22477) Reported by: Michael Shepelev ........ Merged revisions 400013 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 400014 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-27 18:26 +0000 [r399990] Kevin Harwell * include/asterisk/res_pjsip.h, res/res_pjsip.exports.in, res/res_pjsip.c, res/res_pjsip_session.c: res_pjsip: crash when using localnet and external_signaling_address options There was a collision of mod_data use on the transaction between using a nat hook and an session response callback. During state change it was assumed what was in the mod_data was nothing or the response callback. However, it was possible for it to also contain a nat hook thus resulting in a bad cast and a crash. Added the ability to store multiple data elements in mod_data via a hash table. In this instance, mod_data now stores a hash table of the two values that can be retrieved using an associated string key. (closes issue ASTERISK-22394) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2843/ 2013-09-27 17:34 +0000 [r399976] Jonathan Rose * /, channels/chan_sip.c, channels/sip/include/sip.h: chan_sip: Reject calls on 200 OKs if no SDP has been received When Asterisk receives a 200 OK in response to an invite, that peer should have sent an SDP at some point by then. If the channel has never received an SDP, media won't have been set and the remote address won't be known. Endpoints in general should not be doing this. This patch makes it so that Asterisk will simply hang up a call if it sends a 200 OK at this point. So far this odd behavior for endpoints has only been observed in tests which involved manually created SIP transactions in SIPp. (closes issue ASTERISK-22424) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/2827/ ........ Merged revisions 399939 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399962 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-27 17:03 +0000 [r399937] Richard Mudgett * include/asterisk/astobj2.h, tests/test_astobj2.c, main/astobj2.c: astobj2: Remove OBJ_CONTINUE support. OBJ_CONTINUE was a strange feature that came into the world under suspicious circumstances to support an abuse of the ao2_container by chan_iax2. Since chan_iax2 no longer uses OBJ_CONTINUE, it is safe to remove it. The simplified code should help performance slightly and make understanding the code easier. Review: https://reviewboard.asterisk.org/r/2887/ 2013-09-27 14:29 +0000 [r399924] Mark Michelson * bridges/bridge_native_rtp.c: Fix refleaks of ast_rtp_instance structures. These refleaks were causing bridged calls not to close their RTP ports. Thus a call would leave open 4 ports (RTP for party A, RTCP for party A, RTP for party B, and RTCP for party B). This led to an eventual depletion of available RTP ports. 2013-09-27 14:01 +0000 [r399912] Kinsey Moore * include/asterisk/cel.h, tests/test_cel.c, main/cel.c: Restore usefulness of the CEL Peer field This change makes the CEL peer field useful again for BRIDGE_ENTER and BRIDGE_EXIT events and fills the field with a comma-separated list of all channels in the bridge other than the channel that is entering or exiting the bridge. Review: https://reviewboard.asterisk.org/r/2840/ (closes issue ASTERISK-22393) 2013-09-26 18:48 +0000 [r399897] Kevin Harwell * res/res_pjsip/security_events.c, res/res_pjsip_registrar.c, include/asterisk/res_pjsip.h, res/res_pjsip.exports.in: pjsip: race condition in registrar While handling a registration request a race condition could occur if/when two+ clients registered at the same time. This happened when one request obtained a copy of the current contacts for an AOR and another request did the same before the first request updated. Thus the second would update and overwrite the first (or vice-versa depending on which actually updated first). In the case of it being the same contact two "add" events would be raised. pjsip registration handling is now serialized to alleviate this issue. (closes issue AST-1213) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/2860/ 2013-09-26 15:41 +0000 [r399887] David M. Lee * main/channel.c: Minor performance bump by not allocate manager variable struct if we don't need it 2013-09-26 14:12 +0000 [r399874] Rusty Newton * apps/app_dial.c: Adding a few words to the Dial option 'r' help text to clarify its tone argument description 2013-09-25 20:36 +0000 [r399842] Richard Mudgett * channels/sig_ss7.c, channels/chan_dahdi.c, /: chan_dahdi: CLI "core stop gracefully" has needless delay for PRI and SS7. The PRI and SS7 link control threads are not stopped correctly when the chan_dahdi.so module is unloaded. The link control threads pri_dchannel() and ss7_linkset() are not awakened from a poll() to cancel the thread. * Added a SIGURG signal after requesting the thread cancel to break the link control thread poll() immediately. For SS7 it was slightly worse, the link poll() timeout would always be whatever was the last libss7 scheduled event time used. If no libss7 scheduled event was pending, the thread could run more often than necessary. * Set nextms to 60 seconds for the ss7_linkset() poll() if there is no other libss7 scheduled event. ........ Merged revisions 399818 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399834 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-25 19:40 +0000 [r399798] Rusty Newton * res/res_pjsip.c: Broke the build - Fixing XML DTD violation added in r399782, missing tags inside a 2013-09-25 19:28 +0000 [r399796] Michael L. Young * /, channels/chan_sip.c: chan_sip: Fix Realtime Peer Update Problem When Un-registering And Expires Header In 200ok 1st Issue When a realtime peer sends an un-REGISTER request, Asterisk un-registers the peer but the database table record still has regseconds and fullcontact for the peer. This results in calls attempting to be routed to the peer which is no longer registered. The expected behavior is to get busy/congested when attempting to call an un-registered peer through the dialplan. What was discovered is that we are clearing out the peer's registration in the database in parse_register_contact() when calling expire_register() but then upon returning from parse_register_contact(), update_peer() is run which stores back in the database table regseconds and fullcontact. 2nd Issue The reporter pointed out that the 200 ok being returned by Asterisk after un-registering a peer contains a Contact header with ;expires= and the Expires header is not set to 0. This is actually a regression. Tests were created for this second issue (ASTERISK-22548). The tests have been reviewed and a Ship It! was received on those tests. This patch does the following: * Do not ignore the Expires header value even when it is set to 0. The patch sets the pvt->expiry earlier on in the function so that it is set properly and used. * If pvt->expiry is 0, do not call update_peer since that means the peer has already been un-registered and there is no need to update the database record again since nothing has changed. (closes issue ASTERISK-22428) Reported by: Ben Smithurst Tested by: Ben Smithurst, Michael L. Young Patches: asterisk-22428-rt-peer-update-and-expires-header.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2869/ ........ Merged revisions 399794 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399795 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-25 18:36 +0000 [r399781] Rusty Newton * res/res_pjsip.c: Fixing documentation for the configOption "external_media_address" of both Endpoints and Transports Re-using some of Mark Michelson's text from an E-mail discussion for: * Modifying synopsis for both options * Adding description to both options * Changing name of "external_media_address" for Endpoint configuration to "media_address" in anticipation of the option name being changed. (As it is not really specific to external destinations) (issue ASTERISK-22405) (closes issue ASTERISK-22405) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2850/ 2013-09-24 22:50 +0000 [r399736-399749] Richard Mudgett * main/astobj2.c: astobj2: Made use OBJ_SEARCH_xxx identifiers as field enum values internally. * Made ao2_unlink to protect itself from stray OBJ_SEARCH_xxx values passed in. * channels/chan_iax2.c, /: chan_iax2: Prevent some needless breaking of the native IAX2 bridge. * Clean up some twisted code in the iax2_bridge() loop. * Add AST_CONTROL_VIDUPDATE and AST_CONTROL_SRCCHANGE to a list of frames to prevent the native bridge loop from breaking. * Passing the AST_CONTROL_T38_PARAMETERS frame should also allow FAX over a native IAX2 bridge. (issue ABE-2912) Review: https://reviewboard.asterisk.org/r/2870/ ........ Merged revisions 399697 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399708 from http://svn.asterisk.org/svn/asterisk/branches/11 For v12 and above this is really just documentation until IAX2 native bridging is restored. 2013-09-24 19:22 +0000 [r399666-399695] Matthew Jordan * apps/app_queue.c: app_queue: Don't be quite so aggressive in initializing the array We only need the first character. * apps/app_queue.c: app_queue: Initialize array holding MixMonitor exec options If the channel variable MONITOR_EXEC is set, app_queue will pass the specified execution parameters to the MixMonitor application when a queue is recorded. If that channel variable is not set, the buffer that holds the escaped value was not being initialized to NULL, and so would be passed to the MixMonitor application with garbage. Hilarity ensued as app_mixmonitor attempted to execute gobeldy-gook. * main/cdr.c, main/stasis_bridges.c, tests/test_cdr.c: Fix a performance problem CDRs There is a large performance price currently in the CDR engine. We currently perform two ao2_callback calls on a container that has an entry for every channel in the system. This is done to create matching pairs between channels in a bridge. As such, the portion of the CDR logic that this patch deals with is how we make pairings when a channel enters a mixing bridge. In general, when a channel enters such a bridge, we need to do two things: (1) Figure out if anyone in the bridge can be this channel's Party B. (2) Make pairings with every other channel in the bridge that is not already our Party B. This is a two step process. In the first step, we look through everyone in the bridge and see if they can be our Party B (single_state_process_bridge_enter). If they can - yay! We mark our CDR as having gotten a Party B. If not, we keep searching. If we don't find one, we wait until someone joins who can be our Party B. Step 2 is where we changed the logic (handle_bridge_pairings and bridge_candidate_process). Previously, we would first find candidates - those channels in the bridge with us - from the active_cdrs_by_channel container. Because a channel could be a candidate if it was Party B to an item in the container, the code implemented multiple ao2_container callbacks to get all the candidates. We also had to store them in another container with some other meta information. This was rather complex and costly, particularly if you have 300 Local channels (600 channels!) going at once. Luckily, none of it is needed: when a channel enters a bridge (which is when we're figuring all this stuff out), the bridge snapshot tells us the unique IDs of everyone already in the bridge. All we need to do is: For all channels in the bridge: If the channel is us or our Party B that we got in step 1, skip it Compare us and the candidate to figure out who is Party A (based on some specific rules) If we are Party A: Make a new CDR for us, append it to our chain, and set the candidate as Party B If they are Party A: If they don't have a Party B: Make a new CDR for them, append us to their chain, and us as Party B Otherwise: Copy us over as Party B on their existing CDR. This patch does that. Because we now use channel unique IDs to find the candidates during bridging, active_cdrs_by_channel now looks up things using uniqueid instead of channel name. This makes the more complex code simpler; it does, however, have the drawback that dialplan applications and functions will be slightly slower as they have to iterate through the container looking for the CDR by name. That's a small price to pay however as the bridging code will be called a lot more often. This patch also does two other minor changes: (1) It reduces the container size of the channels in a bridge snapshot to 1. In order to be predictable for multi-party bridges, the order of the channels in the container must be stable; that is, it must always devolve to a linked list. (2) CDRs and the multi-party test was updated to show the relationship between two dialed channels. You still want to know if they talked - previously, dialed channels were always ignored, which is wrong when they have managed to get a Party B. (closes issue ASTERISK-22488) Reported by: Richard Mudgett Review: https://reviewboard.asterisk.org/r/2861/ 2013-09-23 12:02 +0000 [r399624] Joshua Colp * res/res_pjsip.c, res/res_pjsip_session.c: Fix crash in res_pjsip on load if error occurs, and prevent unloading of res_pjsip and res_pjsip_session. During load time in res_pjsip if an error occurred the operation would attempt to rollback all operations done during load. This is not permitted by PJSIP as it will assert if the operation has not been done. This fix changes the code so it will only rollback what has been initialized already. Further changes also prevent res_pjsip and res_pjsip_session from being unloaded. This is due to limitations within PJSIP itself. The library environment can only be changed to a certain extent and does not provide the ability, currently, to deinitialize certain required functionality. (closes issue ASTERISK-22474) Reported by: Corey Farrell 2013-09-21 04:48 +0000 [r399576-399607] Richard Mudgett * res/res_rtp_asterisk.c: res_rtp_asterisk: Fix ref leaks in ast_rtcp_read(). Moved rtcp_report RAII_VAR declaration into the loop so it is unref'ed after every loop. Moved message_blob to loop and switched it to a regular variable. The regular variable was used since message_blob is used in a very contained way. (closes issue ASTERISK-22565) Reported by: Corey Farrell Patches: rtcp_report-leak.patch (license #5909) patch uploaded by Corey Farrell Tested by: Corey Farrell * main/media_index.c: media_index: Fix process_description_file() memory leak of file_id_persist. * main/features_config.c: features_config: Fix config ref leak of parkinglots. This leak happend for just about every channel created. * apps/app_queue.c: app_queue: Fix json blob ref leak. The json ref from queue_member_blob_create() was never released. * main/json.c: json: Make it obvious that ast_json_unref() is NULL safe. It looked like the safety check was done after the NULL pointer was used. 2013-09-20 22:41 +0000 [r399565] Kinsey Moore * main/config_options.c, /: Ensure global types in the config framework are initialized If a config object was allocated but one of its global objects was never encountered, then the global object's defaults were never applied. Ensure that global objects are initialized properly upon allocation instead of on configuration. Review: https://reviewboard.asterisk.org/r/2866/ ........ Merged revisions 399564 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-20 22:04 +0000 [r399553] Jonathan Rose * main/dial.c: originate/call forwarding: Fix a crash when forwarding a call from originate (closes issue ASTERISK-22487) Reported by: David M. Lee Review: https://reviewboard.asterisk.org/r/2868/ 2013-09-20 16:17 +0000 [r399531] Joshua Colp * channels/chan_pjsip.c: Add a missing session supplement unregistration in chan_pjsip for ACKs. (closes issue ASTERISK-22453) Reported by: Corey Farrell Patches: chan_pjsip_session_unregister_supplement.patch uploaded by Corey Farrell (license 5909) 2013-09-20 14:25 +0000 [r399514] Kevin Harwell * /, main/logger.c: Fix memory leak in logger. Fixed a memory leak discovered in the logger where a temporary string buffer was not being freed. (closes issue ASTERISK-22540) Reported by: John Hardin ........ Merged revisions 399513 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-19 23:16 +0000 [r399501] Richard Mudgett * main/optional_api.c: optional_api: Make always use the standard malloc functions even with MALLOC_DEBUG. 2013-09-19 16:53 +0000 [r399458] Jonathan Rose * /, channels/chan_sip.c: chan_sip: Make direct media reinvites for T38 put Asterisk in the media path Prior to this patch, Asterisk would incorrectly use the previous endpoint addresses in SDP in spite of providing its own port. T38 is never meant to be done through directmedia and Asterisk should always be in the media path for these streams. (closes issue ASTERISK-17273) Reported by: Kevin Stewart (closes issue ASTERISK-18706) Reported by: Jeremy Kister Review: https://reviewboard.asterisk.org/r/2853/ ........ Merged revisions 399456 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399457 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-18 19:59 +0000 [r399404] Kinsey Moore * main/abstract_jb.c, /: Fix jitter buffer log file creation This adjusts '/'-to-'#' replacement to replace all instances of '/' instead of just the first to ensure that the jitter buffer log file gets the correct name as per Richard Kenner's suggestion. (closes issue ASTERISK-21036) Reported by: Richard Kenner ........ Merged revisions 399402 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399403 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-18 17:23 +0000 [r399365-399376] Matthew Jordan * /, build_tools/prep_tarball: Update prep_tarball with new documentation files on the Asterisk wiki This will now pull both a command reference for the version being prepared, as well as an Admin Guide that applies to all versions of Asterisk. (issue ASTERISK-22439) Reported by: Olle Johansson ........ Merged revisions 399351 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399373 from http://svn.asterisk.org/svn/asterisk/branches/11 * bridges/bridge_softmix.c, /: Add a WARNING in bridge_softmix when a timing module isn't loaded If bridge_softmix fails to be created because no timing source is present in Asterisk, this will currently fail gracefully but with (most likely) a generic error message by whatever module tried to create the softmix bridge. This patch adds a more explicit warning so you can actually diagnose and fix the problem. Review: https://reviewboard.asterisk.org/r/2857/ ........ Merged revisions 399353 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-18 14:34 +0000 [r399339] Kevin Harwell * res/res_pjsip_messaging.c: res_pjsip_messaging: Register message technology as pjsip pjsip's message technology was being registered as 'sip', which was causing it to not load due it conflicting with chan_sip's registered 'sip' technology for messaging. It now registers as 'pjsip'. However, due to this change the "to" field for outgoing pjsip messages need to be prefixed with 'pjsip:' instead of 'sip:'. Incoming messages to res_pjsip_messaging will automatically have their "to" fields altered in order to accommodate the change. Outgoing messages also handle changing it back to 'sip' before being sent so the pjsip library will properly handle it. (closes issue ASTERISK-22445) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2833/ 2013-09-18 00:12 +0000 [r399294] Michael L. Young * main/features_config.c: Fix Segfault In features-config.c When Application Has No Arguments Some applications do not require arguments. Therefore, when parsing application maps in features.conf, it is possible that app_data will be set to NULL. * This patch sets app_data to "" if it is NULL. Review: https://reviewboard.asterisk.org/r/2804 2013-09-17 23:08 +0000 [r399283] Mark Michelson * include/asterisk/res_pjsip.h, res/res_pjsip_sdp_rtp.c, res/res_pjsip/pjsip_configuration.c, res/res_pjsip_t38.c: Change the "external_media_address" PJSIP endpoint option to "media_address". The endpoint option does not apply to communication with external entities. Rather, the option is applied to all communications with the endpoint. The external_media_address transport configuration option may override the endpoint option if it turns out that we are going to be communicating with an external entity. Two things of note: 1) I have not updated the XML documentation. This is being taken care of by Rusty as part of his work on issue ASTERISK-22405 2) This commit is likely to cause testsuite failures since there are tests that use the external_media_address endpoint option, and they will need to be changed over. Well, I'm planning to get that updated ASAP after this commit. (closes issue ASTERISK-22528) reported by Rusty Newton 2013-09-17 18:37 +0000 [r399268] Kevin Harwell * main/asterisk.c, /, main/logger.c: Remote console: more output discrepancies The remote console continued to have issues with its output. In this case CLI command output would either not show up (if verbose level = 0) or would contain verbose prefixes (if verbose level > 0) once log messages were sent to the remote console. The fix now now adds verbose prefix data to all new lines contained in a verbose log string. (closes issue ASTERISK-22450) Reported by: David Brillert (closes issue AST-1193) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/2825/ ........ Merged revisions 399267 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-17 17:54 +0000 [r399257] Richard Mudgett * include/asterisk/features_config.h: Fix doxygen to use correct units of features.conf options. 2013-09-17 17:09 +0000 [r399237-399247] Mark Michelson * main/features_config.c, main/bridge_basic.c: Fix other timeouts (atxferloopdelay and atxfernoanswertimeout) to use seconds instead of milliseconds. Thanks to Richard Mudgett for pointing this out. * include/asterisk/features_config.h, main/bridge_basic.c, main/features_config.c: Switch transferdigittimeout to be configured as seconds instead of milliseconds. This was an unintentional consequence of the update of features.conf to use the config framework in Asterisk 12. Thanks to Marco Signorini on the Asterisk developers list for pointing out the problem. 2013-09-17 14:48 +0000 [r399225] Kevin Harwell * /, apps/confbridge/conf_state_multi_marked.c: Confbridge: empty conference not being torn down Confbridge would not properly tear down an empty conference bridge when all users were kicked via end_marked=yes and at least one user was also set to wait_marked. This occurred because while end_marked users were being kicked and at least one was also set to wait_marked then the leave wait_marked handler would be called on that user, but there would be no waiting user (still considered active). The waiting users would decrement and now be negative. The conference would remain, but be put into an inactive state. The solution was to move from the active list to the wait list, those users with wait_marked set right before kicking. This allows both the active and wait users to decrement correctly and the confbridge to tear down properly. A crashed also occurred when trying to list the specific conference from the CLI. This happened because the conference specified was invalid. Since the conference properly tears down now there is no way to reference it thus alleviating the crash as well. (closes issue ASTERISK-21859) Reported by: Chris Gentle Review: https://reviewboard.asterisk.org/r/2848/ ........ Merged revisions 399222 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-16 18:34 +0000 [r399160-399207] Richard Mudgett * tests/test_ari_model.c: Fix module load errors for test_ari_model.so. You cannot use a function pointer variable with an external function from another dynamically loaded module because data variables are always resolved even with RTLD_LAZY. * Added wrapper functions for ast_ari_validate_int() and ast_ari_validate_string() to use instead for the function pointer variable. (closes issue ASTERISK-22457) Reported by: David M. Lee * res/res_speech.exports.in, apps/app_speech_utils.c: app_speech_utils: Fix unresolved symbol ast_speech_get_setting(). Fixes regression introduced by -r374096. * Made res_speech.export.in export ast_* symbols instead of specific functions. * Made app_speech_utils.c declare that it is dependent upon res_speech. (issue ASTERISK-17136) Reported by: Richard Kenner * /, channels/chan_iax2.c: chan_iax2: Fix saving the wrong expiry time in astdb. When a new IAX2 client registers, the astdb database is updated with the value of minregexpire defined in iax.conf instead of using the expiry time that is provided by the client. The provided expiry time of the client is updated after inserting the astdb entry. As a consequence, restarting or reloading asterisk creates clients whose registration may expire before they reregister. The clients are therefore unavailable after minregexpire seconds until they reregister. * Move updating of the expiry time to before inserting into the astdb. (closes issue ASTERISK-22504) Reported by: Stefan Wachtler Patches: chan_iax2.c.patch (license #6533) patch uploaded by Stefan Wachtler ........ Merged revisions 399158 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399159 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-16 02:33 +0000 [r399146] Matthew Jordan * main/cdr.c: Filter internal channels out of bridge enter/leave message handling Some channels exist merely as an implementation detail in Asterisk, such as ConfBridge's announcer/recorder channels. These channels should never be exposed to the outside world, or to interfaces that report on Asterisk. We already filter out such channels in snapshot processing; however, we failed to filter out bridge related messages that involved these channels. This patch filters out bridge related messages that are for such channels. This prevents a spurious WARNING message from being displayed when those channels move in and out of bridges. 2013-09-13 22:05 +0000 [r399136] Richard Mudgett * channels/chan_sip.c, res/stasis/control.c, main/bridge.c, main/bridge_basic.c, main/core_unreal.c, res/parking/parking_applications.c, main/core_local.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, include/asterisk/features.h, main/channel.c, include/asterisk/bridge_channel.h, res/parking/parking_tests.c, main/features.c, tests/test_cel.c, main/bridge_channel.c, include/asterisk/bridge.h, apps/confbridge/conf_chan_announce.c, tests/test_cdr.c, res/res_pjsip_refer.c: Restore Dial, Queue, and FollowMe 'I' option support. The Dial, Queue, and FollowMe applications need to inhibit the bridging initial connected line exchange in order to support the 'I' option. * Replaced the pass_reference flag on ast_bridge_join() with a flags parameter to pass other flags defined by enum ast_bridge_join_flags. * Replaced the independent flag on ast_bridge_impart() with a flags parameter to pass other flags defined by enum ast_bridge_impart_flags. * Since the Dial, Queue, and FollowMe applications are now the only callers of ast_bridge_call() and ast_bridge_call_with_flags(), changed the calling contract to require the initial COLP exchange to already have been done by the caller. * Made all callers of ast_bridge_impart() check the return value. It is important. As a precaution, I also made the compiler complain now if it is not checked. * Did some cleanup in parking_tests.c as a result of checking the ast_bridge_impart() return value. An independent, but associated change is: * Reduce stack usage in ast_indicate_data() and add a dropping redundant connected line verbose message. (closes issue ASTERISK-22072) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/2845/ 2013-09-13 20:54 +0000 [r399100] David M. Lee * main/astobj2.c, /: Don't write to /tmp/refs when REF_DEBUG is not defined. If MALLOC_DEBUG is enabled, then the debug destructor for the container is used, which would erroneously write to /tmp/refs. This patch only uses the debug destructor if ref_debug is used. (closes issue ASTERISK-22536) ........ Merged revisions 399098 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399099 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-13 14:49 +0000 [r399083] Mark Michelson * res/res_pjsip.c, res/res_pjsip_pubsub.c, res/res_pjsip_session.c, include/asterisk/res_pjsip.h, res/res_pjsip.exports.in: Create more accurate Contact headers for dialogs when we are the UAS. (closes issue AST-1207) reported by John Bigelow Review: https://reviewboard.asterisk.org/r/2842 2013-09-13 14:25 +0000 [r399064] Rusty Newton * res/res_pjsip_endpoint_identifier_ip.c: Broke the build! Forgot para tags within my description. https://bamboo.asterisk.org/bamboo/browse/AST-ATRUNKBUILD-304 2013-09-13 14:24 +0000 [r399059] Mark Michelson * res/res_pjsip_outbound_authenticator_digest.c, res/res_pjsip_authenticator_digest.c, res/res_pjsip/config_auth.c: Change how realms are handled for outbound authentication. With this change, if no realm is specified in an outbound auth section, then we will simply match the realm that was present in the 401/407 challenge. (closes issue ASTERISK-22471) Reported by George Joseph (closes issue ASTERISK-22386) Reported by Rusty Newton Patches: outbound_auth_realm_v4.patch uploaded by George Joseph (License #6322) 2013-09-13 14:21 +0000 [r399039-399049] David M. Lee * res/res_pjsip_logger.c, res/res_rtp_asterisk.c, res/res_pjsip_log_forwarder.c (added): res_pjsip: Forward PJSIP logging to Asterisk logging This patch uses PJSIP's pj_log_set_log_func() to forward PJSIP's log messages to Asterisk's logger. This is done in a new module: res_pjsip_log_forwarder.so. This patch sets defaultenabled on the existing res_pjsip_logger.so to no, since logging every SIP packet seems a bit odd to do by default, and is (hopefully) less necessary with regular PJSIP logging. It also removes res_rtp_asterisk's disabling of PJSIP logging. (closes issue ASTERISK-22360) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/2830/ * res/res_http_websocket.c: ARI: Fix WebSocket response when subprotocol isn't specified When I moved the ARI WebSocket from /ws to /ari/events, I added code to allow a WebSocket to connect without specifying the subprotocol if there's only one subprotocol handler registered for the WebSocket. Naively, I coded it to always respond with the subprotocol in use. Unfortunately, according to RFC 6455, if the server's response includes a subprotocol header field that "indicates the use of a subprotocol that was not present in the client's handshake [...], the client MUST _Fail the WebSocket Connection_.", emphasis theirs. This patch correctly omits the Sec-WebSocket-Protocol if one is not specified by the client. (closes issue ASTERISK-22441) Review: https://reviewboard.asterisk.org/r/2828/ 2013-09-13 13:54 +0000 [r399035] Kinsey Moore * /, apps/app_meetme.c: Fix several crashes in MeetMeAdmin This change ensures that MeetMeAdmin commands requiring a user actually get a user and fixes another issue where an extra dereference could occur for a last-entered user being ejected if a user identifier was also provided. (closes issue ASTERISK-21907) Reported by: Alex Epshteyn Review: https://reviewboard.asterisk.org/r/2844/ ........ Merged revisions 399033 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 399034 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-13 13:27 +0000 [r399031] Rusty Newton * res/res_pjsip_endpoint_identifier_ip.c: 'identify' configObject doesn't have a synopsis Add a straightforward synopsis and description to the identify config object in XML documentation. (issue ASTERISK-22311) (closes issue ASTERISK-22311) Reported By: Rusty Newton 2013-09-12 23:41 +0000 [r399019-399021] Richard Mudgett * main/bridge.c: CLI bridge: Fix "bridge destroy " and "bridge kick " tab completion. These two commands must deal with the live bridges container for tab completion and not the stasis cache. * main/bridge.c: astobj2: Register the bridges container for debug inspection. 2013-09-12 23:21 +0000 [r399017] Rusty Newton * res/res_pjsip_acl.c: Documentation fix and improvements to XML configuration help res_pjsip_acl * One bug fix. Made the synopsis for "type" to accurate. * changing the usage of "IP-domains" to "IP addresses" * clarifying the usage for the options, by adding a relevant description for each * modified other areas of the XML help for clarity, such as the module description and a few synopsis changes here and there. See the patch. (issue ASTERISK-22458) (closes issue ASTERISK-22458) Reported By: Rusty Newton Review: https://reviewboard.asterisk.org/r/2823/ 2013-09-12 20:20 +0000 [r398991] Jonathan Rose * /, channels/chan_sip.c, channels/sip/include/sip.h: chan_sip: Revert r398835 due to failing tests involving originate (issue ASTERISK-22424) Reported by: Jonathan Rose ........ Merged revisions 398977 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398986 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-12 16:38 +0000 [r398938] Richard Mudgett * main/core_unreal.c: core_local: Fix memory corruption race condition. The masquerade super test is failing on v12 with high fence violations and crashing. The fence violations are showing that party id allocated memory strings are somehow getting corrupted in the bridge_reconfigured_connected_line_update() function. The invalid string values happen to be the freed memory fill pattern. After much puzzling, I deduced that the bridge_reconfigured_connected_line_update() is copying a string out of the source channel's caller party id struct just as another thread is updating it with a new value. The copying thread is using the old string pointer being freed by the updating thread. A search of the code found the unreal_colp_redirect_indicate() routine updating the caller party id's without holding the channel lock. A latent bug in v1.8 and v11 hatched in v12 because of the bridging and connected line changes. :) (issue ASTERISK-22221) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2839/ 2013-09-12 15:23 +0000 [r398927] David M. Lee * res/res_pjsip.c: Fix symbol collision with pjsua. We shouldn't be exporting any symbols that start with pjsip_. 2013-09-12 00:04 +0000 [r398882-398886] Rusty Newton * apps/app_queue.c, /: 'queue add member' help text correction You are adding dial strings to the queue, not channels. An aribitrary string could be used, but you are typically referencing a channel. Correcting the command help text. (issue ASTERISK-22263) (closes issue ASTERISK-22263) Reported By: Rusty Newton ........ Merged revisions 398884 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398885 from http://svn.asterisk.org/svn/asterisk/branches/11 * configs/chan_dahdi.conf.sample, /: Documentation fix - waitfordialtone is not boolean, it's time in milliseconds Changing text in chan_dahdi.conf sample to be accurate. (issue ASTERISK-22308) (closes issue ASTERISK-22308) Reported By: Malcolm Davenport ........ Merged revisions 398880 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398881 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-11 19:56 +0000 [r398837] Jonathan Rose * channels/sip/include/sip.h, /, channels/chan_sip.c: chan_sip: Reject calls without prior SDP on 200 OK If we receive a 200 OK without SDP, we will now check to see if the remote address has been established for that channel's RTP session and if the to tag for that channel has changed from the most recent to tag in a response less than 200. If either a change has been made since the last to-tag was received or the remote address is unset, then we will drop the call. (closes issue ASTERISK-22424) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/2827/diff/#index_header ........ Merged revisions 398835 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398836 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-11 18:02 +0000 [r398821] Russell Bryant * configs/confbridge.conf.sample, /: Fix typo in confbridge.conf.sample The denoise filter requires func_speex, not codec_speex. Fix this in the description of the denoise=yes option in confbridge.conf. ........ Merged revisions 398820 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-11 14:14 +0000 [r398806] Kevin Harwell * res/res_pjsip_caller_id.c, channels/chan_pjsip.c: pjsip: reinvite for connected line updates occurs when it should not Connected line updates are now only sent out if an actual update needs to occur. This happens under the following conditions: 1. The endpoint we are sending to is trusted. 2. Either a P-Asserted-Identity or Remote Party-ID header needs to be added/sent. 3. The connected id's number and name are valid. Also added an SDP when an update is sent out. (closes issue AST-1212) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/2831/ 2013-09-10 18:03 +0000 [r398759] Richard Mudgett * res/res_musiconhold.c, main/indications.c, main/asterisk.c, main/xmldoc.c, main/cli.c, /, funcs/func_dialgroup.c, main/heap.c, res/res_pjsip/pjsip_configuration.c, main/event.c: Fix incorrect usages of ast_realloc(). There are several locations in the code base where this is done: buf = ast_realloc(buf, new_size); This is going to leak the original buf contents if the realloc fails. Review: https://reviewboard.asterisk.org/r/2832/ ........ Merged revisions 398757 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398758 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-10 17:49 +0000 [r398750-398754] David M. Lee * /, utils/check_expr.c: Fixed utils directory breakage from r398748, this time with extra hate. ........ Merged revisions 398752 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398753 from http://svn.asterisk.org/svn/asterisk/branches/11 * utils/ael_main.c, utils/conf2ael.c, utils/check_expr.c, /: Fixed utils directory breakage from r398648 ........ Merged revisions 398748 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398749 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-09 23:23 +0000 [r398726] Richard Mudgett * /, main/astmm.c: MALLOC_DEBUG: Change fence magic number to be completely different from the freed magic number. Race conditions between freeing a nul terminated string and ast_strdup()'ing it are more likely to be detected if the fence and freed magic numbers are completely different. ........ Merged revisions 398703 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398721 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-09 21:59 +0000 [r398694] Mark Michelson * res/res_pjsip_endpoint_identifier_ip.c: Add extra debugging to res_pjsip_endpoint_identifier_ip 2013-09-09 20:12 +0000 [r398638-398651] David M. Lee * main/lock.c, /, main/utils.c, include/asterisk/lock.h: Fix DEBUG_THREADS when lock is acquired in __constructor__ This patch fixes some long-standing bugs in debug threads that were exacerbated with recent Optional API work in Asterisk 12. With debug threads enabled, on some systems, there's a lock ordering problem between our mutex and glibc's mutex protecting its module list (Ubuntu Lucid, glibc 2.11.1 in this instance). In one thread, the module list will be locked before acquiring our mutex. In another thread, our mutex will be locked before locking the module list (which happens in the depths of calling backtrace()). This patch fixes this issue by moving backtrace() calls outside of critical sections that have the mutex acquired. The bigger change was to reentrancy tracking for ast_cond_{timed,}wait, which wrongly assumed that waiting on the mutex was equivalent to a single unlock (it actually suspends all recursive locks on the mutex). (closes issue ASTERISK-22455) Review: https://reviewboard.asterisk.org/r/2824/ ........ Merged revisions 398648 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398649 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/ari/resource_channels.h: Added note about expected behavior of originate (the rest of the commit) * rest-api/api-docs/channels.json: Added note about expected behavior of originate 2013-09-08 23:25 +0000 [r398628] Matthew Jordan * tests/test_cdr.c: Update CDR Unit tests to reflect container changes in r398579 When a channel joins a multi-party bridge, the ordering of the CDRs that is created is determined by the ordering of the channels who happen to be in that bridge. When r398579 changed the number of buckets in the container to something sensible, it changed the ordering that the CDRs was created in, causing one of the multiparty tests to fail. This fixes the test with the now expected ordering. 2013-09-07 01:02 +0000 [r398580-398619] Kinsey Moore * /, res/res_xmpp.c: Prevent XMPP timeout on blank responses Sometimes the Google Voice servers have a bad habit of sending out 1 byte replies to the xmpp resource. When a blank 1 byte reply is received from the socket the buffer attempts to wait (endlessly) for the rest of the reply from google which effectively blocks the socket and google voice calls will no longer come into the server. This patch allows the xmpp module to correctly detect empty packets and send out ping replies to google. It also sets a socket timeout on the default socket which prevents the xmpp socket from closing and preventing future google voice calls from coming into the server. Furthermore instead of sending an empty reply back to google we send a proper xmpp ping reply back. This also adds several more socket messages. (closes issue ASTERISK-22347) Reported by: Andrew Nagy Review: https://reviewboard.asterisk.org/r/2771 Patches: xmpp_fix_1.diff uploaded by Andrew Nagy (License #6524) ........ Merged revisions 398618 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, res/res_xmpp.c, res/res_jabber.c: Multiple revisions 398558,398577 ........ r398558 | kmoore | 2013-09-06 14:28:16 -0500 (Fri, 06 Sep 2013) | 17 lines Fix Jabber/XMPP distributed MWI The mailbox and context are swapped on the receiving end for all users of Jabber and XMPP distributed MWI in Asterisk 1.8 and all more recent versions. This swaps those values to be correct when publishing to the internal event system from Jabber/XMPP distributed MWI state. (closes issue ASTERISK-22435) Reported by: abelbeck Tested by: Michael Keuter Patches: asterisk-1.8-res_jabber-aji_handle_pubsub_event.patch uploaded by abelbeck asterisk-11-res_xmpp-xmpp_pubsub_handle_event.patch uploaded by abelbeck ........ Merged revisions 398523 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ r398577 | kmoore | 2013-09-06 16:00:56 -0500 (Fri, 06 Sep 2013) | 10 lines Commit the remainder of r398523 This is a missing part of the commit in revision 398523 that corrects the name of a variable. (issue ASTERISK-22435) ........ Merged revisions 398576 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398558,398577 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-06 21:16 +0000 [r398579] Richard Mudgett * main/cdr.c: cdr: Change the number of container buckets to be similar to the channels container. * Fix the temporary cdr candidate containers to use a prime number of buckets. 2013-09-06 21:03 +0000 [r398578] Kinsey Moore * /: Unblock r398558 2013-09-06 20:20 +0000 [r398533-398572] Richard Mudgett * main/core_local.c: core_local: Fix LocalOptimizationBegin AMI event missing Source channel snapshot. * Fix the LocalOptimizationBegin AMI event by eliminating an artificial buffer size limitation that is too small anyway. * main/cdr.c: cdr: Fix some ref leaks. * Added missing unregister of the cdr container in cdr_engine_shutdown(). * Fixed ref leak in off nominal path of cdr_object_alloc(). * Removed some unnecessary NULL checks in cdr_object_dtor(). * main/parking.c, main/stasis_config.c, include/asterisk/astobj2.h, main/cel.c, main/features_config.c, apps/app_agent_pool.c, main/cdr.c, main/udptl.c: astobj2: Add warn unused attribute to some functions. * Fixed resulting warnings with improper use of ao2_global_obj_replace(). * Made a couple uses of ao2_global_obj_replace_unref(x, NULL) into the equivalent and more appropriate ao2_global_obj_release() call. 2013-09-06 18:49 +0000 [r398511-398521] Kinsey Moore * res/stasis/app.c, main/http.c: Fix build warnings When AST_DEVMODE is not defined, ast_asserts are not compiled into the binary. In some cases, this means variables are not referenced or are set but unused which causes warnings to show up. (closes issue ASTERISK-22446) Reported by: Jason Parker (qwell) * channels/chan_h323.c, /: Fix chan_h323 compilation This fixes the things in chan_h323 that were missed or ignored in the great channel opaquification and gets chan_h323 back into a compiling state. (closes issue ASTERISK-22365) Reported by: Dmitry Melekhov Patches: chan_h323.patch uploaded by Dmitry Melekhov ........ Merged revisions 398510 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-05 21:46 +0000 [r398381-398498] Richard Mudgett * main/astobj2.c: astobj2: Only define ao2_bt() once. * Make ao2_bt() not use single char variable names. * Fix ao2_bt() formatting. * channels/chan_iax2.c, /: chan_iax2: Reduce indentation in __attempt_transmit(). * Reduce indentation in __attempt_transmit(). * Don't update the static last error time variable every time in __schedule_action() and socket_read(). ........ Merged revisions 398456 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398457 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/chan_iax2.c, /: chan_iax2: Fix stray reference to worker thread idle_list. * Fix stray reference to idle_list in cleanup_thread_list(). This may be the reason for the note in iax2_process_thread() about threads not being removed from the task lists. * Move cleanup_thread_list(&idle_list) to after the other lists are cleaned up. ........ Merged revisions 398416 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398417 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/chan_iax2.c, /: chan_iax2: Fix bridgecallno deadlock avoidance. * Fix bridgecallno deadlock avoidance. When doing deadlock avoidance, you need to retest the status of values for each loop to see if you still need the lock for bridgecallno. * As a safety check, after acquiring the bridgecallno lock you should check if iaxs[bridgecallno] is NULL just like the current callno checks. * Move setting thread->iostate to IAX_IOSTATE_IDLE to after processing any deferred frames to ensure that the iostate is IDLE when it is placed back into the idle list. defer_full_frame() tries to ensure iax2_process_thread() wakes up to process the frame. ........ Merged revisions 398379 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398380 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-05 14:09 +0000 [r398368] Mark Michelson * res/res_pjsip_outbound_registration.c: Clarify server_uri and client_uri registration settings. Used some of Rusty's suggested language plus also included more SIPesque descriptions of where the URIs are actually used in an outgoing REGISTER. (closes issue ASTERISK-22390) reported by Rusty Newton 2013-09-04 23:06 +0000 [r398303] Richard Mudgett * channels/iax2/parser.c, /: chan_iax2: Add missing control frame names to debug frame decode output. ........ Merged revisions 398301 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398302 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-04 22:28 +0000 [r398299] Mark Michelson * res/res_pjsip_outbound_authenticator_digest.c: Give more detail regarding failures to create request with auth credentials. (issue ASTERISK-22386) 2013-09-04 21:36 +0000 [r398283-398286] Jonathan Rose * /, tests/test_voicemail_api.c: unit tests: test_voicemail_api leaks stringfields from snapshots (closes issue ASTERISK-22414) Reported by: Corey Farrell Patches: test_voicemail_api-leaks-11.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 398285 from http://svn.asterisk.org/svn/asterisk/branches/11 * apps/app_voicemail.c, /: app_voicemail: Fix leaking config objects when msg_id doesn't match (issues ASTERISK-22414) Reported by: Corey Farrell Patch: test_voicemail_api-leaks-11.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 398281 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-04 16:00 +0000 [r398237] Richard Mudgett * channels/chan_misdn.c, /: chan_misdn: Fix misdn debug output printed with arbitrary verbose levels. Fix the misdn debug output to remote consoles. chan_misdn uses ast_console_puts() which doesn't know about verbose levels. Better to use ast_verbose() instead. Without this patch the misdn debug messages are appended to the verbose level which ever was set by the message sent to the console before, i.e. any undefined level. (closes issue AST-1218) Reported by: Guenther Kelleter Patches: misdnlog.patch (license #6372) patch uploaded by Guenther Kelleter ........ Merged revisions 398235 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398236 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-04 14:29 +0000 [r398226] Kevin Harwell * res/res_pjsip_outbound_registration.c: Debug messages for pjsip outbound registration Added debug messages indicating that an outbound registration attempt was made and it was successful in pjsip. (closes issue ASTERISK-22388) Reported by: Rusty Newton 2013-09-03 19:49 +0000 [r398215] Alexandr Anikin * /, addons/ooh323c/src/ooh245.c: Fix remote tcs sequence handling on empty tcs received ........ Merged revisions 398214 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-09-03 18:08 +0000 [r398206] Kinsey Moore * res/res_pjsip_dtmf_info.c: Prevent a crash in res_pjsip_dtmf_info.c This change makes sure that a content type header exists before checking the contents of the header against known SIP INFO DTMF content types. 2013-09-03 14:36 +0000 [r398198] David M. Lee * Makefile: Fixed 'make clean' for wiki docs 2013-09-03 14:27 +0000 [r398196] Walter Doekes * /, cel/cel_custom.c: Be a little more verbose when loading cel_custom.conf. Review: https://reviewboard.asterisk.org/r/2805/ ........ Merged revisions 398167 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398168 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-30 20:58 +0000 [r398149] David M. Lee * main/optional_api.c, main/asterisk.c, include/asterisk/optional_api.h: Fix graceful shutdown crash. The cleanup code for optional_api needs to happen after all of the optional API users and providers have unused/unprovided. Unfortunately, regsitering the atexit() handler at the beginning of main() isn't soon enough, since module destructors run after that. 2013-08-30 20:34 +0000 [r398147] Rusty Newton * configs/pjsip.conf.sample: New pjsip.conf.sample (issue ASTERISK-22145) (closes issue ASTERISK-22145) Reported By: Matt Jordan Review: https://reviewboard.asterisk.org/r/2811/ 2013-08-30 19:51 +0000 [r398116-398139] Kevin Harwell * include/asterisk/sorcery.h, res/res_pjsip.c, res/res_pjsip/config_transport.c, main/sorcery.c, res/res_pjsip_outbound_registration.c: Add a reloadable option for sorcery type objects Some configuration objects currently won't place nice if reloaded. Specifically, in this case the pjsip transport objects. Now when registering an object in sorcery one may specify that the object is allowed to be reloaded or not. If the object is set to not reload then upon reloading of the configuration the objects of that type will not be reloaded. The initially loaded objects of that type however will remain. While the transport objects will not longer be reloaded it is still possible for a user to configure an endpoint to an invalid transport. A couple of log messages were added to help diagnose this problem if it occurs. (closes issue ASTERISK-22382) Reported by: Rusty Newton (closes issue ASTERISK-22384) Reported by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2807/ * main/translate.c, main/named_acl.c, main/indications.c, main/config.c, res/res_security_log.c, /, channels/chan_sip.c: Fix various memory leaks main/config.c - cleanup cache fie includes res/res_security_log.c - unregister logger level channesl/chan_sip.c - cleanup io context and notify_types main/translator.c - cleanup at shutdown main/named_acl.c - cleanup cli commands main/indications.c - ast_get_indication_tone() unref default_tone_zone if used (closes issues ASTERISK-22378) Reported by: Corey Farrell Patches: config_shutdown.patch uploaded by coreyfarrell (license 5909) res_security_log.patch uploaded by coreyfarrell (license 5909) chan_sip-11.patch uploaded by coreyfarrell (license 5909) indications_refleak.patch uploaded by coreyfarrell (license 5909) named_acl-cli_unreg-trunk.patch uploaded by coreyfarrell (license 5909) translate_shutdown.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 398102 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398103 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-30 18:35 +0000 [r398100] Matthew Jordan * UPGRADE.txt: Update UPGRADE.txt file for Asterisk 12 This simply pulls in the changes that were breaking from the CHANGES file and updates a few other areas accordingly. It also removes the 10 => 11 notes, which are traditionally removed from each major version and stored in the appropriate UPGRADE-X.txt file. 2013-08-30 18:18 +0000 [r398068] Jonathan Rose * main/config_options.c, main/features_config.c: features_config: Ignore parkinglots in features.conf instead of failing to load Parkinglots are defined in res_features.conf now, but this patch fixes features_config so that features don't fail to load when parkinglots are present in features.conf Review: https://reviewboard.asterisk.org/r/2801/ 2013-08-30 17:57 +0000 [r398062] Kevin Harwell * main/manager.c, /, res/res_agi.c: Memory leak fix ast_xmldoc_printable returns an allocated block that must be freed by the caller. Fixed manager.c and res_agi.c to stop leaking these results. (closes issue ASTERISK-22395) Reported by: Corey Farrell Patches: manager-leaks-12.patch uploaded by coreyfarrell (license 5909) res_agi-xmldoc-leaks.patch uploaded by coreyfarrell (license 5909) ........ Merged revisions 398060 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398061 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-30 17:10 +0000 [r398023-398025] Richard Mudgett * tests/test_substitution.c: test_substitution: Fix failing test. Revert the -r392190 change. The original test was correct. The CDR code was actually returning an unititialized buffer. * /, tests/test_substitution.c: test_substituition: Fix failed test reporting to actually report failure. You cannot put the "Testing pass/fail" on a single line before actually performing the test. Now any additional failure information is logged before the test pass/fail announcement. * Added an additional CDR(answer,u) test. ........ Merged revisions 398018 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 398019 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-30 16:57 +0000 [r398020] Jonathan Rose * main/udptl.c, main/features_config.c: features_config: Don't require features.conf to be present for Asterisk to load (closes issue ASTERISK-22426) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2806/ 2013-08-30 16:26 +0000 [r398002-398016] Kevin Harwell * apps/app_mixmonitor.c, /: Fix memory leaks (closes issue ASTERISK-22368) Reported by: Corey Farrell Patches: issueA22368_mixmonitor_free_filename.patch uploaded by wdoekes (license 5674) ........ Merged revisions 398004 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 398011 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/asterisk.c, /: Check return value on fwrite ........ Merged revisions 398000 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-30 13:39 +0000 [r397985-397989] David M. Lee * build_tools/cflags.xml, configure, res/res_ari_events.c, include/asterisk/http_websocket.h, main/optional_api.c (added), rest-api-templates/swagger_model.py, res/ari/ari_websockets.c, main/asterisk.c, channels/sip/include/sip.h, res/res_ari.c, tests/test_optional_api.c (added), channels/chan_sip.c, include/asterisk/autoconfig.h.in, configure.ac, rest-api-templates/res_ari_resource.c.mustache, res/ari/internal.h, res/res_http_websocket.c, CHANGES, include/asterisk/compiler.h, include/asterisk/ari.h, main/loader.c, include/asterisk/optional_api.h: optional_api: Fix linking problems between modules that export global symbols With the new work in Asterisk 12, there are some uses of the optional_api that are prone to failure. The details are rather involved, and captured on [the wiki][1]. This patch addresses the issue by removing almost all of the magic from the optional API implementation. Instead of relying on weak symbol resolution, a new optional_api.c module was added to Asterisk core. For modules providing an optional API, the pointer to the implementation function is registered with the core. For modules that use an optional API, a pointer to a stub function, along with a optional_ref function pointer are registered with the core. The optional_ref function pointers is set to the implementation function when it's provided, or the stub function when it's now. Since the implementation no longer relies on magic, it is now supported on all platforms. In the spirit of choice, an OPTIONAL_API flag was added, so we can disable the optional_api if needed (maybe it's buggy on some bizarre platform I haven't tested on) The AST_OPTIONAL_API*() macros themselves remained unchanged, so existing code could remain unchanged. But to help with debugging the optional_api, the patch limits the #include of optional API's to just the modules using the API. This also reduces resource waste maintaining optional_ref pointers that aren't used. Other changes made as a part of this patch: * The stubs for http_websocket that wrap system calls set errno to ENOSYS. * res_http_websocket now properly increments module use count. * In loader.c, the while() wrappers around dlclose() were removed. The while(!dlclose()) is actually an anti-pattern, which can lead to infinite loops if the module you're attempting to unload exports a symbol that was directly linked to. * The special handling of nonoptreq on systems without weak symbol support was removed, since we no longer rely on weak symbols for optional_api. [1]: https://wiki.asterisk.org/wiki/x/wACUAQ (closes issue ASTERISK-22296) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2797/ * res/stasis_recording (added), res/ari/resource_recordings.c, res/ari/ari_model_validators.h, res/res_ari_recordings.c, res/res_stasis_playback.c, include/asterisk/stasis_app_recording.h, res/ari/resource_recordings.h, res/res_stasis_recording.c, res/Makefile, res/ari/ari_model_validators.c, rest-api/api-docs/recordings.json: ARI: Implement /recordings/stored API's his patch implements the ARI API's for stored recordings. While the original task only specified deleting a recording, it was simple enough to implement the GET for all recordings, and for an individual recording. The recording playback operation was modified to use the same code for accessing the recording as the REST API, so that they will behave consistently. There were several problems with the api-docs that were also fixed, bringing the ARI spec in line with the implementation. There were some 'wishful thinking' fields on the stored recording model (duration and timestamp) that were removed, because I ended up not implementing a metadata file to go along with the recording to store such information. The GET /recordings/live operation was removed, since it's not really that useful to get a list of all recordings that are currently going on in the system. (At least, if we did that, we'd probably want to also list all of the current playbacks. Which seems weird.) (closes issue ASTERISK-21582) Review: https://reviewboard.asterisk.org/r/2693/ 2013-08-30 01:19 +0000 [r397975-397977] Richard Mudgett * main/pbx.c: pbx.c: Make pbx_substitute_variables_helper_full() not mask variables. * main/pbx.c, tests/test_substitution.c, funcs/func_cdr.c: Revert last commit. * funcs/func_cdr.c, main/pbx.c, tests/test_substitution.c: pbx.c: Make ast_str_substitute_variables_full() not mask variables. 2013-08-30 00:10 +0000 [r397960-397968] Mark Michelson * res/res_pjsip_pidf.c: Sanitize XML output for PIDF bodies. PJSIP's PIDF API does not replace angle brackets with their appropriate counterparts for XML. So we have to do it ourself. In this particular case, the problem had to do with attempting to place an unsanitized SIP URI into an XML node. Now we don't get a 488 from recipients of our PIDF NOTIFYs. * res/res_pjsip_pidf.c: Fix method for creating activities string in PIDF bodies. The previous method did not allocate enough space to create the entire string, but adjusted the string's slen value to be larger than the actual allocation. This resulted in garbled text in NOTIFY requests from Asterisk. This method allocates the proper amount of space first and then writes the content into the buffer. 2013-08-29 22:45 +0000 [r397958] Kevin Harwell * apps/app_verbose.c, main/asterisk.c, channels/chan_misdn.c, /, apps/app_dumpchan.c, main/logger.c: Verbose logging discrepancies Refactored cases where a combination of ast_verbose/options_verbose were present. Also in general tried to eliminate, in as many places as possible, where the options_verbose global variable was being used. Refactored the way local and remote consoles handle verbose message logging in an attempt to solve the various discrepancies that sometimes would show between the two. (closes issue AST-1193) Reported by: Guenther Kelleter Review: https://reviewboard.asterisk.org/r/2798/ ........ Merged revisions 397948 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-29 22:24 +0000 [r397955] Mark Michelson * res/res_pjsip_pubsub.c: Fix when the subscription_terminated callback is called for subscription handlers. The previous placement would result in the resubscribe() callback called instead of the subscription_terminated() callback being called when a subscription was ended via a SUBSCRIBE request. This would result in confusing PJSIP and having it throw an assertion. 2013-08-29 21:34 +0000 [r397946] Kevin Harwell * main/cel.c, main/asterisk.c, main/cdr.c, main/manager.c, main/stasis_config.c, main/file.c, main/app.c, main/config_options.c: Memory leaks fix (closes ASTERISK-22376) Reported by: John Hardin Patches: memleak.patch uploaded by jhardin (license 6512) memleak2.patch uploaded by jhardin (license 6512) 2013-08-29 21:33 +0000 [r397945] Mark Michelson * res/res_pjsip_session.c: Fix a race condition where a canceled call was answered. RFC 5407 section 3.1.2 details a scenario where a UAC sends a CANCEL at the same time that a UAS sends a 200 OK for the INVITE that the UAC is canceling. When this occurs, it is the role of the UAC to immediately send a BYE to terminate the call. This scenario was reproducible by have a Digium phone with two lines place a call to a second phone that forwarded the call to the second line on the original phone. The Digium phone, upon realizing that it was connecting to itself, would attempt to cancel the call. The timing of this happened to trigger the aforementioned race condition about 80% of the time. Asterisk was not doing its job of sending a BYE when receiving a 200 OK on a cancelled INVITE. The result was that the ast_channel structure was destroyed but the underlying SIP session, as well as the PJSIP inv_session and dialog, were still alive. Attempting to perform an action such as a transfer, once in this state, would result in Asterisk crashing. The circumstances are now detected properly and the session is ended as recommended in RFC 5407. (closes issue AST-1209) reported by John Bigelow 2013-08-29 20:21 +0000 [r397938] Matthew Jordan * CHANGES, contrib/scripts/safe_asterisk, Makefile, configs/safe_asterisk.conf.sample (removed): Revert r394939 due to (numerous) objections The patch from ASTERISK-21965 was committed perhaps a bit too hastily. Walter and Tzafrir have pointed out numerous issues with the approach and have propsed an alternative in r/2757. Since it's not a time critical issue and is not worth holding up the release of 12 for it, I've gone ahead and reverted r394939 from 12/trunk and re-opened ASTERISK-21965. 2013-08-29 16:18 +0000 [r397927] David M. Lee * rest-api-templates/asterisk_processor.py, rest-api-templates/make_ari_stubs.py, rest-api-templates/api.wiki.mustache: Account for {} in Swagger notes 2013-08-29 16:04 +0000 [r397924] Matthew Jordan * Makefile: Recursively search for '.c' files when making documentation with 'make full' Without this, documentation defined in sub-folders is ignored. Since having properly generated documentation is especially important in Asterisk 12 - not having it can cause a module to not load - 'make full' needs to look in all .c files. 2013-08-29 15:42 +0000 [r397921-397922] Mark Michelson * main/cel.c: Remove extra debug message. * apps/app_queue.c, main/cel.c, main/stasis_bridges.c: Resolve assumptions that bridge snapshots would be non-NULL for transfer stasis events. Attempting to transfer an unbridged call would result in crashes in either CEL code or in the conversion to AMI messages. 2013-08-29 12:27 +0000 [r397911] Matthew Jordan * contrib/ast-db-manage/README.md (added), contrib/ast-db-manage/config/versions (added), contrib/ast-db-manage/voicemail/versions/a2e9769475e_create_tables.py (added), contrib/ast-db-manage (added), contrib/ast-db-manage/voicemail/versions (added), contrib/ast-db-manage/config.ini.sample (added), contrib/ast-db-manage/config/env.py (added), contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py (added), contrib/ast-db-manage/config (added), contrib/ast-db-manage/config/script.py.mako (added), contrib/ast-db-manage/voicemail.ini.sample (added), contrib/ast-db-manage/voicemail/env.py (added), contrib/ast-db-manage/voicemail (added), contrib/ast-db-manage/voicemail/script.py.mako (added): Actually *add* the database schema management utilities In r397874, the scripts were removed... but not replaced. Thanks to Michael Young for noticing this! 2013-08-28 23:14 +0000 [r397885-397902] Richard Mudgett * main/stdtime/localtime.c, main/cdr.c, funcs/func_cdr.c: Fix some uninitialized buffers for CDR handling valgrind found. * Made ast_strftime_locale() ensure that the output buffer is initialized. The std library strftime() returns 0 and does not touch the buffer if it has an error. However, the function can also return 0 without an error. (closes issue ASTERISK-22412) Reported by: rmudgett * main/cdr.c: Fixed problems with ast_cdr_serialize_variables(). * Fixed return value of ast_cdr_serialize_variables() on error. It needs to return 0 indicating no CDR variables found. * Made ast_cdr_serialize_variables() check the return value of cdr_object_format_property() and assert if nonzero. A member of the cdr_readonly_vars[] was not handled. * Removed unused elements from cdr_readonly_vars[]: total_duration, total_billsec, first_start, and first_answer. * main/cdr.c: Made the on/off in CLI "cdr set debug [on|off]" case insensitive. * main/cdr.c: Make CDR variable name chandling consistently case insensitive. * main/cdr.c: Make CDR code deal with channel names case insensitively. * funcs/func_cdr.c, main/cdr.c: Some CDR code optimization. * funcs/func_cdr.c: Whitespace and curly braces. 2013-08-28 21:05 +0000 [r397876] Mark Michelson * res/res_pjsip_refer.c: Improve detection of answer on SIP blind transfer. A problem encountered during testing was that res_pjsip_refer would not ever send a NOTIFY with a 200 OK sipfrag. This is because the framehook that was supposed to send the NOTIFY would never be told that an answer had occurred. This happened for two reasons: 1) The transferee channel on which the framehook was on was already up. 2) Answers are rarely if ever written to channels. Rather, the ast_answer() or ast_raw_answer() function is used to answer channels. Thanks to a suggestion by Matt Jordan, the best way to detect that the call had been answered was to find out when the transferee channel joined a bridge. With stasis this is an easy task. So now, in addition to the framehook logic, there is a stasis subscription used to determine when the transferee has entered a bridge. Once it has entered, an appropriate NOTIFY is sent. 2013-08-28 20:55 +0000 [r397870-397874] Matthew Jordan * contrib/realtime/mysql/voicemail_messages.sql, contrib/realtime/postgresql/realtime.sql, contrib/realtime/mysql/voicemail_data.sql, CHANGES, contrib/realtime/mysql/musiconhold.sql, contrib/realtime/mysql/queue_log.sql, contrib/realtime/mysql/voicemail.sql, contrib/realtime/mysql/sippeers.sql, contrib/realtime/mysql/iaxfriends.sql, contrib/realtime/mysql/meetme.sql: Add database schema management using Alembic This patch replaces contrib/realtime/ with a new setup for managing the database schema required for database integration with Asterisk. In addition to initializing a database with the proper schema, alembic can do a database migration to assist with upgrading Asterisk in the future. Hopefully this helps make setting up and operating Asterisk with a database easier. With this the schema only needs to be maintained in one place instead of once per database. The schemas I have added here have a bit of improvement over the examples that were there before (some added consistency and added some missing indexes). Managing the schema in one place here also applies to all databases supported by SQLAlchemy. See contrib/ast-db-manage/README.md for more details. Review: https://reviewboard.asterisk.org/r/2731 patch by Russell Bryant (license 6300) * CHANGES: Update CHANGES file for Asterisk 12 This updates the Asterisk 12 CHANGES file with the things that were missed during the development cycle. Review: https://reviewboard.asterisk.org/r/2795/ 2013-08-28 16:12 +0000 [r397856-397859] Richard Mudgett * main/pbx.c: pbx.c: Make ast_str_substitute_variables_full() not mask variables. * include/asterisk/threadstorage.h: Match use of ast_free() with ast_calloc() and add some curly braces. 2013-08-28 15:40 +0000 [r397854] Mark Michelson * res/res_pjsip/pjsip_distributor.c: Fix dialog matching in the SIP distributor. Dialog matching is performed in the distributor for the sole purpose of retrieving an associated serializer so the request may be serialized. This patch fixes two problems. First, incoming CANCEL requests that had no to-tag (which really should be *all* CANCEL requests) would not match with a dialog. An earlier bug fix to deal with early CANCEL requests would result in the CANCEL being replied to with a 481. The fix for this is to find the matching INVITE transaction and get the dialog from that transaction. Second, no SIP responses were matching dialogs. This is because we were inverting the tags that we were passing into PJSIP's dialog finding function. This logic has been corrected by setting local and remote tag variables based on whether the incoming message is a request or response. 2013-08-27 19:15 +0000 [r397816] David M. Lee * res/res_ari_bridges.c, res/stasis/app.c, res/res_ari_events.c, res/res_ari_asterisk.c, rest-api-templates/res_ari_resource.c.mustache, res/stasis/app.h, res/res_stasis.c, main/stasis_bridges.c, rest-api-templates/param_parsing.mustache: ARI: WebSocket event cleanup Stasis events (which get distributed over the ARI WebSocket) are created by subscribing to the channel_all_cached and bridge_all_cached topics, filtering out events for channels/bridges currently subscribed to. There are two issues with that. First was a race condition, where messages in-flight to the master subscribe-to-all-things topic would get sent out, even though the events happened before the channel was put into Stasis. Secondly, as the number of channels and bridges grow in the system, the work spent filtering messages becomes excessive. Since r395954, individual channels and bridges have caching topics, and can be subscribed to individually. This patch takes advantage, so that channels and bridges are subscribed to on demand, instead of filtering the global topics. The one case where filtering is still required is handling BridgeMerge messages, which are published directly to the bridge_all topic. Other than the change to how subscriptions work, this patch mostly just moves code around. Most of the work generating JSON objects from messages was moved to .to_json handlers on the message types. The callback functions handling app subscriptions were moved from res_stasis (b/c they were global to the model) to stasis/app.c (b/c they are local to the app now). (closes issue ASTERISK-21969) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2754/ 2013-08-27 18:49 +0000 [r397809] Richard Mudgett * main/astmm.c: Made MALLOC_DEBUG less CPU intensive by default. Storing a backtrace for each allocation in anticipation of a memory management problem is very CPU intensive. * Added the CLI "memory backtrace {on|off}" command to request that the backtrace be gathered only on request. The backtrace is off by default. (issue ASTERISK-22221) Reported by: Matt Jordan 2013-08-27 18:05 +0000 [r397759] Matthew Jordan * /, channels/chan_sip.c: AST-2013-005: Fix crash caused by invalid SDP If the SIP channel driver processes an invalid SDP that defines media descriptions before connection information, it may attempt to reference the socket address information even though that information has not yet been set. This will cause a crash. This patch adds checks when handling the various media descriptions that ensures the media descriptions are handled only if we have connection information suitable for that media. Thanks to Walter Doekes, OSSO B.V., for reporting, testing, and providing the solution to this problem. (closes issue ASTERISK-22007) Reported by: wdoekes Tested by: wdoekes patches: issueA22007_sdp_without_c_death.patch uploaded by wdoekes (License 5674) ........ Merged revisions 397756 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397757 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 397758 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-27 16:47 +0000 [r397745] Richard Mudgett * channels/chan_dahdi.c, channels/sig_analog.c, /, channels/chan_sip.c, channels/chan_motif.c, channels/chan_iax2.c, channels/sig_pri.c, channels/sig_ss7.c: Fix uninitialized value in struct ast_control_pvt_cause_code usage. ........ Merged revisions 397744 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-27 16:03 +0000 [r397690-397713] Matthew Jordan * /, channels/chan_sip.c: AST-2013-004: Fix crash when handling ACK on dialog that has no channel A remote exploitable crash vulnerability exists in the SIP channel driver if an ACK with SDP is received after the channel has been terminated. The handling code incorrectly assumed that the channel would always be present. This patch adds a check such that the SDP will only be parsed and applied if Asterisk has a channel present that is associated with the dialog. Note that the patch being applied was modified only slightly from the patch provided by Walter Doekes of OSSO B.V. (closes issue ASTERISK-21064) Reported by: Colin Cuthbertson Tested by: wdoekes, Colin Cutherbertson patches: issueA21064_fix.patch uploaded by wdoekes (License 5674) ........ Merged revisions 397710 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397711 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 397712 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/bridge_channel.c: Better handle clearing the OUTGOING flag when a channel leaves a bridge When a channel with the OUTGOING flag leaves a bridge, and it will survive being pulled from the bridge (either because it will execute dialplan, go into another bridge, or live in a friendly autoloop), we have to clear the OUTGOING flag. This is the signal to the CDR engine that this channel is no longer a second class citizen, i.e., it is not "dialed". The soft hangup flags are only half the picture. If a channel is being moved from one bridge to another, the soft hangup flags aren't set; however, the state of the bridge_channel will not be hung up. Since the channel does not have one of the two hang up states, that implies that the channel is still technically alive. This patch modifies the check so that it checks both the soft hangup flags as well as the bridge_channel state. If either suggests that the channel is going to persist, we clear the OUTGOING flag. 2013-08-26 21:30 +0000 [r397673] David M. Lee * main/bucket.c: Fixed bucket.c for systems where tv_usec is not an unsigned long. 2013-08-26 16:24 +0000 [r397643-397650] Richard Mudgett * include/asterisk/bridge_channel.h, main/bridge_channel.c: bridging: Fix a livelock with local channel optimization. Use a better means of waking up the bridge channel thread. * channels/Makefile: chan_dahdi: Add some missing build cleanup. 2013-08-25 18:12 +0000 [r397621-397630] Matthew Jordan * tests/test_bucket.c: Fix bucket unit tests After the review for buckets was completed (r2715), the handling of names in the bucket core was deferred to the wizards. As such, the bucket unit tests cannot expect that passing a URI with a scheme specified but no actual resource name will automatically fail. The tests have been updated to not make this check. * include/asterisk/config_options.h, main/config_options.c, tests/test_config.c: Fix the config_options_test The config options test requires the entire configuration item to be transparent from the documentation system. So we let it do that too. As an aside, please do not use this power for evil. Documentation is your friend, and you really should document your configurations. Hiding your module's configuration information from the system attempting to enforce some sanity in the universe is something only a Bond villain would contemplate. * res/res_pjsip/pjsip_configuration.c: Add rtpengine configuration parameter The rtpengine configuration parameter was documented in the XML documentation, but it was not actually registered with the sorcery object. This adds the parameter with a default of "asterisk", such that res_rtp_asterisk is chosen as the default RTP implementation. (closes issue ASTERISK-22380) Reported by: Rusty Newton Tested by: Rusty Newton 2013-08-23 22:36 +0000 [r397614] Matthew Jordan * / (added): __________ | \ |_______ | | | ______| | / | _ _ _ _ _ | _______| / \ ___| |_ ___ _ __(_)___| | __ / || | / _ \ / __| __/ _ \ '__| / __| |/ / | || |_______ / ___ \__ \| | __/ | | \__ \ < | || | /_/ \_\___/\__\___|_| |_|___/_|\_\ |_| \__________| 2013-08-23 22:20 +0000 [r397613] Joshua Colp * main/bucket.c: Fix building of trunk. Note: This is why I commit on the weekend. 2013-08-23 22:12 +0000 [r397606] Matthew Jordan * main/pbx.c: Fix channel reference leak in Originated channels When originating channels, ast_pbx_outgoing_* caused the dialed channel reference to be bumped twice. Ostensibly, this routine is bumping the channel lifetime such that the channel doesn't get nuked in between locks/unlocks; however, since the routine should return the dialed channel with its reference bumped, it only needs to do this one time. 2013-08-23 21:53 +0000 [r397603] Mark Michelson * res/res_pjsip.c: Add some clarifying documentation to the rewrite_contact endpoint option. 2013-08-23 21:51 +0000 [r397602] Richard Mudgett * main/bridge_channel.c: Blank line tweaks. 2013-08-23 21:49 +0000 [r397599-397600] Joshua Colp * makeopts.in, main/asterisk.c, include/asterisk/bucket.h (added), main/sorcery.c, include/asterisk/config_options.h, tests/test_bucket.c (added), build_tools/menuselect-deps.in, configure, include/asterisk/autoconfig.h.in, main/Makefile, main/bucket.c (added), configure.ac, main/config_options.c: Add the bucket API. Bucket is a URI based API for the creation, retrieval, updating, and deletion of "buckets" and files contained within them. Review: https://reviewboard.asterisk.org/r/2715/ * include/asterisk/sorcery.h: Fix a bug where the argc value was passed as no_doc when registering custom sorcery types. This also adds a _nodoc equivalent. 2013-08-23 21:02 +0000 [r397593] Mark Michelson * main/bridge_channel.c: Add test events necessary for bridge tests to pass in the test suite. (closes issue AST-1200) reported by John Bigelow Review: https://reviewboard.asterisk.org/r/2790/ 2013-08-23 20:14 +0000 [r397585] Matthew Jordan * main/stasis_channels.c: Fix error in using ast_channel_snapshot_type before initialization Starting Asterisk would kick back an ERROR message stating that the Stasis message type ast_channel_snapshot_type was used prior to initialization. This occurred due to the caching topic being created prior to the message type that it depended on. This patch re-orders the start up such that the message type is initialized prior to the caching topic. It also checks the return value of the initialization of the agent login/logoff types. 2013-08-23 19:05 +0000 [r397578] Jonathan Rose * bridges/bridge_native_rtp.c: bridge_native_rtp: Fix hold chain bugs caused by native RTP bridge framehook Issuing hold/unhold would lead to odd behavior. Between two chan_sip devices, a hold could cause an endless chain of updates while with pjsip a similar chain would begin but then end somewhat randomly. This patch fixes that by no longer tweaking the RTP glue on both sides of the call for every HOLD/UNHOLD/UPDATE_RTP_PEER frame. (issue ASTERISK-22217) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2794/ 2013-08-23 18:33 +0000 [r397577] Richard Mudgett * include/asterisk/bridge_channel.h, main/channel_internal_api.c, bridges/bridge_builtin_interval_features.c, include/asterisk/channel.h, res/res_musiconhold.c, main/bridge_channel.c, main/channel.c, include/asterisk/bridge_channel_internal.h, main/bridge.c: Handle DTMF and hold wrapup when a channel leaves the bridging system. DTMF start/end and hold/unhold events have state because a DTMF begin event and hold event must be ended by something. The following cases need to be handled when a channel is moved around in the system. * When a channel leaves a bridge it may owe a DTMF end event to the bridge. * When a channel leaves a bridge it may owe an UNHOLD event to the bridge. (This case is explicitly ignored because things like transfers need explicit control over this.) * When a channel leaves the bridging system it may need to simulate a DTMF end event to the channel. * When a channel leaves the bridging system it may need to simulate an UNHOLD event to the channel. The patch also fixes the following: * Fixes playing a file and restarting MOH using the latest MOH class used. (closes issue ASTERISK-22043) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2791/ 2013-08-23 18:10 +0000 [r397571] Matthew Jordan * tests/test_sorcery_realtime.c, tests/test_sorcery_astdb.c, tests/test_sorcery.c: Fix sorcery unit tests When strict XML documentation checking was re-enabled, the test objects used in sorcery would fail to register as the types were not marked internal and the nodoc option wasn't used for the options. This fixes that problem, such that, as one would hope, they once again pass. 2013-08-23 18:07 +0000 [r397570] Richard Mudgett * include/asterisk/utils.h, include/asterisk/astmm.h, /, main/backtrace.c, main/logger.c, main/utils.c, include/asterisk/lock.h, main/astmm.c, channels/sig_pri.c, main/astobj2.c, include/asterisk/backtrace.h, main/lock.c: Fix memory corruption when trying to get "core show locks". Review https://reviewboard.asterisk.org/r/2580/ tried to fix the mismatch in memory pools but had a math error determining the buffer size and didn't address other similar memory pool mismatches. * Effectively reverted the previous patch to go in the same direction as trunk for the returned memory pool of ast_bt_get_symbols(). * Fixed memory leak in ast_bt_get_symbols() when BETTER_BACKTRACES is defined. * Fixed some formatting in ast_bt_get_symbols(). * Fixed sig_pri.c freeing memory allocated by libpri when MALLOC_DEBUG is enabled. * Fixed __dump_backtrace() freeing memory from ast_bt_get_symbols() when MALLOC_DEBUG is enabled. * Moved __dump_backtrace() because of compile issues with the utils directory. (closes issue ASTERISK-22221) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2778/ ........ Merged revisions 397525 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397528 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-23 18:02 +0000 [r397568] Matthew Jordan * main/config_options.c: Prevent seg fault in off nominal path when registered option fails to validate If an option is registered to a type and it is the last known type in the list of registered types, and the option fails to register, an overrun of the types array can occur due to the index variable having been already incremented. 2013-08-23 17:45 +0000 [r397567] Kevin Harwell * contrib/scripts/sip_to_res_sip/sip_to_res_sip.py, contrib/scripts/sip_to_res_sip/astconfigparser.py, contrib/scripts/sip_to_res_sip/astdicts.py: PSJIP - sip.conf to res_sip.conf script Most, if not all, of the backing features of a conf file should now be implemented (e.g. multi-line comments, includes, templates, etc...). A few of the options still need to be mapped. Those are currently listed in the 'sip_to_res_sip.py' file. Things to do: (1) There is more work to do here, at least for the sip.conf items that aren't currently parsed. An issue will be created for that. (2) All of the scripts should probably be passed through pylint and have as many PEP8 issues fixed as possible. (3) A public review is probably warranted at that point of the entire script. Reported by: Matt Jordan 2013-08-23 17:19 +0000 [r397565] David M. Lee * rest-api/api-docs/bridges.json, res/ari/resource_bridges.c, res/res_ari_bridges.c, res/stasis/control.c, include/asterisk/stasis_app.h, include/asterisk/stasis_app_impl.h: ARI: Correct error codes for bridge operations This patch adds error checking to ARI bridge operations, when adding/removing channels to/from bridges. In general, the error codes fall out as follows: * Bridge not found - 404 Not Found * Bridge not in Stasis - 409 Conflict * Channel not found - 400 Bad Request * Channel not in Stasis - 422 Unprocessable Entity * Channel not in this bridge (on remove) - 422 Unprocessable Entity (closes issue ASTERISK-22036) Review: https://reviewboard.asterisk.org/r/2769/ 2013-08-23 15:49 +0000 [r397524-397527] Matthew Jordan * CHANGES: Update CHANGES file to reflect pass through support for Opus/VP8 * channels/chan_sip.c, res/res_pjsip_sdp_rtp.c, include/asterisk/opus.h (added), include/asterisk/format.h, channels/chan_pjsip.c, res/res_format_attr_opus.c (added), main/channel.c, main/format.c, res/res_rtp_asterisk.c, main/frame.c, main/rtp_engine.c: Add pass through support for Opus and VP8; Opus format attribute negotiation This patch adds pass through support for Opus and VP8. That includes: * Format attribute negotiation for Opus. Note that unlike some other codecs, the draft RFC specifies having spaces delimiting the attributes in addition to ';', so you have "attra=X; attrb=Y". This broke the attribute parsing in chan_sip, so a small tweak was also included in this patch for that. * A format attribute negotiation module for Opus, res_format_attr_opus * Fast picture update for VP8. Since VP8 uses a different RTCP packet number than FIR, this really is specific to VP8 at this time. Note that the format attribute negotiation in res_pjsip_sdp_rtp was written by mjordan. The rest of this patch was written completely by Lorenzo Miniero. Review: https://reviewboard.asterisk.org/r/2723/ (closes issue ASTERISK-21981) Reported by: Tzafrir Cohen patches: asterisk_opus+vp8_passthrough_20130718.patch uploaded by lminiero (License 6518) * main/sorcery.c, include/asterisk/config_options.h, include/asterisk/sorcery.h, res/res_pjsip/pjsip_configuration.c, main/config_options.c, main/features_config.c, res/res_pjsip/pjsip_options.c, res/res_pjsip.c: Update config framework/sorcery with types/options without documentation There are times when a configuration option should not have documentation. 1. Some options are registered with a particular object merely as a warning to users. These options aren't even really 'deprecated' - which has its own separate API call - they are actually provided by a different configuration file. The options are merely registered so that the user gets a warning that a different configuration file provides the item. 2. Some object types - most notably some used by modules that use sorcery - are completely internal and should never be shown to the user. 3. Sorcery itself has several 'hidden' fields that should never be shown to a user. This patch updates the configuration framework and sorcery with additional API calls that allow a module to register types as internal and options as not requiring documentation. This bypasses the XML documentation checking. This patch also re-enables the strict XML documentation checking in trunk, as well as updates some documentation that was missing. Review: https://reviewboard.asterisk.org/r/2785/ (closes issue ASTERISK-22359) Reported by: Matt Jordan (closes issue ASTERISK-22112) Reported by: Rusty Newton 2013-08-23 13:58 +0000 [r397515] Joshua Colp * channels/chan_pjsip.c: Fix crash when answering after a transport error occurs. If a response to an initial incoming INVITE results in a transport error the INVITE transaction is removed from the INVITE session. Any attempts to answer the INVITE session after this results in a crash as it requires the INVITE transaction to exist. This change explicitly locks the dialog and checks to ensure that the INVITE transaction exists before answering. (closes issue AST-1203) Reported by: John Bigelow 2013-08-23 13:18 +0000 [r397514] Kinsey Moore * configs/cel.conf.sample: Update CEL sample config 2013-08-23 00:26 +0000 [r397505] Jonathan Rose * res/res_stasis.c, rest-api/api-docs/bridges.json, res/ari/resource_bridges.c, res/res_ari_bridges.c, res/ari/resource_bridges.h, include/asterisk/stasis_app.h: ARI: Music on Hold/Background Music for bridges Adds ARI functions to be able to turn on/off music on hold in a bridge. It actually functions more as a background music without further actions on the bridge since if the rest of the channels in the bridge aren't explicitly muted, they will still be able to communicate. (closes issue ASTERISK-21974) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2688/ 2013-08-22 23:15 +0000 [r397494] Richard Mudgett * apps/app_followme.c, main/channel.c, bridges/bridge_holding.c: Minor tweaks with ast_moh_start() callers. 2013-08-22 22:33 +0000 [r397493] Kinsey Moore * include/asterisk/say.h, apps/app_voicemail.c, main/channel.c, main/pbx.c, main/say.c, res/res_agi.c, CHANGES, apps/app_directory.c, apps/app_chanspy.c: Add SayAlphaCase and similar functionality for AGI This adds a new dialplan application, SayAlphaCase, that performs much the same function as SayAlpha except that it takes additional options which allow the user to specify whether the case of each letter should be announced for uppercase, lowercase, or all letters. Similar functionality has been added to the SAY ALPHA AGI command via an optional parameter. Original Patch by: Kevin Scott Adams Reported by: Kevin Scott Adams Review: https://reviewboard.asterisk.org/r/2725/ (closes issue ASTERISK-20782) 2013-08-22 22:09 +0000 [r397484] Kevin Harwell * res/res_pjsip.c, res/res_pjsip_dtmf_info.c: res_sip_dtmf_info: Support sending of 'raw' DTMF Added the ability to handle 'raw' DTMF within the body of an INFO message. Also made it so values 10-16 are mapped to valid DTMF values. (closes issue ASTERISK-22144) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2776/ 2013-08-22 21:39 +0000 [r397483] Kinsey Moore * res/res_pjsip.c: Add missing configOption close tags 2013-08-22 21:29 +0000 [r397482] Richard Mudgett * include/asterisk/musiconhold.h: Update MOH start/stop routine doxygen. 2013-08-22 21:21 +0000 [r397481] Rusty Newton * res/res_pjsip.c: Fix missing xml doc configOption 'type' for for both 'system' and 'global' configObjects (issue ASTERISK-22344) (closes issue ASTERISK-22344) 2013-08-22 21:09 +0000 [r397472] Richard Mudgett * include/asterisk/bridge_channel.h, main/features.c, bridges/bridge_builtin_interval_features.c, include/asterisk/bridge_internal.h, apps/app_confbridge.c, main/bridge_channel.c, res/res_stasis.c, include/asterisk/bridge.h, apps/app_dial.c, main/bridge.c, main/bridge_basic.c, apps/app_bridgewait.c, res/parking/parking_applications.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, res/res_parking.c, bridges/bridge_builtin_features.c: Bridge API: Set a cause code on a channel when it is ejected from a bridge. The cause code needs to be passed from the disconnecting channel to the bridge peers if the disconnecting channel dissolves the bridge. * Made the call to an app_agent_pool agent disconnect with the busy cause code if the agent does not ack the call in time or hangs up before acking the call. (closes issue ASTERISK-22042) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2772/ 2013-08-22 20:29 +0000 [r397471] Kinsey Moore * main/cel.c: Ensure CEL creates a default config if it isn't provided with one 2013-08-22 20:18 +0000 [r397466] Mark Michelson * apps/app_queue.c: Remove set but unused variable 'meid'. 2013-08-22 19:52 +0000 [r397461] Kinsey Moore * main/cel.c: Fix crash when getting CEL config 2013-08-22 18:52 +0000 [r397441-397451] Mark Michelson * include/asterisk/core_unreal.h, include/asterisk/features.h, include/asterisk/app.h, main/bridge.c, main/bridge_basic.c, main/features.c, main/app.c, main/core_local.c, CHANGES, apps/app_queue.c, include/asterisk/bridge_basic.h: Massively clean up app_queue. This essentially makes app_queue usable again. From reviewboard: * Reporting of transfers and call completion is done by creating stasis subscriptions and listening for specific events in order to determine when the call is finished (either via a transfer or hangup). * Dial end messages have been added where they were previously missing. * Queue stats are properly being updated again once calls have finished. * AgentComplete stasis messages and AMI events are now occurring again. * Mixmonitor starting has been factored into its own function and uses the Mixmonitor API now instead of using ast_pbx_run() In addition to the changes in app_queue, there are several supplementary changes as well: * Queue logging now differentiates between attended and blind transfers. A note about this is in the CHANGES file. * Local channel optimization events now report more information. This includes which of the two local channels involved is the destination of the optimization, the channel that is replacing the destination local channel, and an identifier so that begin and end events can be matched to each other. The end events are now sent whether the optimization was successful or not and includes an indicator of whether the optimization was successful. * Changes were made to features and bridging_basic so that additional flags may be set on a bridge. This is necessary because the queue requires that its bridge only allows move-swap local channel optimizations into the bridge. (closes issue ASTERISK-21517) Reported by Matt Jordan (closes issue ASTERISK-21943) Reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2694 * res/res_pjsip_exten_state.c, include/asterisk/res_pjsip_pubsub.h, res/res_pjsip_mwi.c, res/res_pjsip_pubsub.c: Handle default body types for SIP event packages in res_pjsip_pubsub Prior to this change, we would reject SUBSCRIBE requests that had no Accept headers. Now event package handlers that handle the default type for the event package indicate that they do so. Therefore, if we have a handler that can handle the default type, we can allow SUBSCRIBEs for the handler's event package that have no Accept headers. (closes issue ASTERISK-22067) reported by Mark Michelson Review: https://reviewboard.asterisk.org/r/2774 2013-08-22 17:34 +0000 [r397440] Richard Mudgett * main/bridge_channel.c, main/abstract_jb.c: Made the abstract jitter buffer resync on some more control frames. Resync the abstract jitter buffer on the following additional control frames: AST_CONTROL_HOLD AST_CONTROL_UNHOLD AST_CONTROL_T38_PARAMETERS 2013-08-22 17:13 +0000 [r397431] Kinsey Moore * tests/test_cel.c, main/cel.c, include/asterisk/cel.h: Make CEL behavior conform to the documentation This modifies the behavior of the CEL engine to conform to documented behavior for Asterisk 12 as defined on the wiki https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CEL+Specification The primary changes deal with removal of the peer field from function calls since it is no longer directly relevant to the bridging system and removal of the layer of CDR-like business logic that was providing a partial emulation of Asterisk 11 CEL functionality. With this change, there is no longer a distinction between "bridges" and "conferences" and all participation changes are denoted with bridge enter and bridge exit messages. This updates the CEL unit tests to handle these changes and simplifies some of the macros used in the process. This also fixes a segfault when attempting to ref a configuration that failed to load. Review: https://reviewboard.asterisk.org/r/2788/ (issue ASTERISK-21567) 2013-08-22 16:46 +0000 [r397426] Richard Mudgett * main/bridge.c: Update BUGBUG comment. 2013-08-22 12:28 +0000 [r397379-397415] Walter Doekes * main/asterisk.c: Don't store repeated commands in the editline history buffer. The equivalent of bash HISTCONTROL=ignoredups. Review: https://reviewboard.asterisk.org/r/2775/ * /, main/asterisk.exports.in, default.exports: Add _IO_stdin_used in version-script to fix SIGBUSes on Sparc. The --version-script,asterisk.exports linker flag (and the module exports) didn't provide _IO_stdin_used in the list of exported symbols. That causes some kind of libc compatibility mode to kick in, where stdio file structures (stdout/stderr) land somewhere else. In the case of the Sparc, they landed on misaligned memory. This became apparent first after r376428 (Reorder startup sequence) when a lot of ast_log's were replaced with fprintf's. Writing to stderr triggered a SIGBUS. (Compared to x86 and amd64 architectures, the Sparc is very picky about memory alignment.) (issue ASTERISK-21763) (issue ASTERISK-21665) Reported by: Jeremy Kister Review: https://reviewboard.asterisk.org/r/2760/ ........ Merged revisions 397377 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397378 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-21 23:09 +0000 [r397366] Jonathan Rose * main/udptl.c, /: UDPTL: Fix a regression where UDPTL won't load default settings If the file udptl.conf is unavailable at startup, UDPTL will fail to initialize and while it makes some noise, it isn't immediately obvious why consumers start to fail when using it. This patch makes UDPTL load as though an empty config was provided when udptl is unavailable at startup. (closes issue ASTERISK-22349) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/2773/ ........ Merged revisions 397365 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-21 20:02 +0000 [r397346-397355] Richard Mudgett * include/asterisk/bridge_basic.h, main/bridge_basic.c, main/features.c: * Move ast_bridge_channel_setup_features() into bridge_basic.c. * Made application map hooks be removed on a basic bridge personality change. * main/bridge.c, main/bridge_channel.c: Deferred some more BUGBUG comments to a JIRA issue or XXX comment. 2013-08-21 17:12 +0000 [r397310] David M. Lee * /, main/http.c: Complete http_shutdown. This patch frees up some resources allocated in http.c. * tcp listeners stopped * tls settings freed * uri redirects freed * unregister internal http.c uri's (closes issue ASTERISK-22237) Reported by: Corey Farrell Patches: http.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 397308 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397309 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-21 16:31 +0000 [r397307] Matthew Jordan * include/asterisk/frame.h, /: Set 14400 as the default max bit rate if T38MaxBitRate is not specified If an endpoint fails to include the T38MaxBitRate attribute during negotiation, Asterisk will negotiate a bit rate of 2400 instead of the ITU recommended bit rate of 14400. This patch fixes this by making AST_T38_RATE_14400 the 'default' value of the enum by assigning it a value of 0, such that if an endpoint fails to include the attribute, the default will be 14400. Note that Walter Doekes included the nice comment in frame.h about why we are purposefully assigning AST_T38_RATE_14400 a value of 0. (closes issue ASTERISK-22275) Reported by: Andreas Steinmetz patches: fax-fix.patch uploaded by anstein (License 6523) ........ Merged revisions 397256 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397257 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-21 16:23 +0000 [r397295-397306] David M. Lee * rest-api/api-docs/asterisk.json, res/ari/resource_asterisk.c, res/res_ari_asterisk.c, rest-api/api-docs/channels.json, res/ari/resource_channels.c, res/res_ari_channels.c: ARI: Correct segfault with /variable calls are missing ?variable parameter. Both /asterisk/variable and /channel/{channelId}/variable requires a ?variable parameter to be passed into the query. But we weren't checking for the parameter being missing, which caused a segfault. All calls now properly return 400 Bad Request errors when the parameter is missing. The Swagger api-docs were updated accordingly. (closes issue ASTERISK-22273) * main/stasis_endpoints.c: ARI: Remove the 'channel:' scheme from endpoint's channel list. For times when a reference in ARI might be ambiguous, the reference is built as an URI (such as channel:1376341790.3). An endpoint's channel list is not ambiguous, and in fact the field is named 'channel_ids', but it had channel URI's instead of channel id's. This patch changes the list to be the raw id instead of the URI. (closes issue ASTERISK-22291) * res/stasis/control.h, res/res_stasis.c: res_stasis: remove call to missing function control_continue. In the shuffling around of res_stasis, control_continue was renamed to stasis_app_control_continue, but the call in res_stasis wasn't updated. In looking into it, it turns out it wasn't really the right thing to do in res_stasis anyways. This patch changes the handling of received a AST_CONTROL_HANGUP frame to be the same as receiving a NULL frame, and removed the declaration of control_continue(), since it doesn't exist any more. (closes issue ASTERISK-22292) Reported by: Denis Smirnov 2013-08-21 15:51 +0000 [r397294] Richard Mudgett * apps/app_bridgewait.c, include/asterisk/bridge_features.h, main/bridge_channel.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, bridges/bridge_holding.c, main/bridge.c, include/asterisk/bridge_channel.h, main/features.c, bridges/bridge_builtin_interval_features.c: Fix several interrelated issues dealing with the holding bridge technology. * Added an option flags parameter to interval hooks. Interval hooks now can specify if the callback will affect the media path or not. * Added an option flags parameter to the bridge action custom callback. The action callback now can specify if the callback will affect the media path or not. * Made the holding bridge technology reexamine the participant idle mode option whenever the entertainment is restarted. * Fixed app_agent_pool waiting agents needlessly starting and stopping MOH every second by specifying the heartbeat interval hook as not affecting the media path. * Fixed app_agent_pool agent alert from restarting the MOH after the alert beep. The agent entertainment is now changed from MOH to silence after the alert beep. * Fixed holding bridge technology to defer starting the entertainment. It was previously a mixture of immediate and deferred. * Fixed holding bridge technology to immediately stop the entertainment. It was previously a mixture of immediate and deferred. If the channel left the bridging system, any deferred stopping was discarded before taking effect. * Miscellaneous holding bridge technology rework coding improvements. Review: https://reviewboard.asterisk.org/r/2761/ 2013-08-21 14:39 +0000 [r397255] Mark Michelson * /, channels/chan_sip.c: Prevent a crash on outbound SIP MESSAGE requests. If a From header on an outbound out-of-call SIP MESSAGE were malformed, the result could crash Asterisk. In addition, if a From header on an incoming out-of-call SIP MESSAGE request were malformed, the message was happily accepted rather than being rejected up front. The incoming message path would not result in a crash, but the behavior was bad nonetheless. (closes issue ASTERISK-22185) reported by Zhang Lei ........ Merged revisions 397254 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-21 14:08 +0000 [r397244] Kinsey Moore * res/res_stasis.c: Allow channels in app_stasis to hangup properly This detects hangups that occur while bridged to allow channels to exit app_stasis even if the hangup frame was absorbed by the bridge the channel was in. Reported by: David Lee (closes issue ASTERISK-22297) 2013-08-21 13:41 +0000 [r397243] Matthew Jordan * CHANGES, channels/chan_sip.c: Allow the SIP_CODEC family of variables to specify more than one codec The SIP_CODEC family of variables let you set the preferred codec to be offered on an outbound INVITE request. However, for video calls, you need to be able to set both the audio and video codecs to be offered. This patch lets the SIP_CODEC variables accept a comma delineated list of codecs. The first codec in the list is set as the preferred codec; additional codecs are still offered however. This lets a dialplan writer set both audio and video codecs, e.g., Set(SIP_CODEC=ulaw,h264) Note that this feature was written by both Dennis Guse and Frank Haase Review: https://reviewboard.asterisk.org/r/2728 (closes issue ASTERISK-21976) Reported by: Denis Guse Tested by: mjordan, sysreq patches: patch-channels-chan__sip.c-393919 uploaded by dennis.guse (license 6513) 2013-08-21 02:15 +0000 [r397206] Michael L. Young * /, channels/chan_sip.c: Fix Not Storing Current Incoming Recv Address In 1.8, r384779 introduced a regression by retrieving an old dialog and keeping the old recv address since recv was already set. This has caused a problem when a proxy is involved since responses to incoming requests from the proxy server, after an outbound call is established, are never sent to the correct recv address. In 11, r382322 introduced this regression. The fix is to revert that change and always store the recv address on incoming requests. Thank you Walter Doekes for helping to point out this error and Mark Michelson for your input/review of the fix. (closes issue ASTERISK-22071) Reported by: Alex Zarubin Tested by: Alex Zarubin, Karsten Wemheuer Patches: asterisk-22071-store-recvd-address.diff by Michael L. Young (license 5026) ........ Merged revisions 397204 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397205 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-20 21:01 +0000 [r397111-397193] Mark Michelson * include/asterisk/res_pjsip.h, res/res_pjsip/config_security.c (removed), res/res_pjsip/pjsip_configuration.c, res/res_pjsip_acl.c: Localize and rename ACL configuration. This is more-or-less a reversion of previous ACL behavior so that it is more self-contained. ACL sections are now only parsed if res_pjsip_acl.so is loaded. Moreover, the configuration section is now "type=acl" instead of "type=security". The original reason for having ACLs configured in a "type=security" section was to lump ACLs and other security-related items into the same section. The problem is that ACLs really should be in their own sections and there are no other security-related options implemented anyways. * /, channels/chan_sip.c: Remove REF_DEBUG definition. ........ Merged revisions 397156 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397157 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_sip.c, channels/sip/dialplan_functions.c: Fix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of pvts. (closes issue ASTERISK-22248) reported by Corey Farrell patches: test_sip_rtpqos.patch uploaded by Corey Farrell (license #5909) ........ Merged revisions 397112 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397133 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_pjsip.c: Clarify documentation for the "identify_by" option for SIP endpoints. This also removes documentation for the options that no longer exist. (closes issue ASTERISK-22306) reported by Rusty Newton 2013-08-20 15:36 +0000 [r397110] Kinsey Moore * /, main/threadstorage.c, main/astfd.c: Unregister CLI commands on exit This patch ensures that CLI commands enabled by DEBUG_FD_LEAKS and DEBUG_THREADLOCALS are cleaned up properly on exit. (closes issue ASTERISK-22238) Reported by: Corey Farrell Tested by: Corey Farrell Patches: debug_cli_unregister.patch uploaded by Corey Farrell ........ Merged revisions 397106 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 397107 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-20 15:32 +0000 [r397073-397109] Mark Michelson * res/res_pjsip_endpoint_identifier_ip.c: Add debug message to res_pjsip_endpoint_identifier_ip to indicate when an endpoint is successfully retrieved. (closes issue ASTERISK-22101) reported by Rusty Newton * res/res_pjsip_registrar.c: Add warning messages for registration failure paths. (closes issue ASTERISK-22089) reported by Rusty Newton patches: patch1.txt uploaded by John Bigelow (License #5091) * res/res_pjsip.c: Add note to transport configuration that a restart is required to change transports. (closes issue ASTERISK-22094) reported by Rusty Newton 2013-08-20 14:26 +0000 [r397072] Kinsey Moore * /: Recorded merge of revisions 397067 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Fix xmldoc memory leak This fixes a single-attribute memory leak that was occurring when the "required" attribute was not true. (closes issue ASTERISK-22249) Reported by: Corey Farrell Tested by: Corey Farrell Patches: xmldoc-free_attr_required.patch uploaded by Corey Farrell ........ Merged revisions 397064 from http://svn.asterisk.org/svn/asterisk/branches/1.8 2013-08-20 11:48 +0000 [r396996] Walter Doekes * configs/sip.conf.sample, configs/h323.conf.sample, /: Add "autoframing" option to sip.conf.sample and h323.conf.sample. The autoframing option was added to chan_sip.c in r43243 (mogorman, 2006-09-19 01:32:57), but never made its way into the sample configs. Review: https://reviewboard.asterisk.org/r/2768/ ........ Merged revisions 396994 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396995 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-20 11:33 +0000 [r396993] Joshua Colp * res/res_pjsip_dtmf_info.c: Remove assumption in res_pjsip_dtmf_info that all INFO messages will contain a body. (closes issue ASTERISK-22320) Reported by: Matt Jordan 2013-08-20 00:08 +0000 [r396946-396949] Matthew Jordan * /, apps/app_queue.c: Let Queue wrap up time influence member availability Queue members who happen to be in multiple queues at the same time may not have any wrap up time. This problem occurred due to a code change in Asterisk 11.3.0 that unified device state tracking of Queue members in multiple Queues (which fixed some other problems, but unfortunately caused this one). This patch fixes the behavior by having the is_member_available function check the queue's wrap up time and the time of the member's last call, such that for a particular queue, the member won't be considered available if their last call is within the wrap up time. (closes issue ASTERISK-22189) Reported by: Tony Lewis Tested by: Tony Lewis ........ Merged revisions 396948 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, apps/app_meetme.c: Resolve conflicts between CONFFLAG_DONT_DENOISE and CONFFLAG_INTROUSER_VMREC When r382230 added an option to not denoise the MeetMe conference (if a user had a channel whose format's sample rate changed frequently, for example), the value added was the maximum allowed value for the constants that define the options for MeetMe in 1.8. Not so in 11 - unfortunately, the option CONFFLAG_DONT_DENOISE conflicts with CONFFLAG_INTROUESR_VMREC. This patch fixes that, and also tweaks one of the way in which the constants was declared for consistency. Thanks to Tony Mountifield for pointing out the problem and solution. (closes issue ASTERISK-22269) Reported by: Tony Mountifield ........ Merged revisions 396944 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-19 16:10 +0000 [r396930] Richard Mudgett * main/bridge.c: Update BUGBUG comment. 2013-08-19 14:54 +0000 [r396923] Jonathan Rose * main/bridge.c: attended transfers: Fix a bug affecting external blond transfers Performing a blond transfer (attended transfer that is completed before the transfer recipient picks up) externally through chan_sip or chan_pjsip would result in lost references to the channels involved with the transfer as well as their bridge. (closes issue ASTERISK-22092) Reported by: mmichelson Review: https://reviewboard.asterisk.org/r/2766/ 2013-08-19 14:53 +0000 [r396915-396922] Matthew Jordan * channels/sip/include/sip.h: Whitespace cleanup Remove some extraneous blobs * main/data.c: Fix invalid access to disposed memory in main/data unit test It is not safe to iterate over a macro'd list of ao2 objects, deref them such that the item's destructor is called, and leave them in the list. The list macro to iterate over items requires the item to be a valid allocated object in order to proceed to the next item; with MALLOC_DEBUG on the corruption of the linked list is caught in the crash. This patch fixes the invalid access to free'd memory by removing the ao2 item from the list before de-refing it. 2013-08-18 03:05 +0000 [r396908-396909] Kinsey Moore * channels/chan_mgcp.c: Update chan_mgcp to the modified parking API * res/res_corosync.c: Disable build of res_corosync until it is back in a compiling state 2013-08-17 18:13 +0000 [r396899-396902] Rusty Newton * res/res_pjsip.c: xml doc changes for 'aor' config object and a few of its options Added or modified text in the xml doc for the 'aor' config object to address a few issues: * help for the 'mailboxes' option didn't make it clear how the "list" should be formatted. * AoR object's involvement in inbound registration wasn't mentioned. * help for the 'contact' option didn't describe how to specify multiple contacts. * help for the 'max_contacts' option didn't tell whether it limited the amount of contacts defined through static configuration. (issue ASTERISK-22118) (closes issue ASTERISK-22118) * res/res_pjsip.c: 'domain_alias' config object XML help doesn't make it clear that the name used for the object is the domain alias (issue ASTERISK-22114) (closes issue ASTERISK-22114) * res/res_pjsip.c: xml doc changes for clarity - 'auth' config object and auth's 'auth_type' config option (issue ASTERISK-22108) (closes issue ASTERISK-22108) * res/res_pjsip.c: xml doc change for transport config object - remove non-applicable warning and add text regarding Asterisk restart (closes issue ASTERISK-22105) 2013-08-17 15:01 +0000 [r396887-396890] Kinsey Moore * main/bridge.c, res/parking/parking_applications.c, include/asterisk/parking.h, main/bridge_channel.c, res/parking/parking_bridge_features.c, channels/chan_dahdi.c, res/parking/res_parking.h, res/res_parking.c, channels/sig_analog.c, channels/chan_skinny.c, main/parking.c: Allow res_parking to be unloadable This change protects accesses of res_parking such that it can unload safely once transient uses of its registered functions are complete. The parking API has been restructured such that its consumers do not have access to the vtable exposed by the parking provider, but instead route through stubs to prevent consumers from holding on to function pointers. This adds calls to all the parking unload functions and moves application loading and unloading into functions in parking_applications.c similar to the rest of the parts of res_parking. Review: https://reviewboard.asterisk.org/r/2763/ (closes issue ASTERISK-22142) * tests/test_event.c, include/asterisk/_private.h, main/cel.c, cel/cel_odbc.c, include/asterisk/event.h, include/asterisk/event_defs.h, cel/cel_manager.c, cel/cel_custom.c, tests/test_cel.c, cel/cel_sqlite3_custom.c, main/event.c, main/asterisk.c, cel/cel_pgsql.c, cel/cel_radius.c, include/asterisk/cel.h, cel/cel_tds.c: Refactor CEL to avoid using the event system core This removes usage of the event system for CEL backend data distribution and strips unused pieces out of the event system. Review: https://reviewboard.asterisk.org/r/2732/ * main/presencestate.c, channels/sig_pri.h, res/res_parking.c, channels/chan_dahdi.c, main/manager.c, funcs/func_presencestate.c, include/asterisk/event.h, include/asterisk/event_defs.h, channels/chan_skinny.c, tests/test_cel.c, main/event.c, include/asterisk/security_events_defs.h, res/parking/parking_manager.c, channels/chan_mgcp.c, res/res_security_log.c, apps/app_voicemail.c, res/parking/parking_ui.c, channels/chan_unistim.c, main/pbx.c, include/asterisk/devicestate.h, main/security_events.c, channels/chan_sip.c, main/ccss.c, tests/test_event.c, main/devicestate.c, res/parking/parking_applications.c, res/res_xmpp.c, channels/sig_pri.c, channels/chan_iax2.c, apps/app_queue.c, res/res_jabber.c: Strip down the old event system This removes unused code, event types, IE pltypes, and event IE types where possible and makes several functions private that were once public. This includes a renumbering of the remaining event and IE types which breaks binary compatibility with previous versions. The last remaining consumers of the old event system (or parts thereof) are main/security_events.c, res/res_security_log.c, tests/test_cel.c, tests/test_event.c, main/cel.c, and the CEL backends. Review: https://reviewboard.asterisk.org/r/2703/ (closes issue ASTERISK-22139) 2013-08-16 20:48 +0000 [r396849-396877] Richard Mudgett * main/bridge_channel.c, include/asterisk/bridge.h, main/bridge.c, include/asterisk/bridge_channel.h: Fix CLI "bridge kick " to check if the bridge needs dissolving. SIP/foo -- Local;1==Local;2 -- .... -- Local;1==Local;2 -- SIP/bar Kick a ;1 channel and the chain toward SIP/foo goes away. Kick a ;2 channel and the chain toward SIP/bar goes away. This can leave a local channel chain between the kicked ;1 and ;2 channels that are orphaned until you manually request one of those channels to hangup or request the bridge to dissolve. * Added ast_bridge_kick() as a companion to ast_bridge_remove(). The functional difference is that ast_bridge_kick() may dissolve the bridge as a result of the channel leaving the bridge. * Made CLI "bridge kick " use ast_bridge_kick() instead of ast_bridge_remove() so the bridge can dissolve if needed. * Renamed bridge_channel_handle_hangup() to ast_bridge_channel_kick() and made it accessible to other files. * include/asterisk/doxygen/architecture.h, include/asterisk/bridge_channel_internal.h: Fix some doxygen bridging file references. * res/parking/parking_bridge_features.c, main/cdr.c, main/data.c, main/manager.c, tests/test_jitterbuf.c, main/features.c, tests/test_voicemail_api.c, main/file.c, tests/test_cel.c, main/stasis_channels.c, main/bridge_channel.c, main/message.c, tests/test_cdr.c, main/db.c, main/xmldoc.c, main/format.c, res/res_rtp_asterisk.c, main/pbx.c, main/rtp_engine.c, tests/test_abstract_jb.c, channels/chan_sip.c, main/pickup.c, apps/app_queue.c, main/indications.c: Doxygen comment tweaks. * main/utils.c, main/hashtab.c: Fix utilities compilation/linking. The horrid structure of the source in the utils directory strikes again. Moved the _ast_mem_backtrace_buffer[] definition from the logical location in utils.c to hashtab.c so the aelparse and conf2ael utilities can link. * include/asterisk/utils.h: utils.h: Minor formatting tweaks. 2013-08-16 16:03 +0000 [r396842] David M. Lee * main/stasis.c, main/stasis_cache_pattern.c, main/stasis_cache.c, include/asterisk/astobj2.h, main/stasis_channels.c, tests/test_stasis.c: Stasis: address refcount races; implementation comments Change r395954 reordered some stasis object destruction, which should have been fine. Unfortunately, it caused some hard to reproduce issues related to objects being accessed after they had been destroyed. The patch in r396329 fixed the destruction order problem; this patch addresses the underlying issue. A few other stasis-related fixes were also added. * Add ref-bumps around areas where objects may get transitively destroyed. (For example, where we lock a topic, unref a subscription, which unrefs the topic, which explodes the topic when we try to unlock it.) * Wrote an extensive doxygen page about Stasis implementation, relationships between objects, lifecycles of objects, how the refcounting works, etc. Many other comments were added, corrected, or cleaned up. * Added an assert to the topic dtor to catch extra ref decrements. * Fixed type used after destruction errors for graceful shutdown in stasis_channels.c. * I added two unit tests in an attempt to catch destruction order issues. Since the underlying cause is a race condition, though, the tests rarely failed even when the code was wrong. * Fixed a leak in stasis_cache_pattern.c. (closes issue ASTERISK-22243) Review: https://reviewboard.asterisk.org/r/2746/ 2013-08-16 12:20 +0000 [r396829] Kinsey Moore * main/utils.c, main/sounds_index.c, main/loader.c: Improve sounds indexer CLI commands This reworks the CLI commands used to access sounds information from "sounds show[ soundid]" to "core show sounds" and "core show sound ". This also reworks the "sounds reload" CLI command to fall under normal module reloading ("module reload sounds"). Also, make trunk build when DEBUG_MALLOC is not enabled. Review: https://reviewboard.asterisk.org/r/2745/ (closes issue ASTERISK-22141) 2013-08-16 07:18 +0000 [r396822] Walter Doekes * include/asterisk/utils.h, main/pbx.c, main/utils.c: Prevent heap alloc functions from running out of stack space. When asterisk has run out of memory (for whatever reason), the alloc function logs a message. Logging requires memory. A recipe for infinite recursion. Stop the recursion by comparing the function call depth for sane values before attempting another OOM log message. Review: https://reviewboard.asterisk.org/r/2743/ 2013-08-15 22:10 +0000 [r396783-396814] Richard Mudgett * main/bridge_channel.c: Bridge: Don't suspend/unspend the channel for interception routines. By their nature, the connected line and redirecting interception routines are not supposed to affect the channel's media. Therefore, they should not suspend and unsuspend the channel while running. The suspend/unsuspend operations could be expensive depending upon the bridge and channel technology involved. * res/parking/res_parking.h, res/res_parking.c, res/parking/parking_tests.c, main/features.c: Minor parking cleanup. * res/parking/parking_bridge_features.c: Parking: Eliminate local channel name hack to get peer channel. (closes issue ASTERISK-22034) Reported by: Matt Jordan * main/bridge_channel.c, main/features.c: Remove early bridge BUGBUG comments. Remove some unneeded features.c comments. * configs/features.conf.sample: Update features.conf.sample atxferdropcall option. * main/bridge.c, include/asterisk/bridge_channel.h, main/config_options.c, main/bridge_channel.c, apps/confbridge/conf_config_parser.c: Changed some BUGBUG tags to associated JIRA issue tags. * main/bridge.c, main/features.c, bridges/bridge_softmix.c, include/asterisk/bridge.h: Resolve some BUGBUG comments. 2013-08-15 16:37 +0000 [r396747] Kinsey Moore * main/asterisk.c, main/cli.c, /: Remove leading spaces from the CLI command before parsing If you've mistakenly put a space before typing in a command, the leading space will be included as part of the command, and the command parser will not find the corresponding command. This patch rectifies that situation by stripping the leading spaces on commands. Review: https://reviewboard.asterisk.org/r/2709/ Patch-by: Tilghman Lesher ........ Merged revisions 396745 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396746 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-15 15:12 +0000 [r396732-396734] Richard Mudgett * channels/chan_vpb.cc, main/features.c, include/asterisk/channel.h, channels/chan_iax2.c: Remove some dead code dealing with: AST_BRIDGE_REC_CHANNEL_0, AST_BRIDGE_REC_CHANNEL_1, and AST_BRIDGE_IGNORE_SIGS. * include/asterisk/bridge_channel_internal.h, main/manager.c, main/bridge_channel.c: Fix Bridge API DTMF hook matching for begin and end DTMF events. The Bridge API DTMF hook matching would not deal with DTMF end events only. It required a DTMF begin event to start matching the DTMF hooks. There are many places in Asterisk where code only generates DTMF end events without the corresponding begin event. One such place is the AMI action Atxfer. * Fixed DTMF hook matching if there is a string of DTMF frames in the read queue. We could potentially miss some of them before. * Fixed AMI Atxfer action documentation. (closes issue ASTERISK-22037) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2752/ 2013-08-15 12:17 +0000 [r396722-396724] Kinsey Moore * apps/app_confbridge.c, main/bridge.c, main/features.c: Fix feature_attended_transfer test The feature_attended_transfer test is failing due to Asterisk not passing DTMF in the bridges created for internal attended transfers. This sets the features initialization routine to set this flag by default and adjusts the basic bridge and confbridge's use of the bridging system accordingly as per Richard's suggestion instead of adjusting this individual case. This change allows the necessary DTMF to pass through the attended transfer bridge and complete the test successfully. Review: https://reviewboard.asterisk.org/r/2759/ (closes issue ASTERISK-22222) * main/utils.c, include/asterisk/lock.h, channels/chan_sip.c: Fix deadlocks in chan_sip in REFER and BYE handling This resolves several deadlocks in chan_sip relating to usage of ast_channel_bridge_peer and improves accessibility of lock debugging function calls. Review: https://reviewboard.asterisk.org/r/2756/ (closes issue ASTERISK-22215) * res/res_stasis.c: Prevent automagic things from happening to Stasis application bridges This prevents swap optimization, merges, and transfers involving Stasis application bridges. It wouldn't be nice if the bridge you thought you owned disappeared from under you. Reported-by: Richard Mudgett 2013-08-15 00:16 +0000 [r396695-396713] Richard Mudgett * include/asterisk/channel.h, main/channel.c, channels/chan_vpb.cc: Remove unsupported channel technology callbacks. * channels/chan_vpb.cc: chan_vpb: Effectively remove native support. Left enough bread crumbs to be able to convert later if needed. * channels/chan_iax2.c: chan_iax2: Conditionally remove native support for now. (issue ASTERISK-21944) * channels/chan_misdn.c: chan_misdn: Effectively remove native support. Left enough bread crumbs to be able to convert later if needed. * apps/app_bridgewait.c: app_bridgewait: Inhibit local channel optimizations to the bridge. Holding bridges can allow local channel move/swap optimization to the bridge. However, we cannot allow it for the BridgeWait holding bridge because the call will lose the channel roles and dialplan location as a result. 2013-08-14 19:06 +0000 [r396621-396658] Joshua Colp * /, tests/test_hashtab_thrash.c: Tweak comment for why usleep is used. ........ Merged revisions 396656 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396657 from http://svn.asterisk.org/svn/asterisk/branches/11 * tests/test_hashtab_thrash.c, /: Tweak test_hashtab_thrash test to allow the critical threads to execute. Depending on certain conditions it was possible for the hashtab counting thread to starve other threads, preventing them from executing in the expected fashion. This change adds a sleep to allow the others to do what they need to do. While this doesn't thrash the hashtab as much as previously, it at least works. (closes issue ASTERISK-22276) Reported by: Matt Jordan ........ Merged revisions 396619 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396620 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-13 18:47 +0000 [r396581-396584] Walter Doekes * /, channels/chan_sip.c: chan_sip: Convert 'just did sched_add waitid...' from warning to debug message. Patches: reviewboard-2377.patch uploaded by Paul Belanger Review: https://reviewboard.asterisk.org/r/2377/ ........ Merged revisions 396582 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396583 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_sip.c: chan_sip: Fix IP-addr in warning when rejecting a contact ACL. Patches: reviewboard-2155.patch uploaded by Paul Belanger Review: https://reviewboard.asterisk.org/r/2155/ ........ Merged revisions 396579 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396580 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-13 15:27 +0000 [r396559-396568] David M. Lee * include/asterisk/stasis_app_impl.h, res/res_stasis_recording.c, res/stasis/control.h, include/asterisk/bridge_internal.h, include/asterisk/bridge_features.h, res/res_stasis.c, res/ari/resource_bridges.c, res/res_stasis_bridge_add.c (removed), res/res_stasis_playback.c, res/stasis/control.c, res/res_stasis_bridge_add.exports.in (removed), include/asterisk/stasis_app.h: ARI: allow other operations to happen while bridged This patch changes ARI bridging to allow other channel operations to happen while the channel is bridged. ARI channel operations are designed to queue up and execute sequentially. This meant, though, that while a channel was bridged, any other channel operations would queue up and execute only after the channel left the bridge. This patch changes ARI bridging so that channel commands can execute while the channel is bridged. For most operations, things simply work as expected. The one thing that ended up being a bit odd is recording. The current recording implementation will fail when one attempts to record a channel that's in a bridge. Note that the bridge itself may be recording; it's recording a specific channel in the bridge that fails. While this is an annoying limitation, channel recording is still very useful for use cases such as voice mail, and bridge recording makes up much of the difference for other use cases. (closes issue ASTERISK-22084) Review: https://reviewboard.asterisk.org/r/2726/ * tests/test_hashtab_thrash.c: Missed a spot in r396559 * tests/test_hashtab_thrash.c: Fix build warnings when printf a tv_usec. The debug logs added in r396528 neglected to account for suseconds_t being an int. See r392076 for more info. 2013-08-12 22:05 +0000 [r396552] John Bigelow * res/res_pjsip_registrar.c: Add test suite events for when contacts are added or removed from an AOR These are needed by the pjsip inbound registration test suite tests. (issue ASTERISK-21833) (issue ASTERISK-21834) (issue ASTERISK-21835) (issue ASTERISK-21837) Review: https://reviewboard.asterisk.org/r/2700/ Review: https://reviewboard.asterisk.org/r/2739/ 2013-08-12 15:59 +0000 [r396542-396543] Matthew Jordan * main/bridge_channel.c, main/bridge.c, main/features.c: Fix two race conditions and ref counting issue when joining a bridge These problems were all caught by a test in the Asterisk Test Suite that originated some Local channels and attempted to move the ;2 half of the Local channel into a bridge using the Bridge AMI action. (1) When originating a channel, the Newchannel event is emitted quickly; however, the ;2 channel will not have a pbx thread assigned to it until after the outbound 'dialing' for the ;1 is complete. Thus, there is a period of time where the outside world "knows" of the channel's existence and can influence it but Asterisk has not yet started the dialplan execution thread. If a Bridge AMI action is taken on the channel, the channel appears to be a Dialed channel with no PBX thread; hence, the channel will be imparted into the Bridge by first 'yanking' the channel. At the same time, a race condition can occur after the yank (but before entering the bridge) when ;1 answers and starts a PBX on the ;2. The end result currently is an assertion failure in the Bridging API, as a channel with a PBX is imparted into the Bridge. There's no way to prevent AMI from attempting to Bridge a channel immediately after creation; likewise, holding the channel lock through the entire Dial operation is unwise (and impossible). Instead of treating the presence of a PBX thread as an error, we simply bail out of the adding the channel to the bridge through ast_bridge_impart. The Bridge action will then fail - but we avoid a situation where the channel is both executing a PBX thread and simultaneously being given a separate thread in the bridging system (which would be a "bad thing"). Since imparting a channel with a PBX *can* occur and is not a programming error, the asserts have been removed. (2) When the first condition occurs, we have to take one of two actions: either hangup the yanked channel as it did not enter the bridge, or deref it because we don't own it. We can determine if we own it or not by testing for the presence of the PBX thread. If we hung it up directly, we'd crash. (3) bridge_find_channel does not increase the reference count of the ast_bridge_channel object. The RAII_VAR usage in ast_bridge_add_channel thus created a ticking time bomb in whatever bridge the channel moved into, as the destructor for the ast_bridge_channel object would be called. Review: https://reviewboard.asterisk.org/r/2741/ * main/pbx.c: Unlock outgoing dial lock on off nominal path If the thread servicing the dial request isn't created successfully, the outgoing dial lock will still be held when the function returns. This patch unlocks the lock on this off nominal path. 2013-08-10 20:29 +0000 [r396521-396535] Matthew Jordan * tests/test_hashtab_thrash.c: Pipe test output through test object not stdout Otherwise, it doesn't show up in the automated test failures * tests/test_hashtab_thrash.c: Add some debugging when test_hashtab_thrash fails Disabling DEBUG_THREADS caused this test to fail on the 32-bit build agent. Adding some debugging to see why it thinks the test is timing out. * main/pbx.c: Unlock the dial operation lock on a failed dial If a dial operation fails, the pbx_outgoing_attempt routine will exit without first having unlocked the outgoing dial lock. This would be a "bad thing". 2013-08-09 21:50 +0000 [r396512] Richard Mudgett * bridges/bridge_native_rtp.c: bridge_native_rtp: Remove some unnecessary NULL checks on c1. 2013-08-09 20:29 +0000 [r396505] Walter Doekes * main/autoservice.c: Don't leak frames when memory is full in autoservice_run. Review: https://reviewboard.asterisk.org/r/2566/ 2013-08-09 17:28 +0000 [r396497-396498] Jonathan Rose * main/pbx.c, channels/chan_sip.c: pbx: Make originate threads indicate dial status when synchronous This makes it so that we can detect failures to originate as with earlier versions of Asterisk, which restores the Asterisk 11 behavior for the originate manager action. This was causing the ACL tests for SIP and IAX2 to fail since those tests expected originate failures when ACLs would cause rejections. Also, this patch fixes crashes in chan_sip when ACLs rejected peers during registration verification. (closes issue ASTERISK-22212) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2753/ * main/core_unreal.c, main/bridge_channel.c, include/asterisk/bridge.h, res/ari/resource_bridges.c, include/asterisk/core_unreal.h: bridge_channel: Support the lonely flag and make ARI use it. The lonely flag is an optional flag for bridge channels that will make them leave a bridge when a channel leaves if only lonely channels are in the bridge at that point. This is useful for things like ending recording and playback channels when they cease to be interacting with other channels in the bridge. (closes issue ASTERISK-22117) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2721/ 2013-08-09 13:58 +0000 [r396490] Matthew Jordan * apps/confbridge/conf_config_parser.c: Update documentation for ConfBridge with some additional markup Add some additional markup for items that needed it, e.g., replaceable tags, literal tags, etc. 2013-08-08 22:57 +0000 [r396480] Richard Mudgett * tests/test_stasis.c: Fix stasis/core unit test. Should have had the CR/LF. 2013-08-08 22:09 +0000 [r396474] Tzafrir Cohen * channels/chan_dahdi.c: chan_dahdi: create channels at run-time This code adds chan_dahdi the command 'dahdi create channels ' (where is a single - or 'new') and updates 'dahdi destroy channel' with a similar 'dahdi destroy channels'. It allows DAHDI channels and spans to be added after the initial channel load (without destroying all other channels as in 'dahdi restart'). It also includes some fixes to the D-Channel / span destruction code (r394552). This change is intended to provide a hook for a script running from udev once a span has been assigned ("registered") / unassigned ("unregistered") for its channels. The udev hook configures the span's channels with dahdi_cfg -S, and can then ask Asterisk to create ethe channels. See the scripts added to DAHDI-tools in 2.7.0. Review: https://reviewboard.asterisk.org/r/1598/ 2013-08-08 20:52 +0000 [r396417-396463] Richard Mudgett * tests/test_stasis.c: Add missing CR/LF to FakeMI stasis test AMI event. * main/stasis_bridges.c: Remove extra CR/LF from AMI event. * main/manager_bridges.c, apps/confbridge/confbridge_manager.c, include/asterisk/manager.h, main/stasis_bridges.c: Make bridge snapshots use prefixes. * Changed ast_manager_build_bridge_state_string() to assume an empty prefix string just like ast_manager_build_channel_state_string(). * Created ast_manager_build_bridge_state_string_prefix() to work just like ast_manager_build_channel_state_string_prefix(). * Made BridgeMerge AMI event use To/From prefixes. 2013-08-08 18:40 +0000 [r396412] Matthew Jordan * formats/format_wav_gsm.c: Improve disk writes for wav49 format Writing to a file in the wav49 format performs rather inefficiently. The procedure is approximately: (1) Write GSM frame to the end of the file (2) Seek to the end of the file (3) Seek to the header (4) Update the file size (5) Seek (again) to the end of the file (6) Repeat This pattern negates any attempt to use the stdio buffering setup in ast_writefile. It also results in many small writes that require a seek going to the disk each second which translates to poor disk performance on certain file systems, particularly when there are multiple wav49 files being written simultaneously. (closes issue ASTERISK-19595) Reported by: Byron Clark Tested by: Byron Clark patches: gsm_wav_only_update_header_on_close.patch uploaded by byronclark (License 6157) 2013-08-08 17:51 +0000 [r396401] Richard Mudgett * main/channel_internal_api.c, main/features.c, include/asterisk/bridge_features.h, main/bridge.c: Remove some resolved or obsolete BUGBUG comments. 2013-08-08 14:13 +0000 [r396391-396392] Matthew Jordan * apps/confbridge/conf_chan_announce.c, main/manager_channels.c, main/channel.c, main/manager_bridges.c, channels/chan_bridge_media.c, apps/confbridge/conf_chan_record.c, main/channel_internal_api.c, include/asterisk/channel.h, main/cel.c: Hide the Surrogate channels from external consumers; kill Masquerade events This patch does three things: 1. It provides a Surrogate channel technology with a consolidated "implementation detail flag" on the channel technology. This tells consumers of Stasis that the creation of this channel is an implementation detail in Asterisk and can be ignored (if they so choose). This consolidates the conference recorder/announcer flags as well - these flags had no additional meaning beyond "ignore this channel please". 2. It modifies allocation of a channel in two ways: (a) If a channel technology can be determined from the name, we set it directly in the allocation routine. This prevents the initial publication of the message from going out with a NULL channel technology where possible. This lets Stasis consumers get the right channel technology on the first publication. (b) It reorganizes allocation to make use of the 'finalized' property on the channel. This was already used to know that a channel had completely finished its construction in the masquerade routine; now we also use it to know whether or not the setting of certain channel properties is occurring during or post construction. The various set routines were modified accordingly as well. 3. The masquerade event is now dead, Jim. It no longer served any purpose whatsoever - if you perform a call pickup you'll get a Pickup event; if you perform an attended transfer you will still get those events; if you steal a channel to put it elsewhere you'll get the corresponding NewExten or BridgeEnter events. Review: https://reviewboard.asterisk.org/r/2740 * main/utils.c: Prevent spurious memory error when appending backtrace with MALLOC_DEBUG Backtraces are allocated outside of the usual memory tracking performed by MALLOC_DEBUG. This allows them to be used by the memory tracking enabled by that build option; however, it also means that when backtraces are disposed of they have to be done so outside of the re-defined free. This patch undef's free prior to disposing of the allocated backtrace when a backtrace is appended as a result of 'core show locks'. 2013-08-08 12:38 +0000 [r396385] Kinsey Moore * main/bridge.c: Prevent unreal channels from optimizing during DTMF emulation This prevents unreal channel optimization during the prequalification phase when either channel is involved in DTMF emulation. This prevents a situation where an emulated digit would be missed because the emulation was never completed. Review: https://reviewboard.asterisk.org/r/2747/ (closes issue ASTERISK-22214) 2013-08-08 07:05 +0000 [r396378] Igor Goncharovskiy * channels/chan_unistim.c, /: - Fix different issues with call transfer cancel. In case 3rd party busy or congestion call was not returned. - Fix displaying soft button 'Redial' in case of no redial number exists ........ Merged revisions 396377 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-08 02:58 +0000 [r396365-396371] Matthew Jordan * main/cdr.c: Handle Surrogate channels in Dial message processing Depending on when a Surrogate channel replaces an existing channel, it is possible to get a Dial message for the Surrogate channel. When this occurs, no CDR will exist for the channel as Surrogate channels are ignored. Safely handle the case when a CDR doesn't exist for a Dial message. * apps/app_queue.c: Perform Ring-No-Answer checks before processing Hangup logic The rna() routine will raise a Stasis message involving both the caller and the agent. This doesn't work so well if we already hung up the agent channel, as the channel doesn't quite exist. Not surprisingly, this will crash. This patch properly runs the rna subroutine (performing all of the Ring-No-Answer logic) prior to hanging up the agent channel. (closes issue ASTERISK-22258) Reported by: Kiril Valchev Tested by: Kiril Valchev 2013-08-06 21:20 +0000 [r396329-396347] David M. Lee * apps/app_meetme.c: Fixed app_meetme for cache split changes * include/asterisk/frame.h, rest-api/api-docs/recordings.json, res/ari/resource_recordings.c, apps/app_voicemail.c, main/channel.c, res/res_ari_recordings.c, include/asterisk/app.h, include/asterisk/stasis_app_recording.h, res/ari/resource_recordings.h, funcs/func_frame_trace.c, apps/app_minivm.c, main/app.c, res/res_stasis_recording.c: ARI: Add recording controls This patch implements the controls from ARI recordings. The controls are: * DELETE /recordings/live/{recordingName} - stop recording and discard it * POST /recordings/live/{recordingName}/stop - stop recording * POST /recordings/live/{recordingName}/pause - pause recording * POST /recordings/live/{recordingName}/unpause - resume recording * POST /recordings/live/{recordingName}/mute - mute recording (record silence to the file) * POST /recordings/live/{recordingName}/unmute - unmute recording. Since this underlying functionality did not already exist, is was added to app.c by a set of control frames, similar to how playback control works. The pause/mute control frames are toggles, even though the ARI controls are idempotent, to be consistent with the playback control frames. (closes issue ASTERISK-22181) Review: https://reviewboard.asterisk.org/r/2697/ * main/stasis_cache_pattern.c, main/stasis_cache.c, include/asterisk/stasis.h, tests/test_stasis.c: Tweak caching topics to fix CEL tests The Stasis changes in r395954 had an unanticipated side effect: messages published directly to an _all topic does not get forwarded to the corresponding caching topic. This patch fixes that by changing how caching topics forward messages, and how the caching pattern forwards are setup. For the caching pattern, the all_topic is forwarded to the all_topic_cached. This forwards messages published directly to the all_topic to all_topic_cached. In order to avoid duplicate messages on all_topic_cached, caching topics were changed to no longer forward uncached messages. Subscribers to an individual caching topic should only expect to receive cache updates, and subscription change messages. Since individual caching topics are new, this shouldn't be a problem. There are a few minor changes to the pre-cache split behavior. * For topics changed to use the caching pattern, the all_topic_cached will forward snapshots in addition to cache updates. Since subscribers by design ignore unexpected messages, this should be fine. * Caching topics that don't use the caching pattern no longer forward non-cache updates. This makes no difference for the current caching topics. * mwi_topic_cached, channel_by_name_topic and presence_state_topic_cached have no subscribers * device_state_topic_cached's only subscriber only processes cache udpates (issue ASTERISK-22243) Review: https://reviewboard.asterisk.org/r/2738 2013-08-06 13:08 +0000 [r396320-396321] Kinsey Moore * res/res_pjsip/include/res_pjsip_private.h, res/res_pjsip.c, res/res_pjsip/config_system.c: Expose res_pjsip threadpool options Expose initial size, automatic increment, maximum size, and idle timeout as configurable parameters for the res_pjsip thread pool. Review: https://reviewboard.asterisk.org/r/2704/ (closes issue ASTERISK-22143) * main/cdr.c: Fix memory leaks in the CDR engine Fix refcount bugs and a possible locking problem in the CDR engine relating to use of ao2_iterators. Review: https://reviewboard.asterisk.org/r/2724/ (closes issue ASTERISK-22126) 2013-08-06 12:39 +0000 [r396319] Joshua Colp * res/res_pjsip_notify.c, res/res_pjsip_outbound_registration.c, res/res_pjsip_messaging.c, res/res_pjsip_exten_state.c: Fix crash in res_pjsip_outbound_registration when the remote server can not be resolved. This crash was caused by decrementing the reference count of a newly created message when it should not be. This change fixes that but also fixes all other cases where this was incorrectly done. (closes issue ASTERISK-22188) Reported by: Kinsey Moore 2013-08-06 08:43 +0000 [r396309-396311] Walter Doekes * /, funcs/func_strings.c: Check result of ast_var_assign() calls for memory allocation failure (2). Missed a spot in the previous commit. ........ Merged revisions 396310 from http://svn.asterisk.org/svn/asterisk/branches/11 * pbx/pbx_dundi.c, utils/extconf.c, apps/app_stack.c, apps/app_playback.c, funcs/func_global.c, main/cdr.c, pbx/pbx_loopback.c, main/pbx.c, /, funcs/func_strings.c: Check result of ast_var_assign() calls for memory allocation failure. We try to keep the system running even when all available memory is spent. Review: https://reviewboard.asterisk.org/r/2734/ ........ Merged revisions 396279 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396287 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-05 20:20 +0000 [r396253] Michael L. Young * /, channels/chan_sip.c: Fix Registration Failure When A Peer And TLS Are Used If a peer is used in a register line and TLS is defined as the transport, the registration fails since the transport on the dialog is never set properly resulting in UDP being used instead of TLS. This patch sets the dialog's transport based on the transport that was defined in the register line. If the register line does not specify a transport, the parsing function for the register line always defaults back to UDP. (closes issue ASTERISK-21964) Reported by: Doug Bailey Tested by: Doug Bailey Patches: asterisk-21964-set-reg-dialog-transport.diff by Michael L. Young (license 5026) ........ Merged revisions 396240 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396248 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-05 20:18 +0000 [r396245] Jonathan Rose * main/bridge_basic.c, main/features.c, include/asterisk/bridge_basic.h: bridge features: Dial and Queue add features instead of replace them. Dial and Queue would previously apply a new set of features whenever bridging. These options would be based purely on the options supplied to the dial/queue applications. This patch changes the function those applications use to bridge calls so that the features will be added to the set of existing features for each channel rather than having them override the existing features. (closes issue ASTERISK-22209) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/2713/ 2013-08-05 19:01 +0000 [r396201] Matthew Jordan * res/res_pjsip_outbound_registration.c: Add AMI registration events for PJSIP outbound registration attempts This patch adds AMI events whenever an outbound registration attempt succeeds or fails from res_pjsip_outbound_registration. This brings it inline with the existing SIP channel driver and IAX channel driver. Review: https://reviewboard.asterisk.org/r/2729/ 2013-08-05 18:52 +0000 [r396198-396200] Michael L. Young * /, UPGRADE-11.txt: Change "from" to "From". (related to issue ASTERISK-21903) ........ Merged revisions 396199 from http://svn.asterisk.org/svn/asterisk/branches/11 * UPGRADE-11.txt, /: Adding a note to UPGRADE.txt about a change made to res_agi in order to indicate when streaming an audio file fails like it is done in other parts of the code to indicate an error. Note was requested by Paul Belanger: http://lists.digium.com/pipermail/asterisk-dev/2013-July/061420.html (related to issue ASTERISK-21903) ........ Merged revisions 396196 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 396197 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-08-05 17:48 +0000 [r396175-396189] Jonathan Rose * bridges/bridge_holding.c: bridge_holding: Add suspsend/unsuspend callbacks Suspend and unsuspend callbacks are added to the holding bridge so that entertainment can be disabled and re-enabled when operations would suspend a channel on the bridge (such as playback operations). This fixes entertainment so that when those operations end, the entertainment can pick back up and it also serves as an optimization. Also, this patch fixes a bug caused by triggering ringing frames immediately instead of pushing them to the queue which created a race condition where sometimes parking with ringing during attended transfers would cause the ringing to be interrupted by an unhold frame. (closes issue ASTERISK-22006) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2711/ * res/res_ari_bridges.c, include/asterisk/bridge_roles.h, res/ari/resource_bridges.h, res/stasis/control.c, include/asterisk/stasis_app.h, main/bridge_roles.c, rest-api/api-docs/bridges.json, res/ari/resource_bridges.c: ARI: bridges/{bridgeID}/addChannel: add roles parameter Roles are now cleared with each entry into a bridge with addChannel. If the roles parameter is present, the role specified will be applied to all channels being added with the addChannel command. (closes issue ASTERISK-21973) Reported by: Matt Jordan https://reviewboard.asterisk.org/r/2691/ * res/parking/res_parking.h, res/res_parking.c, res/parking/parking_tests.c (added), res/parking/parking_bridge.c: res_parking: Unit tests Adds the following unit tests: * create_lot: tests adding and removal of a new parking lot (baseline) * park_extensions: creates a parking lot that registers extensions and then confirms that all of the expected extensions exist * extensions_conflicts: creates numerous parking lots to test that extension conflicts in parking lots result in parking lot creation failing * dynamic_parking_variables: Tests that the creation of dynamic parking lots respects the related channel variables set on the channel that requests them. * park_call: Tests adding a channel to a parking lot's holding bridge by standard parking functions. * retrieve_call: Tests pulling a channel out of a parking lot's holding bridge via parked call retrieval functions. (closes issue ASTERISK-22138) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2714/ 2013-08-05 14:35 +0000 [r396166] David M. Lee * main/asterisk.c, main/cli.c, main/channel.c, main/pbx.c, main/manager.c, res/ari/resource_asterisk.c, utils/extconf.c, include/asterisk/options.h: Fix res_ari_asterisk load issue The new res_ari_asterisk.so module presents several config options from asterisk main. Unfortunately, they aren't exported, so the module won't load on Linux. This patch renames the variables, adding the ast_ prefix so they will be exported. Review: https://reviewboard.asterisk.org/r/2737 2013-08-03 03:53 +0000 [r396158] Matthew Jordan * main/manager_bridges.c: Don't unsubscribe from the AMI message router from manager_bridges The AMI message router is owned wholly by manager.c. Previously, each of the manager_{item} source files had their own message router and they unsubscribed from each; once they moved over to using a single message router only a single unsubscribe became necessary. 2013-08-02 17:50 +0000 [r396145] Mark Michelson * channels/sig_pri.c: And get rid of another ast_bridged_channel() 2013-08-02 17:29 +0000 [r396136-396143] David M. Lee * main/stasis_bridges.c: Clean up ast_json with ast_json_unref * /: Removed svnmerge-integrated from trunk 2013-08-02 15:01 +0000 [r396126] Mark Michelson * res/snmp/agent.c: Get the SNMP code to compile. 2013-08-02 14:46 +0000 [r396119-396125] David M. Lee * res/ari/ari_model_validators.c, res/ari/ari_model_validators.h, rest-api/api-docs/asterisk.json, res/ari/resource_asterisk.c: ARI - GET /ari/asterisk/info This patch adds basic system information access to ARI. The results are roughly what you get from 'core show settings', with a few minor differences. * Data is structured, with 'build', 'system', 'config' and 'status' sub-objects. * Each sub-object is selectable, using the ?only= parameter. A comma separated list can be provided to select multiple sections. * A few config options are numeric, for which 0 means 'unlimited'. Instead of having a special interpretation of those fields, they are simply omitted if they're 0. * The information is limited to what might be useful to building external applications. (closes issue ASTERISK-21575) Review: https://reviewboard.asterisk.org/r/2702/ * rest-api-templates/param_cleanup.mustache (added), rest-api/api-docs/events.json, /, res/ari/resource_events.c, rest-api-templates/ari_resource.h.mustache, res/res_ari_asterisk.c, res/res_ari_playback.c, rest-api-templates/res_ari_resource.c.mustache, res/ari/resource_events.h, rest-api/api-docs/sounds.json, res/res_ari_channels.c, rest-api/api-docs/bridges.json, rest-api-templates/param_parsing.mustache, res/ari/resource_bridges.c, res/ari/resource_sounds.h, res/res_ari_recordings.c, res/ari/resource_bridges.h, res/res_ari_endpoints.c, res/res_ari_events.c, res/ari/resource_asterisk.h, rest-api/api-docs/channels.json, res/res_ari_sounds.c, res/res_ari_bridges.c: ARI - implement allowMultiple for parameters Swagger allows parameters to be specified as 'allowMultiple', meaning that the parameter may be specified as a comma separated list of values. I had written some of the API docs using that, but promptly forgot about implementing it. This patch finally fills in that gap. The codegen template was updated to represent 'allowMultiple' fields as array/size fields in the _args structs. It also parses the comma separated list using ast_app_separate_args(), so quoted strings in the argument will be handled properly. Review: https://reviewboard.asterisk.org/r/2698/ * tests/test_json.c, main/json.c, res/res_sorcery_astdb.c, include/asterisk/json.h, main/cel.c, res/ari/ari_websockets.c: Address JSON thread safety issues. In tracking down some unit tests failures, I ended up reading the fine print[1] regarding Jansson's thread safety. In short: 1. Ref-counting is non-atomic. 2. json_dumps() and friends are not thread safe. This patch adds locking where necessary to our ast_json_* wrapper API, with documentation in json.h describing the thread safety limitations of the API. [1]: http://www.digip.org/jansson/doc/2.4/portability.html#thread-safety Review: https://reviewboard.asterisk.org/r/2716/ 2013-08-02 14:13 +0000 [r396107] Mark Michelson * main/cel.c, include/asterisk/parking.h, main/bridge_channel.c, main/stasis_bridges.c, res/parking/parking_manager.c, res/parking/parking_bridge.c, main/manager_bridges.c, include/asterisk/stasis_bridges.h: Make a couple of changes to help AMI events to be more clear in what is occurring. * BridgeEnter now contains the unique ID of the channel that is to be swapped out, if applicable. * There is a ParkedCallSwap event that is sent when a parked channel has a new channel take its place. (closes issue ASTERISK-22193) reported by Mark Michelson Review: https://reviewboard.asterisk.org/r/2712 2013-08-02 14:08 +0000 [r396105] Kinsey Moore * include/asterisk/strings.h, main/astobj2.c, utils/Makefile, utils/refcounter.c, main/strings.c, include/asterisk/astobj2.h: Move ast_str_container_alloc and friends This moves ast_str_container_alloc, ast_str_container_add, ast_str_container_remove, and related private functions into strings.c/h since they really don't belong in astobj2.c/h. As a result of this move, utils also had to be updated. Review: https://reviewboard.asterisk.org/r/2719/ (closes issue ASTERISK-22041) 2013-08-02 14:05 +0000 [r396102-396103] Mark Michelson * channels/chan_sip.c, channels/chan_skinny.c, funcs/func_channel.c, main/channel_internal_api.c, include/asterisk/channel.h, channels/chan_iax2.c, apps/app_chanspy.c, channels/chan_oss.c, channels/chan_mgcp.c, main/channel.c, channels/chan_dahdi.c, channels/chan_misdn.c, main/rtp_engine.c: Get rid of ast_bridged_channel() and the bridged_channel field on ast_channels. This commit is smaller than the initial review placed on review board. This is because a change to allow for channel drivers to access parking functionality externally was committed and invalidated quite a few of the changes initially made. (closes issue ASTERISK-22039) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2717 * include/asterisk/pickup.h: Make sure that pickup.h does not use an include guard name used elsewhere. 2013-08-02 13:29 +0000 [r396087-396099] Kinsey Moore * main/pickup.c: Correct the last of the Newchannel xi:includes * res/res_pjsip_notify.c, res/res_pjsip_outbound_registration.c, res/res_pjsip/include/res_pjsip_private.h, res/res_pjsip/pjsip_options.c, res/res_pjsip.c: Add CLI/AMI commands to force chan_pjsip actions For chan_pjsip, this introduces CLI/AMI remote unregistration commands, reworks CLI syntax for sending NOTIFYs, adds AMI qualification support, and adds documentation for PJSIPNotify. This also fixes two refcounting bugs in the outbound registration code. Review: https://reviewboard.asterisk.org/r/2695/ (closes issue ASTERISK-21939) 2013-08-02 04:48 +0000 [r396075] David M. Lee * channels/sig_analog.c: Fixed chan_dahdi compilation failure 2013-08-02 03:12 +0000 [r396060-396062] Matthew Jordan * tests/test_cel.c, tests/test_cdr.c: Fix test modules More missing include files. :-\ * channels/chan_dahdi.c, channels/chan_mgcp.c: Add pickup.h include lines for chan_dahdi and chan_mgcp * include/asterisk/parking.h, include/asterisk/pickup.h (added), main/asterisk.c, res/parking/parking_manager.c, tests/test_cdr.c, channels/chan_unistim.c, main/pbx.c, res/stasis/control.c, main/pickup.c (added), channels/chan_sip.c, main/bridge.c, UPGRADE.txt, res/parking/parking_applications.c, include/asterisk/_private.h, channels/chan_gtalk.c, main/cel.c, CHANGES, include/asterisk/features.h, main/cdr.c, res/res_parking.c, channels/chan_skinny.c, apps/app_directed_pickup.c, main/features.c, tests/test_cel.c: Remove dead code from features.c; refactor pickup code into pickup.c This patch does the following: * It moves the pickup code out of features.c and into pickup.c * It removes the vast majority of dead code out of features.c. In particular, this includes the parking code. (issue ASTERISK-22134) 2013-08-01 23:38 +0000 [r396048] Joshua Colp * res/res_pjsip_registrar.c: Fix a crash due to performing full URI validation on a contact which only contains '*'. (closes issue AST-1198) Reported by: John Bigelow 2013-08-01 21:19 +0000 [r396035] David M. Lee * main/sorcery.c: Fix sorcery for some rather picky regex implementations. Some regex implementations won't compile an empty string. Assuming that it's equivalent of a regex that will match anything, use ".?" instead. 2013-08-01 20:55 +0000 [r396010-396028] Matthew Jordan * channels/chan_skinny.c, main/parking.c, main/bridge.c, main/features.c, channels/chan_iax2.c, include/asterisk/parking.h, main/bridge_channel.c, res/parking/parking_bridge_features.c, channels/chan_mgcp.c, include/asterisk/features.h, channels/chan_dahdi.c, res/res_parking.c, channels/sig_analog.c: Support externally initiated parking requests; remove some dead code This patch does the following: * It adds support for externally initiated parking requests. In particular, chan_skinny has a protocol level message that initiates a call park. This patch now supports that option, as well as the protocol specific mechanisms in chan_dahdi/sig_analog and chan_mgcp. * A parking bridge features virtual table has been added that provides access to the parking functionality that the Bridging API needs. This includes requests to park an entire 'call' (with little or no additional information, thank you chan_skinny), perform a blind transfer to a parking extension, determine if an extension is a parking extension, as well as the actual "do the parking" request from the Bridging API. * Refactoring in chan_mgcp, chan_skinny, and chan_dahdi to make use of the new functions * The removal of some - but not all - dead parking code from features.c This also fixed blind transferring a multi-party bridge to a parking lot (which was implemented, but had at least one code path where using the parking features kK might not have worked) Review: https://reviewboard.asterisk.org/r/2710 (closes issue ASTERISK-22134) Reported by: Matt Jordan * CHANGES, apps/app_queue.c: Add queue member paused hints This patch adds the ability in Queue to raise a hint when a member's paused state changes. The hint uses the form 'Queue:{queue_name}_pause_{member_name}', where {queue_name} and {member_name} are the name of the queue and the name of the member to subscribe to, respectively. For example: exten => 8501,hint,Queue:sales_pause_mark. Members will show as In Use when paused. Note that the format of the queue pause hint was changed slightly from what is on the issue to accomodate suggestion on the code review. Review: https://reviewboard.asterisk.org/r/2254 (closes issue ASTERISK-20842) Reported by: Philippe Lindheimer patches: qpause-10-378206.diff uploaded by Philippe Lindheimer (license 5519) qpause-11-378206.diff uploaded by Philippe Lindheimer (license 5519) qpause-trunk-378206.diff uploaded by Philippe Lindheimer (license 5519) 2013-08-01 17:23 +0000 [r395985-395998] Kinsey Moore * configure: Regenerate configure for configure.ac changes * Makefile, apps/confbridge/confbridge_manager.c, makeopts.in, doc/appdocsxml.dtd, apps/app_stack.c, res/parking/parking_manager.c, main/manager_mwi.c, main/rtp_engine.c, apps/app_meetme.c, include/asterisk/autoconfig.h.in, main/xml.c, main/stasis_bridges.c, contrib/scripts/install_prereq, main/manager_bridges.c, channels/chan_dahdi.c, main/manager.c, doc/snapshots.xslt (added), main/features.c, apps/app_minivm.c, res/res_agi.c, main/stasis_channels.c, main/manager_channels.c, channels/chan_sip.c, main/Makefile, configure.ac, UPGRADE.txt, main/aoc.c, main/core_local.c, channels/sig_pri.c, apps/app_queue.c, CHANGES, funcs/func_global.c, apps/app_agent_pool.c: Fix documentation replication issues This prevents XML documentation duplication by expanding channel and bridge snapshot tags into channel and bridge snapshot parameter sets with a given prefix or defaulting to no prefix. This also prevents documentation from becoming fractured and out of date by keeping all variations of the documentation in template form such that it only needs to be updated once and keeps maintenance to a minimum. Review: https://reviewboard.asterisk.org/r/2708/ 2013-08-01 16:56 +0000 [r395954-395984] David M. Lee * utils/astman.c: Fixed warning in astman for gcc-4.8. * res/res_pjsip_mwi.c, channels/chan_pjsip.c: Fixed compile errors introduced in r395954. Just a merge error due to a file rename. Grrr... * main/manager.c, tests/test_devicestate.c, res/res_agi.c, include/asterisk/stasis_cache_pattern.h (added), main/app.c, main/stasis_channels.c, res/ari/resource_channels.c, include/asterisk/stasis_endpoints.h, include/asterisk/bridge.h, main/manager_channels.c, channels/chan_mgcp.c, main/pbx.c, include/asterisk/devicestate.h, main/stasis_cache.c, res/ari/resource_endpoints.c, channels/chan_sip.c, main/channel_internal_api.c, include/asterisk/presencestate.h, include/asterisk/stasis_bridges.h, include/asterisk/stasis.h, include/asterisk/channel.h, channels/sig_pri.c, main/cel.c, tests/test_stasis_endpoints.c, res/ari/resource_bridges.c, include/asterisk/app.h, include/asterisk/stasis_channels.h, apps/confbridge/confbridge_manager.c, tests/test_cel.c, tests/test_stasis.c, res/res_stasis.c, main/stasis_cache_pattern.c (added), apps/app_voicemail.c, channels/chan_unistim.c, main/stasis_endpoints.c, main/stasis_wait.c (added), apps/app_meetme.c, res/stasis/control.c, main/bridge.c, main/manager_endpoints.c, include/asterisk/channel_internal.h, main/devicestate.c, res/res_xmpp.c, main/endpoints.c, channels/chan_iax2.c, res/res_jabber.c, main/presencestate.c, main/stasis_bridges.c, res/res_chan_stats.c, main/stasis.c, main/cli.c, main/cdr.c, channels/chan_dahdi.c, main/manager_bridges.c: Split caching out from the stasis_caching_topic. In working with res_stasis, I discovered a significant limitation to the current structure of stasis_caching_topics: you cannot subscribe to cache updates for a single channel/bridge/endpoint/etc. To address this, this patch splits the cache away from the stasis_caching_topic, making it a first class object. The stasis_cache object is shared amongst individual stasis_caching_topics that are created per channel/endpoint/etc. These are still forwarded to global whatever_all_cached topics, so their use from most of the code does not change. In making these changes, I noticed that we frequently used a similar pattern for bridges, endpoints and channels: single_topic ----------------> all_topic ^ | single_topic_cached ----+----> all_topic_cached | +----> cache This pattern was extracted as the 'Stasis Caching Pattern', defined in stasis_caching_pattern.h. This avoids a lot of duplicate code between the different domain objects. Since the cache is now disassociated from its upstream caching topics, this also necessitated a change to how the 'guaranteed' flag worked for retrieving from a cache. The code for handling the caching guarantee was extracted into a 'stasis_topic_wait' function, which works for any stasis_topic. (closes issue ASTERISK-22002) Review: https://reviewboard.asterisk.org/r/2672/ 2013-08-01 11:21 +0000 [r395938] Joshua Colp * res/res_pjsip_session.c: Answer with multiple codecs if the underlying pjproject supports it. 2013-08-01 00:07 +0000 [r395906-395907] Matthew Jordan * channels/chan_sip.c: Raise Registry AMI events on registration failures This patch makes it so that all registration attempts that fail that also permanently modify the registration state will raise an appropriate AMI event. Note that this patch was forward ported to trunk and the Stasis Core message bus by mjordan. (closes issue ASTERISK-21368) Reported by: Dmitriy Serov patches: chan_sip.c.diff uploaded by Demon (license 6479) * res/res_agi.c, CHANGES: Update CONTROL STREAM FILE to accept an 'offsetms' parameter This patch allows starting playback of audio through the CONTROL STREAM FILE AGI command to start at a particular offset. It will also return the final position of the file in the 'endpos' attribute. (closes issue ASTERISK-17803) Reported by: Murray Melvin patches: res_agi.c.r316293.diff uploaded by murraytm (license 6221) 2013-07-31 15:43 +0000 [r395884] Mark Michelson * res/res_pjsip/pjsip_options.c: Found another missed "sip" -> "pjsip" CLI command. 2013-07-31 15:27 +0000 [r395881] Kinsey Moore * tests/test_cel.c: Disable CEL tests that need rearchitecting to operate properly 2013-07-31 14:45 +0000 [r395868] Mark Michelson * res/res_pjsip_endpoint_identifier_constant.c (removed): Remove "constant" endpoint identifier. This was created as a debugging tool before proper endpoint identifiers were created. Using it now can actually lead to harmful results. 2013-07-31 14:29 +0000 [r395866] Joshua Colp * bridges/bridge_native_rtp.c: Fix hold/unhold in bridge_native_rtp, use tech_pvt instead of bridge_pvt, reduce bridging attempts, and fix breaking native RTP bridges. (closes issue ASTERISK-22128) (closes issue ASTERISK-22104) 2013-07-31 13:31 +0000 [r395837-395851] Kinsey Moore * channels/chan_pjsip.c, include/asterisk/res_pjsip.h, include/asterisk/res_pjsip_pubsub.h, include/asterisk/res_pjsip_exten_state.h, include/asterisk/res_pjsip_session.h, configs/pjsip.conf.sample, res/res_pjsip/include/res_pjsip_private.h: Fix remnants of the pjsip renaming * tests/test_cel.c: Enforce conference exit order for CEL tests 2013-07-30 22:41 +0000 [r395810-395824] Mark Michelson * res/res_pjsip_endpoint_identifier_ip.c: Missed a conversion to pjsip.conf in documentation and sorcery. * main/abstract_jb.c: Remove ast_bridged_channel call from abstract_jb.c Interestingly, this only happens in dead code. 2013-07-30 20:44 +0000 [r395793] David M. Lee * res/res_pjsip: Setting svn:ignore for res/res_pjsip 2013-07-30 19:10 +0000 [r395748-395779] Mark Michelson * res/res_pjsip_endpoint_identifier_constant.c: Update res_pjsip_endpoint_identifier_constant.c to use reorganized endpoint structure. * res/res_sip_nat.c (removed), res/res_pjsip_outbound_registration.c (added), res/res_sip_session.c (removed), res/res_pjsip_endpoint_identifier_anonymous.c (added), res/res_sip_rfc3326.c (removed), res/res_pjsip_acl.c (added), res/res_pjsip/pjsip_distributor.c (added), res/res_sip_endpoint_identifier_constant.c (removed), res/res_sip_mwi.c (removed), res/res_pjsip_diversion.c (added), res/res_sip (removed), res/res_pjsip_dtmf_info.c (added), res/res_sip_pubsub.c (removed), include/asterisk/res_pjsip_exten_state.h (added), res/res_pjsip_sdp_rtp.c (added), res/res_pjsip_messaging.c (added), res/res_pjsip_registrar_expire.c (added), res/res_pjsip_caller_id.c (added), res/res_sip_authenticator_digest.c (removed), res/res_sip_session.exports.in (removed), res/res_pjsip_exten_state.c (added), res/res_sip_logger.c (removed), res/res_sip.c (removed), res/res_pjsip_pubsub.exports.in (added), res/res_pjsip_endpoint_identifier_constant.c (added), res/res_sip_outbound_registration.c (removed), res/res_sip_endpoint_identifier_anonymous.c (removed), res/res_pjsip_pubsub.c (added), res/res_pjsip/config_transport.c (added), res/res_pjsip_transport_websocket.c (added), res/res_pjsip_registrar.c (added), channels/chan_pjsip.c (added), res/res_pjsip/pjsip_outbound_auth.c (added), res/res_pjsip/config_global.c (added), res/res_sip_acl.c (removed), res/res_sip_diversion.c (removed), res/res_pjsip_authenticator_digest.c (added), res/res_pjsip_session.exports.in (added), res/res_sip_dtmf_info.c (removed), res/res_pjsip/config_domain_aliases.c (added), include/asterisk/res_sip_session.h (removed), res/res_pjsip_t38.c (added), res/res_sip_notify.c (removed), res/res_pjsip_logger.c (added), res/res_pjsip/pjsip_options.c (added), res/res_sip_endpoint_identifier_ip.c (removed), res/res_sip_sdp_rtp.c (removed), res/res_sip_messaging.c (removed), include/asterisk/res_pjsip_pubsub.h (added), res/res_sip_caller_id.c (removed), res/res_sip_endpoint_identifier_user.c (removed), res/res_sip_pidf.c (removed), res/res_pjsip_outbound_authenticator_digest.c (added), res/res_sip_exten_state.c (removed), res/res_pjsip_one_touch_record_info.c (added), res/res_sip_pubsub.exports.in (removed), res/res_pjsip_refer.c (added), include/asterisk/res_pjsip_session.h (added), res/res_pjsip_notify.c (added), res/res_sip_transport_websocket.c (removed), res/res_sip_registrar.c (removed), res/res_pjsip_endpoint_identifier_ip.c (added), include/asterisk/res_sip.h (removed), res/res_pjsip/config_security.c (added), res/res_sip.exports.in (removed), res/Makefile, res/res_sip_exten_state.exports.in (removed), res/res_pjsip_endpoint_identifier_user.c (added), res/res_pjsip/include (added), res/res_pjsip_pidf.c (added), res/res_pjsip_nat.c (added), res/res_pjsip_session.c (added), res/res_sip_t38.c (removed), channels/chan_gulp.c (removed), res/res_pjsip/location.c (added), res/res_pjsip_rfc3326.c (added), res/res_pjsip/config_system.c (added), configs/pjsip.conf.sample (added), include/asterisk/res_sip_pubsub.h (removed), res/res_pjsip_mwi.c (added), res/res_pjsip/pjsip_configuration.c (added), res/res_sip_outbound_authenticator_digest.c (removed), res/res_pjsip (added), res/res_pjsip/include/res_pjsip_private.h (added), res/res_sip_one_touch_record_info.c (removed), include/asterisk/res_pjsip.h (added), res/res_pjsip/config_auth.c (added), res/res_pjsip.exports.in (added), configs/res_sip.conf.sample (removed), res/res_sip_refer.c (removed), res/res_pjsip_exten_state.exports.in (added), res/res_pjsip/security_events.c (added), include/asterisk/res_sip_exten_state.h (removed), res/res_pjsip/pjsip_global_headers.c (added), res/res_pjsip.c (added), res/res_sip_registrar_expire.c (removed): The large GULP->PJSIP renaming effort. The general gist is to have a clear boundary between old SIP stuff and new SIP stuff by having the word "SIP" for old stuff and "PJSIP" for new stuff. Here's a brief rundown of the changes: * The word "Gulp" in dialstrings, functions, and CLI commands is now "PJSIP" * chan_gulp.c is now chan_pjsip.c * Function names in chan_gulp.c that were "gulp_*" are now "chan_pjsip_*" * All files that were "res_sip*" are now "res_pjsip*" * The "res_sip" directory is now "res_pjsip" * Files in the "res_pjsip" directory that began with "sip_*" are now "pjsip_*" * The configuration file is now "pjsip.conf" instead of "res_sip.conf" * The module info for all PJSIP-related files now uses "PJSIP" instead of "SIP" * CLI and AMI commands created by Asterisk's PJSIP modules now have "pjsip" as the starting word instead of "sip" * res/res_sip/sip_options.c, res/res_sip_outbound_authenticator_digest.c, res/res_sip_outbound_registration.c, res/res_sip_mwi.c, res/res_sip_one_touch_record_info.c, res/res_sip_pubsub.c, res/res_sip_diversion.c, res/res_sip/sip_configuration.c, include/asterisk/res_sip.h, res/res_sip/sip_distributor.c, res/res_sip.exports.in, res/res_sip_authenticator_digest.c, res/res_sip/sip_outbound_auth.c, res/res_sip_sdp_rtp.c, res/res_sip_messaging.c, res/res_sip_t38.c, channels/chan_gulp.c, res/res_sip_caller_id.c, res/res_sip.c, res/res_sip_nat.c, res/res_sip_session.c: Reorganize the ast_sip_endpoint structure into substructures. (closes issue ASTERISK-22135) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2707 2013-07-30 14:16 +0000 [r395731] Joshua Colp * res/res_sip.c, res/res_sip/sip_configuration.c, res/res_sip_session.c, include/asterisk/res_sip.h, include/asterisk/res_sip_session.h, res/res_sip_session.exports.in, channels/chan_gulp.c, res/res_sip_t38.c (added): Add support for T.38 fax to chan_pjsip. Review: https://reviewboard.asterisk.org/r/2692/ 2013-07-30 13:46 +0000 [r395728] Kinsey Moore * res/res_pktccops.c: Fix compilation on gcc 4.8.1 2013-07-29 17:51 +0000 [r395686] David M. Lee * res/parking/parking_devicestate.c, include/asterisk/mixmonitor.h, main/mixmonitor.c: Removed quotes from svn:keywords props on a few files. Subversion doesn't do quote processing, so it actually thinks that the closing quote in 'Revision"' is a part of the keyword. 2013-07-29 16:16 +0000 [r395674] Mark Michelson * res/res_sip.c: Clarify documentation for trust of identification. (closes issue ASTERISK-22023) Reported by Rusty Newton 2013-07-29 15:58 +0000 [r395672-395673] Matthew Jordan * main/loader.c: Put the include in there Mea culpa... * main/loader.c: When performing a reload, reload the new features_config and not the old Performing a module reload of core components causes specific functions compiled into the Asterisk binary to be reloaded. The table of said functions was still pointing to the old features reload mechanism, and not the new one. 2013-07-29 14:51 +0000 [r395653] Kinsey Moore * tests/test_cel.c: Clean up and improve test_cel Improve reliability of attended transfer merge and link tests. Stop using ast_log(LOG_ERROR, ...); in favor of ast_test_status_update Remove fred and eve channel helpers since they are not necessary 2013-07-29 14:08 +0000 [r395636] David M. Lee * res/ari: Set svn:ignore in res/ari directory 2013-07-29 12:10 +0000 [r395619] Kinsey Moore * res/res_sip.c: Remove comment that no longer applies The monitor thread is already properly torn down on unload and load failure. 2013-07-27 23:11 +0000 [r395588-395603] Kinsey Moore * tests/test_ari_model.c, res/ari.make (added), res/ari/resource_bridges.h (added), res/ari/resource_asterisk.c (added), res/res_ari_endpoints.c (added), res/res_stasis_http_sounds.c (removed), res/ari/resource_asterisk.h (added), res/res_stasis_http.c (removed), rest-api-templates/stasis_http_resource.h.mustache (removed), res/res_ari.c (added), rest-api-templates/make_ari_stubs.py, rest-api-templates/ari_resource.h.mustache (added), res/res_ari_asterisk.c (added), res/Makefile, res/ari/internal.h (added), res/res_ari_model.c, res/res_stasis_http.exports.in (removed), res/ari/resource_playback.c (added), tests/test_stasis_http.c (removed), res/ari/resource_playback.h (added), res/ari/resource_channels.c (added), res/ari/ari_websockets.c (added), res/ari/resource_recordings.c (added), res/ari/resource_channels.h (added), tests/test_ari.c (added), res/ari/resource_endpoints.c (added), res/ari/resource_events.c (added), res/ari/resource_recordings.h (added), include/asterisk/stasis_http.h (removed), res/res_ari_playback.c (added), res/ari/resource_endpoints.h (added), res/ari/resource_events.h (added), res/ari/resource_sounds.c (added), configs/ari.conf.sample, include/asterisk/ari.h (added), res/res_ari_channels.c (added), rest-api-templates/stasis_http.make.mustache (removed), res/stasis_http.make (removed), res/ari/resource_sounds.h (added), res/res_ari_recordings.c (added), rest-api-templates/ari.make.mustache (added), res/res_ari_events.c (added), res/res_statsd.c, res/res_stasis_http_bridges.c (removed), res/res_ari_sounds.c (added), rest-api-templates/ari_model_validators.c.mustache, res/res_ari_bridges.c (added), res/res_stasis_http_asterisk.c (removed), res/stasis_http (removed), rest-api-templates/res_stasis_http_resource.c.mustache (removed), main/stasis_config.c, rest-api-templates/rest_handler.mustache, res/ari (added), rest-api-templates/res_ari_resource.c.mustache (added), res/ari/ari_model_validators.c (added), res/ari/ari_model_validators.h (added), res/res_ari.exports.in (added), rest-api-templates/stasis_http_resource.c.mustache (removed), res/ari/config.c (added), rest-api-templates/ari_resource.c.mustache (added), res/ari/cli.c (added), res/res_stasis_http_playback.c (removed), rest-api-templates/ari_model_validators.h.mustache, res/res_stasis_http_channels.c (removed), res/res_ari_model.exports.in, res/res_stasis_http_recordings.c (removed), res/res_stasis_http_endpoints.c (removed), res/ari/resource_bridges.c (added), res/res_stasis_http_events.c (removed): Rename everything Stasis-HTTP to ARI This renames all files and API calls from several variants of Stasis-HTTP to ARI including: * Stasis-HTTP -> ARI * STASIS_HTTP -> ARI * stasis_http -> ari (ast_ari for global symbols, file names as well) * stasis http -> ARI Review: https://reviewboard.asterisk.org/r/2706/ (closes issue ASTERISK-22136) * tests/test_cel.c: Improve reliability of bridge merge CEL test 2013-07-26 21:34 +0000 [r395559-395574] Richard Mudgett * bridges/bridge_builtin_features.c, main/parking.c, main/bridge.c, main/bridge_basic.c, main/features.c, bridges/bridge_builtin_interval_features.c, apps/app_bridgewait.c, apps/app_confbridge.c, include/asterisk/bridge_features.h, include/asterisk/parking.h, main/bridge_channel.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, apps/confbridge/conf_config_parser.c: Remove the unsafe bridge parameter from ast_bridge_hook_callback's. Most hook callbacks did not need the bridge parameter. The pointer value could become invalid if the channel is moved to another bridge while it is executing. * Fixed some issues in feature_attended_transfer() as a result. * Reduce the bridge inhibit count in attended_transfer_properties_shutdown() after it has restored the bridge channel hooks. * Removed basic bridge requirement on feature_blind_transfer(). It does not require the basic bridge like feature_attended_transfer(). * include/asterisk/bridge_features.h, res/parking/parking_bridge_features.c, main/bridge.c, bridges/bridge_builtin_interval_features.c, apps/app_bridgewait.c: Improved feature limits interval hook implementaion. * Fixed feature limits to not use special members of struct ast_bridge_features. * Fixed memory leak in off nominal paths of bridge_builtin_set_limits(). * Fixed off nominal path in ast_bridge_features_limits_construct() freeing unallocated memory if it was not called by bridge_builtin_set_limits(). * Made bridge_builtin_interval_features.so unloadable. * Simplified parking's use of its duration interval hook. * Made BridgeWait S option not depend upon another module being loaded. (closes issue ASTERISK-22107) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2701/ 2013-07-26 17:42 +0000 [r395527] David M. Lee * res/stasis_http/resource_events.c, res/stasis/app.c: Fix /stasis/res/app_replaced unit test. A typo in recent changes caused the JSON ApplicationReplaced message to fail to build, so the message wasn't being sent out the WebSocket. Related, the replaced application would also unregister itself when it disconnected, which would actually unregister the new application. This was also fixed. 2013-07-26 16:34 +0000 [r395509] Jonathan Rose * main/bridge_channel.c, include/asterisk/bridge.h, include/asterisk/bridge_channel_internal.h, main/bridge.c, apps/app_bridgewait.c: Add name argument to BridgeWait() so multiple holding bridges may be used Changes arguments for BridgeWait from BridgeWait(role, options) to BridgeWait(bridge_name, role, options). Now multiple holding bridges may be created and referenced by this application. (closes issue ASTERISK-21922) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2642/ 2013-07-26 00:03 +0000 [r395466-395477] Richard Mudgett * apps/app_bridgewait.c: Remove some unnecessary parentheses. * bridges/bridge_builtin_interval_features.c: Revision 2013-07-25 20:54 +0000 [r395439-395455] Joshua Colp * res/res_sip_session.c: Fix crash due to trying to send a re-invite while in the incorrect state. This crash would occur if a re-invite was queued while the initial INVITE transaction was still occurring and the response to the INVITE was not ACKed. This lack of ACK would cause the INVITE session state to never reach confirmed. Once the transaction terminated, however, the queued re-invite would occur and cause a crash due to this lack of state change. This fix checks the INVITE session state before performing the re-invite to ensure it is in the required confirmed state. * res/res_sip.c, res/res_sip/sip_configuration.c: Change the default value for "allowsubscribe" to yes to match chan_sip. 2013-07-25 18:27 +0000 [r395430] Richard Mudgett * main/stasis_bridges.c, include/asterisk/bridge_after.h, include/asterisk/bridge_channel_internal.h, main/manager_bridges.c, include/asterisk/bridge_channel.h, main/bridge_after.c, include/asterisk/bridge_technology.h, include/asterisk/bridge_internal.h, include/asterisk/bridge_features.h, main/bridge_channel.c, include/asterisk/bridge.h, include/asterisk/bridge_basic.h, include/asterisk/bridge_roles.h, main/bridge.c, main/bridge_basic.c, include/asterisk/stasis_bridges.h, main/bridge_roles.c: Restore bridging files history. 2013-07-25 15:29 +0000 [r395367-395410] Matthew Jordan * main/features.c, include/asterisk/features.h: Remove some dead parking call Since nothing is using these global parking functions, remove them! The first of many. * main/features.c: Remove dead bridging code from features This removes the previously #if 0'd code. The functionality removed has either been subsumed by the Bridging API or is no longer applicable. * main/cli.c, main/cdr.c, main/manager_bridges.c, main/manager.c, res/stasis_http/resource_bridges.c, tests/test_cel.c, res/res_stasis.c, main/stasis_bridges.c, tests/test_cdr.c: Fix incorrect reference to stasis/bridging.h * include/asterisk/stasis_bridges.h (added), include/asterisk/bridging_after.h (removed), bridges/bridge_simple.c, main/core_local.c, res/parking/parking_bridge_features.c, res/parking/parking_bridge.c, main/cli.c, main/manager_bridges.c (added), include/asterisk/bridging_technology.h (removed), apps/confbridge/include/confbridge.h, channels/chan_skinny.c, include/asterisk/bridging_features.h (removed), main/bridge_after.c (added), main/stasis_channels.c, include/asterisk/bridge_features.h (added), main/bridge_channel.c (added), res/parking/parking_manager.c, channels/chan_mgcp.c, channels/chan_unistim.c, include/asterisk/bridge_roles.h (added), channels/chan_bridge_media.c, main/bridge.c (added), res/parking/parking_controller.c, apps/app_bridgewait.c, res/stasis_http/resource_bridges.c, res/parking/parking_applications.c, include/asterisk/bridging_channel_internal.h (removed), main/cel.c, apps/app_queue.c, include/asterisk/stasis_bridging.h (removed), main/stasis_bridges.c (added), main/bridging_after.c (removed), res/res_stasis_bridge_add.c, include/asterisk/bridge_channel_internal.h (added), channels/chan_dahdi.c, channels/sig_analog.c, include/asterisk/bridging_internal.h (removed), apps/confbridge/confbridge_manager.c, main/manager_bridging.c (removed), tests/test_cel.c, include/asterisk/bridge_internal.h (added), include/asterisk/bridging_roles.h (removed), apps/confbridge/conf_chan_announce.c, include/asterisk/bridge_basic.h (added), include/asterisk/core_unreal.h, main/parking.c, res/stasis/control.c, bridges/bridge_holding.c, channels/chan_sip.c, bridges/bridge_softmix.c, main/bridge_roles.c (added), channels/chan_iax2.c, apps/app_agent_pool.c, include/asterisk/bridging_channel.h (removed), apps/confbridge/conf_config_parser.c, include/asterisk/features.h, main/channel.c, res/parking/res_parking.h, main/manager.c, channels/chan_misdn.c, main/stasis_bridging.c (removed), include/asterisk/bridging.h (removed), bridges/bridge_builtin_interval_features.c, include/asterisk/bridging_basic.h (removed), include/asterisk/bridge_technology.h (added), bridges/bridge_native_rtp.c, tests/test_cdr.c, include/asterisk/doxygen/architecture.h, main/bridging_roles.c (removed), res/res_sip_refer.c, main/bridge_basic.c (added), apps/confbridge/conf_chan_record.c, main/core_unreal.c, channels/sig_pri.c, include/asterisk/bridge_after.h (added), bridges/bridge_builtin_features.c, channels/dahdi/bridge_native_dahdi.c, res/stasis_http/resource_channels.c, include/asterisk/bridge_channel.h (added), funcs/func_channel.c, main/bridging_channel.c (removed), apps/app_dumpchan.c, main/features.c, apps/app_confbridge.c, include/asterisk/bridge.h (added), main/bridging.c (removed), main/bridging_basic.c (removed), apps/app_dial.c: A great big renaming patch This patch renames the bridging* files to bridge*. This may seem pedantic and silly, but it fits better in line with current Asterisk naming conventions: * channel is not "channeling" * monitor is not "monitoring" etc. A bridge is an object. It is a first class citizen in Asterisk. "Bridging" is the act of using a bridge on a set of channels - and the API that fulfills that role is more than just the action. (closes issue ASTERISK-22130) * include/asterisk/bridging_features.h, funcs/func_channel.c, main/bridging_channel.c, main/features.c, include/asterisk/bridging.h, bridges/bridge_builtin_interval_features.c, main/bridging.c, main/bridging_basic.c, apps/app_dial.c, include/asterisk/bridging_after.h (added), bridges/bridge_softmix.c, include/asterisk/bridging_channel_internal.h, apps/app_queue.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, include/asterisk/bridging_channel.h, main/bridging_after.c (added), include/asterisk/bridging_technology.h, include/asterisk/bridging_internal.h, bridges/bridge_builtin_features.c: Move after bridge callbacks into their own file One more major refactoring to go. 2013-07-25 00:44 +0000 [r395351] Joshua Colp * res/res_sip/sip_distributor.c, channels/chan_gulp.c, res/res_sip_session.c: Improve initial INVITE handling and fix crash due to rapidly arriving CANCEL. (closes issue ASTERISK-22150) Review: https://reviewboard.asterisk.org/r/2696/ 2013-07-24 23:40 +0000 [r395316-395340] Richard Mudgett * main/bridging.c, include/asterisk/bridging_features.h, main/bridging_channel.c, include/asterisk/bridging_channel_internal.h: Simplify interval hooks since there is only one bridge threading model now. * Convert interval timers to use the ast_waitfor_nandfds() timeout. * Remove bridge channel action for intervals. Now the main loop handles running interval hooks. * main/bridging.c, include/asterisk/bridging_features.h, main/bridging_channel.c, apps/app_confbridge.c: Refactor ast_bridge_features struct. * Reduced the number of hook containers to just dtmf_hooks, interval_hooks, and other_hooks. As a result, several functions dealing with the different hook containers could be combined. * Extended the generic hook struct for DTMF and interval hooks instead of using a variant record. * Merged the special talk detector hook into the other_hooks container. * Replaced ast_bridge_features_set_talk_detector() with ast_bridge_talk_detector_hook(). (issue ASTERISK-22107) * main/features.c: * Refactor setup_bridge_features_builtin(). * Add an error message so you know when a feature is not available and you tried to use it. It usually means the module has not been loaded. 2013-07-24 19:32 +0000 [r395295-395298] Matthew Jordan * main/asterisk.exports.in: Export exports.in as well Because is is rather needed. * main/bridging.c, res/parking/parking_bridge_features.c, apps/app_agent_pool.c, include/asterisk/bridging_channel.h, main/bridging_basic.c, bridges/bridge_builtin_features.c, include/asterisk/bridging_features.h, main/bridging_channel.c, bridges/bridge_builtin_interval_features.c, include/asterisk/bridging_channel_internal.h: Update bridge_channel refactorings; export bridge_ symbol 2013-07-24 18:51 +0000 [r395283] Jason Parker * contrib/scripts/install_prereq: Add pjproject to install_prereq. Also fixes spacing, in passing. (closes issue ASTERISK-22131) 2013-07-24 18:08 +0000 [r395267-395271] Kinsey Moore * res/res_sip.c: Tweak another magic number * main/manager_bridging.c: Make AMI BridgeInfo action more verbose Ensure that the BridgeInfo command provides adequate state information about channels by publishing the full channel snapshot for BridgeInfoChannel subevents. This prevents a two-stage lookup since most consumers will be keying on channel names instead of uniqueids. (closes issue ASTERISK-22140) * res/res_sip/sip_global_headers.c: Tweak a magic number (closes issue ASTERISK-22146) 2013-07-24 16:01 +0000 [r395254-395255] Richard Mudgett * main/bridging_channel.c, include/asterisk/bridging_channel_internal.h, include/asterisk/bridging_channel.h, main/channel.c: Add missing end-of-file line terminators. * bridges/bridge_native_rtp.c: Add missing line terminator to debug message. 2013-07-24 15:38 +0000 [r395253] Matthew Jordan * include/asterisk/bridging_channel_internal.h (added), res/parking/parking_bridge_features.c, apps/app_agent_pool.c, include/asterisk/bridging_channel.h (added), res/parking/parking_bridge.c, include/asterisk/features.h, main/channel.c, include/asterisk/bridging_technology.h, include/asterisk/bridging_internal.h, bridges/bridge_builtin_features.c, main/bridging_channel.c (added), main/features.c, include/asterisk/bridging.h, bridges/bridge_builtin_interval_features.c, main/bridging.c, main/bridging_basic.c, include/asterisk/channel.h: Perform the initial renaming of the Bridging API This patch does the following: * It pulls out bridge_channel and puts it into its own translation unit * It adds public and protected headers for bridging_channel. Protected functions are appropriate only for the Bridging API and sub-classes of a bridge. (issue ASTERISK-22130) 2013-07-24 14:35 +0000 [r395243] Richard Mudgett * main/bridging.c: Let the compiler do more type checking with bridge hook callbacks. 2013-07-23 22:32 +0000 [r395227] Joshua Colp * bridges/bridge_native_rtp.c: Fix a check in bridge_native_rtp which determined if attaching the framehook failed or not. 2013-07-23 21:32 +0000 [r395215] Jonathan Rose * funcs/func_channel.c, include/asterisk/bridging_basic.h, main/bridging_basic.c: func_channel: dtmf_features setting Allows reading andsetting dtmf features via a channel function CHANNEL(dtmf_features) (closes issue ASTERISK-21876) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2648/ 2013-07-23 21:14 +0000 [r395203-395205] Joshua Colp * bridges/bridge_native_rtp.c: Add some debug messages to make it clear what RTP bridging functionality is in use. * bridges/bridge_native_rtp.c: Fix some logic so native RTP bridge will occur when monitor, audiohooks, or framehooks are not present. 2013-07-23 19:14 +0000 [r395188] Richard Mudgett * bridges/bridge_softmix.c, main/bridging.c, include/asterisk/bridging.h: Pull softmix bridge parameters into a sub structure. 2013-07-23 18:41 +0000 [r395183] Joshua Colp * channels/chan_gulp.c: Drop the reference count on the correct object. 2013-07-23 18:41 +0000 [r395154-395182] Richard Mudgett * channels/chan_dahdi.c, main/utils.c: Reinclude sys/stat.h in chan_dahdi.c and remove redundant include in utils.c * channels/chan_dahdi.h, channels/chan_mgcp.c, channels/chan_dahdi.c, channels/dahdi/bridge_native_dahdi.c: Some chan_dahdi protected function renaming. analog_lib_handles --> dahdi_analog_lib_handles enable_dtmf_detect --> dahdi_dtmf_detect_enable disable_dtmf_detect --> dahdi_dtmf_detect_disable dahdi_enable_ec --> dahdi_ec_enable dahdi_disable_ec --> dahdi_ec_disable update_conf --> dahdi_conf_update dahdi_link --> dahdi_master_slave_link dahdi_unlink --> dahdi_master_slave_unlink (closes issue ASTERISK-22129) Reported by: rmudgett * channels/chan_dahdi.c, channels/dahdi/bridge_native_dahdi.c, channels/chan_dahdi.h (added), channels/dahdi (added), channels/dahdi/bridge_native_dahdi.h, bridges/bridge_softmix.c, channels/Makefile, main/bridging.c: Restore chan_dahdi native bridging and PRI tromboned call elimination. Created a native_dahdi bridging technology for use with the new bridging API. The new bridging technology is part of the chan_dahdi channel driver because it is very specific to that driver. Rather than include the new code directly into chan_dahdi.c the new bridge technology is in its own file and linked into chan_dahdi.so. A large part of this change is the mechanical process of moving declarations around so chan_dahdi.c can be split up into more files later. * Changed the bridging core to pass NULL frames into the channel technologies instead of discarding them. The channel technologies may need the proding to determine if their configuration is still valid. (closes issue ASTERISK-21886) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2681/ 2013-07-23 15:28 +0000 [r395151] Mark Michelson * main/bridging_roles.c, include/asterisk/bridging_internal.h (added), bridges/bridge_builtin_features.c, main/stasis_bridging.c, include/asterisk/bridging_features.h, include/asterisk/features_config.h, include/asterisk/bridging.h, main/features.c, include/asterisk/bridging_roles.h, main/cel.c, main/features_config.c, include/asterisk/stasis_bridging.h, main/bridging.c, main/bridging_basic.c: Make DTMF attended transfer support feature-complete. This greatly modifies the operation of DTMF attended transfers so that the full range of options from features.conf applies. In addition, a new option has been added that allows for a transferer to switch between bridges during a transfer before completing the transfer. (closes issue ASTERISK-21543) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2654 2013-07-23 14:57 +0000 [r395136] David M. Lee * res/res_stasis_http_channels.c, res/res_stasis_http_sounds.c, res/res_stasis_http_bridges.c, res/res_stasis_http_recordings.c, res/res_stasis_http.c, res/res_stasis_http_endpoints.c, res/res_stasis_http_asterisk.c, res/res_stasis_http_playback.c, rest-api-templates/res_stasis_http_resource.c.mustache: No more teapots. Now that the ARI implementation is nearing some definition of completeness, we should properly respond with 501's for unimplemented functionality, instead of the almost humorous 418. 2013-07-23 14:49 +0000 [r395135] Matthew Jordan * main/channel.c: Kill the zombies In previous versions of Asterisk, the zombies roamed freely, unchecked and uncontrolled. They ravaged Asterisk systems with their biting and their nashing and their pointy teeth. Sometimes, you couldn't even hang them up. Now, zombies are rare. They still *technically* exist in certain places, but they are controlled. Kind of like a zombie zoo: you can see them, but you can't touch them, and they can't touch you. Bring your kids! Because zombies are now population controlled with a very short lifespan, there's no reason to rename the channels to '%s'. The channels are guaranteed to die off quickly; the rename really is just confusing at this point. This patch finally removes the renaming. On the plus side: this made my life easier in CDRs during call pickup and attended transfers to an Asterisk application. It will make other folks lives easier as well! Review: https://reviewboard.astierks.org/r/2690/ (closes issue ASTERISK-21699) Reported by: Matt Jordan 2013-07-23 13:52 +0000 [r395121] Kinsey Moore * res/res_sip_sdp_rtp.c, channels/chan_gulp.c, res/res_sip.c, channels/chan_sip.c, res/res_sip/sip_configuration.c, res/res_sip_session.c, include/asterisk/res_sip.h, include/asterisk/res_sip_session.h: Add DTLS-SRTP support to chan_pjsip This patch introduces DTLS-SRTP support to chan_pjsip and the options necessary to configure it including an option to allow choosing between 32 and 80 byte SRTP tag lengths. During the implementation and testing of this patch, three other bugs were found and their fixes are included with this patch. The two in chan_sip were a segfault relating to DTLS setup and mistaken call rejection. The third bug fix prevents chan_pjsip from attempting to perform bridge optimization between two endpoints if either of them is running any form of SRTP. Review: https://reviewboard.asterisk.org/r/2683/ (closes issue ASTERISK-21419) 2013-07-23 13:42 +0000 [r395118-395120] David M. Lee * res/stasis/app.h, res/res_stasis.c, res/stasis/app.c: Continue events when ARI WebSocket reconnects This patch addresses a bug in the /ari/events WebSocket in handling reconnects. When a Stasis application's associated WebSocket was disconnected and reconnected, it would not receive events for any channels or bridges it was subscribed to. The fix was to lazily clean up Stasis application registrations, instead of removing them as soon as the WebSocket goes away. When an application is unregistered at the WebSocket level, the underlying application is simply deactivated. If the application WebSocket is reconnected, the application is reactivated for the new connection. To avoid memory leaks from lingering, unused application, the application list is cleaned up whenever new applications are registered/unregistered. (closes issue ASTERISK-21970) Review: https://reviewboard.asterisk.org/r/2678/ * main/manager_bridging.c, include/asterisk/stasis_message_router.h, tests/test_stasis.c, main/manager_channels.c, main/cdr.c, main/stasis_message_router.c: Fix bridge/channel AMI event ordering issues The stasis_cache_update messages are somewhat cumbersome to handle with the stasis_message_router. Since all updates have the same message type, they are normally handled with the same route. Since caching itself is a first class component of stasis-core, it makes sense for the router to handle the cache update messages itself. This patch adds stasis_message_router_add_cache_update() and stasis_message_router_remove_cache_update() to handle the routing of stasis_cache_update messages. This patch also corrects an issue with manager_{bridging,channels}.c, where events might be reordered. The reordering occurs because the components use different message routers, which they needed because they both needed to route cache update messages. They now both use manager's router, and add cache routes for just the cache updates they are interested in. (closes issue ASTERISK-22038) Review: https://reviewboard.asterisk.org/r/2677/ 2013-07-23 12:56 +0000 [r395107] Kinsey Moore * res/res_sip/sip_options.c: Add missing newline 2013-07-23 12:27 +0000 [r395102] Joshua Colp * channels/chan_gulp.c, res/res_sip_session.c, include/asterisk/res_sip_session.h, res/res_sip_session.exports.in: Expose the chan_pjsip implementation pvt and session in a defined manner. This allows modules outside of chan_pjsip itself to get the session given only an Asterisk channel. Review: https://reviewboard.asterisk.org/r/2674/ 2013-07-23 00:16 +0000 [r395089] Matthew Jordan * main/cdr.c: Fix unbalanced lock when serializing CDR variables I'm only surprised that this didn't cause larger problems. 2013-07-23 00:02 +0000 [r395088] Richard Mudgett * main/bridging.c: Remove some BUGBUG notes that have been handled. 2013-07-22 20:42 +0000 [r395074] Kinsey Moore * tests/test_cel.c: Make the CEL blind transfer test pass consistently 2013-07-22 13:52 +0000 [r394881-395034] Matthew Jordan * /, main/asterisk.c: Update copyright year to 2013 in asterisk.c; some whitespace fixes (closes issue ASTERISK-22179) Reported by: Malcolm Davenport ........ Merged revisions 395032 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 395033 from http://svn.asterisk.org/svn/asterisk/branches/11 * funcs/func_channel.c, /: Clean up documentation This patch cleans up documentation in func_channel for the following items: * rtpsource * secure_signaling * secure_media * various OOH323 parameters (closes issue ASTERISK-20969) Reported by: snuffy patches: func_chan-update.diff uploaded by snuffy (License 5024) ........ Merged revisions 394980 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 394981 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, configs/indications.conf.sample: Provide proper ring tone in indications.conf for Malaysia The ring tone provided in the sample indications.conf was incorrect. This patch modifies the sample ring tone to be what it should: ring = 425/400,0/200,425/400,0/2000 This brings it in line with the tone definition in DAHDI 2.7.0. (zonedata.c) (closes issue ASTERISK-21997) Reported by: Filip Jenicek patches: malaysia_ring.patch uploaded by phill (License 6277) ........ Merged revisions 394940 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 394941 from http://svn.asterisk.org/svn/asterisk/branches/11 * contrib/scripts/safe_asterisk, Makefile, configs/safe_asterisk.conf.sample (added), CHANGES: Always install safe_asterisk; add configuration file support This patch modifies the behavior of safe_asterisk in two ways: (1) It modifies the Asterisk Makefile such that safe_asterisk is always installed on a 'make install'. This was done as bugfixes in the safe_asterisk script were not applied in previous version of Asterisk without first removing the old version of the script. (2) In order to keep a newly installed version of safe_asterisk from impacting local modifications, a new config file - safe_asterisk.conf.sample - has been provided. Settings that were previously modified in safe_asterisk can be set there instead. (closes issue ASTERISK-21965) Reported by: Jeremy Kister patches: safe_asterisk.patch uploaded by jkister (License 6232) * /, main/http.c: Tolerate presence of RFC2965 Cookie2 header by ignoring it This patch modifies parsing of cookies in Asterisk's http server by doing an explicit comparison of the "Cookie" header instead of looking at the first 6 characters to determine if the header is a cookie header. This avoids parsing "Cookie2" headers and overwriting the previously parsed "Cookie" header. Note that we probably should be appending the cookies in each "Cookie" header to the parsed results; however, while clients can send multiple cookie headers they never really do. While this patch doesn't improve Asterisk's behavior in that regard, it shouldn't make it any worse either. Note that the solution in this patch was pointed out on the issue by the issue reporter, Stuart Henderson. (closes issue ASTERISK-21789) Reported by: Stuart Henderson Tested by: mjordan, Stuart Henderson ........ Merged revisions 394899 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 394900 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, contrib/realtime/postgresql/realtime.sql: Update PostgreSQL realtime scripts with schema for queue_log table This patch updates the realtime SQL scripts with an entry that will create the queue_log table. This brings the PostgreSQL scripts inline with the MySQL scripts, with respect to what tables they will create. (closes issue ASTERISK-21021) Reported by: Eugene patches: queue_log.sql uploaded by varnav (license 6360) ........ Merged revisions 394896 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 394897 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/iax2/parser.c: Add additional control frame types to the IAX2 parser for debug messages This patch adds some of the more recent control frame types to the IAX2 parser. When IAX2 debugging is enabled, it will now show more of the control frame types. (closes issue ASTERISK-22120) Reported by: Birger "WIMPy" Harzenetter patches: iaxcmds.diff uploaded by wimpy * /, configs/iax.conf.sample: Document connectedline parameter for chan_iax2 The connectedline parameter for a chan_iax2 peer was undocumented. This patch documents the options in the sample configuration file. (closes issue ASTERISK-21953) Reported by: Birger "WIMPy" Harzenetter ........ Merged revisions 394886 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 394890 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/manager.c, CHANGES: Allow setting allowmultiplelogin on an account basis This patch modifies manager to allow the allowmultiplelogin setting to be set on an account by account basis. When set in the general context, it will act as the default for the defined accounts. Setting it in the account will override the general setting. (closes issue ASTERISK-21324) Reported by: vldmr patches: asterisk-manager-per-user-allowmultiplelogin.patch uploaded by vldmr (License 6487) 2013-07-20 13:25 +0000 [r394858-394870] Kinsey Moore * include/asterisk/cel.h, tests/test_cel.c, CHANGES, main/cel.c, main/asterisk.c: Add CEL local optimization record type This adds a new CEL event type, AST_CEL_LOCAL_OPTIMIZE, to represent local channel optimizations. Local channel optimizations were one of several things conveyed by the now defunct BRIDGE_UPDATE event type. This also adds a unit test to test generation of this new CEL event. Review: https://reviewboard.asterisk.org/r/2676/ * tests/test_cel.c, CHANGES, apps/app_queue.c, main/cel.c, apps/app_dial.c, main/channel.c, channels/chan_dahdi.c, main/pbx.c, channels/sig_analog.c, channels/chan_sip.c, include/asterisk/cel.h, apps/app_celgenuserevent.c, apps/app_directed_pickup.c, main/features.c: Add transfer support to CEL This adds CEL support for blind and attended transfers and call pickup. During the course of adding this functionality I noticed that CONF_ENTER, CONF_EXIT, and BRIDGE_TO_CONF events are particularly useless without a bridge identifier, so I added that as well. This adds tests for blind transfers, several types of attended transfers, and call pickup. The extra field in CEL records now consists of a JSON blob whose fields are defined on a per-event basis. Review: https://reviewboard.asterisk.org/r/2658/ (closes issue ASTERISK-21565) 2013-07-20 01:11 +0000 [r394825-394846] Richard Mudgett * include/asterisk/astobj2.h: Regroup the ao2 search_flags. Moved the OBJ_POINTER, OBJ_KEY, and OBJ_PARTIAL_KEY flags together into a field and renamed them to OBJ_SEARCH_OBJECT, OBJ_SEARCH_KEY, and OBJ_SEARCH_PARTIAL_KEY respectively. The values were selected to keep existing code compiling and working until the codebase can be changed to stop using these values as bit flags and use them as an enum field. The old names are defined to the new names for backward compatibility. * main/audiohook.c, main/channel.c, include/asterisk/audiohook.h: Minor optimizations. * Made ast_audiohook_detach_list() and ast_audiohook_write_list_empty() NULL tolerant. * Made ast_audiohook_detach_list() return void since it is a destructor. * main/bridging.c, main/channel.c, include/asterisk/channel.h, bridges/bridge_native_rtp.c: Extract a repeated test into ast_channel_has_audio_frame_or_monitor(). 2013-07-19 19:40 +0000 [r394809-394810] Jonathan Rose * res/stasis/control.c, res/stasis_http/resource_channels.c, res/res_stasis_http_channels.c, include/asterisk/stasis_app.h, res/stasis_http/resource_channels.h, rest-api/api-docs/channels.json: ARI: MOH start and stop for a channel (issue ASTERISK-21974) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2680/ * rest-api/api-docs/channels.json, res/res_stasis_http_bridges.c, res/res_stasis.c, rest-api/api-docs/recordings.json, include/asterisk/core_unreal.h, res/res_stasis_http_playback.c, res/res_stasis_playback.c, channels/chan_bridge_media.c (added), res/stasis/control.c, res/stasis_http/ari_model_validators.c, res/res_stasis_http_channels.c, main/core_unreal.c, include/asterisk/stasis_app.h, res/stasis_http/resource_bridges.c, res/stasis_http/ari_model_validators.h, res/stasis_http/resource_bridges.h, include/asterisk/stasis_app_playback.h, rest-api/api-docs/bridges.json, include/asterisk/logger.h, res/stasis_http/resource_channels.c, rest-api/api-docs/playback.json: ARI: Bridge Playback, Bridge Record Adds a new channel driver for creating channels for specific purposes in bridges, primarily to act as either recorders or announcers. Adds ARI commands for playing announcements to ever participant in a bridge as well as for recording a bridge. This patch also includes some documentation/reponse fixes to related ARI models such as playback controls. (closes issue ASTERISK-21592) Reported by: Matt Jordan (closes issue ASTERISK-21593) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2670/ 2013-07-19 19:23 +0000 [r394795-394808] Kinsey Moore * include/asterisk/channel.h, main/stasis_channels.c, main/cel.c, apps/confbridge/conf_chan_announce.c, main/manager_channels.c, res/parking/parking_manager.c, main/cdr.c, include/asterisk/stasis_channels.h, apps/confbridge/conf_chan_record.c, apps/confbridge/confbridge_manager.c, main/manager_bridging.c: Filter channels used as internal mechanisms This adds new flags to the channel tech properties that flag it as different types of implementation detail used exclusively to provide a feature. Examples of channels that would have these flags include the announcement and recording channels used by confbridge which are the only two marked as such by this patch. Review: https://reviewboard.asterisk.org/r/2633/ (closes issue ASTERISK-21873) * channels/chan_sip.c: Fix crash when using temporary peers Temporary peers do not have an associated Stasis endpoint and quite a bit of code in chan_sip assumes that all peers have a Stasis endpoint. All endpoint accesses in chan_sip are now wrapped in an endpoint NULL-check. 2013-07-19 18:00 +0000 [r394793] Jason Parker * main/stasis_system.c, main/ccss.c, include/asterisk/stasis_system.h: Convert CCSS manager events to stasis. (closes issue ASTERISK-21473) Review: https://reviewboard.asterisk.org/r/2682/ 2013-07-19 17:55 +0000 [r394776-394791] Richard Mudgett * main/bridging.c: Made audiohooks, framehooks, and monitor prevent local channel optimization. Audiohooks, framehooks, and monitor represent state on a local channel that will go away if it is optimized out. (closes issue ASTERISK-21954) Reported by: rmudgett Review: https://reviewboard.asterisk.org/r/2685/ * include/asterisk/channel.h: Fixup doxygen on ast_hangup(). 2013-07-18 19:25 +0000 [r394759] Mark Michelson * res/res_sip_session.c, res/res_sip/sip_global_headers.c (added), res/res_sip/config_system.c (added), res/res_sip_one_touch_record_info.c, res/res_sip_mwi.c, res/res_sip_pubsub.c, res/res_sip/config_transport.c, res/res_sip/sip_configuration.c, res/res_sip_refer.c, include/asterisk/res_sip.h, res/res_sip/config_global.c (added), res/res_sip/include/res_sip_private.h, res/res_sip.exports.in, res/res_sip_sdp_rtp.c, channels/chan_gulp.c, res/res_sip_caller_id.c, res/res_sip.c: Add a bunch of options from sip.conf to res_sip.conf For a complete list of the options added, see the review linked at the bottom of this commit message. (closes issue ASTERISK-21506) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2671 2013-07-18 18:05 +0000 [r394744] David M. Lee * res/res_http_websocket.c: Fixed null dereference when WebSocket subprotocol isn't specified 2013-07-18 16:49 +0000 [r394731] Jonathan Rose * apps/app_bridgewait.c, main/bridging_roles.c, bridges/bridge_holding.c: bridge_holding/app_bridgewait: Add new entertainment options This patch adds more entertainment options to holding bridges and the bridge_wait application. Also, holding bridges will now use music on hold as the default entertainment option instead of none. The parameters for app_bridgewait have changed to (role, options) from the previous (options) and the options themselves have changed as well (entertainment options are now contained in an enumerator, role specification is handled by the role parameter, etc) (closes issue ASTERISK-21923) Reported by: Matthew Jordan Review: https://reviewboard.asterisk.org/r/2679/ 2013-07-18 16:03 +0000 [r394715] Jason Parker * res/stasis_http/resource_channels.c, include/asterisk/stasis_app.h, include/asterisk/channel.h, res/res_mutestream.c, main/channel.c, res/stasis/control.c: ARI: Add support for suppressing media streams. Also convert res_mutestream to use the core feature behind this. (closes issue ASTERISK-21618) Review: https://reviewboard.asterisk.org/r/2652/ 2013-07-18 14:50 +0000 [r394701] Matthew Jordan * main/http.c: Tweak debug statements This patch does two things: 1. It moves the debug statement that shows the HTTP sub-protocols being compared after the string length calculation such that it shows the correct string length in the output 2. It adds some additional debug that displays when it matches on a sub-protocol and when it fails 2013-07-18 14:08 +0000 [r394686] David M. Lee * main/stasis_cache.c: Fix caching topic shutdown assertions The recent changes to update stasis_cache_topics directly from the publisher thread uncovered a race condition, which was causing asserts in the /stasis/core tests. If the caching topic's subscription is the last reference to the caching topic, it will destroy the caching topic after the final message has been processed. When dispatching to a different thread, this usually gave the unsubscribe enough time to finish before destruction happened. Now, however, it consistently destroys before unsubscription is complete. This patch adds an extra reference to the caching topic, to hold it for the duration of the unsubscription. This patch also removes an extra unref that was happening when the final message was received by the caching topic. It was put there because of an extra ref that was put into the caching topic's constructor. Both have been removed, which makes the destructor a bit less confusing. Review: https://reviewboard.asterisk.org/r/2675/ 2013-07-18 12:54 +0000 [r394642] Michael L. Young * /, res/res_agi.c: Properly indicate failure to open an audio stream in res_agi If there is an error streaming an audio file, the current return status makes it difficult for an AGI script to determine that there was an error with the audio file. This patches changes the result to return -1 and the function returns RESULT_FAILURE instead of RESULT_SUCCESS. From looking at other parts of res_agi, this would appear to be the proper way to handle an error. (closes issue ASTERISK-21903) Reported by: Ariel Wainer Tested by: Ariel Wainer Patches: asterisk-21903-return-stream-res_1.8.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2625/ ........ Merged revisions 394640 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 394641 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-07-17 22:30 +0000 [r394600-394623] Richard Mudgett * tests/test_app.c, main/features.c, tests/test_voicemail_api.c, tests/test_cel.c, include/asterisk/channel.h, addons/chan_mobile.c, tests/test_cdr.c, tests/test_stasis_endpoints.c, apps/app_voicemail.c, main/channel.c, main/dial.c, apps/app_meetme.c: Change ast_hangup() to return void and be NULL safe. Since ast_hangup() is effectively a channel destructor, it should be a void function. * Make the few silly callers checking the return value no longer do so. Only the CDR and CEL unit tests checked the return value. * Make all callers take advantage of the NULL safe change and remove the NULL check before the call. * main/features.c: Remove some completed and no longer relevant BUGBUG notes. 2013-07-17 18:26 +0000 [r394583] Jonathan Rose * apps/confbridge/conf_chan_announce.c: app_confbridge: Eliminate a reference leak for confbridge announcer channels 2013-07-17 17:49 +0000 [r394552-394567] Tzafrir Cohen * channels/chan_dahdi.c: Left over spacing issues of review 726. * channels/chan_dahdi.c: handle DAHDI_EVENT_REMOVED on a pri D-Channel When a DAHDI device is removed at run-time it sends the event DAHDI_EVENT_REMOVED on each channel. This is intended to signal the userspace program to close the respective file handle, as the driver of the device will need all of them closed to properly clean-up. This event has long since been handled in chan_dahdi (chan_zap at the time). However the event that is sent on a D-Channel of a "PRI" (ISDN) span simply gets ignored. This commit adds handling for closing the file descriptor (and shutting down the span, while we're at it). It also adds a CLI command 'pri destroy span ' to destroy the span and its DAHDI channels. Review: https://reviewboard.asterisk.org/r/726/ 2013-07-16 22:33 +0000 [r394530-394531] Matthew Jordan * apps/app_confbridge.c, CHANGES: Add 'kick all' capability to ConfBridge CLI command This patch adds the ability to kick all users out of a conference from the ConfBridge kick CLI command. It is invoked by passing 'all' as the channel parameter to the CLI command, i.e., "confbridge kick all". Note that this patch was modified slightly to conform to trunk. (closes issue ASTERISK-21827) Reported by: dorianlogan patches: kickall-patch_v2.diff uploaded by dorianlogan (License 6504) * main/cel.c: Re-order handlers in CEL to ensure that HANGUP events happen after APP_END When a channel is hungup, both an APP_END event and a HANGUP event can be fired. To ensure that HANGUP events occur after APP_END events, the method callbacks for the APP_END event should be processed prior to the callbacks for the HANGUP event. 2013-07-16 21:44 +0000 [r394513] David M. Lee * res/stasis_http/ari_websockets.c: Debug logging to help with WebSocket connection problems 2013-07-16 20:00 +0000 [r394489] Richard Mudgett * channels/chan_gulp.c: chan_gulp: Fix gulp_indicate() handling of AST_CONTROL_PVT_CAUSE_CODE. 2013-07-16 19:13 +0000 [r394473] Mark Michelson * res/res_sip_session.c: Prevent crash from trying to end a session in an invalid way. This ensures that code that was only meant to be run on a reinvite failure only runs on a reinvite failure. (closes issue ASTERISK-22061) reported by Rusty Newton 2013-07-16 18:49 +0000 [r394470-394471] Richard Mudgett * main/channel.c, channels/chan_sip.c: Remove some dead code dealing with old bridging method. * bridges/bridge_simple.c: Simplify bridge_simple chan join code. 2013-07-16 18:22 +0000 [r394469] Matthew Jordan * main/cdr.c: Re-order cleanup This patch attempts to fix some possible race conditions in shutdown of the CDR engine. It: * Adds a cleanup handler to only unsubscribe and join on stasis messages during graceful shutdown. The cleanup handler should execute before the regular atexit handler, as we want to unsubscribe for any further messages before dispatching the CDRs. * The CDRs are now locked when we dispatch them on shutdown. 2013-07-16 15:30 +0000 [r394442] David M. Lee * res/res_http_websocket.c: Fixed null dereference when WebSocket protocol is omitted 2013-07-15 23:20 +0000 [r394417] Richard Mudgett * configs/agents.conf.sample, include/asterisk/config_options.h, include/asterisk/stasis_channels.h, channels/chan_agent.c (removed), configs/queues.conf.sample, include/asterisk/bridging.h, UPGRADE.txt, main/stasis_channels.c, CHANGES, main/bridging.c, apps/app_agent_pool.c (added): Replace chan_agent with app_agent_pool. The ill conceived chan_agent is no more. It is now replaced by app_agent_pool. Agents login using the AgentLogin() application as before. The AgentLogin() application no longer does any authentication. Authentication is now the responsibility of the dialplan. (Besides, the authentication done by chan_agent did not match what the voice prompts asked for.) Sample extensions.conf [login] ; Sample agent 1001 login ; Set COLP for in between calls so the agent does not see the last caller COLP. exten => 1001,1,Set(CONNECTEDLINE(all)="Agent Waiting" <1001>) ; Give the agent DTMF transfer and disconnect features when connected to a caller. same => n,Set(CHANNEL(dtmf-features)=TX) same => n,AgentLogin(1001) same => n,NoOp(AGENT_STATUS is ${AGENT_STATUS}) same => n,Hangup() [caller] ; Sample caller direct connect to agent 1001 exten => 800,1,AgentRequest(1001) same => n,NoOp(AGENT_STATUS is ${AGENT_STATUS}) same => n,Hangup() ; Sample caller going through a Queue to agent 1001 exten => 900,1,Queue(agent_q) same => n,Hangup() Sample queues.conf [agent_q] member => Local/800@caller,,SuperAgent,Agent:1001 Under the hood operation overview: 1) Logged in agents wait for callers in an agents holding bridge. 2) Caller requests an agent using AgentRequest() 3) A basic bridge is created, the agent is notified, and caller joins the basic bridge to wait for the agent. 4) The agent is either automatically connected to the caller or must ack the call to connect. 5) The agent is moved from the agents holding bridge to the basic bridge. 6) The agent and caller talk. 7) The connection is ended by either party. 8) The agent goes back to the agents holding bridge. To avoid some locking issues with the agent holding bridge, I needed to make some changes to the after bridge callback support. The after bridge callback is now a list of requested callbacks with the last to be added the only active callback. The after bridge callback for failed callbacks will always happen in the channel thread when the channel leaves the bridging system or is destroyed. (closes issue ASTERISK-21554) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2657/ 2013-07-15 22:05 +0000 [r394402] Mark Michelson * include/asterisk/stasis_channels.h: Remove misleading documentation for channel snapshot creation. 2013-07-15 21:22 +0000 [r394397] David M. Lee * res/res_stasis_http.c: Document the ari.conf allowed_origins setting 2013-07-15 13:43 +0000 [r394370] Joshua Colp * res/res_sip_session.c, include/asterisk/res_sip_session.h: Remove some callbacks and functions which are not needed. 2013-07-14 02:41 +0000 [r394278-394346] Matthew Jordan * /, apps/app_queue.c: Provide error message for QUEUE_MEMBER when member is not in queue When QUEUE_MEMBER is used and the member specified is not in the queue, Asterisk provides an ERROR message that indicates that the option specified is not valid. This patch now properly displays an ERROR message that the member is not in the queue if an interface is specified. (closes issue ASTERISK-21980) Reported by: Avraam David ........ Merged revisions 394345 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/dns.c: Remove redundant code in dns.c Peter J Philipp pointed out that there are two checks that ensure that len is not less than 0. If len is less than 0, the function returns. Having both of them is clearly redundant. This removes the second and attempts to clarify (slightly) the error condition. (closes issue ASTERISK-21772) Reported by: Peter J Philipp * /, funcs/func_strings.c: Clarify documentation for function PASSTHRU It is not apparent to the average user that the PASSTHRU function should not be passed as ${PASSTHRU(string)} but just as PASSTHRU(string) to functions which take a variable name and not its contents. This patch clarifies the behavior in the documentation and provides an example. (closes issue ASTERISK-21717) Reported by: Richard Miller patches: func_strings.diff uploaded by Richard Miller (license 5685) ........ Merged revisions 394302 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 394303 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/bridging.c, main/cdr.c: Fix FRACK message from external redirects; handle outbound channels better This patch does the following: * It simplifies the Dial handling in CDRs. As a rule, the caller in a dial relationship is always the Party A. There was some logic present in the handling of the dial message that could, conceivably, pick the caller as Party A for the beginning of the dial and the peer as Party A for the end of the dial. This shouldn't have happened if the code in the bridging framework was doing its job; however, that was broken and it led to the FRACK. As it is, this code was overly ocmplex and not needed: the caller, if present, should always be Party A. Period. * It properly checks to see if a channel will continue on in the dialplan. ast_check_hangup - much like cake at the end - is a lie. It will tell you that you are hungup when you are not. Do not believe it. I would make this function tell the truth, but I'm nervous that we've been depending on it sitting on its throne of lies for far too long, and it would probably break lots of things. So I'm just checking the "internal" soft hangup flags, like everyone else. (closes issue ASTERISK-22060) Reported by: Mark Michelson (issue ASTERISK-21831) Reported by: Matt Jordan * channels/chan_sip.c: Pretty up a debug message if the referred-by-uri isn't available Instead of formatting a NULL pointer into a "%s" format string (which is usually not a good thing to do), we instead print "Unknown". 2013-07-12 22:35 +0000 [r394263] Moises Silva * channels/chan_dahdi.c, /: Fix a longstanding issue with MFC-R2 configuration that prevented users from mixing different variants or general MFC-R2 settings within the same E1 line. Most users do not have a problem with this since MFC-R2 lines are usually fractional E1s, or the whole E1 has the same country variant and R2 settings. In Venezuela however is common to have inbound MFC-R2 and outbound DTMF-R2 within the same E1. This fix now properly parses the chan_dahdi.conf file to generate a new openr2 context every time a new channel => section is found and the configuration was changed. (closes issue ASTERISK-21117) Reported by: Rafael Angulo Related Elastix issue: http://bugs.elastix.org/view.php?id=1612 ........ Merged revisions 394106 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 394173 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-07-12 21:42 +0000 [r394249] Joshua Colp * main/channel.c, main/channel_internal_api.c, include/asterisk/channel.h, main/bridging.c: Add support to the bridging core for performing COLP updates when channels join a 2 party bridge. (closes issue ASTERISK-21829) Review: https://reviewboard.asterisk.org/r/2636/ 2013-07-12 21:01 +0000 [r394232] Mark Michelson * main/bridging_basic.c: Prevent potential race condition in multiparty basic bridges. For more details about the race condition see the linked review at the bottom of this commit (closes issue ASTERISK-21882) Reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2663 2013-07-12 19:35 +0000 [r394216] Jason Parker * channels/chan_skinny.c: Fix a compiler warning. 2013-07-12 18:23 +0000 [r394203] David M. Lee * tests/test_json.c: Fixed intermittent crash when loading test_json.so The JSON test attempted an overly clever use of RAII_VAR to run code at the beginning and end of each test, in order to validate that no JSON objects were leaked during the test. The problem is that the validation code would run during the initial load, when the tests were initialized. This happens during startup, when other parts of the system might actively be allocating and freeing JSON objects. This patch changes the RAII_VAR to use the new ast_test_register_{init,cleanup} functions to run the validations properly. (closes issue ASTERISK-21978) Review: https://reviewboard.asterisk.org/r/2669/ 2013-07-12 17:52 +0000 [r394189] Jason Parker * res/stasis_http/internal.h, res/stasis_http/config.c, res/stasis_http/cli.c, res/res_stasis_http.c: ARI: Add support for Cross-Origin Resource Sharing (CORS), origin headers This rejects requests from any unknown origins. (closes issue ASTERISK-21278) Review: https://reviewboard.asterisk.org/r/2667/ 2013-07-11 21:01 +0000 [r394158] Richard Mudgett * include/asterisk/bridging_technology.h: Fix bridge tech write callback parameter name. 2013-07-11 20:59 +0000 [r394156] David M. Lee * channels/chan_skinny.c: Fixed chan_skinny for systems were pthread_t isn't an int. I'm looking at you, OS X. 2013-07-11 20:17 +0000 [r394147] Damien Wedhorn * channels/chan_skinny.c: Refactor and cleanup of skinny session handling. Major changes are to pull all packet reading functions into skinny_session and move timeout handling to scheduling arrangements. Thread cancelling is now undertaken directly rather than waiting for the read to timeout (cleanup is popped on thread cancel). Also added some keepalive timings in debugging messages. Keepalive timeout has been increased from 1.1 by keepalive to 3 times keepalive. This seems to align (after keepalives stabilise) with when devices reset after not receiving keepalives. Probably needs more work, especially around the first and/or second keepalives that vary significantly by device and firmware version. Review: https://reviewboard.asterisk.org/r/2611/ 2013-07-11 16:23 +0000 [r394103] Joshua Colp * res/res_sip_exten_state.c: Tweak the subscription failure warning message to include endpoint name and context. 2013-07-11 15:37 +0000 [r394037-394089] David M. Lee * tests/test_cel.c: Correct test_cel cleanup. When I corrected the CEL test crash in r394037, I didn't quite pay attention to how the globals and locals were being shuffled around in the cleanup callback. I removed the nulling of the global variables, which caused them to be double cleaned. This patch puts the global nulling code back (since the vars are cleaned up by RAII_VARs), and removes the explicit ao2_cleanup() (since they were no-ops, because the variables had just been nulled). * res/stasis_http/config.c, configs/ari.conf.sample, res/res_stasis_http.c: Change ARI user config to use a type field When I initially wrote the configuration support for ARI users, I determined the section type by a category prefix (i.e., [user-admin]). This is neither idiomatic Asterisk configuration, nor is it really that user friendly. This patch replaces the category prefix with a type field in the section, which is much cleaner. Review: https://reviewboard.asterisk.org/r/2664/ * res/stasis_http/config.c: Apply defaults to ari.conf's general section * tests/test_voicemail_api.c: test_voicemail_api: fix warning found by gcc-4.8 The voicemail_api test had code like strncmp(a, b, sizeof(a)), but a was a char pointer, instead of a literal or char array. This meant that sizeof was the size of the pointer, not the length of the string. Since the string is in a stringfield and should be null terminated, I just changed it to a plain strcmp. * tests/test_cel.c: Fixed some CEL test crashes 2013-07-10 22:26 +0000 [r394024] Kevin Harwell * contrib/scripts/sip_to_res_sip (added), contrib/scripts/sip_to_res_sip/astconfigparser.py (added), contrib/scripts/sip_to_res_sip/astdicts.py (added), contrib/scripts/sip_to_res_sip/sip_to_res_sip.py (added): PSJIP - sip.conf to res_sip.conf script ** This script is in no way finished. Started the initial "cut" at converting a sip.conf file to a res_sip.conf file. Hopefully the bulk of the framework is in place and only a few minor adjustments need to be made when an option mapping is added that "doesn't fit". This script and supporting files should be executable against python version 2.5. An OrderedDict class (backported from a newer version of python) is included. A MultiOrderedDict class is implemented so options, when added, should be able to be added in order and allowed to have multiple values. Currently the scripts supports the majority of endpoint options found in res_sip.conf. Support has also been added for Aor(s) and the ACL/security sections. Inside the sip_to_res_sip.py file one can see a list of options that still need to be mapped. Also items that still need to be done: templates, includes, parsing '=>' delimiter. Note that some code is hopefully in place already to support templates (e.g. lookup/retrieving defaults from them). However, the parsing of and adding of the section needs to be done. 2013-07-10 20:02 +0000 [r394004] Joshua Colp * res/res_sip_outbound_registration.c: Handle outbound registration failures that do not occur as a result of a real response. (closes issue ASTERISK-22064) Reported by: Rusty Newton 2013-07-10 17:13 +0000 [r393968-393987] David M. Lee * res/res_stasis_http_channels.c, rest-api/api-docs/channels.json: Document the 400 error response for originate * res/res_stasis_http_asterisk.c, rest-api/api-docs/asterisk.json, res/stasis_http/ari_model_validators.c, res/res_stasis_http_channels.c, rest-api/api-docs/channels.json, res/stasis_http/ari_model_validators.h: Corrected api-docs for channel variables 2013-07-10 01:56 +0000 [r393930] Russell Bryant * configs/sla.conf.sample, /, apps/app_meetme.c: astobj2-ify the SLA code The SLA code within app_meetme was written before asotbj2 had been merged into Asterisk. Worse, support for reloads did not exist at first and was added later as a bolt-on feature. I knew at the time that reloading was not safe at all while SLA was in use, so the reload would be queued up to execute when the system was idle. Unfortunately, this approach was still prone to errors beyond the fact that this was the only place in Asterisk where configuration was not reloaded instantly when requested. This patch converts various SLA objects to be reference counted objects using astobj2. This allows reloads to be processed while the system is in use. The code ensures that the objects will not disappear while one of the other threads is using them. However, they will be immediately removed from the global trunk and station containers so no new calls will use them if removed from configuration. Review: https://reviewboard.asterisk.org/r/2581/ ........ Merged revisions 393928 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 393929 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-07-09 21:40 +0000 [r393919] Jason Parker * include/asterisk/lock.h: Make SCOPED_LOCK use RAII_VAR. This fixes an issue with requiring SCOPED_LOCK to be the last variable declaration and removes duplicate code in the process. Review: https://reviewboard.asterisk.org/r/2665/ 2013-07-09 21:06 +0000 [r393910] Richard Mudgett * main/xmldoc.c: Fix printf NULL string (null) substituion for NULL config framework default. 2013-07-09 20:07 +0000 [r393897] Mark Michelson * channels/chan_gulp.c: Use correct function for getting bridged peer when doing direct media checks. (closes issue ASTERISK-21947) reported by Matt Jordan 2013-07-09 19:38 +0000 [r393896] Richard Mudgett * include/asterisk/manager.h, include/asterisk/stasis_channels.h: Fix some stasis doxygen comments. 2013-07-09 11:05 +0000 [r393857-393870] Joshua Colp * res/res_sip_outbound_registration.c: Ensure all pjsip_regc_* access occurs within a pjlib thread. (closes issue ASTERISK-22054) Reported by: Rusty Newton * res/res_sip/config_auth.c: Tweak log message slightly. * res/res_sip/config_auth.c: Treat the authentication object as invalid if digest configuration is chosen and the digest is not of the correct length. (closes issue ASTERISK-22003) Reported by: Rusty Newton 2013-07-08 20:31 +0000 [r393834-393843] David M. Lee * res/res_stasis_recording.c: Oh menuconfig, why do you hate margins? * res/stasis_http/ari_websockets.c: Better structure for the WebSocket validation failure message 2013-07-08 19:53 +0000 [r393831-393833] Joshua Colp * res/res_sip/config_transport.c: Ensure that a valid bind host is specified for transports. (closes issue ASTERISK-22017) Reported by: Rusty Newton * main/channel_internal_api.c, res/res_agi.c, main/manager_bridging.c, include/asterisk/channel.h, main/stasis_channels.c, main/bridging.c, main/manager_channels.c, main/cli.c, main/channel.c, build_tools/cflags-devmode.xml, main/pbx.c, include/asterisk/stasis_channels.h, main/manager.c: Refactor operations to access the stasis cache instead of objects directly when retrieving information. (closes issue ASTERISK-21883) Review: https://reviewboard.asterisk.org/r/2645/ 2013-07-08 16:04 +0000 [r393816] David M. Lee * res/res_stasis_http.c: res_stasis_http doesn't depend on res_stasis any more 2013-07-08 15:59 +0000 [r393815] Jonathan Rose * res/parking/parking_controller.c, main/bridging.c, res/parking/parking_bridge.c, res/parking/res_parking.h: res_parking: Apply ringing role option on swap with a channel that rings (closes issue ASTERISK-21877) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2656/ 2013-07-08 15:11 +0000 [r393807] Joshua Colp * res/stasis/control.c: Fix building. 2013-07-08 14:46 +0000 [r393804-393806] Jason Parker * res/res_stasis_http_asterisk.c, res/stasis/control.c, res/stasis_http/resource_asterisk.h, rest-api/api-docs/asterisk.json, res/stasis_http/resource_channels.c, res/res_stasis_http_channels.c, include/asterisk/stasis_app.h, res/stasis_http/resource_channels.h, rest-api/api-docs/channels.json, res/stasis_http/resource_asterisk.c: ARI: Add support for getting/setting channel and global variables. This allows for reading and writing of functions on channels. (closes issue ASTERISK-21868) Review: https://reviewboard.asterisk.org/r/2641/ * main/manager_system.c (added), res/res_stun_monitor.c, main/file.c, main/sounds_index.c, include/asterisk/stasis_system.h (added), channels/chan_iax2.c, include/asterisk/manager.h, main/asterisk.c, include/asterisk.h, main/stasis_system.c (added), main/manager.c, channels/chan_sip.c: Move channel driver Registry manager events to core. This also shuffles the stasis system topic and related handling. (closes issue ASTERISK-21488) Review: https://reviewboard.asterisk.org/r/2631/ 2013-07-08 14:26 +0000 [r393801] Matthew Jordan * include/asterisk/core_local.h, include/asterisk/bridging.h, main/core_unreal.c, main/core_local.c, CHANGES, main/bridging.c, include/asterisk/core_unreal.h: Create Local channel messages on the Stasis message bus and produce AMI events This patch does the following: * It adds a virtual table of callbacks to core_unreal. These callbacks can be supplied by concrete implementations of "unreal" channel drivers, which lets the unreal channel driver call specific functionality when it performs some action. Currently, this is done to notify implementations when an optimization operation has begun, and when an optimization operation has succeeded. * It adds Stasis-Core messages for Local channel bridging and Local channel optimization. Local channel optimization is now two events: a Begin and an End. Some consumers of Stasis-Core may want to know when an operation is beginning so that they can 'prepare' their information; others will be more concerned about when the operation has completed, so that they can 'fix up' information. Stasis-Core allows for both, as does AMI. Review: https://reviewboard.asterisk.org/r/2552 2013-07-08 13:57 +0000 [r393793] Mark Michelson * res/res_sip_caller_id.c: Fix some broken logic in sending outbound caller ID. * trust_id_outbound was required even when the caller ID was not marked private. This is against intentions and documentation. * We now check both name and number privacy instead of checking name privacy twice. 2013-07-07 21:29 +0000 [r393777-393785] Matthew Jordan * main/channel.c: In a channel destructor dispose of items that raise Stasis message properly This patch reorders certain actions that may raise Stasis messages in the channel destructor such that they occur before the Stasis cache is cleared. Once the Stasis cache is cleared, its rather a bad idea to be trying to publish information about a channel. (closes issue ASTERISK-22001) Reported by: Jonathan Rose * main/cdr.c, main/channel.c, main/pbx.c, include/asterisk/stasis_channels.h, main/channel_internal_api.c, include/asterisk/cdr.h, include/asterisk/channel.h, main/stasis_channels.c, CHANGES, main/cel.c, main/manager_channels.c: Handle hangup logic in the Stasis message bus and consumers of Stasis messages This patch does the following: * It adds a new soft hangup flag AST_SOFTHANGUP_HANGUP_EXEC that is set when a channel is executing dialplan hangup logic, i.e., the 'h' extension or a hangup handler. Stasis messages now also convey the soft hangup flag so consumers of the messages can know when a channel is executing said hangup logic. * It adds a new channel flag, AST_FLAG_DEAD, which is set when a channel is well and truly dead. Not just a zombie, but dead, Jim. Manager, CEL, CDRs, and other consumers of Stasis have been updated to look for this flag to know when the channel should by lying six feet under. * The CDR engine has been updated to better handle a channel entering and leaving a bridge. Previously, a new CDR was automatically created when a channel left a bridge and put into the 'Pending' state; however, this way of handling CDRs made it difficult for the 'endbeforehexten' logic to work correctly - there was always a new CDR waiting in the hangup logic and, even if 'ended', wouldn't be the CDR people wanted to inspect in the hangup routine. This patch completely removes the Pending state and instead defers creation of the new CDR until it gets a new message that requires a new CDR. 2013-07-05 22:08 +0000 [r393749-393768] David M. Lee * res/res_stasis_http.c: ARI: return a 503 if Asterisk isn't fully booted * res/stasis_http/ari_websockets.c: Print error details when set nonblock fails * res/stasis_http/ari_model_validators.c, res/stasis_http/ari_model_validators.h, res/stasis_http/resource_events.c, res/res_stasis_http_events.c, rest-api/api-docs/events.json: Document MissingParams error message for /ari/events 2013-07-05 17:33 +0000 [r393740] Matthew Jordan * include/asterisk/cdr.h, include/asterisk/channel.h, channels/chan_gtalk.c, include/asterisk/json.h, channels/chan_gulp.c, channels/chan_jingle.c, main/json.c, main/manager.c, channels/chan_skinny.c, channels/chan_motif.c, channels/chan_h323.c, include/asterisk/rtp_engine.h, main/asterisk.c, channels/chan_mgcp.c, channels/chan_unistim.c, res/res_rtp_asterisk.c, channels/chan_multicast_rtp.c, main/rtp_engine.c, channels/chan_sip.c: Refactor RTCP events over to Stasis; associate with channels This patch does the following: * It merges Jaco Kroon's patch from ASTERISK-20754, which provides channel information in the RTCP events. Because Stasis provides a cache, Jaco's patch was modified to pass the channel uniqueid to the RTP layer as opposed to a pointer to the channel. This has the following benefits: (1) It keeps the RTP engine 'clean' of references back to channels (2) It prevents circular dependencies and other potential ref counting issues * The RTP engine now allows any RTP implementation to raise RTCP messages. Potentially, other implementations (such as res_rtp_multicast) could also raise RTCP information. The engine provides structs to represent RTCP headers and RTCP SR/RR reports. * Some general refactoring in res_rtp_asterisk was done to try and tame the RTCP code. It isn't perfect - that's *way* beyond the scope of this work - but it does feel marginally better. * A few random bugs were fixed in the RTCP statistics. (Example: performing an assignment of a = a is probably not correct) * We now raise RTCP events for each SR/RR sent/received. Previously we wouldn't raise an event when we sent a RR report. Note that this work will be of use to others who want to monitor call quality or build modules that report call quality statistics. Since the events are now moving across the Stasis message bus, this is far easier to accomplish. It is also a first step (though by no means the last step) towards getting Olle's pinefrog work incorporated. Again: note that the patch by Jaco Kroon was modified slightly for this work; however, he did all of the hard work in finding the right places to set the channel in the RTP engine across the channel drivers. Much thanks goes to Jaco for his hard work here. Review: https://reviewboard.asterisk.org/r/2603/ (closes issue ASTERISK-20574) Reported by: Jaco Kroon patches: asterisk-rtcp-channel.patch uploaded by jkroon (License 5671) (closes issue ASTERISK-21471) Reported by: Matt Jordan 2013-07-05 14:54 +0000 [r393729] Richard Mudgett * main/bridging.c: OneTouchRecord: Add function defined earlier: ast_bridge_features_do() 2013-07-05 03:08 +0000 [r393716] Matthew Jordan * main/stasis_channels.c, include/asterisk/stasis_channels.h: Remove parkinglot from the channel snapshot Legacy channel drivers often include the ability to set a default parking lot on an endpoint basis; when channels are created for that endpoint, they inherit the parkinglot option. Parking used to use this option more frequently; while it is still supported, other options (such as using channel variables or creation of a custom parkinglot) are supported. More importantly, conveying the parkinglot information through a channel snapshot isn't terribly useful - it is rarely (if ever) changed on a channel and some consumers of channel snapshots, such as ARI, will never use the information. (closes issue ASTERISK-21968) Reported by: Matt Jordan 2013-07-04 18:46 +0000 [r393704] Jonathan Rose * res/parking/parking_ui.c, main/parking.c, res/parking/parking_controller.c, UPGRADE.txt, res/parking/parking_applications.c, include/asterisk/channel.h, main/cel.c, CHANGES, res/parking/parking_bridge_features.c, res/parking/parking_bridge.c, main/channel.c, res/parking/res_parking.h, bridges/bridge_builtin_features.c, main/features.c, include/asterisk/parking.h, main/bridging.c, res/parking/parking_manager.c: res_parking: Replace Parker snapshots with ParkerDialString This process also involved a large amount of rework regarding how to redial the Parker when a channel leaves a parking lot due to timeout. An attended transfer channel variable has been added to attended transfers to extensions that will eventually park (but haven't at the time of transfer) as well. This resolves one of the two BUGBUG comments remaining in res_parking. (issues ASTERISK-21877) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2638/ 2013-07-04 13:37 +0000 [r393675-393687] David M. Lee * res/res_ari_model.c: Fix int width problem for 32-bit... again * tests/test_ari_model.c: Fix int width problem for 32-bit * main/utils.c, main/crypt.c (added), main/Makefile: Fix utils directory breakage. 2013-07-03 23:59 +0000 [r393600-393633] Richard Mudgett * main/config_options.c: Add BUGBUG note for ASTERISK-22009 * channels/chan_agent.c (added), configs/queues.conf.sample, include/asterisk/bridging.h, UPGRADE.txt, main/config_options.c, main/stasis_channels.c, CHANGES, main/bridging.c, apps/app_agent_pool.c (removed), configs/agents.conf.sample, include/asterisk/config_options.h, include/asterisk/stasis_channels.h: Revert accidental overcommit. * channels/chan_agent.c (removed), configs/queues.conf.sample, include/asterisk/bridging.h, UPGRADE.txt, main/config_options.c, main/stasis_channels.c, CHANGES, main/bridging.c, apps/app_agent_pool.c (added), configs/agents.conf.sample, include/asterisk/config_options.h, include/asterisk/stasis_channels.h: Add BUGBUG note for ASTERISK-22009 * channels/chan_dahdi.c, /: chan_dahdi: Fix segfault reloading chan_dahdi when round robin is used. * Clear round_robin[] in dahdi_restart(). (closes issue ASTERISK-21847) Reported by: Ivo Andonov Patches: jira_asterisk_21847_v1.8.patch (license #5621) patch uploaded by rmudgett ........ Merged revisions 393627 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 393628 from http://svn.asterisk.org/svn/asterisk/branches/11 * bridges/bridge_builtin_features.c, include/asterisk/bridging_features.h: OneTouchRecord: Make so Monitor/MixMonitor can be toggled/started/stopped. The OneTouchRecord feature has historically been a toggle. This patch adds the ability to make the OneTouchRecord hook optionally start/stop recording only. If OneTouchRecord is already doing what is requested then only the invoker hears the courtesy tone and/or start/stop recording message. The new feature is written so we could easily add explicit start/stop recording DTMF hooks for Monitor and MixMonitor. The majority of the changes in bridge_builtin_features.c is a refactoring of the OneTouchRecord code (Monitor and MixMonitor versions) so it is easy to direct the toggle/start/stop functionality. Review: https://reviewboard.asterisk.org/r/2655/ * main/bridging.c: Move when bridge channel enter is published so it does not interrupt the thought of some lines of code. * main/stasis_config.c: Fix some indentation in stasis_config.c. 2013-07-03 22:04 +0000 [r393589-393599] Matthew Jordan * main/cdr.c: Fix some bugs in CDRs; add some CLI commands to help debugging This patch fixes a few minor bugs and one major one: the CDR by bridge container was less than helpful. The mechanism previously used to try and find all of the CDRs in a particular bridge ended up missing CDRs, resulting in incorrect records. When looking up CDRs in a bridge, we now just bite the bullet and do a selection across all existing CDRs. * main/stasis_config.c: Let Stasis load itself with default values While a Stasis configuration file is nice, it shouldn't be mandatory. We can carry on with default values. 2013-07-03 20:41 +0000 [r393586] Mark Michelson * main/bridging.c: Publish a bridge enter before pulling on a push-and-swap operation. Prior to this patch, the order of procedures on a bridge push was * Add new bridge channel to bridge's array. * Pull the swap channel out of the bridge * Publish a bridge enter event. The problem is that when the swap channel was pulled from the bridge, a bridge leave event would be published. The bridge snapshot published during the bridge leave showed the new channel that had been added to the bridge, but there had been no bridge enter event for that channel. The fix provided here was to change the order a bit * Add new bridge channel to bridge's array. * Publish bridge enter event. * Pull the swap channel out of the bridge. This makes it so that the bridge snapshots during the stasis events are accurate. 2013-07-03 19:46 +0000 [r393528-393576] David M. Lee * res/res_stasis_http_bridges.c, res/res_stasis_http_recordings.c, res/stasis_http/ari_model_validators.h, res/res_stasis_http_endpoints.c, res/res_stasis_http_events.c, rest-api-templates/ari_model_validators.c.mustache, rest-api-templates/res_stasis_http_resource.c.mustache, rest-api-templates/ari_model_validators.h.mustache, res/stasis_http/ari_model_validators.c, res/res_stasis_http_channels.c, res/res_stasis_http_sounds.c: Fix load errors related to the new ari_model_validators. The Asterisk strategy of loading modules with RTLD_LAZY to extract metadata from the module works well enough, until you try to take the address of a function. If a module takes the address of a function, that function needs to be resolved at load time. That kinda defeats RTLD_LAZY. This patch adds some ari_validator_{id}_fn() wrapper functions for safely getting the function pointer from a different module. * res/res_ari_model.c: Violating the margins to make menuconfig happy * res/res_stasis_recording.exports.in (added), Makefile, include/asterisk/file.h, include/asterisk/paths.h, main/channel.c, include/asterisk/app.h, res/stasis_http/resource_channels.c, tests/test_utils.c, apps/app_minivm.c, main/file.c, res/stasis_http/resource_recordings.c, main/app.c, res/res_stasis_recording.c (added), rest-api-templates/swagger_model.py, rest-api/api-docs/channels.json, res/stasis_http/resource_channels.h, res/res_stasis_http_bridges.c, rest-api/api-docs/recordings.json, res/stasis_http/resource_recordings.h, main/asterisk.c, rest-api-templates/asterisk_processor.py, apps/app_voicemail.c, include/asterisk/utils.h, res/res_stasis_playback.c, include/asterisk/stasis_app_recording.h (added), res/res_stasis_http_channels.c, main/utils.c, include/asterisk/channel.h, res/res_stasis_http_recordings.c: ARI - channel recording support This patch is the first step in adding recording support to the Asterisk REST Interface. Recordings are stored in /var/spool/recording. Since recordings may be destructive (overwriting existing files), the API rejects attempts to escape the recording directory (avoiding issues if someone attempts to record to ../../lib/sounds/greeting, for example). (closes issue ASTERISK-21594) (closes issue ASTERISK-21581) Review: https://reviewboard.asterisk.org/r/2612/ * include/asterisk/stasis.h, configs/stasis_core.conf.sample (removed), main/asterisk.c, main/stasis.c, main/stasis_config.c (added), configs/stasis.conf.sample (added): Configuration for Stasis threadpool The appropriate settings for the Stasis threadpool is very system specific, depending upon both workload and system configuration. This patch adds a stasis.conf file which can be used to configure the key attributes of the threadpool for the Stasis message bus. (closes issue ASTERISK-21280) Review: https://reviewboard.asterisk.org/r/2651/ * res/stasis_http/cli.c (added), res/Makefile, configs/ari.conf.sample (added), makeopts.in, res/res_stasis_http.c, res/stasis_http/internal.h (added), configs/stasis_http.conf.sample (removed), main/Makefile, res/stasis_http/config.c (added), main/http.c, main/utils.c: No message for rev 393530 found * main/json.c, rest-api/api-docs/asterisk.json, rest-api/api-docs/playback.json, res/stasis_http/ari_websockets.c, main/stasis_channels.c, rest-api-templates/swagger_model.py, res/res_stasis_http_bridges.c, rest-api-templates/res_stasis_json_resource.c.mustache (removed), res/res_stasis_json_recordings.exports.in (removed), rest-api/api-docs/endpoints.json, main/stasis_endpoints.c, rest-api/api-docs/events.json, tests/test_res_stasis.c, tests/test_stasis_channels.c, include/asterisk/stasis_http.h, res/res_stasis_json_sounds.exports.in (removed), res/res_ari_model.exports.in (added), res/res_stasis_http_recordings.c, rest-api-templates/res_stasis_json_resource.exports.mustache (removed), rest-api/api-docs/bridges.json, res/res_stasis_http_events.c, res/res_ari_model.c (added), res/res_stasis_json_playback.exports.in (removed), res/res_stasis_http_sounds.c, res/stasis_json (removed), rest-api/api-docs/recordings.json, rest-api-templates/ari_model_validators.c.mustache (added), res/res_stasis_json_endpoints.exports.in (removed), res/res_stasis_json_events.exports.in (removed), res/res_stasis_http_asterisk.c, rest-api-templates/res_stasis_http_resource.c.mustache, rest-api-templates/make_ari_stubs.py (added), res/res_stasis_json_recordings.c (removed), rest-api-templates/api.wiki.mustache (added), rest-api/api-docs/sounds.json, res/Makefile, res/res_stasis_json_events.c (removed), res/res_stasis_json_bridges.exports.in (removed), res/res_stasis_json_sounds.c (removed), rest-api-templates/models.wiki.mustache (added), main/stasis_bridging.c, rest-api-templates/transform.py, rest-api-templates/stasis_json_resource.h.mustache (removed), res/res_stasis_json_channels.exports.in (removed), res/res_stasis_json_asterisk.c (removed), res/res_stasis_http.c, rest-api-templates/asterisk_processor.py, res/res_stasis_http_playback.c, rest-api-templates/ari_model_validators.h.mustache (added), res/res_stasis_http_channels.c, res/res_stasis_json_endpoints.c (removed), include/asterisk/json.h, tests/test_ari_model.c (added), Makefile, res/res_stasis_json_asterisk.exports.in (removed), res/res_stasis_json_bridges.c (removed), res/stasis_http/resource_recordings.c, rest-api/api-docs/channels.json, res/res_stasis_json_playback.c (removed), res/res_stasis.c, doc/rest-api (added), rest-api-templates/make_stasis_http_stubs.py (removed), res/stasis_http/resource_recordings.h, res/res_stasis_json_channels.c (removed), res/stasis_http/ari_model_validators.c (added), rest-api-templates/event_function_decl.mustache (removed), res/stasis_http/ari_model_validators.h (added), res/res_stasis_http_endpoints.c: No message for rev 393529 found * res/Makefile, res/res_http_websocket.c, res/res_stasis_http.exports.in, configure, tests/test_utils.c, res/stasis_http/ari_websockets.c (added), rest-api-templates/stasis_http_resource.c.mustache, tests/test_stasis_http.c, res/stasis_http/resource_events.c, rest-api-templates/asterisk_processor.py, include/asterisk/utils.h, res/res_stasis_http_playback.c, res/res_http_websocket.exports.in, res/stasis_http/resource_events.h, res/res_stasis_http_channels.c, include/asterisk/stasis_http.h, configure.ac, res/res_stasis_http_recordings.c, rest-api-templates/param_parsing.mustache (added), res/res_stasis_http_endpoints.c, res/res_stasis_http_events.c, include/asterisk/http.h, res/res_stasis_http_sounds.c, rest-api-templates/swagger_model.py, res/res_stasis_http_bridges.c, res/res_stasis_http.c, rest-api-templates/stasis_http_resource.h.mustache, res/res_stasis_http_asterisk.c, rest-api-templates/res_stasis_http_resource.c.mustache, rest-api/api-docs/events.json, res/res_stasis_websocket.c (removed), include/asterisk/autoconfig.h.in, rest-api-templates/rest_handler.mustache: No message for rev 393528 found 2013-07-02 22:01 +0000 [r393508] Jason Parker * main/manager.c, CHANGES: Add a SystemName field to all AMI events. This only gets sent out if configured in asterisk.conf (closes issue ASTERISK-21494) 2013-07-02 21:19 +0000 [r393485-393500] Richard Mudgett * apps/app_mixmonitor.c: MixMonitor: Minor code cleanup. * apps/app_mixmonitor.c: MixMonitor: Make start_mixmonitor_callback() options parameter NULL tolerant. * Removed some unnecessary code in start_mixmonitor_callback(). * apps/app_mixmonitor.c: MixMonitor: Don't use ast_strdupa() in a loop. * apps/app_mixmonitor.c: MixMonitor: Update XML documentation and CLI "mixmonitor {start|stop|list}" help. * apps/app_mixmonitor.c: MixMonitor: Fix refleak in manager_stop_mixmonitor() if could not stop monitoring. * apps/app_mixmonitor.c: MixMonitor: Remove some unnecessary channel locking. * apps/app_mixmonitor.c: Fix MixMonitor b option. The option had not been converted to use the replacement for ast_bridged_channel(). One touch mixmonitor now records files again. * channels/chan_gtalk.c: Fix chan_gtalk.c compile error. 2013-07-02 20:34 +0000 [r393484] David M. Lee * res/res_sip_notify.c: Add pjproject dependency to res_sip_notify 2013-07-02 18:28 +0000 [r393463] Mark Michelson * include/asterisk/stasis_bridging.h: Remove unused blind transfer publication structure. I ended up using a bridge blob, so this structure was unused. Keeping it in the header would just cause confusion. 2013-07-02 17:20 +0000 [r393442-393449] Kevin Harwell * main/aoc.c, main/manager.c: Stasis - Refactor AOC Events Refactored the AMI events in AOC onto Stasis-Core. The ast_aoc_manager_event function now publishes a channel snapshot, along with a JSON blob describing the advice of charge. A "to_ami" handler has also been added that converts the channel snapshot and AOC event data back into the appropriate data structure for use with AMI. (closes issue ASTERISK-21472) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2643/ * res/res_sip/sip_configuration.c, include/asterisk/res_sip.h, res/res_sip/sip_distributor.c, res/res_sip/config_auth.c, res/res_sip.exports.in, res/res_sip_outbound_authenticator_digest.c, res/res_sip_authenticator_digest.c, res/res_sip/config_security.c (added), res/res_sip_acl.c, res/res_sip.c: New SIP Channel driver: Always Auth Reject If no matching endpoint is found for the incoming request Asterisk will respond with a 401 Unauthorized (rejecting the request), but will first challenge if no authorization creditials are given. Changes also included moving ACL options into a new global 'security' configuration section in res_sip.conf. (closes issue ASTERISK-21433) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2554/ 2013-07-02 16:11 +0000 [r393410-393429] Kinsey Moore * main/stasis_bridging.c: Fix transfer AMI event parameter naming * tests/test_cel.c (added), main/cel.c, include/asterisk/cel.h: Add CEL unit tests and do some cleanup This adds several unit tests for CEL functionality and provides the requisite framework for creating additional unit tests. This also cleans up some reference leaks that were occurring in Stasis-Core message callback code. Review: https://reviewboard.asterisk.org/r/2646/ 2013-07-02 10:16 +0000 [r393396] Igor Goncharovskiy * channels/chan_unistim.c, /: Fix issue with inability to cancell call transfer made by on-sceen menus. Reported by: Igor Olhovskiy ........ Merged revisions 393395 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-07-02 08:23 +0000 [r393383] Tzafrir Cohen * contrib/scripts/ast_tls_cert: ast_tls_cert: don't recreate generated files Don't regenrate cat.cfg, ca.crt and ca.key if they were already created on a previous run. (closes issue ASTERISK-21932) 2013-07-01 21:28 +0000 [r393364] Kevin Harwell * res/res_sip/sip_configuration.c, include/asterisk/res_sip.h, res/res_sip/include/res_sip_private.h, res/res_sip/sip_options.c, res/res_sip.exports.in, res/res_sip_notify.c (added): New SIP Channel Driver - Add CLI/AMI initiated NOTIFY requests Added the ability to send unsolicited NOTIFY requests to a particular endpoint with a configured payload. Added both CLI and AMI support. For a given endpoint, this module will iterate over all its contacts sending the appropriate NOTIFY request to each. (closes issue ASTERISK-21436) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2623/ 2013-07-01 21:24 +0000 [r393361] Matthew Jordan * include/asterisk/pbx.h, main/pbx.c, main/manager.c: Prevent crash during synchronous AMI origination by ref bumping returned channel The originate APIs allow callers to provide a pointer to a channel that will point to the originated channel if the function call succeeds. This is used by AMI to provide channel information when the originate is performed synchronously. Unfortunately, if the originate fails in certain ways, the outbound channel is already disposed of during the dialing itself. This results in the channel being improperly dereferenced by the internal originate function in pbx.c. This patch ref bumps the channel to prevent this from occurring. Callers must now unlock and unref the channel (which is more in line with general channel management guidelines anyway). This only affects manager, as it is the only consumer of this API function that actually passes in a channel pointer. Review: https://reviewboard.asterisk.org/r/2617/ 2013-07-01 18:56 +0000 [r393326-393332] Jason Parker * res/stasis/control.c, res/stasis_http/resource_channels.c, include/asterisk/stasis_app.h: ARI: Implement channel hold/unhold. This puts the channel on hold (rather than queueing a frame from the channel). (closes issue ASTERISK-21619) Review: https://reviewboard.asterisk.org/r/2647/ * res/stasis_http/resource_channels.c, res/res_stasis_http_channels.c, include/asterisk/stasis_app.h, res/stasis_http/resource_channels.h, rest-api/api-docs/channels.json, res/stasis/control.c: ARI: Implement channel dial. This creates a new outbound channel, and bridges it to a channel already in the Stasis application. (closes issue ASTERISK-21620) Review: https://reviewboard.asterisk.org/r/2634/ 2013-07-01 16:01 +0000 [r393309] Jonathan Rose * bridges/bridge_builtin_features.c, include/asterisk/features_config.h, include/asterisk/mixmonitor.h (added), include/asterisk/channel.h, CHANGES, main/features_config.c, apps/app_mixmonitor.c, configs/features.conf.sample, main/mixmonitor.c (added): bridge_features: Support One touch Monitor/MixMonitor In addition to porting those features, they now enjoy greater feature parity with one another. Specifically, AutoMixMon now has a start and stop message that can be specified with TOUCH_MIXMONITOR_MESSAGE_START and TOUCH_MIXMONITOR_MESSAGE_STOP. (closes issue ASTERISK-21553) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2620/ 2013-07-01 13:16 +0000 [r393284] Kinsey Moore * channels/chan_sip.c, apps/app_meetme.c, include/asterisk/stasis.h, main/core_local.c, include/asterisk/json.h, channels/chan_gtalk.c, channels/sig_pri.c, channels/chan_iax2.c, apps/app_queue.c, CHANGES, main/json.c, channels/chan_dahdi.c, channels/sig_analog.c, res/res_agi.c, configs/sip.conf.sample, channels/sip/include/sip.h: Refactor extraneous channel events This change removes JitterBufStats, ChannelReload, and ChannelUpdate and refactors the following events to travel over Stasis-Core: * LocalBridge * DAHDIChannel * AlarmClear * SpanAlarmClear * Alarm * SpanAlarm * DNDState * MCID * SIPQualifyPeerDone * SessionTimeout Review: https://reviewboard.asterisk.org/r/2627/ (closes issue ASTERISK-21476) 2013-06-29 13:47 +0000 [r393262-393264] Joshua Colp * res/res_sip_pubsub.c: Nothing to see here, move along. * res/res_sip_pubsub.c, include/asterisk/res_sip_pubsub.h, res/res_sip_pubsub.exports.in: Implement the defined PUBLISH ESC API within res_sip_pubsub. (closes issue ASTERISK-21452) Review: https://reviewboard.asterisk.org/r/2630/ 2013-06-29 00:31 +0000 [r393219-393241] Richard Mudgett * main/bridging.c, include/asterisk/bridging.h: Tweak after bridge callback reason to string strings. * main/bridging.c: Fix after bridge callback datastore data memory leak. * main/datastore.c: This is no longer needed. * main/bridging.c: Promote local channel optimizing debug messages to verbose 3 messages. 2013-06-28 19:22 +0000 [r393190-393197] Jonathan Rose * res/parking/parking_applications.c, CHANGES, res/parking/parking_ui.c, res/parking/res_parking.h, res/res_parking.c: res_parking: Dynamic Parking Lots (closes issue ASTERISK-21644) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2615/ * main/features.c, include/asterisk/features.h: features: call pickup stasis refactoring (issue ASTERISK-21544) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2588/ 2013-06-28 19:05 +0000 [r393184] Richard Mudgett * include/asterisk/bridging_features.h: Fix overlapping enum ast_bridge_feature_flags. Things may no longer behave in an unexpected fashion. Local channel optimization to holding bridges will work again. 2013-06-28 18:42 +0000 [r393182] Mark Michelson * main/manager.c, bridges/bridge_builtin_features.c, channels/chan_sip.c, channels/chan_skinny.c, main/stasis_bridging.c, res/res_sip_refer.c, include/asterisk/bridging.h, main/manager_bridging.c, channels/chan_iax2.c, include/asterisk/stasis_bridging.h, main/bridging.c: Add stasis publications for blind and attended transfers. This creates stasis messages that are sent during a blind or attended transfer. The stasis messages also are converted to AMI events. Review: https://reviewboard.asterisk.org/r/2619 (closes issue ASTERISK-21337) Reported by Matt Jordan 2013-06-28 17:31 +0000 [r393164] Matthew Jordan * tests/test_cdr.c, main/cdr.c: Handle an originated channel being sent into a non-empty bridge Originated channels are a bit odd - they are technically a dialed channel (thus the party B or peer) but, since there is no caller, they are treated as the party A. When entering into a bridge that already contains participants, the CDR engine - if the CDR record is in the Dial state - attempts to match the person entering the bridge with an existing participant. The idea is that if you dialed someone and the person you dialed is already in the bridge, you don't need a new CDR record, the existing CDR record describes the relationship. Unfortunately, for an originated channel, there is no Party B. If no one was in the bridge this didn't cause any issues; however, if participants were in the bridge the CDR engine would attempt to match a non-existant Party B on the channel's CDR record and explode. This patch fixes that, and a unit test has been added to cover this case. 2013-06-28 16:23 +0000 [r393144] Jason Parker * res/res_stasis_http_channels.c, res/stasis_http/resource_channels.h, rest-api/api-docs/channels.json, res/stasis_http/resource_channels.c: Change ARI originate to also allow dialing an exten/context/priority. The old way didn't make much sense, so some of the fields were repurposed. (closes issue ASTERISK-21658) Review: https://reviewboard.asterisk.org/r/2626/ 2013-06-28 15:50 +0000 [r393130] Matthew Jordan * include/asterisk/parking.h, main/asterisk.c, main/bridging.c, main/cdr.c, include/asterisk/cdr.h: Better handle parking in CDRs Parking typically occurs when a channel is transferred to a parking extension. When this occurs, the channel never actually hits the dialplan if the extension it was transferred to was a "parking extension", that is, the extension in the first priority calls the Park application. Instead, the channel is immediately sent into the holding bridge acting as the parking bridge. This is problematic. Because we never go out to the dialplan, the CDRs won't transition properly and the application field will not be set to "Park". CDRs typically swallow holding bridges, so the CDR itself won't even be generated. This patch handles this by pulling out the holding bridge handling into its own CDR state. CDRs now have an explicit parking state that accounts for this specific subclass of the holding bridge. In addition, we handle the parking stasis message to set application specific data on the CDR such that the last known application for the CDR properly reflects "Park". This is a bit sad since we're working around the odd internal implementation of parking that exists in Asterisk (and that we had to maintain in order to continue to meet some odd use cases of parking), but at least the code to handle that is where it belongs: in CDRs as opposed to sprinkled liberally throughout the codebase. This patch also properly clears the OUTBOUND channel flag from a channel when it leaves a bridge, and tweaks up dialing handling to properly compare the correct CDR with the channel calling/being dialed. 2013-06-28 15:36 +0000 [r393128] Jason Parker * res/stasis_http/resource_channels.c: Change some 500 errors to 400. 2013-06-28 02:14 +0000 [r393083-393100] David M. Lee * res/res_stasis_http.c: Removed stray apostrophe. Apparently the pluralization of an acronym does not use an apostophe, according to most modern style guides. I feel like I've been living a lie this whole time. * res/res_stasis_http.c: Removed the automatic 302 redirects for ARI URL's that end with a slash. There were some problems redirecting RESTful API requests; notably the client would change the request method to GET on the redirected requests. After some looking into, I decided that a 404 would be simpler and have more consistent behavior. 2013-06-27 21:01 +0000 [r393034-393066] Richard Mudgett * main/bridging.c: Change the name of some local variables in bridging.c to reflect what they really mean. * main/config_options.c, include/asterisk/config_options.h: Add config framework non-empty string validation requirement option. Add config framework OPT_CHAR_ARRAY_T and OPT_STRINGFIELD_T non-empty requirement option. There are cases were you don't want a config option string to be empty. To require the option string to be non-empty, just set the aco_option_register() flags parameter to non-zero. * Updated some config framework enum aco_option_type comments. 2013-06-26 20:59 +0000 [r393005] Jonathan Rose * funcs/func_channel.c, include/asterisk/bridging.h, main/bridging.c: func_channel: Read/Write after_bridge_goto option Allows reading and setting of a channel's after_bridge_goto datastore (closes issue ASTERISK-21875) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2628/ 2013-06-26 19:29 +0000 [r392987] Jason Parker * res/res_stasis_http_channels.c, include/asterisk/stasis_app.h, res/stasis_http/resource_channels.h, rest-api/api-docs/channels.json, res/stasis/control.c, res/stasis_http/resource_channels.c: ARI: Add support for continuing to a different location in dialplan. This allows going elsewhere in the dialplan, so that the location can be specified after exiting the Stasis application. (closes issue ASTERISK-21870) Review: https://reviewboard.asterisk.org/r/2644/ 2013-06-26 19:15 +0000 [r392933-392972] Richard Mudgett * res/res_parking.c: Remove some redundant parking config error messages. * main/bridging.c: Fix several problems with ast_bridge_add_channel(). * Fix locking problems. ast_bridge_move() locks two bridges. To do that, deadlock avoidance must be done. Called bridge_move_locked() instead. * Fix inconsistency in the bridge dissolve check callers. The original caller has already removed the channel from the bridge. The new caller has not removed the channel from the bridge. Reverted bridge_dissolve_check() and added bridge_dissolve_check_stolen() to be used by the new caller on the original bridge after the channel is moved to the new bridge. * Fix memory leak of features if the added channel was already in a bridge. * Fix incorrect call to ast_bridge_impart(). * Renamed bridge_chan to yanked_chan. * channels/chan_sip.c, include/asterisk/bridging.h, apps/confbridge/conf_chan_announce.c: Fix incorrect calls to ast_bridge_impart(). There was a misunderstanding about ast_bridge_impart()'s handling of the imparted channel's reference. The channel reference is passed by the caller unless ast_bridge_impart() returns an error. * Fixed a memory leak in conf_announce_channel_push() if the impart failed. * main/features.c: AMI Bridge action: Get channel xfer config after we have found the second channel. 2013-06-25 22:28 +0000 [r392915] Jonathan Rose * res/parking/parking_applications.c, CHANGES, main/bridging.c, res/parking/parking_bridge_features.c, res/parking/parking_manager.c, include/asterisk/features.h, res/parking/parking_bridge.c, res/parking/res_parking.h, main/features.c, res/parking/parking_controller.c: res_parking: Add Parking manager action to the new parking system (closes issue ASTERISK-21641) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2573/ 2013-06-25 20:25 +0000 [r392898] Jason Parker * Makefile: Fix typo with XML docs. 2013-06-25 19:22 +0000 [r392864-392879] Joshua Colp * include/asterisk/sorcery.h: Add a note about being ready to accept observer invocations before adding an observer. * res/res_sip/sip_options.c: Move where the sorcery observer is added for qualify to guarantee the sched_qualifies container exists. 2013-06-25 13:03 +0000 [r392829] Kinsey Moore * apps/app_queue.c, main/cel.c, apps/app_dial.c, include/asterisk/stasis_channels.h, include/asterisk/cel.h, apps/app_celgenuserevent.c, main/stasis_channels.c: CEL refactoring cleanup This change removes AST_CEL_BRIDGE_UPDATE since it should no longer be used because masquerade situations are now accounted for in other ways. This also refactors usage of AST_CEL_FORWARD to be produced by a Dial message which has been extended with a "forward" field. (closes issue ASTERISK-21566) Review: https://reviewboard.asterisk.org/r/2635/ 2013-06-25 01:12 +0000 [r392797-392812] Matthew Jordan * main/named_acl.c, res/res_calendar.c, /, channels/chan_motif.c, main/http.c, main/config_options.c: Fix memory/ref counting leaks in a variety of locations This patch fixes the following memory leaks: * http.c: The structure containing the addresses to bind to was not being deallocated when no longer used * named_acl.c: The global configuration information was not disposed of * config_options.c: An invalid read was occurring for certain option types. * res_calendar.c: The loaded calendars on module unload were not being properly disposed of. * chan_motif.c: The format capabilities needed to be disposed of on module unload. In addition, this now specifies the default options for the maxpayloads and maxicecandidates in such a way that it doesn't cause the invalid read in config_options.c to occur. (issue ASTERISK-21906) Reported by: John Hardin patches: http.patch uploaded by jhardin (license 6512) named_acl.patch uploaded by jhardin (license 6512) config_options.patch uploaded by jhardin (license 6512) res_calendar.patch uploaded by jhardin (license 6512) chan_motif.patch uploaded by jhardin (license 6512) ........ Merged revisions 392810 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/presencestate.c, main/sorcery.c, res/parking/parking_bridge.c, main/cdr.c, main/manager.c, main/parking.c, main/devicestate.c, main/cel.c: Fix a variety of memory leaks This patch addresses the following memory/ref counting leaks: * main/devicestate.c - unsubscribe and join our devicestate message subscription * main/cel.c - clean up the datastore and config objects on exist * main/parking.c - cleanup memory leak of retriever snapshot on message payload destruction * res/parking/parking_bridge.c - cleanup memory leak of retrieve snapshot on message payload destruction * main/presencestate.c - unsubscribe and join the caching topic on exit * manager.c - properly unregister the manager action "BlindTransfer" * sorcery.c - shutdown the threadpool on exit and dispose of any wizards (issue ASTERISK-21906) Reported by: John Hardin patches: cel.patch uploaded by jhardin (license #6512) devicestate.patch uploaded by jhardin (license #6512) manager.patch uploaded by jardin (license #6512) presencestate.patch uploaded by jhardin (license #6512) retriever-channel-snapshot.patch uploaded by jhardin (license #6512) sorcery.patch uploaded by jhardin (license #6512) 2013-06-24 22:05 +0000 [r392778-392779] David M. Lee * tests/test_endpoints.c, tests/test_stasis_endpoints.c: Few more menuselect fixes missed in r392777 * res/stasis_json/resource_sounds.h, rest-api-templates/res_stasis_json_resource.c.mustache, rest-api-templates/res_stasis_http_resource.c.mustache: Fixed templates so that the changes from r392777 won't be overwritten the next time we run the generators. 2013-06-24 21:40 +0000 [r392777] Richard Mudgett * res/res_stasis_http_playback.c, res/res_stasis_playback.c, res/res_stasis_websocket.c, res/res_stasis_json_recordings.c, res/res_stasis_http_channels.c, res/res_stasis_json_endpoints.c, res/res_stasis_json_events.c, res/res_stasis_http_recordings.c, res/res_stasis_answer.c, res/res_chan_stats.c, res/res_stasis_http_endpoints.c, res/res_stasis_http_events.c, res/res_stasis_json_sounds.c, res/res_stasis_bridge_add.c, res/res_stasis_json_bridges.c, res/res_stasis_http_sounds.c, res/res_statsd.c, res/res_stasis_http_bridges.c, res/res_stasis_json_asterisk.c, res/res_stasis_test.c, res/res_stasis_json_playback.c, res/res_stasis_http.c, res/res_stasis.c, apps/app_stasis.c, res/res_stasis_http_asterisk.c, res/res_stasis_json_channels.c: Fix menuselect display for stasis modules. The menuselect parser is very simple. It looks for AST_MODULE_INFO and uses any quoted string on that line as the module summary display. 2013-06-24 19:28 +0000 [r392729-392747] Mark Michelson * /: Remove stray properties from merge. * /, main/features_config.c, doc/appdocsxml.dtd: Add documentation for features configuration. Review: https://reviewboard.asterisk.org/r/2616 (closes issue ASTERISK-21542) Reported by Matt Jordan 2013-06-24 13:49 +0000 [r392700] Kinsey Moore * include/asterisk/media_index.h (added), main/file.c, main/http.c, include/asterisk/format.h, rest-api/api-docs/sounds.json, include/asterisk/_private.h, main/sounds_index.c (added), res/res_stasis_http.c, main/asterisk.c, main/media_index.c (added), include/asterisk/file.h, include/asterisk/http.h, include/asterisk/sounds_index.h (added), res/stasis_http/resource_sounds.c: Index installed sounds and implement ARI sounds queries This adds support for stasis/sounds and stasis/sounds/{ID} queries via the Asterisk RESTful Interface (ARI, formerly Stasis-HTTP). The following changes have been made to accomplish this: * A modular indexer was created for local media. * A new function to get an ast_format associated with a file extension was added. * Modifications were made to the built-in HTTP server so that URI decoding could be deferred to the URI handler when necessary. * The Stasis-HTTP sounds JSON documentation was modified to handle cases where multiple languages are installed in different formats. * Register and Unregister events for formats were added to the system topic. (closes issue ASTERISK-21584) (closes issue ASTERISK-21585) Review: https://reviewboard.asterisk.org/r/2507/ 2013-06-23 19:19 +0000 [r392676] Matthew Jordan * res/res_fax.c: Properly pack the parameters into ast_json_pack when sending a send fax message This patch properly packs the parameters into the send fax message so that it actually work. Missing a ',' between two string fields can be difficult to debug, particularly when the actual packing succeeds. Interestingly enough, this didn't actually crash until the JSON blob we deref'd and disposed of. Since that happened in a different thread, it was pretty tough to track down. 2013-06-23 18:59 +0000 [r392627-392667] Joshua Colp * res/res_sip_outbound_registration.c, res/res_sip_endpoint_identifier_ip.c, res/res_sip_acl.c: Add some more missing ast_sorcery_generic_alloc conversions. * tests/test_sorcery_realtime.c, tests/test_sorcery_astdb.c: Add missing ast_sorcery_generic_alloc conversions. * main/manager_endpoints.c: Fix a bug where messages were getting duplicated on AMI. This was caused by forwarding all endpoint messages to manager which includes channel messages that are related to the endpoint. This change causes only the PeerStatus messages to be forwarded to manager thus eliminating the duplicate channel messages. 2013-06-22 22:42 +0000 [r392607] Matthew Jordan * res/res_fax.c: Properly extract channel variables for the SendFAX/ReceiveFAX Stasis messages By the time something extracts the pointers from ast_json_pack, the channels will already be disposed of. This patch properly pulls the information out of the variables and packs them into the JSON blob. 2013-06-22 14:26 +0000 [r392565-392586] Joshua Colp * include/asterisk/sorcery.h, res/res_sip/config_auth.c, res/res_sip/sip_options.c, res/res_sip/location.c, tests/test_sorcery.c, main/sorcery.c, res/res_sip/config_domain_aliases.c, res/res_sip/config_transport.c, res/res_sip/sip_configuration.c: Make sorcery details opaque and add extended fields. Sorcery specific object information is now opaque and allocated with the object. This means that modules do not need to be recompiled if the sorcery specific part is changed. It also means that sorcery can store additional information on objects and ensure it is freed or the reference count decreased when the object goes away. To facilitate the above a generic sorcery allocator function has been added which also ensures that allocated objects do not have a lock. Extended fields have been added thanks to all of the above which allows specific fields to be marked as extended, and thus simply stored as-is within the object. Type safety is *NOT* enforced on these fields. A consumer of them has to query and ultimately perform their own safety check. What does this mean? Extra modules can extend already defined structures without having to modify them. Tests have also been included to verify extended field functionality. Review: https://reviewboard.asterisk.org/r/2585/ * res/res_sip_exten_state.exports.in (added), res/res_sip_session.exports.in, res/res_sip_sdp_rtp.c, res/res_sip_messaging.c (added), res/res_sip_caller_id.c, channels/chan_gulp.c, res/res_sip_session.c, res/res_sip_exten_state.c (added), res/res_sip/sip_options.c, res/res_sip_pubsub.exports.in, channels/sip/include/sip.h, include/asterisk/sdp_srtp.h (added), channels/sip/sdp_crypto.c (removed), main/pbx.c, channels/sip/srtp.c (removed), res/res_sip_transport_websocket.c (added), channels/chan_sip.c, res/res_sip_registrar.c, res/res_sip/sip_distributor.c, include/asterisk/res_sip_session.h, include/asterisk/res_sip_exten_state.h (added), res/res_sip/security_events.c (added), res/res_sip_registrar_expire.c (added), res/res_sip.c, res/res_sip_pidf.c (added), include/asterisk/res_sip_pubsub.h, channels/sip/include/sdp_crypto.h (removed), res/res_sip/location.c, res/res_sip_outbound_registration.c, channels/sip/include/srtp.h (removed), res/res_sip_endpoint_identifier_anonymous.c (added), res/res_sip_one_touch_record_info.c (added), res/res_sip_pubsub.c, res/res_sip/config_transport.c, configs/res_sip.conf.sample, res/res_sip/sip_configuration.c, res/res_sip_diversion.c (added), res/res_sip_refer.c (added), include/asterisk/res_sip.h, res/res_sip_dtmf_info.c, main/sdp_srtp.c (added), res/res_sip/include/res_sip_private.h, res/res_sip.exports.in: Merge in current pimp_my_sip work, including: 1. Security events 2. Websocket support 3. Diversion header + redirecting support 4. An anonymous endpoint identifier 5. Inbound extension state subscription support 6. PIDF notify generation 7. One touch recording support (special thanks Sean Bright!) 8. Blind and attended transfer support 9. Automatic inbound registration expiration 10. SRTP support 11. Media offer control dialplan function 12. Connected line support 13. SendText() support 14. Qualify support 15. Inband DTMF detection 16. Call and pickup groups 17. Messaging support Thanks everyone! Side note: I'm reminded of the song "How Far We've Come" by Matchbox Twenty. 2013-06-22 13:58 +0000 [r392564] Matthew Jordan * res/res_fax.c: Fix a deadlock and possible crash in res_fax This patch fixes two bugs. (1) It unlocks the channel in the framehook handlers before attempting to grab the peer from the bridge. The locking order for the bridging framework is bridge first, then channel - having the channel locked while attempting to obtain the bridge lock causes a locking inversion and a deadlock. This patch bumps the channel ref count prior to releasing the lock in the framehook to avoid lifetime issues. Note that this does expose a subtle problem in framehooks; that is, something could modify the framehook list while we are executing, causing issues in the framehook list traversal that the callback executes in. Fixing this is a much larger problem that is beyond the scope of this patch - (a) we already unlock the channel in this particular framehook and we haven't run into a problem yet (as modifying the framehook list when a channel is about to perform a fax gateway would be a very odd operation) and (b) migrating to an ao2 container of framehooks would be more invasive at this point. See the referenced ASTERISK issue for more information. (2) Directly packing channel variables into a JSON object turned out to be unsafe. A condition existed where the strings in the JSON blob were no longer safe to be accessed if the channel object itself was disposed of. (issue ASTERISK-21951) 2013-06-22 12:40 +0000 [r392538] Joshua Colp * include/asterisk/res_sip.h, main/manager_endpoints.c (added), include/asterisk/stasis_endpoints.h, channels/chan_iax2.c, include/asterisk/manager.h, channels/chan_gulp.c, main/stasis_endpoints.c, res/res_sip.c, main/manager.c, channels/chan_sip.c, channels/chan_skinny.c, res/res_sip/sip_configuration.c: Migrate PeerStatus events to stasis, add stasis endpoints, and add chan_pjsip device state. (closes issue ASTERISK-21489) (closes issue ASTERISK-21503) Review: https://reviewboard.asterisk.org/r/2601/ 2013-06-21 22:39 +0000 [r392514] Richard Mudgett * bridges/bridge_simple.c, bridges/bridge_softmix.c, bridges/bridge_native_rtp.c, main/bridging.c, include/asterisk/bridging_technology.h, bridges/bridge_holding.c, include/asterisk/bridging.h: Extract a useful routine from the softmix bridge technology. * Extract a useful routine from the softmix bridge technology for other technologies. Make other technologies use it if they can. * Made native and 1-1 bridges write to all parties if the bridge channel writing the frame into the bridge is NULL. Softmix will also do the same for frame types that make sense. * Tweak the bridge write routine return value meaning and adjust the bridge technologies to match. 2013-06-21 21:22 +0000 [r392489] Matthew Jordan * channels/chan_gulp.c: Add BUGBUG for broken direct media in chan_gulp (issue ASTERISK-21947) 2013-06-21 18:54 +0000 [r392464] Jason Parker * rest-api/api-docs/channels.json: Fix typo. 2013-06-21 18:10 +0000 [r392437] Richard Mudgett * main/bridging.c: Add channel optimization interaction with frame hooks BUGBUG comments. 2013-06-21 18:05 +0000 [r392436] Mark Michelson * channels/chan_unistim.c: Change chan_unistim to use core transfer API. Review: https://reviewboard.asterisk.org/r/2553 (closes issue ASTERISK-21527) Reported by Matt Jordan 2013-06-21 17:48 +0000 [r392435] Richard Mudgett * bridges/bridge_softmix.c, main/bridging.c, include/asterisk/bridging_technology.h, include/asterisk/bridging.h, main/features.c: Change several bridge functions to return error status. The bridge frame queue functions need to return an error status if the frame failed to be queued because of an error condition. The main calls that needed to return the status are: ast_bridge_channel_queue_action_data() and ast_bridge_channel_write_action_data(). The other return changes are ripple effects. 2013-06-21 14:21 +0000 [r392409] Matthew Jordan * contrib/scripts/autosupport: Update autosupport script This patch updates the autosupport script to collect all information available to the Asterisk CLI command "digium_phones". It also makes minor improvements in options handling. (closes issue AST-1163) Reported by: Trey Blancher patches: 390347_autosupport.diff uploaded by tblancher (License 5821) 390348_autosupport.diff uploaded by tblancher (License 5821) 2013-06-20 21:13 +0000 [r392364] Joshua Colp * res/res_sip_session.c: Add a log message for when an incoming session is rejected due to the extension not being found. 2013-06-20 17:21 +0000 [r392335] Richard Mudgett * include/asterisk/bridging_features.h, main/features.c, main/bridging.c, res/parking/parking_bridge_features.c, apps/confbridge/conf_config_parser.c: Fix potential bridge hook resource leak if the hook install fails. 2013-06-20 16:29 +0000 [r392318] Mark Michelson * main/threadpool.c: Fix threadpool rapid growth problem. When a threadpool is set to autoincrement its threadcount, an issue may arise when multiple tasks are queued at once into the threadpool. Since threads start active, each new task would result in autoincrementing the thread count. So if all threads were active, and a thread's autoincrement value were 5, then 3 new tasks would result in 15 threads being created even though the initial autoincrement was sufficient to handle the number of tasks. This change introduces three behavior changes: 1) New threads in the threadpool start idle instead of active. 2) When a threadpool autoincrements, one thread is activated after the growth. 3) When a threadpool's size is incremented manually, all added threads are activated. For a more detailed explanation about the changes, please see the Review Board link at the bottom of this commit. Review: https://reviewboard.asterisk.org/r/2629 2013-06-19 22:52 +0000 [r392279] David M. Lee * Makefile, main/Makefile: Fix build problem on OS X Mountain Lion (10.8) For about forever, our build flags for OS X have been slightly off, but good enough to build and run. Apparently they aren't good enough any more. Previously, we would compile with macosx-version-min unset and link with it set. This combination, using GCC 4.8, on Mountain Lion, would create a bad executable ("Illegal Instruction: 4", or something like that) This patch consistently sets macosx-version-min for both compiling and linking, which makes everything happy enough to build and run. 2013-06-19 12:55 +0000 [r392241] Kinsey Moore * include/asterisk/cel.h, main/cel.c: Pull CEL linkedid manipulation into cel.c This finishes moving all CEL linkedid tracking entirely within cel.c since that is now possible with channel snapshots. This also removes another CEL linkedid manipulation function from cel.h that has already been internalized and is neither called nor available to link against. Review: https://reviewboard.asterisk.org/r/2632/ 2013-06-19 01:28 +0000 [r392190-392214] Matthew Jordan * funcs/func_cdr.c: Handle variable substitution in dummy variables When func_cdr is used for variable substitution, there is no channel name and hence no run-time information available for CDR variable substitution. In that case, the correct thing to do is to use the CDR object on the channel passed to the function. This patch checks to see if the channel passed in has a name - if not, it uses ast_cdr_format_var instead of ast_cdr_get_var. This allows CDR backends to continue to use variable substitution in order to resolve ast_cdr object properties. * tests/test_substitution.c: Fix the test_substitution test In r391947, the CDR function was modified such that it will return a value for the start,answer, and end times if asked. That time will just be 0 if it hasn't happened yet. 2013-06-18 19:31 +0000 [r392139-392166] Richard Mudgett * main/bridging.c, include/asterisk/bridging.h: Bridging: Fix crash on destruction of a partially constructed bridge. * Promoted some bridge construction debug messages to warnings. * main/bridging.c: Add some safety cleanup for a failed push into a bridge. * main/bridging_basic.c: Remove stub comment on function that is not a stub. 2013-06-18 14:30 +0000 [r392116] Kinsey Moore * include/asterisk/stasis_bridging.h, rest-api/api-docs/bridges.json, main/stasis_bridging.c: Fix bridge snapshot conversion to JSON This makes ast_bridge_snapshot_to_json conform to the swagger Bridge model by adding the two fields it required. Review: https://reviewboard.asterisk.org/r/2583/ 2013-06-17 18:58 +0000 [r392076] David M. Lee * funcs/func_cdr.c, main/cdr.c: Fix build warnings related to printf/scanf of tv_usec. The type of tv_usec is suseconds_t. On Linux, this is usually a long int, but the specification is actually pretty lax on what it might actually be. And, sadly, there's no printf/scanf width specifier for suseconds_t. So it could bit an int or a long, but there's not a great way to tell which it is. This patch fixes scanf by reading into a long temporary variable that's then stored into the tv_usec. It fixes printf by casting the tv_usec to a long first. This patch also adds some missing width specifiers for some debug statements, which would cause ".000001" to be displayed at ".1". 2013-06-17 18:37 +0000 [r392053-392073] Richard Mudgett * main/channel.c, channels/chan_vpb.cc: chan_vpb: Fix compile error and __ast_channel_alloc() prototype const inconsistency. * channels/chan_misdn.c: chan_misdn: Fix compile error after CDR merge. 2013-06-17 16:59 +0000 [r392032] Jason Parker * include/asterisk/app.h: Fix a build warning with stasis messages. 2013-06-17 14:40 +0000 [r392004-392005] Matthew Jordan * main/manager_channels.c: Prevent sending a NewExten event after a Hangup during a stack restore When a channel is originated, its application is typically set to AppDial2, indicating that it was a dialed channel through the Dial API. Asterisk during an originate will perform a stack execute to direct the outgoing channel to a particular place in the dialplan or application. When the stack returns, the previous application (AppDial2) is restored. Unfortunately, in the case of an originated channel, the stack restore happens after hangup. A stasis message is sent notifying everyone that the application was restored, and this causes a NewExten event to go out after the Hangup event, violating the basic contract consumers have of the channel lifetime. While we could preclude the message from going out, restoring the channel's state before it executed the next higher frame in the stack has to occur, and other places in the code depend on this behavior. Since we know that channel hung up (it's a ZOMBIE!), this patch simply checks to see if the channel has been zombified before sending a NewExten event. Note that this will fix a number of bouncing tests in the Test Suite. Go tests. * CHANGES: Restore bad merge on CHANGES The patch for CDRs moved around a lot of content in CHANGES to try and organize the areas that were affected. This missed some changes that went in with a merge and removed some updates - this patch adds them back in. 2013-06-17 12:28 +0000 [r391982] Joshua Colp * main/cdr.c: Fix build warning (which is transmogrified into an error) with my compiler due to uninitialized variable. 2013-06-17 03:31 +0000 [r391947-391964] Matthew Jordan * addons/cdr_mysql.c: Make cdr_mysql compile again by not directly setting the run-time CDR object A stray ast_cdr_setvar was missed in cdr_mysql (silly addons). This has now been refactored to not set the property, as the property would have been set on a run-time object that was already dispatched to the backend. The module simply remembers the value it wanted to set and writes it to MySQL later in the processing. * apps/app_forkcdr.c, include/asterisk/stasis_channels.h, main/test.c, channels/chan_h323.c, main/asterisk.c, channels/chan_unistim.c, addons/chan_ooh323.c, include/asterisk/cel.h, apps/app_authenticate.c, cdr/cdr_pgsql.c, apps/app_followme.c, channels/chan_iax2.c, res/res_config_sqlite.c, main/stasis.c, cdr/cdr_csv.c, main/cli.c, main/dial.c, channels/chan_skinny.c, cel/cel_manager.c, res/res_agi.c, main/stasis_channels.c, cdr/cdr_odbc.c, tests/test_cdr.c (added), main/bridging_basic.c, main/pbx.c, channels/chan_sip.c, main/channel_internal_api.c, UPGRADE.txt, include/asterisk/cdr.h, include/asterisk/channel.h, res/res_stasis_answer.c, main/cel.c, cdr/cdr_tds.c, funcs/func_channel.c, funcs/func_cdr.c, include/asterisk/bridging.h, addons/cdr_mysql.c, funcs/func_callerid.c, apps/app_cdr.c, include/asterisk/time.h, cel/cel_radius.c, include/asterisk/stasis_internal.h (added), include/asterisk/channel_internal.h, main/utils.c, cdr/cdr_adaptive_odbc.c, cdr/cdr_radius.c, main/channel.c, main/cdr.c, include/asterisk/test.h, channels/chan_dahdi.c, main/manager.c, apps/app_osplookup.c, main/features.c, apps/app_dumpchan.c, main/manager_channels.c, main/bridging.c, cdr/cdr_custom.c, channels/chan_mgcp.c, cdr/cdr_manager.c, apps/app_dial.c, main/stasis_cache.c, cdr/cdr_syslog.c, cel/cel_tds.c, channels/chan_agent.c, apps/app_disa.c, apps/app_queue.c, CHANGES, res/res_monitor.c: Update Asterisk's CDRs for the new bridging framework This patch is the initial push to update Asterisk's CDR engine for the new bridging framework. This patch guts the existing CDR engine and builds the new on top of messages coming across Stasis. As changes in channel state and bridge state are detected, CDRs are built and dispatched accordingly. This fundamentally changes CDRs in a few ways. (1) CDRs are now *very* reflective of the actual state of channels and bridges. This means CDRs track well with what an actual channel is doing - which is useful in transfer scenarios (which were previously difficult to pin down). It does, however, mean that CDRs cannot be 'fooled'. Previous behavior in Asterisk allowed for CDR applications, channels, and other properties to be spoofed in parts of the code - this no longer works. (2) CDRs have defined behavior in multi-party scenarios. This behavior will not be what everyone wants, but it is a defined behavior and as such, it is predictable. (3) The CDR manipulation functions and applications have been overhauled. Major changes have been made to ResetCDR and ForkCDR in particular. Many of the options for these two applications no longer made any sense with the new framework and the (slightly) more immutable nature of CDRs. There are a plethora of other changes. For a full description of CDR behavior, see the CDR specification on the Asterisk wiki. (closes issue ASTERISK-21196) Review: https://reviewboard.asterisk.org/r/2486/ 2013-06-14 23:26 +0000 [r391921] Mark Michelson * main/app.c: Fix regression in MWI stasis handling. In revision 389733, mwi state allocation was placed into its own function instead of performing the allocation in-line when required. The issue was that in ast_publish_mwi_state_full(), the local variable "uniqueid" was no longer being set, but it was still being used as the topic for MWI. This meant that all MWI publications ended up being published to the "" (empty string) mailbox topic. Thus MWI subscriptions for specific mailboxes were never notified of mailbox state changes. This change fixes the issue by removing the local uniqueid variable from ast_publish_mwi_state_full() and instead referencing the mwi_state->uniqueid field since it has been properly set. (closes issue ASTERISK-21913) Reported by Malcolm Davenport 2013-06-14 21:57 +0000 [r391902] Joshua Colp * res/res_sip_registrar.c: Ensure that the number of added contacts never goes below 0. This can happen when a REGISTER request is removing a contact. (closes issue ASTERISK-21911) Reported by: mdavenport 2013-06-14 18:50 +0000 [r391855-391856] Kinsey Moore * main/stasis_bridging.c, include/asterisk/stasis_bridging.h, rest-api/api-docs/bridges.json: Revert parts of r391855 that were not ready to go in to trunk * main/cel.c, include/asterisk/stasis_bridging.h, rest-api/api-docs/bridges.json, main/stasis_bridging.c: Fix two more possible crashes in CEL These are locations that should return valid snapshots, but need to be handled if not. 2013-06-14 16:32 +0000 [r391828] Jonathan Rose * apps/app_mixmonitor.c, /: app_mixmonitor: Fix crashes caused by unloading app_mixmonitor Unloading app_mixmonitor while active mixmonitors were running would cause a segfault. This patch fixes that by making it impossible to unload app_mixmonitor while mixmonitors are active. Review: https://reviewboard.asterisk.org/r/2624/ ........ Merged revisions 391778 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391794 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-06-14 16:12 +0000 [r391776-391777] Kinsey Moore * main/cel.c: Fix a crash in CEL bridge snapshot handling Properly search for bridge association structures so that they are found when expected and handle cases where they don't exist. * main/bridging.c: Publish bridge snapshots more often Bridge snapshot events were missing some important transitions that were noticed in subsequent snapshots. Snapshots will now be published on all bridge reconfigurations. 2013-06-13 21:53 +0000 [r391732] Matthew Jordan * utils/check_expr.c, utils/refcounter.c, utils/ael_main.c, utils/conf2ael.c: Make the utils directory compile... again. Utils is a source folder that lies, eventually all developers will cry, "I know I must maintain it, But really with this last commit I can kiss my software ethics good-bye." 2013-06-13 19:04 +0000 [r391701] Richard Mudgett * apps/app_confbridge.c, apps/confbridge/conf_config_parser.c, /, apps/confbridge/include/confbridge.h: app_confbridge: Fix memory leak on reload. The config framework options should not be registered multiple times. Instead the configuration just needs to be reprocessed by the config framework. ........ Merged revisions 391700 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-06-13 18:26 +0000 [r391699] Mark Michelson * main/features_config.c: Just return outright on a reload since we have already processed configuration. 2013-06-13 18:20 +0000 [r391689] Kinsey Moore * main/cel.c: Ensure that Asterisk still starts up when cel.conf is missing 2013-06-13 18:17 +0000 [r391676] Mark Michelson * main/features_config.c: Fix memory leak in features_config.c The options should not be registered multiple times. Instead, the configuration just needs to be reprocessed by the config framework. This also exposed that we were not properly telling the config framework to treat the configuration processing with the "reload" semantics when a reload occurred. Both of these errors are fixed now. Thanks to Richard Mudgett for discovering the leak. 2013-06-13 18:14 +0000 [r391675] Matthew Jordan * main/json.c, main/manager.c, include/asterisk/json.h: Blow away usage of libjansson's foreach macro While very handy, this macro didn't occur until a later version of libjansson. We'd prefer to be compatible with older versions still - as such, iteration over key/value pairs in a JSON object have to be done with a little bit more manual work. 2013-06-13 13:46 +0000 [r391622-391643] Kinsey Moore * main/parking.c, include/asterisk/cel.h, main/features.c, include/asterisk/_private.h, main/cel.c, include/asterisk/parking.h, main/asterisk.c, res/parking/parking_manager.c: Refactor CEL bridge events on top of Stasis-Core This pulls bridge-related CEL event triggers out of the code in which they were residing and pulls them into cel.c where they are now triggered by changes in bridge snapshots. To get access to the Stasis-Core parking topic in cel.c, the Stasis-Core portions of parking init have been pulled into core Asterisk init. This also adds a new CEL event (AST_CEL_BRIDGE_TO_CONF) that indicates a two-party bridge has transitioned to a multi-party conference. The reverse cannot occur in CEL terms even though it may occur in actuality and two party bridges which receive a AST_CEL_BRIDGE_TO_CONF will be treated as multi-party conferences for the duration of the bridge. Review: https://reviewboard.asterisk.org/r/2563/ (closes issue ASTERISK-21564) * include/asterisk/strings.h, main/cel.c, include/asterisk/stasis_bridging.h, main/asterisk.c, main/channel.c, include/asterisk/config_options.h, main/pbx.c, include/asterisk/stasis_channels.h, main/stasis_bridging.c, main/config_options.c, main/stasis_channels.c: Refactor CEL channel events on top of Stasis-Core This uses the channel state change events from Stasis-Core to determine when channel-related CEL events should be raised. Those refactored in this patch are: * AST_CEL_CHANNEL_START * AST_CEL_ANSWER * AST_CEL_APP_START * AST_CEL_APP_END * AST_CEL_HANGUP * AST_CEL_CHANNEL_END Retirement of Linked IDs is also refactored. CEL configuration has been refactored to use the config framework. Note: Some HANGUP events are not generated correctly because the bridge layer does not propagate hangupcause/hangupsource information yet. Review: https://reviewboard.asterisk.org/r/2544/ (closes issue ASTERISK-21563) 2013-06-13 11:02 +0000 [r391596] Joshua Colp * main/endpoints.c, res/stasis_http/resource_endpoints.c, main/stasis_cache.c, main/stasis_endpoints.c, main/channel_internal_api.c, include/asterisk/stasis.h, include/asterisk/channel.h, include/asterisk/stasis_endpoints.h: Add support for requiring that all queued messages on a caching topic have been handled before retrieving from the cache and also change adding channels to an endpoint to be an immediate operation. Review: https://reviewboard.asterisk.org/r/2599/ 2013-06-12 21:08 +0000 [r391561] David M. Lee * res/res_http_websocket.c, /: Fix segfault for certain invalid WebSocket input. The WebSocket code would allocate, on the stack, a string large enough to hold a key provided by the client, and the WEBSOCKET_GUID. If the key is NULL, this causes a segfault. If the key is too large, it could overflow the stack. This patch checks the key for NULL and checks the length of the key to avoid stack smashing nastiness. (closes issue ASTERISK-21825) Reported by: Alfred Farrugia Tested by: Alfred Farrugia, David M. Lee Patches: issueA21825_check_if_key_is_sent.patch uploaded by Walter Doekes (license 5674) ........ Merged revisions 391560 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-06-12 02:29 +0000 [r391479-391521] Matthew Jordan * main/loader.c, main/format.c, /, main/endpoints.c: Fix memory leak while loading modules, adding formats, and destroying endpoints This patch fixes three memory leaks * When we load a module with the LOAD_PRIORITY flag, we remove its entry from the load order list. Unfortunately, we don't free the memory associated with entry in the list. This patch corrects that and properly frees the memory for the module in the list. * When adding a custom format (such as SILK or CELT), the routine for adding the format was leaking a reference. RAII_VAR cleans this up properly. * We now de-ref the channel_snapshot appropriately when an endpoint is disposed of ........ Merged revisions 391489 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391507 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/stasis_channels.c, bridges/bridge_native_rtp.c: Fix memory leaks in stasis_channels and bridge_native_rtp This patch fixes two memory leaks: * A memory leak in packing channels into a multi-channel blob payload when publishing dial messages. The multi-channel blob payload does not steal the references - this approach was chosen because it works well with the RAII_VAR macro. Unfortunately, this does mean that you actually have to use the RAII_VAR macro (or manually deref it yourself) * RTP instances returned as a result of one of the glue operations are ref counted and have to be de-ref'd appropriately. We now do that, as saying that we should do it and then not would be silly. 2013-06-11 22:57 +0000 [r391455] Mark Michelson * main/bridging.c: Remove incorrect comment about local channel optimization occurring when performing an attended transfer on an entire bridge. 2013-06-11 22:21 +0000 [r391430-391453] Jonathan Rose * bridges/bridge_native_rtp.c, include/asterisk/framehook.h, main/framehook.c: bridge_native_rtp: Fix native bridge tech being incompatible when it should be. When checking compatability for the native RTP bridge technology there is a race condition between clearing framehooks that are destroyed when leaving certain bridges with certain technologies (such as bridge_native_rtp) and joining bridges with the bridge_native_rtp technology. Yes, that means a channel in a native RTP bridge could move to another native RTP bridge and be considered incompatible with the new native RTP bridge causing it to revert to a simple bridge technology0. This fixes that bug by ignoring framehooks that have been marked for destruction when checking for compatibility with the bridge_native_rtp technology. * bridges/bridge_native_rtp.c: bridge_native_rtp: Fix possible segfaults on leaves/joins native_rtp_bridge_get can return any result from the ast_rtp_glue_result enumerator and the join/leave functions for bridge_native_rtp seem to assume that if the result wasn't local that it was remote. Meanwhile forbid can be returned by that function which can mean certain glue pointers are NULL. Then when the join/leave functions try to use members of that pointer, boom. Segfault. 2013-06-11 15:46 +0000 [r391403] David M. Lee * main/manager.c, main/stasis_message.c, main/parking.c, tests/test_stasis_channels.c, include/asterisk/stasis.h, main/stasis_channels.c, tests/test_stasis.c, main/manager_channels.c: Add vtable and methods for to_json and to_ami for Stasis messages When a Stasis message type is defined in a loadable module, handling those messages for AMI and res_stasis events can be cumbersome. This patch adds a vtable to stasis_message_type, with to_ami and to_json virtual functions. These allow messages to be handled abstractly without putting module-specific code in core. As an example, the VarSet AMI event was refactored to use the to_ami virtual function. (closes issue ASTERISK-21817) Review: https://reviewboard.asterisk.org/r/2579/ 2013-06-11 10:24 +0000 [r391380] Igor Goncharovskiy * channels/chan_unistim.c, /: Fix issue with no sound in both way in case of previous call to chan_unistim phone was canceled. (related to ASTERISK-20183) ........ Merged revisions 391379 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-06-11 08:13 +0000 [r391335] Alec L Davis * channels/chan_iax2.c, /: IAX2: Transfer Reject: Lock bridgecallno before touching it, refactor 1). When touching the bridgecallno, we need to lock it. 2). Remove magic number '0' and replace with TRANSFER_NONE. 3). Exit early if no bridgecallno. 4). Reduce indentation. Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2613/ ........ Merged revisions 391333 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391334 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-06-10 22:38 +0000 [r391314] Matthew Jordan * main/loader.c: Make the reload stasis message bump the ref count of its sub-object JSON objects are reference stealing. Hence, if you've RAII_VAR'd some subobject and want to pack it into another JSON object, you have to bump the reference count. Using the 'O' option during the pack will bump the reference count for you. 2013-06-10 21:04 +0000 [r391297] Damien Wedhorn * channels/chan_skinny.c: Change chan_skinny to use core transfer API. Changes for both attended and blind transfers in chan_skinny to use the new transfer API instead of masquerade. (closes issue ASTERISK-21526) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2557/ 2013-06-10 16:03 +0000 [r391271] Kinsey Moore * res/res_agi.c: Add AGI command arguments to AsyncAGI event This makes the AGI AsyncAGI event put provided AGI command arguments in the event's environment. (closes issue ASTERISK-21304) Patch-By: Dirk Wendland 2013-06-10 15:32 +0000 [r391269] Mark Michelson * main/features_config.c: Temporary fix for people using sample features.conf from previous Asterisk versions. People who use the features.conf.sample file from Asterisk 11 and before in trunk were given a rude awakening when features configuration changes were made. Because it uses the config framework and the config framework is strict about what is accepted and what isn't, people that had parking options configured found that Asterisk no longer started. This is because parking options are currently handled in res_parking.conf instead of features.conf. This fix seeks to create a temporary band-aid fix for the problem, but having parking options from the general section be passed to a handler that will simply print that the option is no longer supported. This will not cause Asterisk to exit. The fix only applies to options in the general section. There are two main reasons for this: 1) The sample features.conf file only has parking options in the general section. There are no configured parking lots. Therefore it's not quite as "urgent" to get the parking lot parsing fixed. 2) The plan is to move parking configuration back from res_parking.conf to features.conf. When that happens, the parking lots will also be addressed at that time. 2013-06-10 14:36 +0000 [r391245] Matthew Jordan * apps/app_queue.c, /, configs/queues.conf.sample, UPGRADE.txt: Add announce-to-first-user option for app_queue In r386792, the ability to play prompts to the first caller in a call queue was added. While this is arguably a bug fix for those who expect the first caller to continue receiving prompts while the agent is dialed, it has the side effect of preventing the first caller from hearing the agent immediately upon bridging. This may not be a problem for those who really want this option, but for those who didn't care whether or not the first caller in queue heard their position, it was an issue. This patch disables the ability for the first caller in the queue to hear prompts and adds a new option, announce-to-first-user, to queues.conf. Those who the behavior can enable it by setting this value to True. Note that if we ever implement the ability to have the prompts be stopped upon bridging, this option can be removed. (closes issue ASTERISK-21782) Reported by: Remi Quezada ........ Merged revisions 391215 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391241 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-06-10 13:07 +0000 [r391199] Kinsey Moore * res/res_stasis_bridge_add.exports.in (added), include/asterisk/stasis_app.h, res/stasis_http/resource_bridges.c, res/stasis/app.h, res/res_stasis_json_events.c, include/asterisk/stasis_bridging.h, rest-api/api-docs/bridges.json, res/stasis_http/resource_bridges.h, res/res_stasis_bridge_add.c (added), main/stasis_bridging.c, res/stasis_json/resource_events.h, res/res_stasis.c, res/res_stasis_json_events.exports.in, rest-api/api-docs/events.json, res/stasis/control.c, res/stasis/app.c: Stasis-HTTP: Flesh out bridge-related capabilities This adds support for Stasis applications to receive bridge-related messages when the application shows interest in a given bridge. To supplement this work and test it, this also adds support for the following bridge-related Stasis-HTTP functionality: * GET stasis/bridges * GET stasis/bridges/{bridgeId} * POST stasis/bridges * DELETE stasis/bridges/{bridgeId} * POST stasis/bridges/{bridgeId}/addChannel * POST stasis/bridges/{bridgeId}/removeChannel Review: https://reviewboard.asterisk.org/r/2572/ (closes issue ASTERISK-21711) (closes issue ASTERISK-21621) (closes issue ASTERISK-21622) (closes issue ASTERISK-21623) (closes issue ASTERISK-21624) (closes issue ASTERISK-21625) (closes issue ASTERISK-21626) 2013-06-10 09:33 +0000 [r391064-391154] Alec L Davis * /, channels/chan_iax2.c: chan_iax2: nativebridge refactor, missed unlock bridgecallno ........ Merged revisions 391143 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391148 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/chan_iax2.c, /: fix bad edit after conflict resolution ........ Merged revisions 391107 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391111 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/chan_iax2.c, /: IAX2: refactor nativebridge transfer remove triple checking of iaxs[fr->callno]->transferring reduce indentation. Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2602/ ........ Merged revisions 391065 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391084 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/chan_iax2.c, /: IAX2: fix race condition with nativebridge transfers. 1). When touching the bridgecallno, we need to lock it. 2). stop_stuff() which calls iax2_destroy_helper() Assumes the lock on the pvt is already held, when iax2_destroy_helper() is called. Thus we need to lock the bridgecallno pvt before we call stop_stuff(iaxs[fr->callno]->bridgecallno); 3). When evaluating the state of 'callno->transferring' of the current leg, we can't change it to READY unless the bridgecallno is locked. Why, if we are interrupted by the other call leg before 'transferring = TRANSFER_RELEASED', the interrupt will find that it is READY and that the bridgecallno is also READY so Releases the legs. (closes issue ASTERISK-21409) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2594/ ........ Merged revisions 391062 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391063 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-06-09 21:11 +0000 [r391012-391040] Matthew Jordan * main/app.c: Clean up MWI topic pool before message type destruction Topics need to be disposed of prior to the message types that are published on them. This includes topic pools. This prevents an assertion from being raised on shutdown. * main/manager.c: Only initialize manager_bridging during startup This moves the initialization call behind the protection against reloads. We don't want to re-add message router routes during reloads. * main/backtrace.c (added), main/logger.c, include/asterisk/lock.h, main/astmm.c, utils/extconf.c, main/astobj2.c, include/asterisk/backtrace.h (added), include/asterisk/logger.h: Add backtrace generation to MALLOC_DEBUG memory corruption reports This patch allows astmm to access the backtrace generation code in Asterisk. When memory is allocated, a backtrace is created and stored with the memory region that tracks the allocation. If a memory corruption is detected, the backtrace is printed to the astmm log. The backtrace will make use of the BETTER_BACKTRACES build option if available. As a result, this patch moves the backtrace generation code into its own file and uses the non-wrapped versions of the C library memory allocation routines. This allows the memory allocation code to safely use the backtrace generation routines without infinitely recursing. Review: https://reviewboard.asterisk.org/r/2567 2013-06-08 06:31 +0000 [r390940-390991] Richard Mudgett * include/asterisk/bridging_technology.h, main/bridging.c: Add more support for native bridging. * Added a start technology callback that technologies can use to start bridging operations. It is expected that native bridges will find this useful. * Factored out bridge_channel_complete_join(). * main/bridging.c, include/asterisk/bridging_technology.h, bridges/bridge_softmix.c: Fix a crash when a bridge switches from the softmix bridge technology to another. A three party bridge uses the softmix bridging technology. This technology has a dedicated thread used to perform the analog mixing. When one of these parties leaves the bridge, the bridge technology is changed from the softmix technology to a two-party mixing technology. Changing technologies is done by removing channels from the old technology and adding them to the new technology. Since the remaining channels do not leave the bridge, the softmix mixing thread could continue to process all channels in the bridge. If the bridge code is not able to start destruction of the softmix technology before the softmix mixing thread wakes up, a crash happens. * Added a stop technology callback that technologies can use to request any helper threads to stop in preparation for being destroyed. (closes issue AST-1156) Reported by: John Bigelow * include/asterisk/bridging_technology.h: Update some doxygen comments. * bridges/bridge_softmix.c: The bridge uniqueid is available for softmix destructor. * bridges/bridge_softmix.c: Add some bridge identifiers to some softmix messages. 2013-06-07 20:51 +0000 [r390920] Jonathan Rose * res/parking/parking_devicestate.c (added): res_parking: Add parking_devicestate.c left out from previous commit (issue ASTERISK-21645) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2545/ 2013-06-07 19:51 +0000 [r390885-390901] Jason Parker * configs/queues.conf.sample, CHANGES, apps/app_queue.c, main/manager.c: Make app_queue AMI events more consistent. Give Join/Leave more useful names. This also removes the eventwhencalled and eventmemberstatus configuration options. These events can just be filtered via manager.conf blacklists. (closes issue ASTERISK-21469) Review: https://reviewboard.asterisk.org/r/2586/ * res/res_stasis_http_channels.c, res/stasis_http/resource_channels.h, rest-api/api-docs/channels.json, res/stasis_json/resource_channels.h, res/stasis_http/resource_channels.c: Implement ARI POST to /channels, to originate a call. (closes issue ASTERISK-21617) Review: https://reviewboard.asterisk.org/r/2597/ 2013-06-07 16:22 +0000 [r390864] Kinsey Moore * tests/test_devicestate.c: Ensure that all unit tests compile with the cache clear rework in place 2013-06-07 16:07 +0000 [r390848-390849] Jonathan Rose * include/asterisk/pbx.h, CHANGES, res/parking/parking_bridge_features.c, res/parking/parking_bridge.c, main/pbx.c, res/parking/res_parking.h, res/res_parking.c, main/features.c, res/parking/parking_controller.c: res_parking: Automatically generate extensions, hints, etc. (closes issue ASTERISK-21645) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2545/ * main/manager.c, apps/app_meetme.c, apps/confbridge/confbridge_manager.c, include/asterisk/manager.h: app_meetme: Refactor manager events to use stasis (closes issue ASTERISK-21467) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2564/ 2013-06-07 12:56 +0000 [r390830] Kinsey Moore * main/channel.c, main/stasis_cache.c, include/asterisk/stasis.h, main/stasis_channels.c, main/endpoints.c, tests/test_stasis.c, main/bridging.c: Rework stasis cache clear events Stasis cache clear message payloads now consist of a stasis_message representative of the message to be cleared from the cache. This allows multiple parallel caches to coexist and be cleared properly by the same cache clear message even when keyed on different fields. This change fixes a bug where multiple cache clears could be posted for channels. The cache clear is now produced in the destructor instead of ast_hangup. Additionally, dummy channels are no longer capable of producing channel snapshots. Review: https://reviewboard.asterisk.org/r/2596 2013-06-07 01:06 +0000 [r390803-390804] Richard Mudgett * channels/sig_pri.c, channels/sig_pri.h, main/channel.c, channels/chan_dahdi.c, channels/chan_misdn.c, channels/sig_analog.c: Refactor chan_dahdi/sig_analog/sig_pri and chan_misdn to use the common transfer functions. (closes issue ASTERISK-21523) Reported by: Matt Jordan (closes issue ASTERISK-21524) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2600/ * main/features_config.c: Tweak applicationmap and featuregroup config containers. * Change applicationmap and featuregroup to replace duplicate config items rather than reject them. * Remove some unneeded warning messages when getting the applicationmap allows duplicates from DYNAMIC_FEATURES. 2013-06-06 23:32 +0000 [r390787] Mark Michelson * main/features_config.c: Conditionally reject duplicate entries in applicationmap containers. When reading from a config file, it's important to reject duplicates. Otherwise, featuregroups will have ambiguity when pointing to applicationmap items. However, when constructing the channel's current applicationmap, we don't care about duplicate names since it's the DTMF that identifies a feature, not the name. 2013-06-06 22:46 +0000 [r390771] Richard Mudgett * configs/iax.conf.sample, configs/chan_dahdi.conf.sample, bridges/bridge_builtin_features.c, include/asterisk/bridging_features.h, include/asterisk/bridging.h, main/features.c, UPGRADE.txt, configs/sip.conf.sample, configs/skinny.conf.sample, CHANGES, main/bridging.c: Reimplement bridging and DTMF features related channel variables in the bridging core. * The channel variable ATTENDED_TRANSFER_COMPLETE_SOUND is no longer channel driver specific. If the channel variable is set on the transferrer channel, the sound will be played to the target of an attended transfer. * The channel variable BRIDGEPEER becomes a comma separated list of peers in a multi-party bridge. The BRIDGEPEER value can have a maximum of 10 peers listed. Any more peers in the bridge will not be included in the list. BRIDGEPEER is not valid in holding bridges like parking since those channels do not talk to each other even though they are in a bridge. * The channel variable BRIDGEPVTCALLID is only valid for two party bridges and will contain a value if the BRIDGEPEER's channel driver supports it. * The channel variable DYNAMIC_PEERNAME is redundant with BRIDGEPEER and is removed. The more useful DYNAMIC_WHO_ACTIVATED gives the channel name that activated the dynamic feature. * The channel variables DYNAMIC_FEATURENAME and DYNAMIC_WHO_ACTIVATED are set only on the channel executing the dynamic feature. Executing a dynamic feature on the bridge peer in a multi-party bridge will execute it on all peers of the activating channel. (closes issue ASTERISK-21555) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2582/ 2013-06-06 21:40 +0000 [r390751] Mark Michelson * channels/sip/include/sip.h, main/bridging.c, channels/chan_mgcp.c, apps/app_dial.c, channels/chan_unistim.c, channels/chan_sip.c, include/asterisk/features_config.h (added), include/asterisk/channel.h, main/features_config.c (added), include/asterisk/features.h, channels/chan_dahdi.c, channels/chan_misdn.c, channels/sig_analog.c, main/manager.c, bridges/bridge_builtin_features.c, main/features.c: Refactor the features configuration scheme. Features configuration is handled in its own API in features_config.h and features_config.c. This way, features configuration is accessible to anything that needs it. In addition, features configuration has been altered to be more channel-oriented. Most callers of features API code will be supplying a channel so that the individual channel's settings will be acquired rather than the global setting. Missing from this commit is XML documentation for the features configuration. That will be handled in a separate commit. Review: https://reviewboard.asterisk.org/r/2578/ (issue ASTERISK-21542) 2013-06-06 20:50 +0000 [r390733-390734] Richard Mudgett * main/stasis_message_router.c: Fix compiler warning. * main/bridging.c, main/features.c, apps/app_bridgewait.c: * Fix a couple missed hook installs that need AST_BRIDGE_HOOK_REMOVE_ON_PULL. * Rename some hook flag parameters to remove_flags. 2013-06-06 20:37 +0000 [r390730] Kinsey Moore * res/res_agi.c: Fix documentation generation Regression from r390701 2013-06-06 20:32 +0000 [r390729] Jason Parker * /: Remove props that people will yell at me for. I'm sorry I broke automerge. :( 2013-06-06 20:30 +0000 [r390728] Kinsey Moore * res/parking/parking_manager.c: Fix documentation that was in review during the great suffix/prefix swap 2013-06-06 19:51 +0000 [r390698-390701] Jason Parker * CHANGES, /, res/res_agi.c: Split AGI manager events, to remove SubEvent field. This moves them to stasis, in the process. (closes issue ASTERISK-21470) Review: https://reviewboard.asterisk.org/r/2587/ * main/stasis_message_router.c, include/asterisk/stasis_message_router.h: Convert message_router routes to ao2. Add support for removal. Review: https://reviewboard.asterisk.org/r/2591/ 2013-06-06 18:21 +0000 [r390669] Jonathan Rose * main/bridging.c: Parking: Enable code responsible for intercepting park exten transfers 2013-06-06 01:52 +0000 [r390612-390639] Richard Mudgett * channels/chan_dahdi.c: Add a BUGBUG note. * main/bridging.c: Misc core external attended transfer fixes. * Fix external attended transfer bridge move/swap method. One of the transferrer channels was not kicked out of the bridge. * Fix several off-nominal extended attended transfer paths. Mainly the channels involved needed to be hung up or kicked out of the bridge. * main/core_local.c: Make local channels use ast_channel_move() instead of the inlined version. 2013-06-05 21:14 +0000 [r390584-390585] David M. Lee * include/asterisk/stasis.h: Corrected comment on stasis_cache_get * main/manager_channels.c: Fixed refcounting problems with chanspy AMI support. The ast_multi_channel_blob_get_channel function does not bump the refcount on the channel snapshot that it returns. This is typical for Stasis message payloads, since being immutable means that the object won't get unreffed out from underneath you. The manager code for chanspy was unreffing the snapshots it got out of the multi-channel blob, which was one unref too many. 2013-06-05 19:19 +0000 [r390510-390550] Mark Michelson * include/asterisk/bridging_features.h, main/features.c, bridges/bridge_builtin_interval_features.c, main/bridging.c, res/parking/parking_bridge_features.c, main/bridging_basic.c: Remove remaining traces of remove_on_pull from hooks and hook APIs. * include/asterisk/bridging_features.h: Give the AST_BRIDGE_HOOK_REMOVE_ON_PULL a legitimate value. * include/asterisk/bridging_features.h, main/bridging.c: Change the remove_on_pull flag on ast_bridge_hook to be a set of flags. This change is used to make bridge hook removal more generic. This way, depending on the circumstance, the appropriate bridge hooks may be removed. 2013-06-05 14:50 +0000 [r390473] Joshua Colp * main/channel.c: Publish the channel state snapshot *before* calling device state so a device state producer can use an up to date snapshot. 2013-06-05 14:47 +0000 [r390472] David M. Lee * main/channel_internal_api.c: Fixed a consistency problem with channel snapshot and endpoint state. When channels are added to an endpoint, the code originally posted a channel snapshot to the endoint's topic directly. Turns out, this is a bad idea. This causes the endpoint to see an inconsistent view of the channel, since it will later receive in-flight messages with old channel snapshots. This patch instead just publishes channel state immediately after setting up the forward to the endpoint's topic. This gives the endpoints a consistent view of the channel's state. 2013-06-04 22:55 +0000 [r390439-390440] Richard Mudgett * bridges/bridge_native_rtp.c: Add BUGBUG comment. * bridges/bridge_native_rtp.c: Simple lock, assignment, unlock sandwich optimization. 2013-06-04 15:55 +0000 [r390352-390398] David M. Lee * include/asterisk/manager.h: Corrected the docs on ast_manager_event_blob_create * configure.ac, makeopts.in, configure, include/asterisk/autoconfig.h.in, main/Makefile: Correct autoconf script for finding UUID support. The library that provides UUID support varies greatly from system to system. On most Linux distros, it's in libuuid. On OpenBSD, it's in libe2fs-uuid. On OS X, it is in libsystem. This patch plays hide-and-seek with UUID support, looking for it in the three places we know about. It also corrects the Makefile so that it uses the configured library name and include path. (closes issue ASTERISK-21816) Reported by: Brad Latus (snuffy) Tested by: Brad Latus (snuffy) 2013-05-31 19:00 +0000 [r390317] Kinsey Moore * main/pbx.c, apps/app_userevent.c, main/stasis_channels.c: Refactor code and fix a reference leak Refactor some channel blob publishing code to use ast_channel_publish_blob now that it is available and fix a JSON reference leak that was occurring during varset publishing. 2013-05-31 16:15 +0000 [r390289-390291] Richard Mudgett * main/channel.c, main/manager.c, main/channel_internal_api.c, include/asterisk/channel.h: Remove ast_channel_bridge() and associated code called only by it. * Added some more BUGBUG notes. * include/asterisk/stasis_channels.h, bridges/bridge_builtin_features.c, include/asterisk/bridging.h, main/stasis_channels.c, main/bridging.c, main/channel.c: Fixup hold/unhold with attended and blind transfers. * DTMF attended and blind transfers have hold/unhold behavior restored. * External attended and blind transfers unhold the transfered party when the transfer is initiated. * Made prohibit blind transferring a bridge marked as masquerade only. (ConfBridge bridges) * Made running an application or playing a file inside a bridge post the hold/unhold messages if MOH is requested. Review: https://reviewboard.asterisk.org/r/2574/ 2013-05-31 14:36 +0000 [r390268] Jason Parker * main/manager.c, include/asterisk/manager.h, main/asterisk.c: Replace ast_manager_publish_message() with a more useful version. It's much easier to just create a blob of the message. Convert some AMI events to use it. Review: https://reviewboard.asterisk.org/r/2577/ 2013-05-31 12:41 +0000 [r390249-390250] Kinsey Moore * apps/confbridge/include/confbridge.h, main/stasis_bridging.c, apps/confbridge/confbridge_manager.c, apps/app_confbridge.c, include/asterisk/stasis_bridging.h: Remove remnant of snapshot blob JSON types Remove usage of the once-mandatory snapshot blob type field, refactor confbridge stasis messages accordingly, and remove ast_bridge_blob_json_type(). Review: https://reviewboard.asterisk.org/r/2575/ * main/stasis_channels.c, include/asterisk/stasis_channels.h: Add snapshot cache that indexes by channel name This adds a new channel snapshot cache in parallel to the existing cache; the difference being that it indexes the channel snapshots by channel name instead of channel uniqueid. Review: https://reviewboard.asterisk.org/r/2576 2013-05-31 10:42 +0000 [r390230] Alexandr Anikin * addons/chan_ooh323.c, /: Multiple revisions 390228-390229 ........ r390228 | may | 2013-05-31 14:19:52 +0400 (Fri, 31 May 2013) | 14 lines reject call attempts when gatekeeper is configured but not registered (closes issue ASTERISK-21800) Reported by: Dmitry Melekhov Patches: ASTERISK-21800-1.patch Tested by: Dmitry Melekhov ........ Merged revisions 390181 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 390223 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ r390229 | may | 2013-05-31 14:34:20 +0400 (Fri, 31 May 2013) | 4 lines remove unnecessary declarations (issue ASTERISK-21800) ........ Merged revisions 390228-390229 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-31 07:57 +0000 [r390180] Walter Doekes * Makefile: Let find do its own globbing. Previously a stray .c file would cause xmldocs to not get built. 2013-05-30 19:23 +0000 [r390122-390154] David M. Lee * main/app.c: Missed a line from a bad merge in r390122 * main/stasis_cache.c, include/asterisk.h, main/security_events.c, include/asterisk/stasis.h, main/devicestate.c, main/named_acl.c, include/asterisk/stasis_bridging.h, main/presencestate.c, main/stasis.c, main/channel.c, include/asterisk/stasis_channels.h, main/stasis_bridging.c, main/test.c, main/app.c, main/stasis_channels.c, include/asterisk/security_events.h, main/asterisk.c, main/bridging.c: Avoid unnecessary cleanups during immediate shutdown This patch addresses issues during immediate shutdowns, where modules are not unloaded, but Asterisk atexit handlers are run. In the typical case, this usually isn't a big deal. But the introduction of the Stasis message bus makes it much more likely for asynchronous activity to be happening off in some thread during shutdown. During an immediate shutdown, Asterisk skips unloading modules. But while it is processing the atexit handlers, there is a window of time where some of the core message types have been cleaned up, but the message bus is still running. Specifically, it's still running module subscriptions that might be using the core message types. If a message is received by that subscription in that window, it will attempt to use a message type that has been cleaned up. To solve this problem, this patch introduces ast_register_cleanup(). This function operates identically to ast_register_atexit(), except that cleanup calls are not invoked on an immediate shutdown. All of the core message type and topic cleanup was moved from atexit handlers to cleanup handlers. This ensures that core type and topic cleanup only happens if the modules that used them are first unloaded. This patch also changes the ast_assert() when accessing a cleaned up or uninitialized message type to an error log message. Message type functions are actually NULL safe across the board, so the assert was a bit heavy handed. Especially for anyone with DO_CRASH enabled. Review: https://reviewboard.asterisk.org/r/2562/ 2013-05-29 20:24 +0000 [r390068] Richard Mudgett * main/channel.c, /: Fix segfault when dealing with chan_agent channels. Check the returned bridged pointer for NULL to avoid a crash. It looks like chan_agent is returning a NULL pointer when it probably should be returning a pointer to the channel the Agent channel is pretending to be. (closes issue ASTERISK-21793) Reported by: Rodrigo P. Telles Patches: jira_asterisk_21793_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: Rodrigo P. Telles ........ Merged revisions 390044 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 390047 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-29 19:54 +0000 [r390042] Jason Parker * main/channel.c: Remove unused RAII vars. 2013-05-29 03:22 +0000 [r389990] Matthew Jordan * res/res_fax.c: Pack the right number of items into the status and receive fax blobs The code was still attempting to pack an additional item into the blobs that didn't exist. Crashes ensued. This patch modifies the publishing of these messages so that the correct number of items are packed in the JSON. 2013-05-29 02:26 +0000 [r389974] Kinsey Moore * res/res_musiconhold.c, res/res_monitor.c, include/asterisk/stasis_channels.h, res/res_fax.c, apps/app_fax.c, main/stasis_channels.c: Resolve a merge conflict When ast_channel_cached_blob_create was merged, ast_channel_blob_create_from_cache was partially removed in an unresolved merge conflict. This restores ast_channel_blob_create_from_cache and refactors usage of ast_channel_cached_blob_create (requires an ast_channel) to use ast_channel_blob_create_from_cache (requires a channel uniqueid) instead. 2013-05-28 17:47 +0000 [r389897] Jonathan Rose * /, main/slinfactory.c: Fix a memory copying bug in slinfactory which was causing mixmonitor issues. Reported by: Michael Walton Tested by: Jonathan Rose Patches: slinfactory.c.ASTERISK-21799.patch uploaded by Michael Walton (license 6502) (closes issue ASTERISK-21799) ........ Merged revisions 389895 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 389896 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-28 15:54 +0000 [r389848-389870] Mark Michelson * main/bridging.c: Add missing NULL check to acquire_bridge() function. * channels/chan_sip.c, channels/sip/include/sip.h: Add attended transfer support for chan_sip.c This now uses the core API for performing attended transfers. Review https://reviewboard.asterisk.org/r/2513 (Closes issue ASTERISK-21520) reported by Matt Jordan * main/channel.c, main/pbx.c, bridges/bridge_builtin_features.c, channels/chan_sip.c, apps/confbridge/confbridge_manager.c, include/asterisk/bridging.h, main/features.c, include/asterisk/channel.h, CHANGES, main/bridging.c, channels/chan_mgcp.c: Adds support for a core attended transfer function plus adds some hiding of masquerades. The attended transfer API call can complete the attended transfer in a number of ways depending on the current bridged states of the channels involved. The hiding of masquerades is done in some bridging-related functions, such as the manager Bridge action and the Bridge dialplan application. In addition, call pickup was edited to "move" a channel rather than masquerade it. Review: https://reviewboard.asterisk.org/r/2511 (closes issue ASTERISK-21334) Reported by Matt Jordan (closes issue Asterisk-21336) Reported by Matt Jordan 2013-05-27 01:33 +0000 [r389770-389827] Matthew Jordan * res/res_fax.c, res/res_fax_spandsp.c: Fix some more fax test errors due to needing the peer in a bridge In r389799, a number of fax errors in gateway mode were fixed by using the appropriate function to get a channel's peer while in a bridge. This patch does two things: (1) It uses the same function in res_fax_spandsp while starting the fax gateway. Without this, the fax gateway will not actually start up, as res_fax_spandsp also must inspect the channel's peer in a two-party bridge (2) It refactors some ao2 objects in sendfax_exec to use RAII_VAR. This was reverted in r389799 as some off nominal paths were getting hit without the fix in (1) that indicated an ao2 object issue; this turned out to be a red herring (which is an odd phrase) * main/stasis_endpoints.c: Initialize the message type before the topic Caching topics will during initialization attempt to reference their message type. The message type therefore has to be initialized prior to the topic to prevent the dreaded assertion. * res/res_fax.c: Fix a few fax gateway failures Fax gateway requires knowledge of a channel's peer in a bridge. This patch now uses the supported mechanisms to get this information. This is acceptable for a few reasons: * Fax gateway can only ever work in a 2-party bridge * Fax gateway cannot work when not in a bridge * Fax gateway cannot work without knowledge of the capabilities of both channels in the fax operation (it is, after all, a gateway) * main/asterisk.c, res/res_fax.c, main/devicestate.c: Fix a variety of memory corruption/assertion errors * Initialize a Stasis-Core message type prior to initializing a caching topic. The caching topic will attempt to use the message type. * Don't attempt to publish Stasis-Core messages from remote console connections. They aren't the main process; they shouldn't attempt to behave as it (they also don't have the infrastructure to do so) * Don't treat a JSON object as an ao2 object (whoops) * In asterisk.c, ref bump the JSON even package that is distributed with the event meta data. The callers assume that they own the reference, and the packing routine steals references. * main/asterisk.c: Restore initialization of security topics During a merge the security topic initialization got blown away. This patch restores it. 2013-05-24 21:23 +0000 [r389746-389748] Jason Parker * /: grr, props. * channels/chan_h323.c, main/stasis_channels.c, main/manager_channels.c, channels/chan_mgcp.c, channels/chan_unistim.c, /, channels/chan_sip.c, include/asterisk/channel.h, channels/sig_pri.c, channels/chan_iax2.c, CHANGES, res/res_sip_sdp_rtp.c, main/channel.c, channels/chan_dahdi.c, include/asterisk/stasis_channels.h, channels/sig_analog.c, channels/chan_misdn.c, channels/chan_skinny.c, channels/chan_motif.c: Split Hold event into Hold/Unhold, and move it into core. (closes issue ASTERISK-21487) Review: https://reviewboard.asterisk.org/r/2565/ 2013-05-24 21:01 +0000 [r389738] Kinsey Moore * res/res_stasis.c: Remove a junk define BLOB_HANDLER_BUCKETS is a remnant of using "type" fields in JSON/snapshot blobs and is no longer used. 2013-05-24 20:44 +0000 [r389680-389733] Matthew Jordan * include/asterisk/_private.h, include/asterisk/manager.h, channels/sig_pri.c, CHANGES, res/res_monitor.c, include/asterisk/app.h, main/json.c, include/asterisk/stasis_channels.h, apps/app_chanspy.c, res/parking/parking_manager.c, main/asterisk.c, main/manager_mwi.c (added), apps/app_voicemail.c, channels/chan_unistim.c, include/asterisk/json.h, res/res_musiconhold.c, res/res_xmpp.c, channels/chan_iax2.c, res/res_jabber.c, main/enum.c, main/loader.c, main/cli.c, main/cdr.c, channels/chan_dahdi.c, main/manager.c, channels/chan_skinny.c, apps/app_minivm.c, main/app.c, main/stasis_channels.c, main/manager_channels.c, res/res_sip_mwi.c, channels/chan_mgcp.c, main/pbx.c, main/dnsmgr.c, channels/chan_sip.c, res/res_fax.c, apps/app_fax.c: Migrate a large number of AMI events over to Stasis-Core This patch moves a number of AMI events over to the Stasis-Core message bus. This includes: * ChanSpyStart/Stop * MonitorStart/Stop * MusicOnHoldStart/Stop * FullyBooted/Reload * All Voicemail/MWI related events In addition, it adds some Stasis-Core and AMI support for generic AMI messages, refactors the message router in AMI to use a single router with topic forwarding for the topics that AMI cares about, and refactors MWI message types and topics to be more name compliant. Review: https://reviewboard.asterisk.org/r/2532 (closes issue ASTERISK-21462) * /, main/logger.c: Print all logger messages on shutdown When Asterisk shuts down and shuts down the loggin gsubsystem, any messages currently in flight will not get logged. This patch prevents the loop writing messages from breaking out prematurely, such that all of the messages are logged. (closes issue ASTERISK-21716) Reported by: Corey Farrell patches: logger-process-all-messages.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 389676 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 389677 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-24 10:23 +0000 [r389663] Igor Goncharovskiy * channels/chan_unistim.c, /: Fix several problems caused by multiple line usage with i2004 phones. Reported by: Daniel Bohling, MihaiMircea (closes issue ASTERISK-21061) (closes issue ASTERISK-21120) ........ Merged revisions 389661 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-23 21:46 +0000 [r389639] David M. Lee * res/res_stasis_playback.c, res/stasis_http/resource_channels.c, include/asterisk/stasis_http.h, res/res_stasis_http.c: stasis-http: Provide a response body for 201 created responses 2013-05-23 21:11 +0000 [r389618-389623] Jonathan Rose * res/parking/parking_bridge.c: res_parking: Add a verbose message when a channel is parked * res/parking/parking_bridge.c: res_parking: Fix some simple bugs Both of them are covered in the dynamic parking review on https://reviewboard.asterisk.org/r/2550 - Remove unref against parking lot that the bridge did on dissolve since the reference wasn't taken in the first place. On a swap, reapply bridge roles in order to get music on hold and such playing on the channel that swaps into the bridge. 2013-05-23 20:25 +0000 [r389609] Joshua Colp * res/res_sip_session.c: Fix a crash due to the INVITE session being destroyed before the session. This change ensures that the INVITE session remains valid for the lifetime of the session object itself by increasing the session count on the dialog that the INVITE session is allocated from. Once this reaches zero (normally as a result of decrementing it within the session destructor) the dialog, and INVITE session, are destroyed. 2013-05-23 20:21 +0000 [r389587-389603] David M. Lee * include/asterisk/stasis_app_playback.h, res/stasis_http/resource_playback.c, include/asterisk/app.h, res/res_stasis_playback.c, res/stasis/control.c, res/stasis_http/resource_channels.c, rest-api/api-docs/playback.json, res/res_stasis_http_channels.c, include/asterisk/stasis_app.h, main/app.c, include/asterisk/channel.h, res/stasis_http/resource_channels.h, rest-api/api-docs/channels.json: This patch adds support for controlling a playback operation from the Asterisk REST interface. This adds the /playback/{playbackId}/control resource, which may be POSTed to to pause, unpause, reverse, forward or restart the media playback. Attempts to control a playback that is not currently playing will either return a 404 Not Found (because the playback object no longer exists) or a 409 Conflict (because the playback object is still in the queue to be played). This patch also adds skipms and offsetms parameters to the /channels/{channelId}/play resource. (closes issue ASTERISK-21587) Review: https://reviewboard.asterisk.org/r/2559 * res/res_stasis_json_events.exports.in, res/res_stasis_playback.c (added), rest-api/api-docs/events.json, res/stasis/control.c, main/channel_internal_api.c, include/asterisk/stasis_http.h, res/res_stasis_http_channels.c, res/res_stasis_json_events.c, include/asterisk/stasis_app_playback.h (added), res/stasis_http/resource_playback.c, include/asterisk/app.h, include/asterisk/stasis_channels.h, res/stasis_json/resource_channels.h, res/stasis_http/resource_channels.c, res/stasis_http/resource_channels.h, main/stasis_channels.c, rest-api/api-docs/channels.json, res/res_stasis_playback.exports.in (added), res/res_stasis_http.c, res/stasis_json/resource_events.h: This patch implements the REST API's for POST /channels/{channelId}/play and GET /playback/{playbackId}. This allows an external application to initiate playback of a sound on a channel while the channel is in the Stasis application. /play commands are issued asynchronously, and return immediately with the URL of the associated /playback resource. Playback commands queue up, playing in succession. The /playback resource shows the state of a playback operation as enqueued, playing or complete. (Although the operation will only be in the 'complete' state for a very short time, since it is almost immediately freed up). (closes issue ASTERISK-21283) (closes issue ASTERISK-21586) Review: https://reviewboard.asterisk.org/r/2531/ 2013-05-23 18:40 +0000 [r389569] Richard Mudgett * main/features.c: Fix inverted test preventing DTMF disconnect from working. 2013-05-23 18:39 +0000 [r389551-389568] Joshua Colp * res/res_sip_sdp_rtp.c: Fix a bug where the DTMF mode was not set on newly created RTP instances in the res_sip_sdp_rtp module. * res/res_sip_sdp_rtp.c: Fix a bug with applying the end result of the codec negotiation to the Asterisk channel. * res/res_sip_session.c: Fix a bug where the codec order as configured was not being obeyed. 2013-05-22 19:15 +0000 [r389519] David M. Lee * main/app.c: Fixed startup race condition which caused occasional stasis_mwi_state_type assertions. The caching topic (which refers to the message type) was created before the message type. If the initial subscription message gets processed before the type can be initialized, the assertion about using an uninitialized type fires. 2013-05-22 18:20 +0000 [r389492-389505] Jason Parker * /: Remove bad props, before anybody notices. * /, include/asterisk/dial.h, apps/app_followme.c, apps/app_queue.c, apps/app_dial.c, main/dial.c: Add dial events to app_queue and app_followme. Also fixes an issue in app_dial, where the channels were swapped on dial events. (closes issue ASTERISK-21551) (closes issue ASTERISK-21550) Review: https://reviewboard.asterisk.org/r/2549/ 2013-05-21 22:49 +0000 [r389454] David M. Lee * main/stasis_bridging.c: Fix destruction order assert for stasis_bridging 2013-05-21 21:08 +0000 [r389426] Richard Mudgett * apps/app_queue.c: Conditional out more app_queue logging that needs to be reworked. Fixes crash because app_queue was unconditionally freeing a datastore that was still on a channel. 2013-05-21 18:45 +0000 [r389402] Matthew Jordan * apps/app_confbridge.c, apps/confbridge/confbridge_manager.c: Raise the ConfBridgeMute/Unmute events when a CLI or AMI action triggers the change New in 12 are the ConfBridgeMute/Unmute events, which are triggered when a user changes their mute/unmute state. This was typically triggered when a user hit a DTMF key that triggered the mute/unmute menu handler. Forgotten in this is when an AMI action or CLI command triggers the mute/unmute. This patch now raises the events in those situations as well. (closes issue ASTERISK-21802) Reported by: Birger "WIMPy" Harzenetter 2013-05-21 18:00 +0000 [r389378] Richard Mudgett * rest-api-templates/res_stasis_json_resource.c.mustache, include/asterisk/frame.h, apps/app_mixmonitor.c, include/asterisk/parking.h (added), channels/chan_mgcp.c, main/bridging_roles.c (added), main/pbx.c, main/strings.c, rest-api/api-docs/events.json, include/asterisk/core_local.h (added), configs/res_parking.conf.sample (added), channels/chan_bridge.c (removed), res/parking/parking_controller.c, res/parking/parking_applications.c, include/asterisk/channel.h, include/asterisk/manager.h, apps/app_queue.c, include/asterisk/stasis_bridging.h (added), include/asterisk/framehook.h, include/asterisk/config_options.h, bridges/bridge_builtin_features.c, apps/confbridge/confbridge_manager.c (added), main/features.c, apps/app_dumpchan.c, channels/chan_motif.c, channels/chan_h323.c, apps/app_confbridge.c, include/asterisk/rtp_engine.h, apps/app_chanspy.c, include/asterisk/ccss.h, main/manager_channels.c, main/bridging.c, apps/confbridge/conf_chan_announce.c (added), main/bridging_basic.c (added), include/asterisk/core_unreal.h (added), apps/app_dial.c, res/res_stasis_json_events.exports.in, addons/chan_ooh323.c, main/frame.c, main/parking.c (added), bridges/bridge_holding.c (added), bridges/bridge_simple.c, bridges/bridge_softmix.c, funcs/func_jitterbuffer.c, res/Makefile, res/res_stasis_json_events.c, main/core_local.c (added), CHANGES, channels/chan_iax2.c, bridges/bridge_multiplexed.c (removed), res/parking/parking_bridge_features.c, include/asterisk/abstract_jb.h, channels/chan_gulp.c, apps/confbridge/conf_config_parser.c, main/channel.c, res/res_parking.c (added), main/manager.c, main/stasis_bridging.c (added), res/parking (added), bridges/bridge_builtin_interval_features.c (added), rest-api-templates/stasis_json_resource.h.mustache, main/config_options.c, res/stasis_json/resource_events.h, main/asterisk.c, res/parking/parking_manager.c, apps/app_parkandannounce.c (removed), channels/chan_unistim.c, res/parking/parking_ui.c, channels/chan_local.c (removed), main/rtp_engine.c, apps/confbridge/conf_chan_record.c (added), main/core_unreal.c (added), apps/app_bridgewait.c (added), apps/app_followme.c, configs/features.conf.sample, channels/chan_jingle.c, channels/chan_dahdi.c, apps/app_channelredirect.c, funcs/func_channel.c, main/abstract_jb.c, main/manager_bridging.c (added), include/asterisk/bridging_roles.h (added), channels/chan_vpb.cc, channels/chan_sip.c, main/channel_internal_api.c, channels/chan_agent.c, UPGRADE.txt, include/asterisk/_private.h, res/parking/parking_bridge.c, main/cli.c, res/parking/res_parking.h, include/asterisk/bridging_technology.h, channels/chan_misdn.c, apps/confbridge/include/confbridge.h, channels/chan_skinny.c, include/asterisk/bridging_features.h, funcs/func_frame_trace.c, include/asterisk/bridging.h, include/asterisk/bridging_basic.h (added), bridges/bridge_native_rtp.c (added): Merge in the bridge_construction branch to make the system use the Bridging API. Breaks many things until they can be reworked. A partial list: chan_agent chan_dahdi, chan_misdn, chan_iax2 native bridging app_queue COLP updates DTMF attended transfers Protocol attended transfers 2013-05-21 14:17 +0000 [r389343] David M. Lee * apps/app_userevent.c, main/stasis_channels.c: Fixed some extra field assertion when the event WebSocket is connected 2013-05-20 19:24 +0000 [r389306] Matthew Jordan * main/pbx.c: Set the AST_CDR_FLAG_ORIGINATED flag on originated channel's CDRs This may alleviate some of the CDR woes with originated channels, as CDRs do like to know when a channel was originated. Eventually this will get converted to be a channel flag, so its location is still good to know post the great CDR shakeup of 2013. 2013-05-20 18:03 +0000 [r389247-389251] Richard Mudgett * res/stasis_http/resource_recordings.c, cel/cel_sqlite3_custom.c, main/event.c, funcs/func_iconv.c, res/stasis_http/resource_recordings.h, res/stasis_http/resource_events.c, res/res_stasis_http_asterisk.c, main/udptl.c, res/res_stasis_websocket.c, res/stasis_http/resource_events.h, tests/test_gosub.c, main/threadstorage.c, cel/cel_tds.c, tests/test_dlinklists.c, res/res_stasis_http_endpoints.c, res/stasis_http/resource_asterisk.c, res/ael/pval.c, main/json.c, res/stasis_http/resource_asterisk.h, res/ael/ael_lex.c, res/res_stasis_http_bridges.c, tests/test_stasis_http.c, tests/test_stasis.c, res/res_clioriginate.c, cel/cel_pgsql.c, tests/test_res_stasis.c, res/res_stasis_http_channels.c, res/res_srtp.c, main/stasis.c, main/stasis_message.c, main/stasis_message_router.c, main/hashtab.c, res/ael/ael.tab.c, cel/cel_manager.c, funcs/func_odbc.c, res/stasis_http/resource_channels.c, funcs/func_channel.c, res/ael/ael.tab.h, res/stasis_http/resource_channels.h, utils/ael_main.c, formats/format_h264.c, codecs/codec_dahdi.c, contrib/utils/eagi_proxy.c, res/res_stasis.c, main/manager_channels.c, tests/test_json.c, cel/cel_radius.c, main/stasis_cache.c, tests/test_astobj2_thrash.c, funcs/func_dialgroup.c, tests/test_xml_escape.c, pbx/pbx_lua.c, res/res_ael_share.c, res/res_pktccops.c, funcs/func_realtime.c, cel/cel_odbc.c, res/res_smdi.c, cel/cel_custom.c, res/res_curl.c, res/res_stasis_http.c, res/stasis_http/resource_endpoints.c, utils/refcounter.c, res/stasis_http/resource_endpoints.h, funcs/func_rand.c, funcs/func_version.c, main/sha1.c, tests/test_hashtab_thrash.c, res/stasis_http/resource_bridges.c, res/res_stasis_http_recordings.c, main/cel.c, res/stasis_http/resource_bridges.h, res/res_stasis_http_events.c, tests/test_time.c: Fixup svn:keywords in all *.c and *.h files. * channels/sip/include/globals.h, apps/app_celgenuserevent.c, channels/sip/dialplan_functions.c, include/asterisk/pktccops.h, channels/sip/include/sdp_crypto.h, include/asterisk/ael_structs.h, include/asterisk/udptl.h, channels/sip/include/srtp.h, include/asterisk/frame_defs.h, apps/app_stasis.c, include/asterisk/sha1.h, include/asterisk/smdi.h, include/asterisk/stringfields.h, channels/sip/sdp_crypto.c, channels/sip/include/dialog.h, include/asterisk/res_srtp.h, channels/sip/srtp.c, include/asterisk/cel.h, include/asterisk/stasis_http.h, include/asterisk/stasis_app.h, include/asterisk/stasis.h, apps/app_morsecode.c, apps/app_waituntil.c, include/asterisk/json.h, include/asterisk/stasis_message_router.h, include/asterisk/hashtab.h, channels/sip/include/dialplan_functions.h, include/asterisk/paths.h, include/asterisk/event.h, apps/app_setcallerid.c, include/asterisk/event_defs.h: Fixup svn:keywords in all *.c and *.h files. 2013-05-20 17:44 +0000 [r389246] Jason Parker * /: Add doxygen.log to svn:ignore property. ........ Merged revisions 389244 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 389245 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-20 14:21 +0000 [r389217] Kinsey Moore * res/res_stasis_answer.exports.in (added): Add missing exports file This exposes stasis_app_control_answer and allows res_stasis_http_channels to load properly. 2013-05-20 14:02 +0000 [r389204] Joshua Colp * main/sorcery.c: In Sorcery pass the name of the object being allocated to the allocator. 2013-05-20 13:45 +0000 [r389202] Kinsey Moore * apps/confbridge/conf_config_parser.c: Add documentation for record_file_append When this option was added, it was noted in CHANGES, but was missing the XML documentation that this patch adds. (closes issue ASTERISK-21780) Patch-by: Brad Latus (snuffy) 2013-05-19 20:52 +0000 [r389180] Alexandr Anikin * addons/chan_ooh323.c, addons/chan_ooh323.h: add ast_publish_channel_state according new event framework 2013-05-19 19:45 +0000 [r389164] Damien Wedhorn * channels/chan_skinny.c: Add transfer softkey to ringout state to enable blond transfers. (closes issue ASTERISK-21327) Reported by: wedhorn Tested by: myself Patches: skinny-blindxfer01.diff uploaded by wedhorn (license 5019) 2013-05-19 17:45 +0000 [r389148] Kinsey Moore * res/res_sip_acl.c, res/res_sip.c, res/res_sip_outbound_registration.c, res/res_sip_endpoint_identifier_ip.c: Add base XML documentation for res_sip Thanks to Brad Latus, this patch adds a significant amount much-needed documentation to res_sip. It should cover all existing configuration options currently in Asterisk trunk. Patch-by: Brad Latus (snuffy) Review: https://reviewboard.asterisk.org/r/2471/ 2013-05-19 02:21 +0000 [r389116-389132] Joshua Colp * main/pbx.c: Don't hold the outgoing lock for a prolonged period of time as it may block the originator. * main/pbx.c: If the caller of the originate API calls wants the channel ensure it has been requested and dialed. 2013-05-18 23:20 +0000 [r389097] Damien Wedhorn * channels/chan_skinny.c, configs/skinny.conf.sample: Add call forward no answer to skinny and cleanup general callfwd handling. CallforwardNoAnswer uses a sched to determine when to forward the call. Defaults to 20secs but configurable in skinny.conf. Adds dialType to each subchannel structure to be used to differentiate between normal dials that result in a call being placed (default) and other uses for the skinny_dialer (such as cfwd digit collection). Restructured all cfwd handling to use this new arrangement. (closes issue ASTERISK-21292) Reported by: wedhorn Tested by: myself Patches: skinny-callfwdnoans03.diff uploaded by wedhorn (license 5019) 2013-05-18 22:49 +0000 [r389053-389085] Joshua Colp * main/pbx.c: Fix a bug where synchronous origination (oddly enough triggered by doing an async manager Originate) would not work properly. * include/asterisk/dial.h, main/manager_channels.c, main/dial.c, main/pbx.c: Move origination to use the dialing API and send Stasis messages on dial begin and end. (closes issue ASTERISK-21549) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2512/ 2013-05-17 21:10 +0000 [r389011] David M. Lee * res/res_jabber.c, apps/app_queue.c, channels/chan_iax2.c, main/endpoints.c, include/asterisk/stasis_message_router.h, res/res_chan_stats.c, main/stasis.c, main/manager.c, funcs/func_presencestate.c, main/stasis_message_router.c, main/app.c, main/stasis_channels.c, res/res_stasis.c, main/manager_channels.c, apps/app_voicemail.c, main/stasis_cache.c, main/pbx.c, main/stasis_endpoints.c, channels/chan_sip.c, include/asterisk/stasis.h, main/devicestate.c: Fix shutdown assertions in stasis-core In r388005, macros were introduced to consistently define message types. This added an assert if a message type was used either before it was initialized or after it had been cleaned up. It turns out that this assertion fires during shutdown. This actually exposed a hidden shutdown ordering problem. Since unsubscribing is asynchronous, it's possible that the message types used by the subscription could be freed before the final message of the subscription was processed. This patch adds stasis_subscription_join(), which blocks until the last message has been processed by the subscription. Since joining was most commonly done right after an unsubscribe, a stasis_unsubscribe_and_join() convenience function was also added. Similar functions were also added to the stasis_caching_topic and stasis_message_router, since they wrap subscriptions and have similar problems. Other code in trunk was refactored to join() where appropriate, or at least verify that the subscription was complete before being destroyed. Review: https://reviewboard.asterisk.org/r/2540 2013-05-17 20:24 +0000 [r389009] Michael L. Young * channels/chan_iax2.c: Remove Character Limit On "inkeys" For IAX2 Currently, the buffer for processing "inkeys" is limited to 256 characters. If the user has many keys and the names of those key files are long, the 256 character limit is not enough. * Change inkeys buffer to be dynamic (closes issue ASTERISK-21398) Reported by: Pavel Kopchyk Tested by: Pavel Kopchyk, Michael L. Young Patches: asterisk-21398-iax2-inkeys-dynamic-buffer_v3.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2501/ 2013-05-17 17:43 +0000 [r388976] Matthew Jordan * apps/app_dial.c, main/channel.c, main/dial.c, include/asterisk/stasis_channels.h, main/stasis_channels.c: Publish the outbound channel's application/data when dialing This patch does two things: * It fixes a bug where the outbound channel's application/data set by the dialing API/app_dial is not communicated until the channel is hung up. If that happens, AMI would incorrectly send a NewExten event immediately after a Hangup. This isn't really AMI's fault, as the dialing APIs never communicated the 'helpful' app/data on the outbound channel until it was hungup. * It makes public sending a stasis message about a change in channel state. This is useful enough that - for now at least - it should be public. If operations on a channel go to being more coarse-grained, this function could be made private again. Review: https://reviewboard.asterisk.org/r/2548 Note that this problem was found and reported by Matt DiMeo. 2013-05-17 17:36 +0000 [r388975] Jonathan Rose * include/asterisk/json.h, main/named_acl.c, CHANGES, channels/chan_iax2.c, tests/test_security_events.c, res/res_sip.c, main/json.c, main/manager.c, channels/sip/include/config_parser.h, res/res_sip_nat.c, channels/sip/dialplan_functions.c, include/asterisk/netsock2.h, res/res_sip_outbound_registration.c, channels/sip/config_parser.c, include/asterisk/security_events.h, channels/sip/include/sip.h, include/asterisk/security_events_defs.h, main/asterisk.c, res/res_security_log.c, include/asterisk/acl.h, res/res_sip/config_transport.c, channels/chan_sip.c, main/security_events.c, channels/sip/security_events.c, include/asterisk/res_sip.h: Stasis: Update security events to use Stasis Also moves ACL messages to the security topic and gets rid of the ACL topic (closes issue ASTERISK-21103) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2496/ 2013-05-15 21:13 +0000 [r388896] David M. Lee * res/stasis/app.c, res/stasis/app.h: Fixed inverted logic in app_add_channel(). Also added some missing doc comments for stasis/app.h. 2013-05-15 15:58 +0000 [r388840] Kevin Harwell * main/lock.c, /: Fix for segfault in __ast_rwlock_destroy with DEBUG_THREADS If DEBUG_THREADS is enabled __ast_rwlock_destroy causes a segfault while trying to access a possible NULL t->track object. A NULL check has been added before trying to access the memory. (closes issue ASTERISK-21724) Reported by: Corey Farrell Fixed by: Corey Farrell Patches: ast_rwlock_destroy-segv.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 388838 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388839 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-15 15:03 +0000 [r388818] Jason Parker * apps/app_voicemail.c, /: Fix VM snapshot handling for combined INBOX. The snapshot API contains an option that allow for combining of new and old messages within a single snapshot. New messages, however, include options beyond just 'INBOX' - it also includes the Urgent folder. A previous patch that combined INBOX and Urgent accidentally impacted snapshots that attempted to gain messages from just the Old folder. This patch fixes the snapshot gathering such that the API returns the appropriate messages for the folder selected, with and without the combine option. This should make it more clear about what's happening. Review: https://reviewboard.asterisk.org/r/2539/ ........ Merged revisions 388816 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-15 12:42 +0000 [r388770] Kinsey Moore * res/res_srtp.c, /, configure, include/asterisk/autoconfig.h.in, configure.ac: Use srtp_shutdown when available This allows the SRTP library to be shut down properly when the functionality is offered by libsrtp. Review: https://reviewboard.asterisk.org/r/2538/ (closes issue ASTERISK-21719) ........ Merged revisions 388768 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388769 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-15 02:37 +0000 [r388729-388751] David M. Lee * main/named_acl.c, res/res_stasis_test.c, main/asterisk.c, main/presencestate.c, main/stasis.c, main/stasis_cache.c, main/stasis_endpoints.c, include/asterisk/stasis.h, main/test.c, main/app.c, main/devicestate.c: Refactored the rest of the message types to use the STASIS_MESSAGE_TYPE_* macros. * res/res_stasis_answer.c (added), res/res_stasis.c, apps/app_stasis.c, res/stasis (added), include/asterisk/module.h, include/asterisk/stasis_app.h, include/asterisk/stasis_app_impl.h (added), res/Makefile: Break res_stasis into smaller files. When implementing playback for stasis-http, the monolithicedness of res_stasis really started to get in my way. This patch breaks the major components of res_stasis.c into individual files. * res/stasis/app.c - Stasis application tracking * res/stasis/control.c - Channel control objects * res/stasis/command.c - Channel command object This refactoring also allows res_stasis applications to be loaded as independent modules, such as the new res_stasis_answer module. The bulk of this patch is simply moving code from one file to another, adjusting names and adding accessors as necessary. Review: https://reviewboard.asterisk.org/r/2530/ 2013-05-14 19:03 +0000 [r388701] Richard Mudgett * main/astobj2.c, /, include/asterisk/astobj2.h: Make ao2 global objects not always use the debug version of the ao2_ref() calls. The debug versions of ao2_ref() should only be used if REF_DEBUG is enabled so nothing is written to /tmp/refs unexpectedly. (closes issue ASTERISK-21785) Reported by: abelbeck Patches: jira_asterisk_21785_v11.patch (license #5621) patch uploaded by rmudgett Tested by: abelbeck ........ Merged revisions 388700 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-14 12:47 +0000 [r388668] Kinsey Moore * res/stasis_http/resource_recordings.h, rest-api-templates/stasis_http_resource.h.mustache, res/res_stasis_json_endpoints.exports.in (added), res/res_stasis_json_events.exports.in (added), res/res_stasis_json_channels.c (added), rest-api-templates/res_stasis_http_resource.c.mustache, res/stasis_http/resource_events.h, res/res_stasis_json_recordings.c (added), res/stasis_json/resource_bridges.h (added), res/stasis_http/resource_sounds.h, res/res_stasis_json_events.c (added), res/res_stasis_json_bridges.exports.in (added), res/stasis_json/resource_playback.h (added), res/res_stasis_json_sounds.c (added), res/stasis_http/resource_asterisk.h, res/stasis_json/resource_channels.h (added), rest-api-templates/stasis_json_resource.h.mustache (added), res/res_stasis_json_channels.exports.in (added), res/stasis_json/resource_recordings.h (added), res/res_stasis_json_asterisk.c (added), rest-api-templates/res_stasis_json_resource.c.mustache (added), res/res_stasis_json_recordings.exports.in (added), res/stasis_json/resource_events.h (added), res/stasis_http/resource_endpoints.h, res/stasis_json/resource_sounds.h (added), tests/test_res_stasis.c, res/res_stasis_json_sounds.exports.in (added), res/res_stasis_json_endpoints.c (added), rest-api-templates/res_stasis_json_resource.exports.mustache (added), res/stasis_http/resource_bridges.h, res/stasis_json/resource_asterisk.h (added), res/res_stasis_http_events.c, res/res_stasis_json_asterisk.exports.in (added), res/res_stasis_json_playback.exports.in (added), res/stasis_http/resource_playback.h, res/res_stasis_json_bridges.c (added), res/stasis_http/resource_channels.h, res/stasis_json (added), res/stasis_json/resource_endpoints.h (added), res/res_stasis_json_playback.c (added), res/res_stasis.c, rest-api-templates/make_stasis_http_stubs.py: Move JSON event generators into separate modules This moves the JSON event generators out of the Stasis-HTTP modules and into standalone JSON-related counterparts so that Stasis-HTTP and res_stasis can depend on them without creating dependency cycles. This also provides a future location for Swagger Model validator functions once the generators for that code are written. Review: https://reviewboard.asterisk.org/r/2534/ 2013-05-13 21:21 +0000 [r388602-388617] Michael L. Young * /, main/logger.c: Fix Missing CALL-ID When Logging Through Syslog The CALL-ID (ie [C-00000074]) is missing when logging to syslog. This was just an oversight when this feature was added. * Add CALL-IDs when using syslog (closes issue ASTERISK-21430) Reported by: Nikola Ciprich Tested by: Nikola Ciprich, Michael L. Young Patches: asterisk-21430-syslog-callid_trunk.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2526/ ........ Merged revisions 388605 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_sip.c: Fix Crash Caused By One-way Audio With auto_* NAT Settings Fix The prior code committed, r385473, failed to take into consideration that not all outgoing calls will be to a peer. My fault. This patch does the following: * Check if there is a related peer involved. If there is, check and set NAT settings according to the peer's settings. * Fix a problem with realtime peers. If the global setting has auto_force_rport set and we issued a "sip reload" while a peer is still registered, the peer's flags for NAT are reset to off. When this happens, we were always setting the contact address of the peer to that of the full contact info that we had. (closes issue ASTERISK-21374) Reported by: jmls Tested by: Michael L. Young Patches: asterisk-21374-fix-crash-and-rt-peers.diff by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2524/ ........ Merged revisions 388601 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-13 20:37 +0000 [r388598] Kinsey Moore * res/res_srtp.c, /: Revert r388529 for now Adding the cleanup function needs some deeper thought since it apparently doesn't exist for all variants of libsrtp. ........ Merged revisions 388596 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388597 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-13 19:29 +0000 [r388579] Jonathan Rose * main/pbx.c, /: pbx: Fix lack of cleanup on macrolock and context_table (closes issue ASTERISK-21723) Reported by: Corey Farrell Patches: core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909) ........ Merged revisions 388532 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388578 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-13 18:10 +0000 [r388531] Kinsey Moore * res/res_srtp.c, /: Close libsrtp properly Ensure that libsrtp is shutdown properly when res_srtp is unloaded. (closes issue ASTERISK-21719) Reported by: Corey Farrell Patches: res_srtp-library-shutdown.patch uploaded by Corey Farrell ........ Merged revisions 388529 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388530 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-13 17:20 +0000 [r388526] Jonathan Rose * channels/chan_gulp.c: chan_gulp: Minor readability Improvements to chan_gulp (closes issue ASTERISK-21670) Reported by: Snuffy Review: https://reviewboard.asterisk.org/r/2473/ Patches: gulp-coding-guide.diff uploaded by snuffy (license 5024) 2013-05-13 14:28 +0000 [r388479] Richard Mudgett * main/manager.c, /: Fix SendText AMI action to never return non-zero. AMI actions must never return non-zero unless they intend to close the AMI connection. (Which is almost never.) (closes issue ASTERISK-21779) Reported by: Paul Goldbaum ........ Merged revisions 388477 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388478 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-10 22:12 +0000 [r388427] Richard Mudgett * /, channels/misdn/isdn_msg_parser.c: Allow mISDN to send PROGRESS messsage. * Made isdn_msg_parser.c build a progress message with the mandatory progress indicator IE. (The mISDNuser NT state machine rejected sending the incomplete message.) Note: The associated mISDN and mISDNuser patches respectively are viewable here: http://svnview.digium.com/svn/thirdparty?view=rev&rev=200 http://svnview.digium.com/svn/thirdparty?view=rev&rev=201 (closes issue AST-1153) Reported by: Guenther Kelleter Patches: progress-chan_misdn.diff (license #6372) patch uploaded by Guenther Kelleter progress-misdn.diff (license #6372) mISDN patch uploaded by Guenther Kelleter progress-misdnuser.diff (license #6372) mISDNuser patch uploaded by Guenther Kelleter ........ Merged revisions 388425 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388426 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-10 20:50 +0000 [r388380] Mark Michelson * /, pbx/pbx_dundi.c: Fix memory leak in pbx_dundi pbx_dundi added an io context without removing it. This caused a memory leak when the module was unloaded. (closes ASTERISK-21718) Reported by Corey Farrell Patches: pbx_dundi-ast_io_remove.patch uploaded by Corey Farrell (License #5909) ........ Merged revisions 388376 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388378 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-10 20:28 +0000 [r388375] Michael L. Young * res/res_config_odbc.c: Fix Finding Extensions With Patterns Using ODBC Realtime After the merge of support for the realtime sorcery module, extensions that contained a pattern were not being found through odbc realtime. It was tracked down to this one line that was advancing to the next variable list before it should have been. The removal of this one line fixes this. Tested this fix on my machine. Received confirmation that this is the right fix from file on IRC. 2013-05-10 17:12 +0000 [r388318-388350] David M. Lee * res/res_stasis_http_channels.c, include/asterisk/stasis_app.h, res/res_stasis_http_recordings.c, res/res_stasis_http_endpoints.c, main/loader.c, res/res_stasis_http_events.c, res/res_stasis_http_sounds.c, res/res_stasis_http_bridges.c, res/res_stasis_http.c, res/res_stasis.c, apps/app_stasis.c, res/res_stasis_http_asterisk.c, rest-api-templates/res_stasis_http_resource.c.mustache, res/res_stasis_http_playback.c, res/res_stasis_websocket.c, tests/test_res_stasis.c: Address unload order issues for res_stasis* modules I've noticed when doing a graceful shutdown that the res_stasis_http.so module gets unloaded before the modules that use it, which causes some asserts during their unload. While r386928 was a quick hack to get it to not assert and die, this patch increases the use counts on res_stasis.so and res_stasis_http.so properly. It's a bigger change than I expected, hence the review instead of just committing it. Review: https://reviewboard.asterisk.org/r/2489/ * include/asterisk/stasis.h: Avoided __ast names for the private variables created by the STASIS_MESSAGE_TYPE_*() macros. 2013-05-10 13:13 +0000 [r388275] Kinsey Moore * rest-api-templates/event_function_decl.mustache (added), res/stasis_http/resource_sounds.h, CHANGES, res/res_stasis_http_events.c, include/asterisk/stasis_channels.h, main/stasis_channels.c, rest-api-templates/swagger_model.py, res/res_stasis.c, main/manager_channels.c, rest-api-templates/stasis_http_resource.h.mustache, res/stasis_http/resource_recordings.h, rest-api-templates/asterisk_processor.py, rest-api-templates/res_stasis_http_resource.c.mustache, res/stasis_http/resource_endpoints.h, rest-api/api-docs/events.json, res/stasis_http/resource_events.h, res/res_stasis_websocket.c, apps/app_userevent.c: Add channel events for res_stasis apps This change adds a framework in res_stasis for handling events from channel topics. JSON event generation and validation code is created from event documentation in rest-api/api-docs/events.json to assist in JSON event generation, ensure consistency, and ensure that accurate documentation is available for ALL events that are received by res_stasis applications. The userevent application has been refactored along with the code that handles userevent channel blob events to pass the headers as key/value pairs in the JSON blob. As a side-effect, app_userevent now handles duplicate keys by overwriting the previous value. Review: https://reviewboard.asterisk.org/r/2428/ (closes issue ASTERISK-21180) Patch-By: Kinsey Moore 2013-05-10 11:47 +0000 [r388254] Sean Bright * /, channels/chan_sip.c: Fix copy/paste error in one-touch-recording implementation. ........ Merged revisions 388253 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-09 14:41 +0000 [r388175] Matthew Jordan * apps/app_userevent.c: Don't expect to pack three tuples when you only have two 2013-05-09 04:11 +0000 [r388110-388113] Michael L. Young * res/res_rtp_asterisk.c, /: Fix The Payload Being Set On CN Packets And Do Not Set Marker Bit When we send out a CN packet (for instance, in the case of using rtpkeepalives), we are not setting the payload code properly. Also, we are setting the marker bit when we shouldn't be according to RFC 3389, section 4. AST_RTP_CN is not defined by AST_FORMAT codes. Therefore, we should be using ast_rtp_codecs_payload_code() rather than ast_rtp_codecs_payload_lookup(). 11 and trunk already use the appropriate function. * In 1.8, use ast_rtp_codecs_payload_code() * Remove the setting of the marker bit * Fix the debug message by incrementing the seqno after the debug message is set in order to display the correct seqno that was sent out (closes issue ASTERISK-21246) Reported by: Peter Katzmann Tested by: Peter Katzmann, Michael L. Young Patches: asterisk-21246-rtp-cng-payload-error_1.8_v2.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2500/ ........ Merged revisions 388111 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 388112 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, apps/app_queue.c: Fix Segfault In app_queue When "persistentmembers" Is Enabled And Using Realtime When the "ignorebusy" setting was deprecated, we added some code to allow us to be compatible with older setups that are still using the "ignorebusy" setting instead of "ringinuse". We set a char *variable with the column name to use, which helps the realtime functions to use the correct column in their SQL queries. When "persistentmembers" is enabled, we are not setting this variable before the realtime functions were called to load members. This results in the variable being NULL and therefore causing a segfault when loading members during the module's process of loading. The solution was to move the code that sets that variable to be before these realtime functions are called during the loading of the module. (closes issue ASTERISK-21738) Reported by: JoshE Tested by: JoshE Patches: asterisk-21738-rt-ringinuse-field-not-set.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2499/ ........ Merged revisions 388108 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-08 22:00 +0000 [r388014-388075] David M. Lee * res/res_stasis_websocket.c: Fixed MODFLAG for res_stasis_websocket * build_tools/cflags.xml, include/asterisk/inline_api.h: Add development flag to disable the inline API. A GCC bug[1] can, in some cases, pop up an unsuppressible pedwarn when using a static inline standard library function from a non-static inline function. This normally doesn't show up, but can occur if you're running an upgrade version of GCC (such as GCC 4.8 on OS X, which normally runs GCC 4.2). [1]: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47816 * main/srv.c, main/enum.c: Removed #if checks for crazy old versions of OS X. The was introduced way back in OS X Panther, which itself was end-of-lifed back in 2007. We can assume that any OS X machine we build on will need that header file :-) Why bother removing it? The flag we're checking (__APPLE_CC__) is actually Apple's build number. Self-compiled versions of GCC (such as installing the latest version of GCC from homebrew) sets the value to 0, making it useless for this sort of compile flaggery. * tests/test_stasis_endpoints.c: Fixed set-but-not-used warning caught by newer GCC 2013-05-08 18:36 +0000 [r388008] Matthew Jordan * apps/app_directory.c: Don't perform a realtime lookup with a NULL keyword Previously, a call to ast_load_realtime_multientry could get away with passing a NULL parameter to the function, even though it really isn't supposed to do that. After the change over to using ast_variable instead of variadic arguments, the realtime engine gets unhappy if you do this. This was always an unintended function call in app_directory anyway - now, we just don't call into the realtime function calls if we don't have anything to query on. 2013-05-08 18:34 +0000 [r388005] David M. Lee * main/stasis_channels.c, res/res_stasis.c, main/manager_channels.c, main/channel.c, include/asterisk/stasis_channels.h, tests/test_stasis_channels.c, apps/app_userevent.c, include/asterisk/stasis.h: Remove required type field from channel blobs When we first introduced the channel blob types, the JSON blobs were self identifying by a required "type" field in the JSON object itself. This, as it turns out, was a bad idea. When we introduced the message router, it was useless for routing based on the JSON type. And messages had two type fields to check: the stasis_message_type() of the message itself, plus the type field in the JSON blob (but only if it was a blob message). This patch corrects that mistake by removing the required type field from JSON blobs, and introducing first class stasis_message_type objects for the actual message type. Since we now will have a proliferation of message types, I introduced a few macros to help reduce the amount of boilerplate necessary to set them up. Review: https://reviewboard.asterisk.org/r/2509 2013-05-08 16:58 +0000 [r387974] Richard Mudgett * utils: Add version.c to list of ignored files in the utils directory. 2013-05-08 13:39 +0000 [r387932] David M. Lee * tests/test_endpoints.c (added), include/asterisk/stasis_endpoints.h (added), res/res_stasis_test.c (added), res/stasis_http/resource_endpoints.c, channels/sip/include/sip.h, main/asterisk.c, rest-api/api-docs/endpoints.json, res/stasis_http/resource_endpoints.h, main/stasis_cache.c, main/stasis_endpoints.c (added), channels/chan_sip.c, include/asterisk/endpoints.h (added), include/asterisk/astobj2.h, main/channel_internal_api.c, include/asterisk/stasis_test.h (added), include/asterisk/stasis.h, main/endpoints.c (added), main/astobj2.c, res/res_stasis_http_endpoints.c, tests/test_stasis_endpoints.c (added), res/res_stasis_test.exports.in (added): Initial support for endpoints. An endpoint is an external device/system that may offer/accept channels to/from Asterisk. While this is a very useful concept for end users, it is surprisingly not a core concept within Asterisk itself. This patch defines ast_endpoint as a separate object, which channel drivers may use to expose their concept of an endpoint. As the channel driver creates channels, it can use ast_endpoint_add_channel() to associate channels to the endpoint. This updated the endpoint appropriately, and forwards all of the channel's events to the endpoint's topic. In order to avoid excessive locking on the endpoint object itself, the mutable state is not accessible via getters. Instead, you can create a snapshot using ast_endpoint_snapshot_create() to get a consistent snapshot of the internal state. This patch also includes a set of topics and messages associated with endpoints, and implementations of the endpoint-related RESTful API. chan_sip was updated to create endpoints with SIP peers, but the state of the endpoints is not updated with the state of the peer. Along for the ride in this patch is a Stasis test API. This is a stasis_message_sink object, which can be subscribed to a Stasis topic. It has functions for blocking while waiting for conditions in the message sink to be fulfilled. (closes issue ASTERISK-21421) Review: https://reviewboard.asterisk.org/r/2492/ 2013-05-08 07:21 +0000 [r387885] Alec L Davis * /, channels/chan_sip.c: chan_sip: NOTIFYs for BLF start queuing up and fail to be sent out after retries fail RFC6665 4.2.2: ... after a failed State NOTIFY transaction remove the subscription The problem is that the State Notify requests rely on the 200OK reponse for pacing control and to not confuse the notify susbsystem. The issue is, the pendinginvite isn't cleared if a response isn't received, thus further notify's are never sent. The solution, follow RFC 6665 4.2.2's 'SHOULD' and remove the subscription after failure. (closes issue ASTERISK-21677) Reported by: Dan Martens Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2475/ ........ Merged revisions 387875 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387880 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-07 18:32 +0000 [r387803-387825] David M. Lee * include/asterisk/lock.h: Fixed up \example marker in lock.h Doxygen comment. The \example tags marks an entire file as an example, not a code snippet. * res/res_config_pgsql.c, main/manager.c, /: Minor fixups to Doxygen comments. The \example tags marks an entire file as an example, not a code snippet. ........ Merged revisions 387823 from http://svn.asterisk.org/svn/asterisk/branches/11 * include/asterisk/json.h: Better explained the depths of reference stealing. 2013-05-07 17:53 +0000 [r387802] Jason Parker * include/asterisk.h: Fix build breakage, from LOW_MEMORY fix. 2013-05-06 17:15 +0000 [r387740-387741] Richard Mudgett * include/asterisk/astobj2.h: Update ao2_destructor_fn doxygen. * channels/chan_dahdi.c: Make a log NOTICE more explicit that the event comes from DAHDI and not PRI. 2013-05-06 17:01 +0000 [r387738] Jason Parker * main/asterisk.c: Fix building with LOW_MEMORY defined. 2013-05-06 15:58 +0000 [r387690] Russell Bryant * /, apps/app_meetme.c: Make SLA reload more paranoid. Reload support was originally not included for SLA. It was added later, but in a fairly non-traditional way. It basically sets a flag indicating that a reload is pending, and then waits for a time where it thinks everything SLA related is idle and unused, and *then* executes the reload. It does this because the reload process is destructive. It starts by throwing everything away and starting over. There are a number of problems with this approach. One of them is that the check to see if anything in use was incomplete. This patch makes it more complete and thus less likely for a crash to occur during reload processing. However, this approach still has problems so some much more significant reworking of this code will need to come in as a next step. Patch credit and testing by CoreDial, LLC. ........ Merged revisions 387688 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387689 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-06 13:04 +0000 [r387662] Joshua Colp * include/asterisk/sorcery.h, res/res_sorcery_astdb.c, tests/test_sorcery.c, main/sorcery.c: Add support for observers and JSON objectset creation to sorcery. This change adds the ability for modules to add themselves as observers to sorcery object types. Observers can be notified when objects are created, updated, or deleted as well as when the object type is loaded or reloaded. Observer notifications are done using a thread pool in a serialized fashion so the caller of the sorcery API calls is minimally impacted. This also adds the ability to create JSON changesets of a sorcery object. Tests are also present to confirm all of the above functionality. Review: https://reviewboard.asterisk.org/r/2477/ 2013-05-04 16:00 +0000 [r387630-387633] Matthew Jordan * main/asterisk.c, include/asterisk.h: Clean up documentation; prevent ref leak on exit This patch: * Cleans up some doxygen * Prevents leaking the system level Stasis topics and messages on exit (users of valgrind will be happier) * funcs/func_global.c: Migrate SHARED's use of the VarSet AMI event to Stasis-Core This patch removes the direct call to AMI from the SHARED function and instead call Stasis-Core. Stasis-Core delivers the notification that a shared variable has changed on a channel to all interested consumers. (issue ASTERISK-21462) 2013-05-03 18:03 +0000 [r387594] Jonathan Rose * main/asterisk.c, include/asterisk.h, channels/chan_sip.c, res/res_stun_monitor.c, main/event.c, channels/chan_iax2.c: Stasis: Convert network change events into network change stasis messages (issue ASTERISK-21103) Review: https://reviewboard.asterisk.org/r/2490/ 2013-05-03 11:35 +0000 [r387545] Joshua Colp * res/res_sip_sdp_rtp.c, channels/chan_gulp.c: Use the configured formats for Gulp sessions if there are no joint formats between requested formats and configured formats. (closes issue ASTERISK-21756) 2013-05-02 20:59 +0000 [r387519] Matthew Jordan * build_tools/post_process_documentation.py, apps/app_stack.c: Migrate AMI VarSet events raised by GoSub local variables This patch moves VarSet events for local variables raised by GoSub over to Stasis-Core. It also tweaks up the post-processing documentation scripts to not combine parameters if both parameters are already documented. (issue ASTERISK-21462) 2013-05-02 19:06 +0000 [r387482] Richard Mudgett * main/channel.c: Remove the ABI compatability ast_channel_alloc(). It is no longer needed. 2013-05-02 17:15 +0000 [r387423] Matthew Jordan * utils/Makefile, /: Update utils Makefile to handle r387294 Alec's patch that added the Asterisk version to 'core show locks' angered the items in utils, as they exist somewhat outside of the Asterisk build system. Some day, this Makefile should get nuked from high orbit, but for now, include version.c in its list of stuff to pile in. ........ Merged revisions 387421 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387422 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-02 16:39 +0000 [r387420] Jonathan Rose * include/asterisk/event_defs.h, main/event.c: Putting all event defs and names back for now due to res_corosync dependency 2013-05-02 08:24 +0000 [r387296-387369] Alec L Davis * /, channels/chan_sip.c, channels/sip/include/sip.h: chan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval when not the refresher RFC 4028 Section 10 if the side not performing refreshes does not receive a session refresh request before the session expiration, it SHOULD send a BYE to terminate the session, slightly before the session expiration. The minimum of 32 seconds and one third of the session interval is RECOMMENDED. Prior to this asterisk would refresh at 1/2 the Session-Expires interval, or if the remote device was the refresher, asterisk would timeout at interval end. Now, when not refresher, timeout as per RFC noted above. (closes issue ASTERISK-21742) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2488/ ........ Merged revisions 387344 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387345 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_sip.c: chan_sip: Honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk is the refresher. RFC 4028 Section 7.2 "UACs MUST be prepared to receive a Session-Expires header field in a response, even if none were present in the request." What changed After ASTERISK-20787, inbound calls to asterisk with no Session-Expires in the INVITE are now are offered a Session-Expires (1800 asterisk default) in the response, with asterisk as the refresher. Symptom: After 900 seconds (asterisk default refresher period 1800), asterisk RE-INVITEs the device, the device may respond with a much lower Session-Expires (180 in our case) value that it is now using. Asterisk ignores this response, as it's deemed both an INBOUND CALL, and a RE-INVITE. After 180 seconds the device times out and sends BYE (hangs up), asterisk is still working with the refresher period of 1800 as it ignored the 'Session Expires: 180' in the previous 200OK response. Fix: handle_response_invite() when 200OK, remove check for outbound and reinvite. (closes issue ASTERISK-21664) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2463/ ........ Merged revisions 387312 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387319 from http://svn.asterisk.org/svn/asterisk/branches/11 * channels/chan_dahdi.c, /: chan_dahdi: fix lower bound check with -ve integer conversion from a float Lower bound of a 16bit signed int is -32768 not -32767 (closes issue ASTERISK-21744) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) ........ Merged revisions 387297 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387298 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, main/utils.c: Add Asterisk Version to core show locks Assist with reporting 'core show locks' when submitting bug reports. Example below: =========================== == SVN-branch-1.8-... == Currently Held Locks =========================== (closes issue ASTERISK-21743) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) ........ Merged revisions 387294 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387295 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-01 21:55 +0000 [r387260-387261] Richard Mudgett * channels/chan_local.c: Simplify chan_local.c:manager_optimize_away() using ao2_find(). * channels/chan_local.c: Cleanup chan_local.c:local_new(). * Remove t and ama local variables. There is no way they could be anything other than default because p->owner can only be NULL at this point. * Rename tmp and tmp2 to owner and chan respectively. * Remove redundant initialization of channel context, exten, priority. 2013-05-01 21:18 +0000 [r387220] Matthew Jordan * res/res_rtp_asterisk.c, /: Clear the DTMF sending digit tracking on off nominal paths In certain situations, when the RTP engine goes to send a DTMF end digit it may be in a situation where the remote address is no longer available, or the digit that was supposed to be sent is invalid. In such cases, we need to clear the RTP counters appropriately. Otherwise, when the RTP source is set again, we'll continue to think that we're in the middle of sending a DTMF digit, which can confuse the remote party (signficantly). (closes issue ASTERISK-21522) Reported by: Corey Farrell patches: rtp_dtmf_process_end.patch uploaded by Corey Farrell (License 5909) ........ Merged revisions 387213 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387216 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-01 21:09 +0000 [r387181-387212] Richard Mudgett * channels/chan_local.c: Trivial changes. Comments, parentheses, spelling, wording. * channels/chan_local.c: Make chan_local locals container an explicit list container. Pretending that chan_local locals container can have more than one bucket is silly. The container has no key to help search. * channels/chan_local.c: Whitespace changes. * main/loader.c: Make mod_load_cmp() not as klunky. There is a reason the heap comparison functions like qsort(), and other comparison functions specify <0, >0, and =0 for the return values. * channels/chan_unistim.c: Remove some unnecessary calls to ast_bridged_channel() in chan_unistim.c * channels/chan_mgcp.c: Remove some unnecessary calls to ast_bridged_channel() in chan_mgcp.c * channels/chan_skinny.c: Remove some unnecessary calls to ast_bridged_channel() in chan_skinny.c * channels/chan_iax2.c: Remove some unnecessary calls to ast_bridged_channel() in chan_iax2.c * channels/chan_dahdi.c, channels/sig_analog.c: Remove some unnecessary calls to ast_bridged_channel() in chan_dahdi.c/sig_analog.c 2013-05-01 18:38 +0000 [r387135] Matthew Jordan * /, channels/chan_sip.c: Prevent crash in 'sip show peers' when the number of peers on a system is large When you have lots of SIP peers (according to the issue reporter, around 3500), the 'sip show peers' CLI command or AMI action can crash due to a poorly placed string duplication that occurs on the stack. This patch refactors the command to not allocate the string on the stack, and handles the formatting of a single peer in a separate function call. (closes issue ASTERISK-21466) Reported by: Guillaume Knispel patches: fix_sip_show_peers_stack_overflow_asterisk_11.3.0-v2.patch uploaded by gknispel (License 6492) ........ Merged revisions 387134 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-05-01 17:15 +0000 [r387108] Richard Mudgett * channels/chan_dahdi.c: Move some annoying chan_dahdi debug messages to level 5. 2013-04-30 22:50 +0000 [r387039] Matthew Jordan * main/features.c, /: Fix CDR not being created during an externally initiated blind transfer Way back when in the dark days of Asterisk 1.8.9, blind transferring a call in a context that included the 'h' extension would inadvertently execute the hangup code logic on the transferred channel. This was a "bad thing". The fix was to properly check for the softhangup flags on the channel and only execute the 'h' extension logic (and, in later versions, hangup handler logic) if the channel was well and truly dead (Jim). Unfortunately, CDRs are fickle. Setting the softhangup flag when we detected that the channel was leaving the bridge (but not to die) caused some crucial snippet of CDR code, lying in ambush in the middle of the bridging code, to not get executed. This had the effect of blowing away one of the CDRs that is typically created during a blind transfer. While we live and die by the adage "don't touch CDRs in release branches", this was our bad. The attached patch restores the CDR behavior, and still manages to not run the 'h' extension during a blind transfer (at least not when it's supposed to). Thanks to Steve Davies for diagnosing this and providing a fix. Review: https://reviewboard.asterisk.org/r/2476 (closes issue ASTERISK-21394) Reported by: Ishfaq Malik Tested by: Ishfaq Malik, mjordan patches: fix_missing_blindXfer_cdr2 uploaded by one47 (License 5012) ........ Merged revisions 387036 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 387038 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-30 22:37 +0000 [r387035-387037] Jonathan Rose * main/event.c, include/asterisk/json.h, channels/chan_iax2.c, main/named_acl.c, include/asterisk/acl.h, main/json.c, main/manager.c, channels/chan_sip.c, include/asterisk/event_defs.h: Stasis Core: Refactor ACL Change events to go out over the stasis core msg bus (issue ASTERISK-21103) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2481/ * /, main/event.c: Add forgotten event types to event_names array ........ Merged revisions 387030 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-30 18:12 +0000 [r386990] Jason Parker * channels/chan_gulp.c: Fix a log message. 2013-04-30 13:48 +0000 [r386931] Sean Bright * include/asterisk/utils.h, /: Use the proper lower bound when doing saturation arithmetic. 16 bit signed integers have a range of [-32768, 32768). The existing code was using the interval (-32768, 32768) instead. This patch fixes that. Review: https://reviewboard.asterisk.org/r/2479/ ........ Merged revisions 386929 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386930 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-30 13:37 +0000 [r386928] David M. Lee * tests/test_stasis_http.c, res/res_stasis_http.c: Just a couple of Stasis-HTTP nitpick fixes. * Fixed crash when res_stasis_http is unloaded before the implementation modules. * Cleaned up test initialization for test_stasis_http.so. 2013-04-29 23:36 +0000 [r386879] Rusty Newton * sounds/Makefile, /: Modifying sounds/Makefile to pull down 1.4.24 core sounds 1.4.24 core sounds includes a full set of Italian prompts for core sounds and a fix for the missing voicemail prompts in the Russian language. (closes issue ASTERISK-19431) (closes issue ASTERISK-19721) ........ Merged revisions 386877 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386878 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-29 13:38 +0000 [r386793-386841] Olle Johansson * /, CHANGES, apps/app_queue.c: Play periodic prompts for first call in a call queue Review: https://reviewboard.asterisk.org/r/2263/ ........ Merged revisions 386792 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386794 from http://svn.asterisk.org/svn/asterisk/branches/11 * include/asterisk/doxygen/commits.h: Change pointer to existing wiki page instead of non-existing page 2013-04-28 03:32 +0000 [r386774] Kinsey Moore * rest-api-templates/swagger_model.py: Fix spelling error in python doc 2013-04-27 19:03 +0000 [r386731-386760] Joshua Colp * res/res_sip.c: Tweak res_sip priority so it gets loaded first before all other SIP stuff. * res/res_config_sqlite.c: Update res_config_sqlite to use the ast_variable lists. * CHANGES, res/res_config_ldap.c, main/config.c, tests/test_sorcery_realtime.c (added), main/sorcery.c, res/res_sorcery_realtime.c (added), addons/res_config_mysql.c, res/res_config_sqlite3.c, res/res_config_curl.c, res/res_config_pgsql.c, res/res_config_odbc.c, include/asterisk/config.h: Add support for a realtime sorcery module. This change does the following: 1. Adds the sorcery realtime module 2. Adds unit tests for the sorcery realtime module 3. Changes the realtime core to use an ast_variable list instead of variadic arguments 4. Changes all realtime drivers to accept an ast_variable list Review: https://reviewboard.asterisk.org/r/2424/ 2013-04-26 21:52 +0000 [r386685-386686] Matthew Jordan * res/res_sip_nat.c, res/res_sip_registrar.c, res/res_sip_dtmf_info.c, res/res_sip_outbound_authenticator_digest.c, res/res_sip_rfc3326.c, res/res_sip_outbound_registration.c, res/res_sip_endpoint_identifier_ip.c, res/res_sip_endpoint_identifier_constant.c, res/res_sip_mwi.c, res/res_sip_acl.c, res/res_sip_logger.c, res/res_sip_endpoint_identifier_user.c, res/res_sip_pubsub.c: Add missing module dependencies to various res_sip* modules This patch updates the various res_sip modules with their proper menuselect options and proper dependencies, such that Asterisk still has a snowball's chance in hell of compiling without pjproject. Much thanks to snuffy(-home|-work) for making everyone's life easier with this patch. Review: https://reviewboard.asterisk.org/r/2472/ (closes issue ASTERISK-21669) Reported by: snuffy patches: xml-depends.diff uploaded by snuffy (license 5024) * /, main/config.c: Clean up memory leak in config file on off nominal paths when glob is allowed If a system allows for its usage, Asterisk will use glob to help parse Asterisk .conf files. The config file loading routine was leaking the memory allocated by the glob() routine when the config file was in an unmodified or invalid state. This patch properly calls globfree in those off nominal paths. (closes issue ASTERISK-21412) Reported by: Corey Farrell patches: config_glob_leak.patch uploaded by Corey Farrell (license 5909) ........ Merged revisions 386672 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386677 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-26 21:31 +0000 [r386684] David M. Lee * main/loader.c: By popular demand, putting the about-to-load-module printf back. But now it only prints during the initial startup, and prints at verbose 1 level. 2013-04-26 21:27 +0000 [r386676] Matthew Jordan * /, main/features.c: Clean up resources in features on exit This patch cleans up two things features: * It properly unregisters the CLI commands that features registered * It cancels and performs a pthread_join on the created parking thread. This not only properly joins a non-detached thread, but also prevents disposing of the parking lots prior to the parking thread completely exiting. (closes issue ASTERISK-21407) Reported by: Corey Farrell patches: features_shutdown-r2.patch uploaded by Corey Farrell (License 5909) ........ Merged revisions 386641 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386642 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-26 21:00 +0000 [r386640] David M. Lee * main/loader.c: Removing stray printf from r386540 2013-04-26 20:32 +0000 [r386638] Mark Michelson * main/uuid.c: Add an \extref doxygen pointer for libuuid. Thanks to Olle Johansson for suggesting this. 2013-04-26 20:05 +0000 [r386623-386624] David M. Lee * res/res_chan_stats.c (added), res/res_statsd.exports.in (added), configs/statsd.conf.sample (added), include/asterisk/utils.h, include/asterisk/statsd.h (added), res/res_statsd.c (added): Example of how to use the Stasis message bus In order to get people familiar with the Stasis message bus, it would be useful to have something of a tutorial. Since I'm not clever enough to think of some cool integration we could do with Twitter, I settled for something that might actually be useful. This patch adds a res_statsd.so module, which implements a basic statsd[1] client. Statsd is a very simple statistics gathering server, which can publish its results to a backend graphing engine, like Graphite[2]. There are several different Statsd server implementations[3], so you can pick what works best for your environment. The actual example of how to use the Stasis message bus is in res_chan_stats.so. This module demonstrates how to use subscriptions and the message router by monitoring messages and posting channels stats to the statsd server. A wiki page walking through res_chan_stats.so is forthcoming. [1]: https://github.com/etsy/statsd/ [2]: http://graphite.readthedocs.org/en/latest/ [3]: http://joemiller.me/2011/09/21/list-of-statsd-server-implementations/ Review: https://reviewboard.asterisk.org/r/2460/ * res/res_sip: Ignore *.[oi] files in res/res_sip 2013-04-25 21:32 +0000 [r386577] Joshua Colp * configs/res_sip.conf.sample: Don't bind to anything in the sample configuration so we don't clash with chan_sip on a "make samples" right now. 2013-04-25 18:28 +0000 [r386540-386541] Mark Michelson * /: REmove automerge properties. * res/res_sip/sip_options.c, res/res_sip_pubsub.exports.in (added), res/res_sip_rfc3326.c (added), res/res_sip_mwi.c (added), main/sorcery.c, res/res_sip (added), include/asterisk/threadpool.h, res/res_sip_registrar.c (added), res/res_sip/sip_distributor.c, res/res_sip/config_auth.c, include/asterisk/res_sip_session.h (added), res/res_sip_endpoint_identifier_ip.c (added), channels/Makefile, tests/test_sorcery.c, res/res_sip/config_domain_aliases.c, res/res_sip_endpoint_identifier_user.c (added), res/res_sip.c (added), include/asterisk/res_sip_pubsub.h (added), include/asterisk/sorcery.h, res/res_sip_outbound_authenticator_digest.c (added), res/res_sip/location.c, res/res_sip_outbound_registration.c (added), res/res_sip_endpoint_identifier_constant.c (added), res/res_sip_acl.c (added), res/res_sip_pubsub.c (added), res/res_sorcery_config.c, res/res_sip/config_transport.c, configs/res_sip.conf.sample (added), res/res_sip/sip_configuration.c, /, include/asterisk/autoconfig.h.in, include/asterisk/res_sip.h (added), res/res_sip_dtmf_info.c (added), res/res_sip/include/res_sip_private.h, res/res_sip.exports.in (added), main/threadpool.c, res/Makefile, res/res_sip_authenticator_digest.c (added), main/taskprocessor.c, res/res_sip_session.exports.in (added), main/astobj2.c, res/res_sip_sdp_rtp.c (added), res/res_sip/sip_outbound_auth.c, main/loader.c, channels/chan_gulp.c (added), res/res_sip_caller_id.c (added), res/res_sip_logger.c (added), res/res_sip/include, res/res_sip_nat.c (added), configure, res/res_sip_session.c (added): Merge the pimp_my_sip branch into trunk. The pimp_my_sip branch is being merged at this point because it offers basic functionality, and from an API standpoint, things are complete. SIP work is *not* feature-complete; however, with the completion of the SUBSCRIBE/NOTIFY API, all APIs (except a PUBLISH API) have been created, and thus it is possible for developers to attempt to create new SIP work. API documentation can be found in the doxygen in the code, but usability documentation is still lacking. 2013-04-25 03:04 +0000 [r386485-386487] Michael L. Young * /, channels/chan_sip.c: Fix Displaying Symmetric RTP Global Setting * Use comedia_string() to display correctly the symmetric rtp setting when running "sip show settings" ........ Merged revisions 386486 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_sip.c: Change Case On Forcerport For Consistency * Change "ForcerPort" to "Forcerport" to match everywhere else it is displayed ........ Merged revisions 386483 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386484 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-24 21:47 +0000 [r386461-386462] David M. Lee * res/stasis_http/resource_bridges.h, res/stasis_http/resource_recordings.h, rest-api-templates/stasis_http_resource.h.mustache, res/stasis_http/resource_endpoints.h, res/stasis_http/resource_events.h, res/stasis_http/resource_asterisk.h, res/stasis_http/resource_playback.h, res/stasis_http/resource_channels.h, res/stasis_http/resource_sounds.h: Document JSON models in resource_*.h * rest-api-templates/swagger_model.py: Oops. Mustache doesn't like dictionaries 2013-04-23 20:18 +0000 [r386375] Richard Mudgett * apps/confbridge/conf_config_parser.c, apps/app_confbridge.c: confbridge: Make search the conference bridges container using OBJ_KEY. * Make confbridge config parsing user profile, bridge profile, and menu container hash/cmp functions correctly check the OBJ_POINTER, OBJ_KEY, and OBJ_PARTIAL_KEY flags. * Made confbridge load_module()/unload_module() free all resources on failure conditions. 2013-04-23 18:57 +0000 [r386352] Kinsey Moore * res/res_stasis.c: Fix some bad whitespace This crept in with the RESTful HTTP interface merge. 2013-04-22 16:44 +0000 [r386289] Richard Mudgett * main/channel.c, /: Fix crash when AMI redirect action redirects two channels out of a bridge. The two party bridging loops were changing the bridge peer pointers without the channel locks held. Thus when ast_channel_massquerade() tested and used the pointer there is a small window of opportunity for the pointers to become NULL even though the masquerade code has the channels locked. (closes issue ASTERISK-21356) Reported by: William luke Patches: jira_asterisk_21356_v11.patch (license #5621) patch uploaded by rmudgett Tested by: William luke ........ Merged revisions 386256 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386286 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-22 16:22 +0000 [r386266] Andrew Latham * include/asterisk/srv.h: Doxygen - Markup Guidelines Expand on a commit by OEJ to use the Coding-Guidelines (issue ASTERISK-20259) 2013-04-22 14:58 +0000 [r386232] David M. Lee * res/stasis_http/resource_channels.c, res/res_stasis_http_sounds.c (added), rest-api (added), main/http.c, res/res_stasis_http_bridges.c (added), tests/test_stasis_http.c (added), include/asterisk/strings.h, res/res_stasis_http.c (added), tests/test_stasis.c, res/res_stasis.c, res/res_stasis_http_asterisk.c (added), res/res_stasis_http_playback.c (added), res/stasis_http (added), configs/stasis_http.conf.sample (added), include/asterisk/stasis_http.h (added), res/res_stasis_http_channels.c (added), include/asterisk/stasis_app.h, res/Makefile, include/asterisk/json.h, res/res_stasis_http_recordings.c (added), res/stasis_http.make (added), tests/test_strings.c, res/res_stasis_http_endpoints.c (added), res/res_stasis_http_events.c (added), include/asterisk/http.h, Makefile, main/json.c, res/res_stasis_http.exports.in (added), rest-api-templates (added): This patch adds a RESTful HTTP interface to Asterisk. The API itself is documented using Swagger, a lightweight mechanism for documenting RESTful API's using JSON. This allows us to use swagger-ui to provide executable documentation for the API, generate client bindings in different languages, and generate a lot of the boilerplate code for implementing the RESTful bindings. The API docs live in the rest-api/ directory. The RESTful bindings are generated from the Swagger API docs using a set of Mustache templates. The code generator is written in Python, and uses Pystache. Pystache has no dependencies, and be installed easily using pip. Code generation code lives in rest-api-templates/. The generated code reduces a lot of boilerplate when it comes to handling HTTP requests. It also helps us have greater consistency in the REST API. (closes issue ASTERISK-20891) Review: https://reviewboard.asterisk.org/r/2376/ 2013-04-22 12:45 +0000 [r386211] Olle Johansson * include/asterisk/srv.h: Fix mistake in Doxygen. Doxygen is only *ONE* comment that applies to the NEXT piece of code. 2013-04-22 01:05 +0000 [r386190] Russell Bryant * apps/app_meetme.c: sla: remove redundant locking. sla.lock was already locked in the only place that sla_check_reload() was called. Remove the redundant locking of sla.lock done in this function. Less recursive locking is A Good Thing. 2013-04-19 22:27 +0000 [r386160] Matthew Jordan * /, res/res_timing_pthread.c: Prevent res_timing_pthread from blocking callers There were several reports of deadlock when using res_timing_pthread. Backtraces indicated that one thread was blocked waiting for the write to the pipe to complete and this thread held the container lock for the timers. Therefore any thread that wanted to create a new timer or read an existing timer would block waiting for either the timer lock or the container lock and deadlock ensued. This patch changes the way the pipe is used to eliminate this source of deadlocks: 1) The pipe is placed in non-blocking mode so that it would never block even if the following changes someone fail... 2) Instead of writing bytes into the pipe for each "tick" that's fired the pipe now has two states--signaled and unsignaled. If signaled, the pipe is hot and any pollers of the read side filedescriptor will be woken up. If unsigned the pipe is idle. This eliminates even the chance of filling up the pipe and reduces the potential overhead of calling unnecessary writes. 3) Since we're tracking the signaled / unsignaled state, we can eliminate the exta poll system call for every firing because we know that there is data to be read. (closes issue ASTERISK-21389) Reported by: Matt Jordan Tested by: Shaun Ruffell, Matt Jordan, Tony Lewis patches: 0001-res_timing_pthread-Reduce-probability-of-deadlocking.patch uploaded by sruffell (License 5417) (closes issue ASTERISK-19754) Reported by: Nikola Ciprich (closes issue ASTERISK-20577) Reported by: Kien Kennedy (closes issue ASTERISK-17436) Reported by: Henry Fernandes (closes issue ASTERISK-17467) Reported by: isrl (closes issue ASTERISK-17458) Reported by: isrl Review: https://reviewboard.asterisk.org/r/2441/ ........ Merged revisions 386109 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386159 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-19 05:20 +0000 [r386019-386054] David M. Lee * main/cli.c, /: cli.c: Properly initialize debug_modules and verbose_modules. This avoids some lock errors on the core set {debug,verbose} commands. ........ Merged revisions 386049 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386051 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_http_websocket.c, include/asterisk/http_websocket.h: Allow WebSocket connections on more URL's This patch adds the concept of ast_websocket_server to res_http_websocket, allowing WebSocket connections on URL's more more than /ws. The existing funcitons for managing the WebSocket subprotocols on /ws still work, so this patch should be completely backward compatible. (closes issue ASTERISK-21279) Review: https://reviewboard.asterisk.org/r/2453/ * main/message.c, /: Fix lock errors on startup. In messages.c, there are several places in the code where we create a tmp_tech_holder and pass that into an ao2_find call. Unfortunately, we weren't initializing the rwlock on the tmp_tech_holder, which the hash function was locking. It's apparently harmless, but still not the best code. This patch extracts all that copy/pasted code into two functions, msg_find_by_tech and msg_find_by_tech_name, which properly initialize and destroy the rwlock on the tmp_tech_holder. Review: https://reviewboard.asterisk.org/r/2454/ ........ Merged revisions 386006 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-16 23:44 +0000 [r385939] Alec L Davis * res/res_xmpp.c, res/res_jabber.c, /: res_xmpp and res_jabber need to search 'cachable' in the attrib section of the received IE, not data. (issue ASTERISK-20175) (closes issue ASTERISK-21429) (closes issue ASTERISK-21069) (closes issue ASTERISK-21164) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2452/ 2013-04-16 17:50 +0000 [r385860-385886] Kinsey Moore * res/res_corosync.c: Allow res_corosync to build ast_enable_distributed_devstate is no longer applicable to how the distributed device state system works and is no longer necessary. * main/pbx.c, funcs/func_presencestate.c, include/asterisk/presencestate.h, main/presencestate.c: Move presence state distribution to Stasis-core Convert presence state events to Stasis-core messages and remove redundant serializers where possible. Review: https://reviewboard.asterisk.org/r/2410/ (closes issue ASTERISK-21102) Patch-by: Kinsey Moore * include/asterisk/devicestate.h, main/pbx.c, main/ccss.c, include/asterisk/xmpp.h, tests/test_devicestate.c, main/devicestate.c, res/res_xmpp.c, apps/app_queue.c, res/res_jabber.c, main/asterisk.c: Move device state distribution to Stasis-core In the move from Asterisk's event system to Stasis, this makes distributed device state aggregation always-on, removes unnecessary task processors where possible, and collapses aggregate and non-aggregate states into a single cache for ease of retrieval. This also removes an intermediary step in device state aggregation. Review: https://reviewboard.asterisk.org/r/2389/ (closes issue ASTERISK-21101) Patch-by: Kinsey Moore 2013-04-16 14:09 +0000 [r385835] David M. Lee * include/asterisk/stasis_channels.h: Fixed a typo 2013-04-15 17:26 +0000 [r385782] Jason Parker * Makefile, /: Don't unnecessarily rebuild things on every run of 'make'. Review: https://reviewboard.asterisk.org/r/2449/ ........ Merged revisions 385745 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385768 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-15 16:47 +0000 [r385718-385743] David M. Lee * res/res_stasis_websocket.c: Avoid unused variable warning when not in devmode * main/json.c, include/asterisk/stasis_channels.h, res/res_stasis.exports.in (added), apps/Makefile, apps/app_stasis.exports.in (removed), apps/stasis_json.c (removed), main/stasis_channels.c, tests/test_app_stasis.c (removed), res/res_stasis.c (added), main/manager_channels.c, apps/app_stasis.c, tests/test_json.c, res/res_stasis_websocket.c, tests/test_res_stasis.c (added), tests/test_stasis_channels.c, include/asterisk/app_stasis.h (removed), include/asterisk/stasis_app.h (added), include/asterisk/json.h: Moved core logic from app_stasis to res_stasis After some discussion on asterisk-dev, it was decided that the bulk of the logic in app_stasis actually belongs in a resource module instead of the application module. This patch does that, leaves the app specific stuff in app_stasis, and fixes up everything else to be consistent with that change. * Renamed test_app_stasis to test_res_stasis * Renamed app_stasis.h to stasis_app.h * This is still stasis application support, even though it's no longer in an app_ module. The name should never have been tied to the type of module, anyways. * Now that json isn't a resource module anymore, moved the ast_channel_snapshot_to_json function to main/stasis_channels.c, where it makes more sense. Review: https://reviewboard.asterisk.org/r/2430/ * apps/app_stasis.c, main/manager_channels.c, main/channel.c, include/asterisk/cli.h, include/asterisk/strings.h: DTMF events are now published on a channel's stasis_topic. AMI was refactored to use these events rather than producing the events directly in channel.c. Finally, the code was added to app_stasis to produce DTMF events on the WebSocket. The AMI events are completely backward compatible, including sending events on transmitted DTMF, and sending DTMF start events. The Stasis-HTTP events are somewhat simplified. Since DTMF start and DTMF send events are generally less useful, Stasis-HTTP will only send events on received DTMF end. (closes issue ASTERISK-21282) (closes issue ASTERISK-21359) Review: https://reviewboard.asterisk.org/r/2439 * apps/app_saycounted.c, channels/sip/security_events.c, contrib/realtime/mysql/voicemail_messages.sql, BSDmakefile, contrib/realtime/mysql/voicemail_data.sql, build_tools/sha1sum-sh, res/res_mutestream.c, configs/res_curl.conf.sample, tests/test_func_file.c, res/res_rtp_multicast.c, include/asterisk/select.h, include/asterisk/bridging_technology.h, include/asterisk/bridging_features.h, tests/test_locale.c, doc/Makefile, tests/test_poll.c, contrib/realtime/mysql/musiconhold.sql, res/res_timing_kqueue.c, contrib/realtime/mysql/queue_log.sql, channels/sip/include/security_events.h, channels/sig_ss7.c, channels/chan_multicast_rtp.c, channels/sig_ss7.h, /, tests/test_expr.c: Fix the svn:keywords property on several files. Normally I think keyword expansion is silly, but the one time it would have been good, it didn't work because the property had quotes in it. This patch fixes obviously busted svn:keywords properties. ........ Merged revisions 385683 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385689 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-14 03:01 +0000 [r385635-385638] Matthew Jordan * res/res_rtp_multicast.c, /: Calculate the timestamp for outbound RTP if we don't have timing information This patch calculates the timestamp for outbound RTP when we don't have timing information. This uses the same approach in res_rtp_asterisk. Thanks to both Pietro and Tzafrir for providing patches. (closes issue ASTERISK-19883) Reported by: Giacomo Trovato Tested by: Pietro Bertera, Tzafrir Cohen patches: rtp-timestamp-1.8.patch uploaded by tzafrir (License 5035) rtp-timestamp.patch uploaded by pbertera (License 5943) ........ Merged revisions 385636 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385637 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_alsa.c: Don't attempt to create a voice frame on a read error Prior to this patch, a read error in snd_pcm_readi would still be treated as a nominal result when constructing a voice frame from the expected data. Since the value returned is negative, as opposed to the number of samples read, this could result in a crash. With this patch, we now return a null frame when a read error is detected. Note that the patch on ASTERISK-21329 was modified slightly for this commit, in that we bail immediately on detecting the read error, rather than bypassing the construction of the voice frame. (closes issue ASTERISK-21329) Reported by: Keiichiro Kawasaki patches: chan_alsa.diff uploaded by kawasaki (License 6489) ........ Merged revisions 385633 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385634 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-12 22:38 +0000 [r385595] Michael L. Young * /, apps/app_queue.c: Fix Manager Segfault When app_queue Is Unloaded When app_queue is unloaded, some manager commands are not being unregistered which result in a segfault. This patch corrects this. (closes issue ASTERISK-21397) Reported by: Peter Katzmann, Corey Farrell Tested by: Corey Farrell Patches: asterisk-21397-missing-unreg-manager-cmd_1.8.diff Michael L. Young (license 5026) asterisk-21397-missing-unreg-manager-cmd_11.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2444/ ........ Merged revisions 385593 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385594 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-12 22:26 +0000 [r385585] Kinsey Moore * /, codecs/codec_resample.c: Allow codec_resample to be unloaded Ensure that trans_size is correct to prevent uninitialized entries from preventing reload. (closes issue ASTERISK-21401) Reported by: Corey Farrell Tested by: Corey Farrell Patches: codec_resample-unload.patch uploaded by Corey Farrell ........ Merged revisions 385582 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-12 22:22 +0000 [r385573] Michael L. Young * apps/app_voicemail.c, /: Fix app_voicemail Segfault And A Few Memory Leaks The original report was that app_voicemail would crash. This was caused by ast_config_load() returning CONFIG_STATUS_FILEINVALID but no checks being performed for that return status. After adding the initial patch to fix this issue, Jaco Kroon (jkroon) added some fixes to memory leaks he had discovered. During review, Walter Doekes (wdoekes) suggested adding a helper function in order to determine if we had a valid configuration or not. This patch does the following: * Creates a helper function to check if the configuration is valid * Adds calls to the new helper function where appropiate * Fixes memory leaks where the code returned without running ast_config_destroy() on the configuration that was loaded (closes issue ASTERISK-21302) Reported by: Jaco Kroon Tested by: Jaco Kroon, Michael L. Young Patches: asterisk-11.3.0-app_voicemail-ast_config-fixes.patch Jaco Kroon (license 5671) asterisk-21302-valid_cfg_and_mem_leaks_v3-1.8.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2443/ ........ Merged revisions 385551 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385557 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-12 21:48 +0000 [r385548] Jason Parker * include/asterisk/sorcery.h: Fix documentation. 2013-04-12 21:11 +0000 [r385522] Kinsey Moore * include/asterisk/manager.h, main/manager_channels.c: Expose channel snapshot manager blob generation These functions are already used in one branch (jrose's parking branch) and will soon be used in other branches as well. 2013-04-12 15:06 +0000 [r385474] Michael L. Young * /, channels/chan_sip.c: Fix One-Way Audio With auto_* NAT Settings When SIP Calls Initiated By PBX When we reload Asterisk or chan_sip, the flags force_rport and comedia that are turned on and off when using the auto_force_rport and auto_comedia nat settings go back to the default setting off. These flags are turned on when needed or off when not needed at the time that a peer registers, re-registers or initiates a call. This would apply even when only the default global setting "nat=auto_force_rport" is being used, which in this case would only affect the force_rport flag. Everything is good except for the following: The nat setting is set to auto_force_rport and auto_comedia. We reload Asterisk and the peer's registration has not expired. We load in the settings for the peer which turns force_rport and comedia back to off. Since the peer has not re-registered or placed a call yet, those flags remain off. We then initiate a call to the peer from the PBX. The force_rport and comedia flags stay off. If NAT is involved, we end up with one-way audio since we never checked to see if the peer is behind NAT or not. This patch does the following: * Moves the checking of whether a peer is behind NAT into its own function * Create a function to set the peer's NAT flags if they are using the auto_* NAT settings * Adds calls in sip_request_call() to these new functions in order to setup the dialog according to the peer's settings (closes issue ASTERISK-21374) Reported by: Michael L. Young Tested by: Michael L. Young Patches: asterisk-21374-auto-nat-outgoing-fix_v2.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2421/ ........ Merged revisions 385473 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-12 08:52 +0000 [r385406-385431] Alec L Davis * channels/chan_iax2.c, /: IAX2 defer_full_frames fail to get sent Ensure iax2_process_thread is signalled when a deferred frame is queued to it. (closes issue ASTERISK-18827) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2426/ ........ Merged revisions 385429 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385430 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_iax2.c: IAX2, prevent network thread starting before all helper threads are ready On startup, it's possible for a frame to arrive before the processing threads were ready. In iax2_process_thread() the first pass through falls into ast_cond_wait, should a frame arrive before we are at ast_cond_wait, the signal will be ignored. The result iax2_process_thread stays at ast_cond_wait forever, with deferred frames being queued. Fix: When creating initial idle iax2_process_threads, wait for init_cond to be signalled after each thread is started. (issue ASTERISK-18827) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2427/ ........ Merged revisions 385402 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385403 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-11 16:53 +0000 [r385277-385314] Richard Mudgett * /, configs/cli_aliases.conf.sample: Fix 'pri intense debug span' alias. ........ Merged revisions 385313 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/features.c: Eliminated dial_features_destroy() since it is equivalent to ast_free_ptr() * main/manager.c, main/features.c: * Fix unlocked accesses to feature_list. The feature_list is now also protected by the features_lock. * Made all calls to ast_find_call_feature() have the features_lock held. * Fixed set_config_flags() to actually use find_group() to look for feature groups in DYNAMIC_FEATURES. The code originally assumed all feature groups were listed in DYNAMIC_FEATURES. * Make everyone use ast_rdlock_call_features(), ast_unlock_call_features(), and new ast_wrlock_call_features() instead of directly calling the rwlock API on features_lock. 2013-04-10 15:34 +0000 [r385236] David M. Lee * main/stasis_channels.c: Fixed manager channelvars support. For the events that have been ported to Stasis, this was broken in r384910, when a couple of lines of code was lost in a merge. 2013-04-10 14:26 +0000 [r385174-385202] Matthew Jordan * /, res/res_config_ldap.c: Use LDAP memory management functions instead of Asterisk's When MALLOC_DEBUG is enabled with res_config_ldap, issues (munmap_chunk: invalid pointer errors) can occur as the memory is being allocated with Asterisk's wrappers around malloc/calloc/free/strdup, as opposed to the LDAP library's wrappers. This patch uses the LDAP library's wrappers where appropriate, so that compiling with MALLOC_DEBUG doesn't cause more problems than it solves. Note that the patch listed below was modified slightly for this commit to account for some additional memory allocation/deallocations. (closes issue ASTERISK-17386) Reported by: John Covert Tested by: Andrew Latham patches: issue18789-1.8-r316873.patch uploaded by seanbright (License 5060) ........ Merged revisions 385190 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385199 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, channels/chan_sip.c: Fix crash in chan_sip when a core initiated op occurs at the same time as a BYE When a BYE request is processed in chan_sip, the current SIP dialog is detached from its associated Asterisk channel structure. The tech_pvt pointer in the channel object is set to NULL, and the dialog persists for an RFC mandated period of time to handle re-transmits. While this process occurs, the channel is locked (which is good). Unfortunately, operations that are initiated externally have no way of knowing that the channel they've just obtained (which is still valid) and that they are attempting to lock is about to have its tech_pvt pointer removed. By the time they obtain the channel lock and call the channel technology callback, the tech_pvt is NULL. This patch adds a few checks to some channel callbacks that make sure the tech_pvt isn't NULL before using it. Prime offenders were the DTMF digit callbacks, which would crash if AMI initiated a DTMF on the channel at the same time as a BYE was received from the UA. This patch also adds checks on sip_transfer (as AMI can also cause a callback into this function), as well as sip_indicate (as lots of things can queue an indication onto a channel). Review: https://reviewboard.asterisk.org/r/2434/ (closes issue ASTERISK-20225) Reported by: Jeff Hoppe ........ Merged revisions 385170 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385173 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-09 19:58 +0000 [r385142] Richard Mudgett * main/features.c: Rename struct feature_ds to struct feature_datastore. Because "struct feature_ds *feature_ds" is not a good thing. 2013-04-09 18:22 +0000 [r385116] David M. Lee * apps/app_stasis.c: Backported app_stasis fix from stasis-http branch. The hash and compare functions for the control container was reusing the wrong ones, causing some problems. I fixed it, but in the wrong branch. Oh well, it happens. 2013-04-09 06:16 +0000 [r385088] Russell Bryant * main/features.c, CHANGES: Add inheritance support to FEATURE()/FEATUREMAP(). The settings saved on the channel for FEATURE()/FEATUREMAP() were only for that channel. This patch adds the ability to have these settings inherited to child channels if you set FEATURE(inherit)=yes. Closes issue ASTERISK-21306. Review: https://reviewboard.asterisk.org/r/2415/ 2013-04-08 23:38 +0000 [r385049] Rusty Newton * /, configs/extconfig.conf.sample: Modified the list of keys for the driver backends for sake of sample clarity Added a line showing the mapping of "mysql" to res_config_mysql available in add-ons. We used "mysql" as an example driver key in the sample, but didn't show what module it mapped too. Also added a subtitle above the list of keys for driver backends. ........ Merged revisions 385047 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385048 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-08 18:24 +0000 [r384989] Walter Doekes * build_tools/make_buildopts_h, build_tools/make_linker_version_script, Makefile, build_tools/mkpkgconfig, build_tools/make_version: Clean up Makefile "warning" clutter when makeopts doesn't exist. Review: https://reviewboard.asterisk.org/r/2304 2013-04-08 15:38 +0000 [r384910-384942] Matthew Jordan * res/res_http_websocket.c, res/res_stasis_websocket.c: Don't attempt a websocket protocol removal if res_http_websocket isn't there This patch sets the protocols container provided by res_http_websocket to NULL when the module gets unloaded and adds the necessary checks when adding/ removing a websocket protocol. This prevents some FRACKing on an invalid pointer to the disposed container if a module that uses res_http_websocket is unloaded after it. * apps/app_stasis.c, main/manager_channels.c, apps/app_dial.c, main/pbx.c, main/channel_internal_api.c, tests/test_stasis_channels.c (added), include/asterisk/app_stasis.h, apps/app_userevent.c, include/asterisk/channel.h, CHANGES, main/channel.c, main/dial.c, include/asterisk/stasis_channels.h (added), main/features.c, apps/stasis_json.c, pbx/pbx_realtime.c, main/stasis_channels.c (added): Add multi-channel Stasis messages; refactor Dial AMI events to Stasis This patch does the following: * A new Stasis payload has been defined for multi-channel messages. This payload can store multiple ast_channel_snapshot objects along with a single JSON blob. The payload object itself is opaque; the snapshots are stored in a container keyed by roles. APIs have been provided to query for and retrieve the snapshots from the payload object. * The Dial AMI events have been refactored onto Stasis. This includes dial messages in app_dial, as well as the core dialing framework. The AMI events have been modified to send out a DialBegin/DialEnd events, as opposed to the subevent type that was previously used. * Stasis messages, types, and other objects related to channels have been placed in their own file, stasis_channels. Unit tests for some of these objects/messages have also been written. 2013-04-08 13:27 +0000 [r384879] David M. Lee * main/json.c, res/res_stasis_websocket.c (added), main/frame.c, apps/Makefile, tests/test_abstract_jb.c, apps/app_stasis.exports.in (added), apps/stasis_json.c (added), include/asterisk/app_stasis.h (added), include/asterisk/json.h, include/asterisk/localtime.h, tests/test_app_stasis.c (added), include/asterisk/frame.h, apps/app_stasis.c (added), tests/test_json.c: Stasis application WebSocket support This is the API that binds the Stasis dialplan application to external Stasis applications. It also adds the beginnings of WebSocket application support. This module registers a dialplan function named Stasis, which is used to put a channel into the named Stasis app. As a channel enters and leaves the Stasis diaplan application, the Stasis app receives a 'stasis-start' and 'stasis-end' events. Stasis apps register themselves using the stasis_app_register and stasis_app_unregister functions. Messages are sent to an application using stasis_app_send. Finally, Stasis apps control channels through the use of the stasis_app_control object, and the family of stasis_app_control_* functions. Other changes along for the ride are: * An ast_frame_dtor function that's RAII_VAR safe * Some common JSON encoders for name/number, timeval, and context/extension/priority Review: https://reviewboard.asterisk.org/r/2361/ 2013-04-06 16:00 +0000 [r384857] Joshua Colp * tests/test_sorcery_astdb.c (added), res/res_sorcery_astdb.c (added): Add a res_sorcery_astdb module which uses the astdb to persist objects. Review: https://reviewboard.asterisk.org/r/2420/ 2013-04-05 20:41 +0000 [r384828] Michael L. Young * /, channels/chan_sip.c, UPGRADE-11.txt: Fix For Not Overriding The Default Settings In chan_sip The initial report was that the "nat" setting in the [general] section was not having any effect in overriding the default setting. Upon confirming that this was happening and looking into what was causing this, it was discovered that other default settings would not be overriden as well. This patch works similar to what occurs in build_peer(). We create a temporary ast_flags structure and using a mask, we override the default settings with whatever is set in the [general] section. In the bug report, the reporter who helped to test this patch noted that the directmedia settings were being overriden properly as well as the nat settings. This issue is also present in Asterisk 1.8 and a separate patch will be applied to it. (issue ASTERISK-21225) Reported by: Alexandre Vezina Tested by: Alexandre Vezina, Michael L. Young Patches: asterisk-21225-handle-options-default-prob_v4.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2385/ ........ Merged revisions 384827 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-04 18:15 +0000 [r384696-384760] Richard Mudgett * main/event.c: Separate some event struct definitions from instantiation. * channels/chan_dahdi.c, configs/chan_dahdi.conf.sample, UPGRADE.txt: chan_dahdi: Change inband_on_proceeding option default to no/disabled. (issue ASTERISK-21151) * channels/sig_pri.h, channels/chan_dahdi.c, configs/chan_dahdi.conf.sample, /, channels/sig_pri.c: chan_dahdi: Add inband_on_proceeding compatibility option. The new inband_on_proceeding option causes Asterisk to assume inband audio may be present when a PROCEEDING message is received. Q.931 Section 5.1.2 says the network cannot assume that the CPE side has attached to the B channel at this time without explicitly sending the progress indicator ie informing the CPE side to attach to the B channel for audio. However, some non-compliant ISDN switches send a PROCEEDING without the progress indicator ie indicating inband audio is available and assume that the CPE device has connected the media path for listening to ringback and other messages. ASTERISK-17834 which causes this issue was dealing with a non-compliant network switch. (closes issue ASTERISK-21151) Reported by: Gianluca Merlo Tested by: rmudgett ........ Merged revisions 384685 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384689 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-03 17:17 +0000 [r384642] Matthew Jordan * funcs/func_channel.c, /: Update documentation for CHANNEL function Document that you can read/write the 'accountcode' and 'amaflags' on a channel. ........ Merged revisions 384640 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384641 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-03 16:01 +0000 [r384616] Richard Mudgett * main/astobj2.c: astobj2: Fix rbtree duplicate handling. OBJ_PARTIAL_KEY searching a rbtree did not find all possible matches if the container did not accept duplicates. Added matching node bias to indicate which matching node is being searched for: first, last, any. 2013-04-02 17:35 +0000 [r384546] David M. Lee * Makefile, /: Fixed spurious rebuilds of func_version. func_version.so was being rebuilt every time, because build.h was changing every build, because of the cleantest dependency that was added in r384410 to fix parallel make bugs. Now build.h will only be created if it does not exist, which was the original behavior of the Makefile. ........ Merged revisions 384544 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384545 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-02 12:18 +0000 [r384518] Joshua Colp * main/sorcery.c: Pass the object type name to the configuration framework. 2013-04-02 11:40 +0000 [r384514] Matthew Jordan * main/xmldoc.c, include/asterisk/app.h: Make things work again Sorry folks. ',' are still greater than '|'. Thanks for playing along :-) 2013-04-01 20:10 +0000 [r384488] David M. Lee * contrib/scripts/install_prereq: install_prereq: Build jansson from source, when necessary When r383579 was committed, it made Jansson a required dependency. While libjansson-dev and jansson-devel are available on recent distros, some older (but still supported) distros don't have it. There's a pull request[1] to get it into repoforge, but that still doesn't help everyone. (And helps no one until the pull request is merged and packages are built). This patch adds Jansson install from source to the install_unpackaged() function. There are a few gotcha's, which makes this change not completely trivial. * Since Jansson may be installed by a package, don't install from source if a package installation can be found * libresample may also be installed via package, so I added a similar check to that. * Since Jansson installs into /usr/local, this patch also adds /usr/local/lib to /etc/ld.so.conf.d so that the library can be found. * The alternative was to install into /usr, but then it gets complicated having to deal with EL's /usr/lib{32,64} shenanigans. [1]: https://github.com/repoforge/rpms/pull/250 Review: https://reviewboard.asterisk.org/r/2414/ 2013-04-01 14:44 +0000 [r384452] Matthew Jordan * main/xmldoc.c, include/asterisk/app.h: Make appropriate items parse using '|' instead of ',' This patch fixes a bug introduced in r76703, wherein Asterisk could only parse arguments in the so-called 'recommended' way, e.g., NoOp(foo,bar). The proper syntax of NoOp,foo|bar is now parsed correctly. 2013-04-01 14:10 +0000 [r384416] Joshua Colp * /, apps/app_voicemail.c: Remove silly use of strncmp. ........ Merged revisions 384414 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-04-01 13:37 +0000 [r384412-384413] David M. Lee * main/stasis.c, tests/test_stasis.c: stasis: Fixed message ordering issues when forwarding This patch fixes an issue of message ordering that occurs when multiple topics are forwarded to an aggregator topic (such as ast_channel_topic_all()). It is (very reasonably) expected that the rules governing message dispatch order still apply, so long as the messages start from the same thread, and are received by the same subscription. Because the existing code had an additional layer of dispatching via the Stasis thread pool for forwards, those promises couldn't be kept. Forwarding subscriptions no longer have their own mailbox, and now dispatch directly from the forwarding topic's stasis_publish() call. This means that the topic's lock is held for the duration of not only a message's dispatch, but the dispatch of all the forwards. This shouldn't be a problem right now, but if an aggregator topic had many subscribers, it could become a problem. But I figure we can write more clever code when the time comes, if necessary. Review: https://reviewboard.asterisk.org/r/2419/ * /, Makefile: Fix parallel make problems. Occasionally, make -j would fail due to missing includes, or other unusual errors. This was due to the 'cleantest' target, which was designed to force a make clean when some change in the code would cause the typical depedency checking to fail. Several targets in the main Makefile did not depend upon cleantest, hence would run in parallel to it. By adding the dependency, make -j runs happily now. Review: https://reviewboard.asterisk.org/r/2418/ ........ Merged revisions 384410 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384411 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-30 05:15 +0000 [r384389-384390] Matthew Jordan * main/manager.c: Properly format an intmax_t value * include/asterisk/test.h, main/manager.c, main/test.c, apps/app_voicemail.c: Convert TestEvent AMI events over to Stasis Core This patch migrates the TestEvent AMI events to first be dispatched over the Stasis-Core message bus. This helps to preserve the ordering of the events with other events in the AMI system, such as the various channel related events. 2013-03-29 16:37 +0000 [r384327] Jonathan Rose * apps/app_voicemail.c: app_voicemail: Add blank argument to externnotify if no context argument At least one call to run_externnotify provides a NULL context parameter and because the snprintf statement doesn't account for a NULL context parameter, it simply writes '(null)' to the arguments string instead. This patch makes it write two quotes back to back for that argument instead in the event of a NULL context. (closes issue ASTERISK-18207) Reported by: Barry L. Kline Patches: modified from patch-20130306 uploaded by Karsten Wemheuer (License 5930) ........ Merged revisions 384325 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384326 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-28 23:59 +0000 [r384302] Richard Mudgett * main/sorcery.c, main/stasis.c, main/uuid.c, res/res_calendar_exchange.c, res/res_sorcery_config.c, include/asterisk/uuid.h, tests/test_uuid.c: Add uuid wrapper API call ast_uuid_generate_str(). * Updated test_uuid.c to test the new API call. * Made system use the new API call to eliminate "10's of lines" where used. * Fixed untested ast_strdup() return in stasis_subscribe() by eliminating the need for it. struct stasis_subscription now contains the uniqueid[] string. * Fixed some issues in exchangecal_write_event(): Create uid with enough space for a UUID string to avoid a realloc. Fix off by one error if the calendar event provided a UUID string. There is no need to check for NULL before calling ast_free(). 2013-03-28 15:45 +0000 [r384219-384261] Kinsey Moore * include/asterisk/stasis.h, main/app.c, pbx/pbx_realtime.c, include/asterisk/channel.h, tests/test_stasis.c, main/manager_channels.c, main/stasis.c, apps/app_voicemail.c, main/channel.c, main/pbx.c, main/stasis_cache.c: Break the world. Stasis message type accessors should now all be named correctly. * main/app.c, res/res_xmpp.c, channels/chan_iax2.c, channels/sig_pri.c, res/res_jabber.c, channels/chan_mgcp.c, channels/chan_unistim.c, channels/chan_dahdi.c, include/asterisk/app.h, channels/chan_sip.c, channels/chan_skinny.c: Convert MWI state message type to the new stasis naming convention 2013-03-27 21:52 +0000 [r384201] David M. Lee * include/asterisk/app.h, include/asterisk/stasis.h, include/asterisk/channel.h: Added a doxygen group for Stasis messages and topics 2013-03-27 19:52 +0000 [r384164] Kinsey Moore * main/format_pref.c, /, channels/chan_sip.c: Address uninitialized conditional that valgrind found ........ Merged revisions 384162 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384163 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-27 18:52 +0000 [r384120] Matthew Jordan * /, main/http.c: Fix a file descriptor leak in off nominal path While looking at the security vulnerability in ASTERISK-20967, Walter noticed a file descriptor leak and some other issues in off nominal code paths. This patch corrects them. Note that this patch is not related to the vulnerability in ASTERISK-20967, but the patch was placed on that issue. (closes issue ASTERISK-20967) Reported by: wdoekes patches: issueA20967_file_leak_and_unused_wkspace.patch uploaded by wdoekes (License 5674) ........ Merged revisions 384118 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384119 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-27 17:07 +0000 [r384050] Kinsey Moore * res/res_rtp_asterisk.c, /: Fix white noise on SRTP decryption When res_rtp_asterisk.c was altered to avoid attempting to apply unprotect algorithms to non-audio RTP packets, the test used was incorrect. This caused the audio packets to not be decrypted and resulted in loud white noise on the other endpoint (or both endpoints depending on the call legs involved). The test now properly checks the version field in the RTP header to ensure that RTP and RTCP are decrypted while other types of packets are not. (closes issue ASTERISK-21323) Reported by: andrea Tested by: Kinsey Moore, andrea, John Bigelow Patches: whitenoise_fix.diff uploaded by Kinsey Moore ........ Merged revisions 384048 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384049 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-27 15:27 +0000 [r383975-384019] Matthew Jordan * channels/sip/include/sip.h, /, channels/chan_sip.c, channels/sip/security_events.c: AST-2013-003: Prevent username disclosure in SIP channel driver When authenticating a SIP request with alwaysauthreject enabled, allowguest disabled, and autocreatepeer disabled, Asterisk discloses whether a user exists for INVITE, SUBSCRIBE, and REGISTER transactions in multiple ways. The information is disclosed when: * A "407 Proxy Authentication Required" response is sent instead of a "401 Unauthorized" response * The presence or absence of additional tags occurs at the end of "403 Forbidden" (such as "(Bad Auth)") * A "401 Unauthorized" response is sent instead of "403 Forbidden" response after a retransmission * Retransmission are sent when a matching peer did not exist, but not when a matching peer did exist. This patch resolves these various vectors by ensuring that the responses sent in all scenarios is the same, regardless of the presence of a matching peer. This issue was reported by Walter Doekes, OSSO B.V. A substantial portion of the testing and the solution to this problem was done by Walter as well - a huge thanks to his tireless efforts in finding all the ways in which this setting didn't work, providing automated tests, and working with Kinsey on getting this fixed. (closes issue ASTERISK-21013) Reported by: wdoekes Tested by: wdoekes, kmoore patches: AST-2013-003-1.8 uploaded by kmoore, wdoekes (License 6273, 5674) AST-2013-003-10 uploaded by kmoore, wdoekes (License 6273, 5674) AST-2013-003-11 uploaded by kmoore, wdoekes (License 6273, 5674) ........ Merged revisions 384003 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, main/http.c: AST-2013-002: Prevent denial of service in HTTP server AST-2012-014, fixed in January of this year, contained a fix for Asterisk's HTTP server for a remotely-triggered crash. While the fix put in place fixed the possibility for the crash to be triggered, a denial of service vector still exists with that solution if an attacker sends one or more HTTP POST requests with very large Content-Length values. This patch resolves this by capping the Content-Length at 1024 bytes. Any attempt to send an HTTP POST with Content-Length greater than this cap will not result in any memory allocation. The POST will be responded to with an HTTP 413 "Request Entity Too Large" response. This issue was reported by Christoph Hebeisen of TELUS Security Labs (closes issue ASTERISK-20967) Reported by: Christoph Hebeisen patches: AST-2013-002-1.8.diff uploaded by mmichelson (License 5049) AST-2013-002-10.diff uploaded by mmichelson (License 5049) AST-2013-002-11.diff uploaded by mmichelson (License 5049) ........ Merged revisions 383978 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_format_attr_h264.c, /: AST-2013-001: Prevent buffer overflow through H.264 format negotiation The format attribute resource for H.264 video performs an unsafe read against a media attribute when parsing the SDP. The value passed in with the format attribute is not checked for its length when parsed into a fixed length buffer. This patch resolves the vulnerability by only reading as many characters from the SDP value as will fit into the buffer. (closes issue ASTERISK-20901) Reported by: Ulf Harnhammar patches: h264_overflow_security_patch.diff uploaded by jrose (License 6182) ........ Merged revisions 383973 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-27 07:24 +0000 [r383948] Damien Wedhorn * channels/chan_skinny.c: Fix skinny encall button to not blind xfer. The softbutton endcall should not turn a transfer into a blind transfer but hangup the exten being called and leave the original call on hold. This does that. (closes issue ASTERISK-21321) Reported by: wedhorn Tested by: snuffy, myself Patches: skinny-xferendcall01.diff uploaded by wedhorn (license 5019) 2013-03-26 23:34 +0000 [r383925] Joshua Colp * main/sorcery.c: Remove the noop handler from sorcery so it does not produce an empty value. 2013-03-26 02:30 +0000 [r383841-383879] Matthew Jordan * /, channels/chan_sip.c: Resolve deadlock between SIP registration and channel based functions In r373424, several reentrancy problems in chan_sip were addressed. As a result, the SIP channel driver is now properly locking the channel driver private information in certain operations that it wasn't previously. This exposed two latent problems either in register_verify or by functions called by register_verify. This includes: * Holding the private lock while calling sip_send_mwi_to_peer. This can create a new sip_pvt via sip_alloc, which will obtain the channel container lock. This is a locking inversion, as any channel related lock must be obtained prior to obtaining the SIP channel technology private lock. Note that this issue was already fixed in Asterisk 11. * Holding the private lock while calling sip_poke_peer. In the same vein as sip_send_mwi_to_peer, sip_poke_peer can create a new SIP private, causing the same locking inversion. Note that this locking inversion typically occured when CLI commands were run while a SIP REGISTER request was being processed, as many CLI commands (such as 'sip show channels', 'core show channels', etc.) have to obtain the channel container lock. (issue ASTERISK-21068) Reported by: Nicolas Bouliane (issue ASTERISK-20550) Reported by: David Brillert (issue ASTERISK-21314) Reported by: Badalian Vyacheslav (issue ASTERISK-21296) Reported by: Gabriel Birke ........ Merged revisions 383863 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383878 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/cdr.c, /: Resolve deadlock between pending CDR and batch CDR locks r375757 attempted to resolve a race condition between multiple submissions of CDRs while in batch mode from attempting to destroy the scheduled batch submission by extending the batch CDR lock. Unfortunately, this causes a deadlock between the pending CDR lock and the batch CDR lock. This patch resolves the intent of r375757 by simply providing a new lock that protects the scheduling of the batches. The original batch CDR lock is kept to protect manipulation of the batch CDR settings, but has been placed such that it is not held when the pending lock is held. Thanks to Chase Venters for providing lock analysis on the issue. (issue ASTERISK-21162) Reported by: Chase Venters ........ Merged revisions 383839 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383840 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-26 01:46 +0000 [r383837-383838] Russell Bryant * channels/chan_skinny.c: Suppress compiler warning. This code caused a compiler warning when --enable-dev-mode was not used. The warning was that this variable was set but not used. That was indeed the case as the only place this is used is as an argument to SKINNY_DEBUG which is compiled out when not in dev mode. * /, apps/app_meetme.c: Fix multi-station answer race condition. When an SLA trunk is ringing (inbound call on the trunk) Asterisk will make outbound calls to the stations that have that trunk. If more than one station answers the call at the same time, all channels other than the first one to answer are left in a bad state. The channel gets leaked, is not connected to anything, and there's no way to get rid of it. We now properly clean up these losing channels by hanging up on them. Since they lost the race, as we process their answer, there is no ringing trunk for them to answer. ........ Merged revisions 383835 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383836 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-25 23:25 +0000 [r383799] Richard Mudgett * /, channels/sig_pri.c: Set the CALLERID(dnid-num-plan) for incoming ISDN calls. The CALLEDTON channel variable is set for incoming ISDN calls to the lower 7 bits of the Q.931 type-of-number/numbering-plan octet. The CALLERID(dnid-num-plan) should have the same value. (closes issue ASTERISK-21248) Reported by: rmudgett ........ Merged revisions 383796 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383798 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-25 20:15 +0000 [r383753-383754] Kinsey Moore * main/manager_channels.c: Fix typo * main/stasis.c: Fix missing ' ' around '=' 2013-03-25 19:28 +0000 [r383726-383747] David M. Lee * contrib/scripts/install_prereq: install_prereq: removed some out-of-date comments * contrib/scripts/install_prereq: install_prereq: Adding jansson-devel to RH packages * main/channel_internal_api.c, include/asterisk/channel.h, CHANGES, main/manager_channels.c, main/channel.c, main/manager.c: Move NewCallerid, HangupRequest and SoftHangupRequest to Stasis HangupRequest and SoftHangupRequest are now ast_channel_blob Stasis messages, with the cause code as an optional field in the blob. NewCallerid now simply watches for changes in the callerid information in channel snapshots, and creates the AMI event appropriately. Since the original NewCallerid event honored the channelvars setting in manager.conf, the channel variables configured there had to become a part of the channel snapshot. These are now a part of every snapshot based event, making the configuration description "every time a channel-oriented event is emitted" less of a lie. There a a few other changes wrapped up in here as well. * When ast_channel_topic() is given NULL for a channel, it returns the ast_channel_topic_all() topic instead of NULL. This can clean up a lot of NULL checking we're doing currently. * The fields Cause and Cause-txt were removed from the base channel information and put only on the Hangup events, since those fields are meaningless outside of a Hangup event. * Removed the pipe-delimiter processing of the channelvars field, since that's been deprecated forever. (closes issue ASTERISK-21096) Review: https://reviewboard.asterisk.org/r/2405/ 2013-03-25 12:38 +0000 [r383669] Sean Bright * res/res_config_curl.c, /: Properly delimit post data in res_config_curl. ........ Merged revisions 383667 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383668 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-22 20:51 +0000 [r383633] David M. Lee * main/json.c, main/Makefile: Fixed another issue from r383579. Core modules don't honor flags in MODULEINFO, which broke jansson if specified --with-jansson to configure. 2013-03-22 20:43 +0000 [r383632] Michael L. Young * apps/app_mixmonitor.c, /: Fix StopMixMonitor Hanging Up When Unable To Stop MixMonitor On A Channel A regression was accidentally introduced when allowing an optional ID to be used when calling StopMixMonitor. When we are unable to stop MixMonitor on a channel, -1 is being returned which triggers the hangup of the channel. This patch restores the prior behavior by returning 0 whether we were successful or not. It also allows the call from the manager to use the return code when the action fails. (closes issue ASTERISK-21294) Reported by: daroz Tested by: daroz Patches: asterisk-21294-stop_mixmonitor_hangingup.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2404/ ........ Merged revisions 383631 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-22 19:26 +0000 [r383579-383611] David M. Lee * main/asterisk.c, main/json.c, include/asterisk/json.h: Corrected some module issues introduced by r383579. When I moved res_json.c to json.c, I left the MODULE_INFO stuff in there, which was interesting if you ran module show. I also forgot to call what was in module_load() from asterisk main(). * pbx/pbx_realtime.c, main/manager_channels.c (added), tests/test_json.c, res/res_json.c (removed), main/pbx.c, include/asterisk/autoconfig.h.in, configure.ac, apps/app_userevent.c, include/asterisk/channel.h, CHANGES, include/asterisk/manager.h, main/channel.c, main/json.c (added), main/manager.c, configure, res/res_json.exports.in (removed): Move more channel events to Stasis; move res_json.c to main/json.c. This patch started out simply as fixing the bouncing tests introduced in r382685, but required some other changes to give it a decent implementation. To fix the bouncing tests, the UserEvent and Newexten AMI events needed to be refactored to dispatch via Stasis. Dispatching directly to AMI resulted in those events sometimes getting ahead of the associated Newchannel events, which would understandably confuse anyone. I found that instead of creating a zillion different message types and structures associated with them, it would be preferable to define a message type that has a channel snapshot and a blob of structured data with a small bit of additional information. The JSON object model provides a very nice way of representing structured data, so I went with that. * Move JSON support from res_json.c to main/json.c * Made libjansson-dev a required dependency * Added an ast_channel_blob message type, which has a channel snapshot and JSON blob of data. * Changed UserEvent and Newexten events so that they are dispatched via ast_channel_blob messages on the channel's topic. * Got rid of the ast_channel_varset message; used ast_channel_blob instead. * Extracted the manager functions converting Stasis channel events to AMI events into manager_channel.c. (issue ASTERISK-21096) Review: https://reviewboard.asterisk.org/r/2381/ 2013-03-22 06:32 +0000 [r383560] Damien Wedhorn * channels/chan_skinny.c: Fix skinny voicemail indication issues. Unsubscribe from MWI stasis event on channel reload. (closes issue ASTERISK-21216) Reported by: wedhorn Tested by: snuffy, myself Patches: skinny-mwiind02.diff uploaded by snuffy (license 5024) 2013-03-21 20:09 +0000 [r383541] David M. Lee * include/asterisk/stasis.h: Corrected doc error for Stasis. I guess the mutex isn't necessary. Thanks, rmudgett! 2013-03-21 17:41 +0000 [r383519] Richard Mudgett * include/asterisk/astobj2.h: Fix astobj2 doxygen comment. 2013-03-20 20:27 +0000 [r383458-383462] Walter Doekes * funcs/func_curl.c, /: Have func_curl log a warning when a curl request fails. Review: https://reviewboard.asterisk.org/r/2403/ ........ Merged revisions 383460 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383461 from http://svn.asterisk.org/svn/asterisk/branches/11 * funcs/func_curl.c, /: Minor cleanup in func_curl near hashcompat code. Review: https://reviewboard.asterisk.org/r/2402/ ........ Merged revisions 383457 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-20 16:01 +0000 [r383422] Kinsey Moore * main/stasis.c: Resolve a race condition in Stasis Because of the way that topics were handled when publishing, it was possible to dispatch a message to a subscription after that subscription had been unsubscribed such that the dispatched message arrived at the callback after the callback had received its final message. In callbacks that cleaned up user data, this would often cause a segfault. This has been resolved by locking the topic during the entirety of dispatch. To prevent long publishing and topic locking times, forwarding subscriptions have been made to be standard subscriptions instead of mailboxless subscriptions which were dispatched at publishing time. 2013-03-20 14:52 +0000 [r383405] Joshua Colp * main/sorcery.c, res/res_sorcery_memory.c, include/asterisk/sorcery.h, tests/test_sorcery.c: Pass the sorcery instance to wizards for CUD operations as well as retrieve. 2013-03-19 19:07 +0000 [r383377] Kinsey Moore * main/stasis_message_router.c: Fix lock destruction/unlock inversion When using scoped locks, the unref of an AO2 object should happen after the unlock occurs which requires usage of scoped refs. 2013-03-19 16:00 +0000 [r383343] David M. Lee * codecs/Makefile, /: Multiple revisions 383341-383342 ........ r383341 | dlee | 2013-03-19 10:57:29 -0500 (Tue, 19 Mar 2013) | 5 lines Removed codecs/g722/*.i on make clean ........ Merged revisions 383340 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ r383342 | dlee | 2013-03-19 10:58:33 -0500 (Tue, 19 Mar 2013) | 1 line Remove codecs/speex/*.i on make clean ........ Merged revisions 383341-383342 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-16 16:00 +0000 [r383284-383287] Kinsey Moore * res/res_jabber.c, channels/chan_mgcp.c: Make sure things compile... * channels/sip/include/sip.h, main/asterisk.c, channels/chan_mgcp.c, apps/app_voicemail.c, channels/chan_unistim.c, channels/chan_sip.c, include/asterisk/stasis.h, res/res_xmpp.c, channels/sig_pri.c, channels/chan_iax2.c, res/res_jabber.c, main/stasis.c, channels/sig_pri.h, main/channel.c, include/asterisk/app.h, channels/chan_dahdi.c, channels/chan_skinny.c, include/asterisk/xmpp.h, apps/app_minivm.c, main/app.c: Transition MWI to Stasis-core Remove MWI's dependency on the event system by moving it to Stasis-core. This also introduces forwarding topic pools in Stasis-core which aggregate many dynamically allocated topics into a single primary topic. Review: https://reviewboard.asterisk.org/r/2368/ (closes issue ASTERISK-21097) Patch-by: Kinsey Moore 2013-03-16 15:40 +0000 [r383267-383283] Joshua Colp * res/res_xmpp.c, CHANGES: Add support for using XMPP buddy state via device state. This change allows you to use XMPP buddy state in places where device state can be used be used, such as dialplan hints. If at least one resource is available the buddy is considered available. Now your phone can reflect their IM status too! * res/res_xmpp.c, /: Fix a bug where resources were not found due to hashing on the priority itself. ........ Merged revisions 383266 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-15 17:35 +0000 [r383225-383242] David M. Lee * main/stasis_cache.c, main/stasis_message_router.c (added), main/stasis_message.c, include/asterisk/stasis_message_router.h (added), tests/test_stasis.c, main/stasis.c: A simplistic router for stasis_message's. Often times, when subscribing to a topic, one wants to handle different message types differently. While one could cascade if/else statements through the subscription handler, it is much cleaner to specify a different callback for each message type. The stasis_message_router is here to help! A stasis_message_router is constructed for a particular stasis_topic, which is subscribes to. Call stasis_message_router_unsubscribe() to cancel that subscription. Once constructed, routes can be added using stasis_message_router_add() (or stasis_message_router_set_default() for any messages not handled by other routes). There may be only one route per stasis_message_type. The route's callback is invoked just as if it were a callback for a subscription; but it only gets called for messages of the specified type. (issue ASTERISK-20887) Review: https://reviewboard.asterisk.org/r/2390/ * configs/stasis_core.conf.sample (added): Sample config file for stasis-core. (issue ASTERISK-20887) 2013-03-15 13:04 +0000 [r383167-383169] Kinsey Moore * tests/test_stasis.c, main/manager.c, main/channel_internal_api.c: Take advantage of the fact that stasis_unsubscribe now returns NULL * main/stasis.c, main/stasis_cache.c, include/asterisk/stasis.h: Make stasis unsubscription functions return NULL Unsubscribing things in Asterisk seems to very commonly follow with NULLing out the variable that was unsubscribed. This change makes that a bit simpler. * main/tcptls.c, main/manager.c, /, channels/chan_sip.c, main/http.c: tcptls: Prevent unsupported options from being set AMI, HTTP, and chan_sip all support TLS in some way, but none of them support all the options that Asterisk's TLS core is capable of interpreting. This prevents consumers of the TLS/SSL layer from setting TLS/SSL options that they do not support. This also gets tlsverifyclient closer to a working state by requesting the client certificate when tlsverifyclient is set. Currently, there is no consumer of main/tcptls.c in Asterisk that supports this feature and so it can not be properly tested. Review: https://reviewboard.asterisk.org/r/2370/ Reported-by: John Bigelow Patch-by: Kinsey Moore (closes issue AST-1093) ........ Merged revisions 383165 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383166 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-15 01:38 +0000 [r383122-383126] Matthew Jordan * /, channels/chan_sip.c: When a session timer expires during a T.38 call, re-invite with correct SDP When a session timer expires during a dialog that has re-negotiated to T.38 and Asterisk is the refresher, Asterisk will send a re-INVITE with an SDP containing audio media only. This causes some hilarity with the poor fax session under weigh. This patch corrects that by sending T.38 parameters if we are in the middle of a T.38 session. (closes issue ASTERISK-21232) Reported by: Nitesh Bansal patches: dont-send-audio-reinvite-for-sess-timer-in-t38-call.patch uploaded by nbansal (License 6418) ........ Merged revisions 383124 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383125 from http://svn.asterisk.org/svn/asterisk/branches/11 * pbx/pbx_spool.c, /: Fix processing of call files when using KQueue on OS X In certain situations, call files are not processed when using KQueue with pbx_spool. Asterisk was sending an invalid timeout value when the spool directory is empty, causing the call to kevent to error immediately. This can create a tight loop, increasing the CPU load on the system. (closes issue ASTERISK-21176) Reported by: Carlton O'Riley patches: kqueue_osx.patch uploaded by coriley (License 6473) ........ Merged revisions 383120 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383121 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-14 16:57 +0000 [r383063] Jason Parker * /, autoconf/ast_ext_lib.m4: Fix whitespace in AST_EXT_LIB_CHECK macro. ........ Merged revisions 383061 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 383062 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-13 14:39 +0000 [r383008] Matthew Jordan * res/res_rtp_asterisk.c: Always set the RTP instance data in the RTP engine Not informing the RTP engine of the instance data creates shrapnel. 2013-03-12 22:43 +0000 [r382989] Andrew Latham * res/res_config_ldap.c: Update Doxygen Push some cleanups upstream before testing another ticket. (issue ASTERISK-20259) 2013-03-12 21:19 +0000 [r382941-382954] Michael L. Young * addons/res_config_mysql.c, /: Fix Sorting Order For Parking Lots Stored In Static Realtime When retrieving the parking lots from a MySQL database table, the current order is "filename, cat_metric desc, var_metric asc, category". If there are multiple parking lots with the same cat_metric but different categories, everything is being sorted on cat_metric first resulting in errors when loading the parking lots. This patch fixes the problem by sorting on the category field first, then the cat_metric field. (closes issue ASTERISK-21035) Reported by: Alex Epshteyn Patches: asterisk-21035-orderby.diff Michael L. Young (license 5026) ........ Merged revisions 382942 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382943 from http://svn.asterisk.org/svn/asterisk/branches/11 * contrib/realtime/mysql/sippeers.sql, /, contrib/realtime/postgresql/realtime.sql: Update Contributed Realtime Schema Files - IPv6 Addresses This commit updates some fields in the contributed realtime schema files to handle IPv6 addresses. (closes issue ASTERISK-21173) Reported by: Torrey Searle Patches: realtime_sql.patch Torrey Searle (license 5334) asterisk-21173-update-ip-fields.diff Michael L. Young (license 5026) ........ Merged revisions 382939 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382940 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-12 20:07 +0000 [r382924] Joshua Colp * res/res_xmpp.c, /: Fix a crash when res_xmpp is configured using a username without a domain. (closes issue ASTERISK-21156) Reported by: amsoft2001 ........ Merged revisions 382923 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-12 19:08 +0000 [r382900] Jason Parker * build_tools/menuselect-deps.in, configure, include/asterisk/autoconfig.h.in, configure.ac, res/Makefile, CHANGES, makeopts.in, res/pjproject (removed), res/res_rtp_asterisk.c: Switch to using external pjproject libraries. ICE/STUN/TURN support in res_rtp_asterisk is also now optional. 2013-03-12 16:30 +0000 [r382852] Matthew Jordan * /, channels/chan_sip.c: Include the Username field in SIP Registry events when Status is registered In ASTERISK-17888, the AMI Registry event during SIP registrations was supposed to include the Username field. Somehow, one of the events was missed. This patch corrects that - the Username field should be included in all AMI Registry events involving SIP registrations. (issue ASTERISK-17888) (closes issue ASTERISK-21201) Reported by: Dmitriy Serov patches: chan_sip.c.diff uploaded by Dmitriy Serov (license 6479) ........ Merged revisions 382847 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382848 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-12 08:55 +0000 [r382828] Igor Goncharovskiy * channels/chan_unistim.c, /: Fix core dump on CLI usage Fix issue with 'unistim show info' CLI command when device connected not configured ........ Merged revisions 382827 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-11 15:22 +0000 [r382787] Kevin Harwell * CHANGES, channels/sip/include/sip.h, channels/chan_sip.c: Added an option to disallow music on hold Added an option "discard_remote_hold_retrieval" (default "no") that if set does not trigger the music on hold event. This essentially stops telling the peer to start music on hold. (issue ABE-2899) Reported by: Denis Alberto Martinez Review: https://reviewboard.asterisk.org/r/2336/ 2013-03-09 00:21 +0000 [r382764] Richard Mudgett * apps/confbridge/include/conf_state.h, apps/confbridge/conf_state_multi.c, apps/app_confbridge.c, apps/confbridge/conf_state_multi_marked.c, apps/confbridge/conf_state_empty.c, apps/confbridge/conf_state.c, apps/confbridge/conf_config_parser.c, apps/confbridge/conf_state_single.c, apps/confbridge/conf_state_inactive.c, apps/confbridge/conf_state_single_marked.c, apps/confbridge/include/confbridge.h: confbridge: Rename items for clarity and consistency. struct conference_bridge_user -> struct confbridge_user struct conference_bridge -> struct confbridge_conference struct conference_state -> struct confbridge_state struct conference_bridge_user *conference_bridge_user -> struct confbridge_user *user struct conference_bridge_user *cbu -> struct confbridge_user *user struct conference_bridge *conference_bridge -> struct confbridge_conference *conference The names are now generally shorter, consistently used, and don't conflict with the struct names. This patch handles the renaming part of the issue. (issue ASTERISK-20776) Reported by: rmudgett 2013-03-08 20:26 +0000 [r382746] Jonathan Rose * /, channels/chan_sip.c: chan_sip: Update the via header when relaying SMS MESSAGE Prior to this change, certain conditions for sending the message would result in an address of '(null)' being used in the via header of the SIP message because a NULl value of pvt->ourip was used when initially generating the via header. This is fixed by adding a call to build_via when the address is set before sending the message. (closes issue ASTERISK-21148) Reported by: Zhi Cheng Patches: 700-sip_msg_send_via_fix.patch uploaded by Zhi Cheng (license 6475) ........ Merged revisions 382739 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-08 16:59 +0000 [r382721-382724] David M. Lee * main/stasis_cache.c, include/asterisk/stasis.h: Stasis documentation updates. (issue ASTERISK-20887) (issue ASTERISK-20959) * main/stasis.c, main/channel.c, main/channel_internal_api.c: Ensure dummy channels get a stasis topic. Fixes test failure introduced in r382685. (issue ASTERISK-20887) (issue ASTERISK-20959) 2013-03-08 16:00 +0000 [r382705] Kinsey Moore * include/asterisk/stasis.h, tests/test_stasis.c, main/stasis_cache.c: Add message dump capability to stasis cache layer The cache dump mechanism allows the developer to retreive multiple items of a given type (or of all types) from the cache residing in a stasis caching topic in addition to the existing single-item cache retreival mechanism. This also adds to the caching unit tests to ensure that the new cache dump mechanism is functioning properly. Review: https://reviewboard.asterisk.org/r/2367/ (issue ASTERISK-21097) 2013-03-08 15:15 +0000 [r382685] David M. Lee * include/asterisk/channel.h, tests/test_stasis.c (added), main/asterisk.c, main/stasis.c (added), main/channel.c, main/stasis_cache.c (added), main/pbx.c, main/stasis_message.c (added), main/manager.c, main/asterisk.exports.in, include/asterisk/channel_internal.h, main/channel_internal_api.c, include/asterisk/stasis.h (added): This patch adds a new message bus API to Asterisk. For the initial use of this bus, I took some work kmoore did creating channel snapshots. So rather than create AMI events directly in the channel code, this patch generates Stasis events, which manager.c uses to then publish the AMI event. This message bus provides a generic publish/subscribe mechanism within Asterisk. This message bus is: - Loosely coupled; new message types can be added in seperate modules. - Easy to use; publishing and subscribing are straightforward operations. In addition to basic publish/subscribe, the patch also provides mechanisms for message forwarding, and for message caching. (issue ASTERISK-20887) (closes issue ASTERISK-20959) Review: https://reviewboard.asterisk.org/r/2339/ 2013-03-08 04:11 +0000 [r382670-382671] Matthew Jordan * channels/chan_sip.c: Remove unused function After r382670, get_ip_and_port_from_sdp was no longer used. * channels/chan_sip.c: Don't reset the RTP address on a glare re-INVITE Originally, way back in r201583, we added the alternate RTP address so that the RTP engine would expect to receive audio from a new source when a glare re-INVITE occurred. In r382589, we remove the alternate RTP source, as the 'secret' probation mode allows for switching to a new RTP source when a previous source stops sending RTP. At the time, it seemed appropriate to set the RTP source based on the information in the glared re-INVITE. Unfortunately, that doesn't work so well - in a glared re-INVITE that occurs with no SDP - such as in a connected line update that glances - we'll set the RTP source to an invalid address. In subsequent re-INVITE requests from this Asterisk instance, we'll then send an invalid media address, which will result in the remote side sending a 488. Whoops. There isn't any need to reset the RTP source - if we're using strictrtp, we'll simply synchronize to a new source when we stop getting packets from the old one. If we aren't using strictrtp, then again there shouldn't be a problem. Note that the Asterisk Test Suite's connectedline test caught this error. 2013-03-07 21:55 +0000 [r382648] David M. Lee * main/threadpool.c: Changing log level of "Not changing threadpool size" from notice to debug. 2013-03-07 21:14 +0000 [r382636] Jason Parker * res/res_sorcery_config.c, res/res_sorcery_memory.c: Load sorcery modules earlier, so they can actually be used. 2013-03-07 19:14 +0000 [r382621] Matthew Jordan * apps/app_voicemail.c, /: Let vm_mailbox_snapshot combine "Urgent" when no folder is specified r381835 fixed a bug in vm_mailbox_snapshot where combining INBOX and Old forgot that Urgent also "counts" as new messages. This fixed the problem when any of the three folders was specified and the combine option was used. It missed the case where the folder isn't specified and we build a snapshot of all folders. This patch corrects that. ........ Merged revisions 382617 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-07 16:48 +0000 [r382600-382604] Kinsey Moore * main/xmldoc.c: Fix a memory leak in xmldoc Another instance of attribute retrieval not being freed properly. * main/xmldoc.c: Resolve more memory leaks in xmldoc Many places that allocated to pull out an attribute are now freed properly. 2013-03-07 15:48 +0000 [r382589] Matthew Jordan * include/asterisk/rtp_engine.h, res/res_rtp_asterisk.c, main/rtp_engine.c, /, channels/chan_sip.c: Add a 'secret' probation strictrtp mode to handle delayed changes in RTP source Often, Asterisk may realize that a change in the source of an RTP stream is about to occur and ask that the RTP engine reset it's lock on the current RTP source. In certain scenarios, it may take awhile for the new remote system to send RTP packets, while the old remote system may continue providing RTP during that time period. This causes Asterisk to re-lock onto the old source, thereby rejecting the new source when the old source stops sending RTP and the new source begins. This patch prevents that by having a constant secondary, 'secret' probation mode enabled when an RTP source has been chosen. RTP packets from other sources are always considered, but never chosen unless the current RTP source stops sending RTP. Review: https://reviewboard.asterisk.org/r/2364 (closes issue AST-1124) Reported by: John Bigelow Tested by: John Bigelow (closes issue AST-1125) Reported by: John Bigelow Tested by: John Bigelow ........ Merged revisions 382573 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-07 15:36 +0000 [r382489-382587] Kinsey Moore * main/xmldoc.c: Fix minor memory leak in xmldoc Strings retrieved via ast_xml_get_text() must be freed with ast_xml_free_text(). * /, main/logger.c: Ensure that logmsgs are freed properly Messages sent while the logger thread is shutting down will now have their associated callid freed properly. ........ Merged revisions 382574 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/threadpool.c: Fix ref leak in threadpool.c If ast_threadpool_set_size with a size equal to the current size, a reference to a set_size_data structure would be leaked. * main/threadpool.c: Resolve a ref leak in threadpool.c Ownership of the listener reference is not transferred because the listener is reffed when placed into the taskprocessor. Ensure that the listener is dereffed properly. 2013-03-05 13:14 +0000 [r382440] Matthew Jordan * configs/res_ldap.conf.sample, contrib/realtime/postgresql/realtime.sql, configs/sip.conf.sample, CHANGES, contrib/scripts/asterisk.ldap-schema, contrib/scripts/asterisk.ldif, channels/sip/include/sip.h, CREDITS, contrib/realtime/mysql/sippeers.sql, channels/chan_sip.c: Add RFC 3327 Path header support to chan_sip This patch adds support for RFC 3327 "Path" headers. This can be enabled in sip.conf using the 'supportpath' setting, either on a global basis or on a peer basis. This setting enables Asterisk to route outgoing out-of-dialog requests via a set of proxies by using a pre-loaded route-set defined by the Path headers in the REGISTER request. This patch also adds Realtime support for dynamically updating the Path information for a peer. A huge thank-you to Klaus Darillion and Olle E Johansson for their efforts in writing this patch. Review: https://reviewboard.asterisk.org/r/2235/ Review: https://reviewboard.asterisk.org/r/991/ (closes issue ASTERISK-16884) Reported by: klaus3000 Tested by: klaus3000, oej, mjordan patches: path-1.8.0-patch.txt uploaded by klaus3000 (License 5054) oolong-path-support-trunk in team branch by oej (License 5267) 2013-03-05 03:53 +0000 [r382411] Igor Goncharovskiy * /, channels/chan_unistim.c: Fix several unreleased mutex locks that cause problem with processing calls Reported by: Daniel Bohling Tested by: Daniel Bohling (Closes issue ASTERISK-21119) ........ Merged revisions 382409 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382410 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-04 21:15 +0000 [r382392] Richard Mudgett * include/asterisk/format_cap.h, main/bridging.c: Fixup some bridge and format capabilities comments and whitespace. 2013-03-04 21:14 +0000 [r382391] Jason Parker * /, main/event.c: Fix comparison of presence state in event subsystem. Several new IEs were not given types (or names), causing the comparison function to improperly succeed. This adds those. (closes issue AST-1128) ........ Merged revisions 382390 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-04 20:18 +0000 [r382386] Kevin Harwell * /, apps/app_confbridge.c: Confbridge CLI new record file name check. This fix checks to make sure that if a confbridge record start command is issued from the CLI it will always use the file name given on the CLI even if it changes between start/stop records for a conference. Previously it had been reusing the same file between start/stops even if a new filename was given. (issue AST-1088) Reported by: John Bigelow ........ Merged revisions 382385 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-03-01 18:01 +0000 [r382340] Joshua Colp * include/asterisk/sorcery.h, tests/test_sorcery.c, main/sorcery.c: Add support for registering a sorcery handler which supports multiple fields using a regex. Review: https://reviewboard.asterisk.org/r/2332/ 2013-03-01 04:32 +0000 [r382323] Michael L. Young * contrib/realtime/postgresql/realtime.sql, CHANGES, contrib/realtime/mysql/sippeers.sql, /, channels/chan_sip.c: Fix / Clean Up Some Items To Handle The New auto_* NAT Options The original report had to do with a realtime peer behind NAT being pruned and the peer's private address being used instead of its external address. Upon debugging, it was discovered that this was being caused by the addition of the auto_force_rport and auto_comedia settings. This patch does the following: * Adds a missing note to the CHANGES file indicating that the default global nat setting is auto_force_rport * Constify the 'req' parameter for check_via() * Add calls to check_via() in a couple of places in order for the auto_* settings to do their job in attempting to determine if NAT is involved * Set the flags SIP_NAT_FORCE_RPORT and SIP_PAGE2_SYMMETRICRTP if the auto_* settings are in use where it was needed * Moves the copying of peer flags up in build_peer() to before they are used; this fixes the realtime prune issue * Update the contrib/realtime schemas to allow the nat column to handle the different nat setting combinations we have This patch received a review and "Ship It!" on the issue itself. (closes issue ASTERISK-20904) Reported by: JoshE Tested by: JoshE, Michael L. Young Patches: asterisk-20904-nat-auto-and-rt-peersv2.diff Michael L. Young (license 5026) ........ Merged revisions 382322 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-28 21:59 +0000 [r382297-382299] Joshua Colp * /, res/res_rtp_asterisk.c: While the ICE negotiation is occurring leave strictrtp in an open state, media can and will come from different places. ........ Merged revisions 382298 from http://svn.asterisk.org/svn/asterisk/branches/11 * res/res_rtp_asterisk.c, /: Fix a bug with ICE and strictrtp where media could get dropped. If the end result of the ICE negotiation resulted in the path for media changing it was possible for the strictrtp code to discard the RTP packets. This change causes strictrtp to enter learning mode once again when the ICE negotiation has completed successfully. ........ Merged revisions 382296 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-28 21:31 +0000 [r382294-382295] Richard Mudgett * main/threadpool.c: threadpool: Make ast_threadpool_push() return -1 if shutting_down * include/asterisk/threadpool.h, main/threadpool.c: threadpool: Whitespace and comment corrections. 2013-02-28 21:21 +0000 [r382292] Jason Parker * res/res_rtp_asterisk.c, include/asterisk.h: Don't undefine bzero()/bcopy(). This was causing build failures against external libraries that happened to use them, unless silly hacks were added to the modules that used those headers. Review: https://reviewboard.asterisk.org/r/2359/ 2013-02-28 17:17 +0000 [r382232-382236] Matthew Jordan * /, channels/chan_iax2.c: Prevent deadlock in chan_iax2 when attempting to set caller ID A deadlock can occur in chan_iax2 when it attempts to set the caller ID, as it already holds the iax2 private lock and improperly fails to obtain the channel lock before calling ast_set_callerid. By not safely obtaining the channel lock, a locking inversion can take place, causing a deadlock. This patch solves this by calling the required deadlock avoidance functions that obtain the channel lock before setting the caller ID. Thanks to Pavel for fixing my syntax errors and testing this patch out. (closes issue ASTERISK-21128) Reported by: Pavel Troller Tested by: Pavel Troller patches: ASTERISK-21128-1.8.diff uploaded by mjordan (license 6283) ASTERISK-21128-modified-1.8.diff uploaded by Pavel Troller (license 6302) ........ Merged revisions 382233 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382234 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, apps/app_meetme.c, CHANGES: Let channels joining a MeetMe conference opt out of the denoiser For some channel drivers, specifically those that have a varying rate in the number of audio samples, the audio quality for a MeetMe conference can be exceedingly poor. This is due to a unilateral application of the DENOISE function in func_speex to channels joining the conference. The denoiser function in the speex library is initialized with the number of audio samples in each sample that will be provided to it. If the number of audio samples changes, the denoiser has to be thrown away and re-initialized. While this could be worked around by removing func_speex, that doesn't help if you actually use the denoiser with other channels on the system. This patches does the following: * Checks for the presence of func_speex as opposed to codec_speex when determining if the DENOISE function is present (which is where the function is actually implemented) * Adds an option to MeetMe 'n' that causes the denoiser to not be applied to a channel when it joins. This keeps the current behavior the default, but let's users disable the denoiser if it causes problems on their system. Review: https://reviewboard.asterisk.org/r/2358 (closes issue AST-1062) Reported by: Thomas Arimont ........ Merged revisions 382227 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382230 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-27 20:31 +0000 [r382203-382204] Richard Mudgett * channels/chan_skinny.c: More places to eliminate the cast to argv but were not giving warnings. * channels/chan_skinny.c: Fix compiler warning by eliminating the need for a cast. 2013-02-27 16:19 +0000 [r382182] Joshua Colp * /, channels/chan_sip.c: Relax dialog checking in get_sip_pvt_byid_locked so it works when the dialog is forked. (closes issue ASTERISK-20638) Reported by: eelcob Patches: pedantic-call-pickup-from-tag.patch uploaded by eelcob (license 6442) ........ Merged revisions 382171 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382174 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-26 20:05 +0000 [r382113] Tzafrir Cohen * /, configure, configure.ac: Consider linux-gnuspe as linux-gnu * The powerpcspe Linux port uses linux-gnuspe as the OS string. * Our build system shouldn't really care for that, so just call it linux-gnu. * Original report: Roland Stigge , http://bugs.debian.org/701505 Review: https://reviewboard.asterisk.org/r/2357/ ........ Merged revisions 382110 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382111 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-26 19:36 +0000 [r382109] Walter Doekes * /, channels/chan_sip.c: Correct RPID parsing for unquoted display-name. Parsing Remote-Party-ID will now succeed if display-name is of the *(token LWS) kind and not just the quoted-string kind. Review: https://reviewboard.asterisk.org/r/2341/ ........ Merged revisions 382107 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382108 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-26 19:29 +0000 [r382106] Tzafrir Cohen * /, main/Makefile: Remove unneeded linux-gnueabi* As of r380522 the configure scripts converts the value of linux-gnueabi* of OSARCH to "linux-gnu". So no point in testing for those values. ........ Merged revisions 382087 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382096 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-26 15:52 +0000 [r382067-382070] Matthew Jordan * apps/app_confbridge.c, /: Clean up ConfBridge commands to account for wait_marked users When ConfBridge was refactored to better handle the concept of marked, wait_marked, and normal users co-existing in a conference (thereby implementing a state machine for the conference), the wait_marked users were put into their own list of conference participants, separate from the active users. This list is used for wait_marked users when they are waiting in a conference but no marked user has joined; normal users may have joined at this point however. There are several AMI/CLI commands that affect conference users that were not checking the wait_marked users list: * CLI/AMI commands that mute/unmute a participant. In this case, wait_marked users have to remain in their particular state and should not be affected - however, the commands would return "Channel not found" as opposed to the appropriate error condition. * CLI/AMI commands that kick a participant. An admin should always be able to kick a participant out of the conference. This patch fixes both sets of commands, and cleans up the CLI commands slightly by allowing them to complete a participant name (this was supposed to have been added, but the function call was commented out and wasn't implemented). Review: https://reviewboard.asterisk.org/r/2346/ (closes issue AST-1114) Reported by: John Bigelow Tested by: John Bigelow ........ Merged revisions 382068 from http://svn.asterisk.org/svn/asterisk/branches/11 * configs/confbridge.conf.sample, /, apps/confbridge/conf_config_parser.c: Ensure that the default bridge/user profiles are always available ConfBridge and Page require that there always be a default bridge and user profile available. While properties of the default profiles can be overriden in the configuration file, removing them can create situations where neither application can function properly. This patch ensures that if an administrator removes the profiles from the confbridge.conf configuration file, the profiles are added upon load. Documentation clarifying this has been added to the confbridge.conf.sample file. Review: https://reviewboard.asterisk.org/r/2356/ (closes issue AST-1115) Reported by: John Bigelow Tested by: John Bigelow ........ Merged revisions 382066 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-25 12:51 +0000 [r382023] Matthew Jordan * addons/res_config_mysql.c, /: Clean up use of va_end/va_args in res_config_mysql There were several problems using variadic argument macros in res_config_mysql. * Improper use of va_end. Multiple calls to va_end were possible resulting in an unbalanced matching of va_start/va_end. * Calls to va_arg after a possible encounter of a SENTINEL value. This patch corrects those errors. (closes issue ASTERISK-19451) Reported by: wdoekes patches: ASTERISK-19451-1.8--2.diff uploaded by wdoekes (License 5674) ........ Merged revisions 382021 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 382022 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-25 07:09 +0000 [r382007-382008] Damien Wedhorn * channels/chan_skinny.c: More called details fixup for skinny. Basically sets the callerid and callername to the first device talked to for the purposes of putting the the calls made log on the device. Does not affect the device displaying who the device is currently talking to. Also some minor changes to use sub->exten in lieu of l->lastnumberdialed. (closes issue ASTERISK-21095) Reported by: wedhorn Tested by: snuffy, myself Patches: skinny-calllogsoutbound03.diff uploaded by wedhorn (license 5019) * channels/chan_skinny.c: Add prinotify messages to skinny. Adds both fixed and variable prinotify messages and clearprinotify messages to skinny. Also adds cli function for pushing messages to devices. i Initial code by snuffy, expanded by myself to include fixed messages. (closes issue ASTERISK-21091) Reported by: snuffy Tested by: snuffy, myself Patches: skinny-prinotify02.diff uploaded by wedhorn (license 5019) 2013-02-24 23:01 +0000 [r381918-381977] Matthew Jordan * channels/chan_jingle.c, /: Set the sin_family on the bind address socket during initialization Somehow, chan_jingle has managed to operate for years without setting the sin_family on its bindaddr socket. This patch properly sets the field during initial module load to AF_INET. Note that the patch on the issue was modified slightly to change the initialization of the socket from allocation of a chan_jingle private to the module initialization, as the bindaddr object (which is static) only needs to have the address set once. (closes issue ASTERISK-19341) Reported by: andre valentin patches: 0105-chan_jingle.patch uploaded by avalentin (License 6064) ........ Merged revisions 381975 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381976 from http://svn.asterisk.org/svn/asterisk/branches/11 * main/manager.c, /: Don't display the AMI ALL class authorization for users if they don't have it When converting AMI class authorizations to a string representation, the method always appends the ALL class authorization. This is especially important for events, as they should always communicate that class authorization - even if the event itself does not specify ALL as a class authorization for itself. (Events have always assumed that the ALL class authorization is implied when they are raised) Unfortunately, this did mean that specifying a user with restricted class authorizations would show up in the 'manager show user' CLI command as having the ALL class authorization. Rather then modifying the existing string manipulation function, this patch adds a function that will only return a string if the field being compared explicitly matches class authorization field it is being compared against. This prevents ALL from being returned unless it is actually specified for the user. (closes issue ASTERISK-20397) Reported by: Johan Wilfer ........ Merged revisions 381939 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381943 from http://svn.asterisk.org/svn/asterisk/branches/11 * /, apps/app_parkandannounce.c: Make ParkAndAnnounce return to priority + 1 when return context is not defined The ParkAndAnnounce application documentation for the optional return_context parameter states the following: return_context The goto-style label to jump the call back into after timeout. Default 'priority+1'. Unfortunately, the application was sending the channel back into the dialplan at 'priority', which is the ParkAndAnnounce application call. This causes an infinite loop of the channel constantly being parked, announced, timed out, parked, announced, timed out... while fun, especially for those callers you wish to drive to the end of madness, this was not the intent of the application. (closes issue ASTERISK-20113) Reported by: serginuez patches: app_parkandannounce.diff uploaded by serginuez (License 6405) ........ Merged revisions 381916 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381917 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-22 19:40 +0000 [r381894] Michael L. Young * /, res/res_agi.c: Fix FastAGI To Properly Check For A Connection When IPv6 support was added to FastAGI, the intent was to have the ability to check all addresses resolved for a host since we might receive an IPv4 address and an IPv6 address. The problem with the current code, is that, since we are doing O_NONBLOCK, we get EINPROGRESS when calling ast_connect() but are ignoring this instead of handling it. We break out of the loop and continue on. When we later call ast_poll(), it succeeds but we never check if we have a connection or not on the socket level. We then attempt to send data to the host address that we think is setup and it fails. We then check the errno and see that we have "connection refused" and then return with agi failed. This patch does the following: * Handles EINPROGRESS by creating the function handle_connection() - ast_poll() was moved into this function - This function checks the results of the connection on the socket level after calling ast_poll() * Continues to the next address if the above fails to create a connection * Once all addresses resolved are tried and we still are unable to establish a connection, then we return that the FastAGI call failed (closes issue ASTERISK-21065) Reported by: Jeremy Kister Tested by: Jeremy Kister, Michael L. Young Patches: asterisk-21065_poll_correctly_v4.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2330/ ........ Merged revisions 381893 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-22 15:51 +0000 [r381881] Jonathan Rose * /, apps/app_dial.c: app_dial: Honor the 'c' flag when the calling party hangs up Apparently this feature became broken in 11, probably as a result of the Hangup Cause project. (closes issue ASTERISK-21113) Reprted by: Heiko Wundram Patches: app_dial.patch uploaded by Heiko Wundram (license 5822) ........ Merged revisions 381880 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-22 01:52 +0000 [r381869] Matthew Jordan * configure, configure.ac, /: Properly detect launchd Asterisk was a little too pro-active in claiming that it found launchd. On systems without launchd - such as FreeBSD - this resulted in certain items in Asterisk that conflict with launchd to not be selectable, such as res_timing_kqueue. (closes issue ASTERISK-20749) Reported by: Oleg Baranov ........ Merged revisions 381847 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381848 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-19 19:47 +0000 [r381792] Kevin Harwell * main/features.c: Write the correct callid to the data1 field in queue_log for transfer events. The incorrect callid was being written to the "data1" field in queue_log table for transfer events. The callid of the queue was being written instead of the transfer target's callid. This now gets the correct "transfer to" number and places that in the "data1" field of the queue_log table when a transfer event is triggered. (closes issue ASTERISK-19960) Reported by: vladimir shmagin ........ Merged revisions 381770 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381791 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-19 17:17 +0000 [r381749] Michael L. Young * channels/chan_motif.c, include/asterisk/module.h, res/snmp/agent.c, main/loader.c, main/cli.c: Add The Status Of A Module To The Output Of "CLI> module show" When a module's configuration is not loadable, we still load the module but it is not in a running state. When trying to troubleshoot, let's say, why chan_motif is ignoring inbound XMPP traffic, there is no way to indicate that a loaded module is not currently running. (closes issue ASTERISK-21108) Reported by: Rusty Newton Tested by: Michael L. Young Patches: asterisk-21108_add_status-v2.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2331/ 2013-02-19 16:23 +0000 [r381729-381741] Kevin Harwell * apps/app_confbridge.c: Confbridge channels staying active when all participants leave. If you started/stopped recording of a conference multiple times channels would remain active even when all participants left the conference. This was due to the fact that a reference to the confbridge was being added every time a start record command was issued, but when the recording was stopped there was no matching de-reference thus keeping the conference alive. Made sure only a single reference is added for the record thread no matter how many times recording is started/stopped. A de-reference is issued upon thread ending. Note, this issue is being fixed under AST-1088 since it relates to it and should have been corrected along with those modifications. (issue AST-1088) Reported by: John Bigelow ........ Merged revisions 381737 from http://svn.asterisk.org/svn/asterisk/branches/11 * CHANGES, apps/confbridge/conf_config_parser.c, apps/confbridge/include/confbridge.h, apps/app_confbridge.c: Added Confbridge record_file_append option. Currently, if one starts, stops, and then starts a recording again for a conference the recorded data is appended to the file originally created on the first record start. An option record_file_append has been added that defaults to "yes", but when set to "no" will force creation of a new file between every record start/stop. (issue AST-1088) Reported by: John Bigelow Review: http://reviewboard.digium.internal/r/374/ 2013-02-19 06:54 +0000 [r381717-381718] Damien Wedhorn * channels/chan_skinny.c, configs/skinny.conf.sample: Add serviceURL stuff to skinny. Patch adds all the packet and structure stuff to skinny to enable setting service URLs in skinny, such as corporate directories. This stuff is only relevant during load/unload as when activated. Also some minor changes removing duplicated counting of addons and speedials in handle_skinny_show_devices. Review: https://reviewboard.asterisk.org/r/2321/ * channels/chan_skinny.c: Fixup skinny CLI completion. Auto complete for skinny debug allows multiple options and negation, also add debug all option. Usage example: 'skinny debug all -packets' (each can be autocompleted including -packet). Change show device to use device name. Remove the duplicate ast_strdup's from place calling device complete return immediately from complete devicename and complete linename so that multiple options are displayed on the CLI if more than one option available. Review: https://reviewboard.asterisk.org/r/2333/ 2013-02-18 22:23 +0000 [r381703] Kevin Harwell * apps/app_confbridge.c, /: Fixed Confbridge file recording deadlock and appending. A deadlock occurred after starting/stopping and then restarting a confbridge recording. Upon starting a recording a record thread is created that holds a lock until just before exiting. Stopping the recording does not stop/exit the thread or release the lock. The thread waits until recording begins again. Starting a stopped recording signals the thread to continue and start recording again. However restarting the recording also created another record thread resulting in a deadlock. The fix was to make sure the record thread was only created once. Also it was noted that filenames for the recordings were being concatenated for each start/stop. This was fixed by creating a new file for each conference session and appending the actual recorded data within the file (e.g. passing the 'a' option to MixMonitor). (issue AST-1088) Reported by: John Bigelow Review: http://reviewboard.digium.internal/r/374/ ........ Merged revisions 381702 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-18 20:31 +0000 [r381670] Walter Doekes * configs/sip.conf.sample, /: Remove "registertrying" and add "rtp_engine" from/to sip.conf.sample The "registertrying" option was removed in r343220. The "rtp_engine" option was added in r186078 but erroneously named "engine" in the sample. Note that there is no global sip setting for a different engine. ........ Merged revisions 381668 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381669 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-18 19:48 +0000 [r381656] Jonathan Rose * funcs/func_presencestate.c, /: PRESENCE_STATE: Provide better documentation for the 'e' option. Notes that the 'e' option actually decodes data when used as a write function such as with the SET application while it encodes data when used to read. Review: https://reviewboard.asterisk.org/r/2335/ ........ Merged revisions 381655 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-18 19:12 +0000 [r381644] Richard Mudgett * apps/app_confbridge.c: confbridge: Add flags column to CLI "confbridge list " * Added the following flags to the CLI "confbridge list " output: A - The user is an admin M - The user is a marked user W - The user must wait for a marked user to join E - The user will be kicked after the last marked user leaves the conference w - The user is waiting for a marked user to join * Added the following header to the AMI ConfbridgeList events: WaitMarked, EndMarked, and Waiting. (closes issue AST-1101) Reported by: John Bigelow Patches: confbridge-show-admin3.txt (license #5091) patch uploaded by John Bigelow Modified 2013-02-16 20:44 +0000 [r381628] Richard Mudgett * apps/app_confbridge.c: confbridge: Rename i iterator variables to iter. 2013-02-16 16:28 +0000 [r381615] Matthew Jordan * /, channels/chan_sip.c: Don't send presencestate information if the state is invalid Previously, presencestate information was sent whenever the state was not NOT_SET. When r381594 actually returned INVALID presence state in all the places it was supposed to, it caused chan_sip to start adding presence state information to NOTIFY requests that it previously would not have added. chan_sip shouldn't be adding presence state information when the provider is in an invalid state; users can't set the state to invalid and an invalid state always implies that the provider is in an error condition. (issue AST-1084) ........ Merged revisions 381613 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-16 16:24 +0000 [r381614] Joshua Colp * res/res_sorcery_memory.c, include/asterisk/sorcery.h, tests/test_sorcery.c, main/sorcery.c, res/res_sorcery_config.c: Add support for retrieving multiple objects from sorcery using a regex on their id. Review: https://reviewboard.asterisk.org/r/2329/ 2013-02-15 23:29 +0000 [r381595] Matthew Jordan * /, main/presencestate.c, funcs/func_presencestate.c, main/manager.c: Fix crash in PresenceState AMI action when specifying an invalid provider This patch fixes a crash in Asterisk that could be caused by using the PresenceState AMI action while providing an invalid provider. This patch also adds some additional warnings when a user attempts to provide the PresenceState action with invalid data, and removes some NOTICE statements that were still lurking in the code from testing. (closes issue AST-1084) Reported by: John Bigelow Tested by: John Bigelow ........ Merged revisions 381594 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-15 18:51 +0000 [r381568] Mark Michelson * /, channels/chan_sip.c: Fix a crash that occurred when a BYE was received on a replaced dialog. Reference counting for the channel and its tech_pvt got messed up at some point between 1.8 and 11. The result was that if a BYE for a dialog that had been replaced (via an INVITE with Replaces) was received, Asterisk would crash due to trying to access data on a channel that was no longer there. The fix I introduced is to remove code that both unrefs the sip_pvt and sets the channel's tech_pvt to NULL when an INVITE with Replaces is handled. This way when a BYE is received, the tech_pvt will be non-NULL and so the BYE can be processed and not cause a crash. (closes issue ASTERISK-20929) reported by Kristopher Lalletti patches: ASTERISK-20929.patch uploaded by Mark Michelson (License #5049) ........ Merged revisions 381566 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-15 18:44 +0000 [r381567] Matthew Jordan * include/asterisk/sorcery.h, main/config_options.c, main/sorcery.c: Disable strict XML documentation config checking; fix crash caused by sorcery This patch does two things: 1. It disables (temporarily) strict XML documentation checking for module configurations. We should re-enable it before making any release from trunk. 2. Pass the module flag AST_MODULE through sorcery. This means several of the API calls are now macros and will do this automatically for you. The config framework needs the module that objects are registering to so it can properly construct the documentation. (This was already a required field, but sorcery was getting by without it) 2013-02-15 17:38 +0000 [r381557] Kevin Harwell * main/logger.c, include/asterisk/logger.h, main/autoservice.c: Stopped spamming of debug messages during attended transfer. While autoservice is running and servicing a channel the callid is being stored and removed in the thread's local storage for each iteration of the thread loop. If debug was set to a sufficient level the log file would be spammed with callid thread local storage debug messages. Added a new function that checks to see if the callid to be stored is different than what is already contained (if anything). If it is different then store/replace and log, otherwise just leave as is. Also made it so all logging of debug messages pertaining to the callid thread storage outputs only when TEST_FRAMEWORK is defined. (issue ASTERISK-21014) (closes issue ASTERISK-21014) Report by: Rusty Newton Review: https://reviewboard.asterisk.org/r/2324/ 2013-02-15 17:33 +0000 [r381556] Jonathan Rose * /, channels/chan_sip.c: chan_sip: Use video and text crypto attributes to append RTP profiles to SDP Some bad copy/pasting resulted in using the audio crypto attribute for both text and video RTP. Also the audio crypto isn't set until after these, so it was really just bad all around. (closes ASTERISK-20905) Reported by: Kristopher Lalletti patches: rtp_crypto_video_text.diff uploaded by Jonathan Rose (license 6182) ........ Merged revisions 381553 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-15 15:26 +0000 [r381527-381543] Matthew Jordan * /: Remove automerge propertrties added in r381527 * main/asterisk.c, main/xmldoc.c, main/udptl.c, include/asterisk/xml.h, /, main/xml.c, include/asterisk/_private.h, res/res_xmpp.c, main/named_acl.c, configs/motif.conf.sample, apps/confbridge/conf_config_parser.c, Makefile, include/asterisk/config_options.h, configs/xmpp.conf.sample, apps/app_skel.c, channels/chan_motif.c, include/asterisk/xmldoc.h, main/config_options.c, doc/appdocsxml.dtd: Add CLI configuration documentation This patch allows a module to define its configuration in XML in source, such that it can be parsed by the XML documentation engine. Documentation is generated in a two-pass approach: 1. The documentation is first generated from the XML pulled from the source 2. The documentation is then enhanced by the registration of configuration options that use the configuration framework This patch include configuration documentation for the following modules: * chan_motif * res_xmpp * app_confbridge * app_skel * udptl Two new CLI commands have been added: * config show help - show configuration help by module, category, and item * xmldoc dump - dump the in-memory representation of the XML documentation to a new XML file. Review: https://reviewboard.asterisk.org/r/2278 Review: https://reviewboard.asterisk.org/r/2058 patches: on review 2058 uploaded by twilson 2013-02-14 19:58 +0000 [r381470-381471] Damien Wedhorn * channels/chan_skinny.c: Remove extraneous stuff from r381470. * channels/chan_skinny.c: Add back sending dialnumber to skinny. Don't know why it seemed to work during testing, but it really is needed for protocol v17 (and probably above). 2013-02-14 19:52 +0000 [r381469] Richard Mudgett * /, main/features.c: End stuck DTMF if AST_SOFTHANGUP_ASYNCGOTO because it isn't a real hangup. It doesn't hurt to check AST_SOFTHANGUP_UNBRIDGE either, but it should not be set outside of a bridge. (issue ASTERISK-20492) ........ Merged revisions 381466 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381467 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-14 19:25 +0000 [r381465] Damien Wedhorn * channels/chan_skinny.c: Respect callerid presentation in skinny. Fix chan_skinny so that it respects callerID presentation of inbound calls to device and a couple of other minor fixes: 145 packet (add OCTAL_FROM amd callerid), and dont send dialednumber message if protocol >= 17. (closes issue ASTERISK-21066) Reported by: snuffy Tested by: snuffy, myself Patches: skinny-respect-clid-restrictions-v2.diff uploaded by snuffy (license 5024) 2013-02-14 18:47 +0000 [r381448] Kinsey Moore * main/logger.c, include/asterisk/term.h, apps/app_queue.c, main/asterisk.c, main/term.c, main/data.c, main/pbx.c, main/manager.c: Revamp of terminal color codes The core module related to coloring terminal output was old and needed some love. The main thing here was an attempt to get rid of the obscene number of stack-local buffers that were allocated for no other reason than to colorize some output. Instead, this uses a simple trick to allocate several buffers within threadlocal storage, then automatically rotates between them, so that you can make multiple calls to the colorization routine within one function and not need to allocate multiple buffers. Review: https://reviewboard.asterisk.org/r/2241/ Patches: bug.patch uploaded by Tilghman Lesher 2013-02-14 17:06 +0000 [r381398-381427] Sean Bright * channels/chan_iax2.c: Use a shuffling algorithm to find unused IAX2 call numbers. While adding red-black tree containers to astobj2 in r376575, Richard pointed out the way chan_iax2 finds unused call numbers will prevent ao2_container integrity checks at runtime. This patch removes the ao2_container and instead uses fixed sized arrays and a modified Fisher-Yates-Durstenfeld shuffle to maintain the call number list. While the locking semantics are similar to the ao2_container implementation, this implementation should be faster and more memory efficient. Review: https://reviewboard.asterisk.org/r/2288/ * include/asterisk/doxygen/asterisk-git-howto.h: Update the name of the update_tags utility in the git mirror how-to. 2013-02-14 03:49 +0000 [r381366] Matthew Jordan * apps/app_db.c, /: Don't throw a spurious error when using DBdeltree The function call ast_db_deltree returns the number of row deleted, or a negative number if it failed. DBdeltree was treating any non-zero return as an error, causing a spurious verbose error message to be displayed. This patch handles the return code of ast_db_deltree correctly. (closes issue ASTERISK-21070) Reported by: ianc patches: dbdeltree.diff uploaded by ianc (License #5955) ........ Merged revisions 381364 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381365 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-12 21:45 +0000 [r381326] David M. Lee * tests/test_threadpool.c, tests/test_taskprocessor.c, main/threadpool.c, main/taskprocessor.c, include/asterisk/threadpool.h: Add a serializer interface to the threadpool This patch adds the ability to create a serializer from a thread pool. A serializer is a ast_taskprocessor with the same contract as a default taskprocessor (tasks execute serially) except instead of executing out of a dedicated thread, execution occurs in a thread from a ast_threadpool. Think of it as a lightweight thread. While it guarantees that each task will complete before executing the next, there is no guarantee as to which thread from the pool individual tasks will execute. This normally only matters if your code relys on thread specific information, such as thread locals. This patch also fixes a bug in how the 'was_empty' parameter is computed for the push callback, and gets rid of the unused 'shutting_down' field. Review: https://reviewboard.asterisk.org/r/2323/ 2013-02-12 20:57 +0000 [r381307] Mark Michelson * main/rtp_engine.c, /: Do not allow native RTP bridging if packetization of media streams differs. The RTP engine will no longer allow for local and remote native RTP bridges if packetization of streams differs. Allowing native bridging in this scenario has been known to cause FAX failures. (closes ASTERISK-20650) Reported by: Maciej Krajewski Patches: ASTERISK-20659.patch uploaded by Mark Michelson (License #5049) Review: https://reviewboard.asterisk.org/r/2319 ........ Merged revisions 381281 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 381306 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-12 20:18 +0000 [r381285] Kinsey Moore * /, channels/chan_sip.c, channels/sip/security_events.c, channels/sip/include/sip.h: Fix some more REF_DEBUG-related build errors When sip_ref_peer and sip_unref_peer were exported to be usable in channels/sip/security_events.c, modifications to those functions when building under REF_DEBUG were not taken into account. This change moves the necessary defines into sip.h to make them accessible to other parts of chan_sip that need them. ........ Merged revisions 381282 from http://svn.asterisk.org/svn/asterisk/branches/11 2013-02-12 03:31 +0000 [r381256] Michael L. Young * apps/app_confbridge.c: Adding Some More Manager Events To ConfBridge Currently, ConfBridge does not send manager events for ConfbridgeMute, ConfbridgeUnmute, ConfbridgeStartRecord and ConfbridgeStopRecord. This patch adds these events to the manager. The reporter's patch moves some other events up to the beginning of the file. The patch being committed is based on the patch contributed from the reporter of this issue. I have made a lot of modifications to the patch in order for it to fit in better with what we currently are doing in the code when it comes to manager events. I also made a few changes to the elements on some of the events. (closes issue ASTERISK-20827) Reported by: Clint Davis Tested by: Clint Davis, Michael L. Young Patches: 20827.diff uploaded by Clint Davis (license 6453) asterisk-20827-confbridge-events.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2309/ 2013-02-11 21:17 +0000 [r381219] Kevin Harwell * /, apps/app_playback.c: Properly load say.conf upon reload of module app_playback. If say.conf did not exists prior to originally loading module app_playback it would not load on subsequent reloads of the module once it had been created. This occurred because upon reload of the app_playback module it would only load a new configuration if an old one had previously existed. This fix simply removed the association between checking if an old configuration existed and the loading of the new one. (closes issue ASTERISK-20800) Reported by: pgoergler ........ Merged revisions 381216 from http://svn.asterisk.org/s