summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-05-19res/res_http_websocket: Add a pre-session established callbackMatt Jordan
This patch updates http_websocket and its corresponding implementation with a pre-session established callback. This callback allows for WebSocket server consumers to be notified when a WebSocket connection is attempted, but before we accept it. Consumers can choose to reject the connection, if their application specific logic allows for it. As a result, this patch pulls out the previously private websocket_protocol struct and makes it public, as ast_websocket_protocol. In order to preserve backwards compatibility with existing modules, the existing APIs were left as-is, and new APIs were added for the creation of the ast_websocket_protocol as well as for adding a sub-protocol to a WebSocket server. In particular, the following new API calls were added: * ast_websocket_add_protocol2 - add a protocol to the core WebSocket server * ast_websocket_server_add_protocol2 - add a protocol to a specific WebSocket server * ast_websocket_sub_protocol_alloc - allocate a sub-protocol object. Consumers can populate this with whatever callbacks they wish to support, then add it to the core server or a specified server. ASTERISK-24988 Reported by: Joshua Colp Change-Id: Ibe0bbb30c17eec6b578071bdbd197c911b620ab2
2015-05-17chan_pjsip: Fix crash during off-nominal when no endpoint specified.snuffy
Add missing return -1 when no endpoint name is specified. ASTERISK-25086 #close Reported by: snuffy Change-Id: I9de76c2935a1f4e3f0cffe97a670106f5605e89e
2015-05-15res_pjsip_config_wizard/config: Fix template processingGeorge Joseph
The config wizard was always pulling the first occurrence of a variable from an ast_variable list but this gets the template value from the list instead of any overridden value. This patch creates ast_variable_find_last_in_list() in config.c and updates res_pjsip_config_wizard to use it instead of ast_variable_find_in_list. Now the overridden values, where they exist, are used instead of template variables. Updated test_config to test the new API. ASTERISK-25089 #close Reported-by: George Joseph <george.joseph@fairview5.com> Tested-by: George Joseph <george.joseph@fairview5.com> Change-Id: Ifa7ddefc956a463923ee6839dd1ebe021c299de4
2015-05-15cdr: Fix 'core show channel' CDR variable truncation.snuffy
When the new Bridging API was implemented, the workspace variable changed to a malloc'd string, causing sizeof() to always be 8 (char). Revert back to stored on stack string for workspace. ASTERISK-25090 #close Change-Id: I51e610ae87371df771ce7693a955510efb90f8f7
2015-05-14Merge "sorcery: Add API to insert/remove a wizard to/from an object type's ↵Joshua Colp
list" into 13
2015-05-14Merge "Message.c: Clear message channel frames on cleanup" into 13Joshua Colp
2015-05-14Merge "main/manager.c: Bugfix sort action_manager by alphabetically" into 13Joshua Colp
2015-05-13Message.c: Clear message channel frames on cleanupJonathan Rose
The message channel is a special channel that doesn't actually process frames. However, certain actions can cause frames to be placed in the channel's read queue including the Hangup application which is called on the channel after each message is processed. Since the channel will continually be reused for many messages, it's necessary to flush these frames at some point. ASTERISK-25083 #close Reported by: Jonathan Rose Change-Id: Idf18df73ccd8c220be38743335b5c79c2a4c0d0f
2015-05-13Merge "app_voicemail: fix moving when old messages full" into 13Joshua Colp
2015-05-13app_voicemail: fix moving when old messages fullJonathan Rose
When completing voicemail playback of a message in the 'INBOX', the message gets moved to the 'Old' messages folder. Without this patch, if the 'Old' folder is already at its set limit, then the 'INBOX' message will simply be deleted. With this patch, the flag to delete the message will be removed if the save_to_folder function indicates that the message could not be moved due to a full folder. ASTERISK-25082 #close Reported by: Jonathan Rose Review: https://gerrit.asterisk.org/#/c/448/ Change-Id: I2be440a09f42e2d06d50975c40d1ad7f836ecb3f
2015-05-13Merge "General: Fix recent menuselect-related cross compile regression" into 13Joshua Colp
2015-05-13Merge "res_config_mysql: Fix broken column type checking" into 13Joshua Colp
2015-05-13Merge "chan_dahdi/sig_pri: Fix crash on ISDN call hangup collision." into 13Joshua Colp
2015-05-13main/manager.c: Bugfix sort action_manager by alphabeticallyRodrigo Ramírez Norambuena
Fix the alphabetic order added on ast_manager_register_struct. The order for struct manager_action added is not working, this change fixes the problem. Change-Id: I149da0cd06c3c4445d7516cc303358e9f26f8b4b
2015-05-13res_config_mysql: Fix broken column type checkingAlexandre Fournier
MySQL configuration engine contains a bug in require_mysql(). This function is used for column type checking in tables. This bug only affects DATETIME, DATE and FLOAT types. It came from mixing the first condition (switch-case-like if/then/else), to check the expected column type, with the second condition, to check the actual column type against the expected column type. Both conditions must be checked separately in order to avoid the execution of the wrong block. ASTERISK-18252 #comment This patch might fix the issue Reported by: Gareth Blades ASTERISK-25041 #close Reported by: Alexandre Fournier Tested by: Alexandre Fournier Change-Id: I0b8bf7e68ab938be8e6525a249260cb648cb0bfa
2015-05-13res_rtp_asterisk: Correction for the limit which detects that a packet is DTLS.Yousf Ateya
First byte of DTLS packet shall be in range 20-63, not 20-64. Refer to RFC https://tools.ietf.org/html/rfc5764#section-5.1.2 for correct values. Change-Id: Iae6fa0d72b37c36a27fe40686e0ae6fba3afec31
2015-05-13Merge "cdr_pgsql: Use PQescapeStringConn for escaping names." into 13Joshua Colp
2015-05-12chan_dahdi/sig_pri: Fix crash on ISDN call hangup collision.Richard Mudgett
If an ISDN call is hungup by both sides at the same time a crash could happen. * Added missing NULL checks for the owner channel after calling pri_queue_pvt_cause_data() in two places. Code after those calls need to check the owner channel pointer for NULL before use because pri_queue_pvt_cause_data() needs to do deadlock avoidance to lock the owner and the owner may get hung up. ASTERISK-21893 #close Reported by: Alexandr Gordeev Change-Id: Ica3e266ebc7a894b41d762326f08653e1904bb9a
2015-05-12General: Fix recent menuselect-related cross compile regressionSebastian Kemper
MAKE_MENUSELECT currently sets CC to CC, which is the compiler for the target platform. But menuselect is to be run on the build system, so BUILD_CC needs to be used instead - like it was in the past, before the recent changes (https://reviewboard.asterisk.org/r/4370/). This is the patch for ASTERISK-25074. ASTERISK-25074 #close Reported by: Sebastian Kemper Tested by: Sebastian Kemper Change-Id: I8a2b1fc5deb6ad2b80f49baca35b1b13d468ebf8
2015-05-12sorcery: Add API to insert/remove a wizard to/from an object type's listGeorge Joseph
Currently you can 'apply' a wizard to an object type but the wizard always goes at the end of the object type's wizard list. This patch adds a new ast_sorcery_insert_wizard_mapping function that allows you to insert a wizard anyplace in the list. I.E. You could add a caching wizard to an object type and place it before all wizards. ast_sorcery_get_wizard_mapping_count and ast_sorcery_get_wizard_mapping were added to allow examination of the mapping list. ast_sorcery_remove_mapping was added to remove a mapping by name. As part of this patch, the object type's wizard list was converted from an ao2_container to an AST_VECTOR_RW. A new test was added to test_sorcery for this capability. ASTERISK-25044 #close Change-Id: I9d2469a9296b2698082c0989e25e6848dc403b57
2015-05-12Fix processing of asterisk.conf debug=yes.Corey Farrell
The code which reads asterisk.conf supports processing the debug option with ast_true, but ast_true returns -1. This causes debug to still be off, convert to 1 so debug will be on as requested. ASTERISK-25042 Reported by: Corey Farrell Change-Id: I3c898b7d082d914b057e111b9357fde46bad9ed6
2015-05-12cdr_pgsql: Use PQescapeStringConn for escaping names.Rodrigo Ramírez Norambuena
Use function PQescapeStringConn for escaping the name of the table and schema instead of doing it manually. Change-Id: I6709165e2d00463e9c813d24f17830ad4910b599
2015-05-12Merge "vector: Add REMOVE, ADD_SORTED and RESET macros" into 13Joshua Colp
2015-05-11vector: Add REMOVE, ADD_SORTED and RESET macrosGeorge Joseph
Based on feedback from Corey Farrell and Y Ateya, a few new macros have been added... AST_VECTOR_REMOVE which takes a parameter to indicate if order should be preserved. AST_VECTOR_ADD_SORTED which adds an element to a sorted vector. AST_VECTOR_RESET which cleans all elements from the vector leaving the storage intact. Change-Id: I41d32dbdf7137e0557134efeff9f9f1064b58d14
2015-05-11pbx/pbx_spool: Fix issue when call files were executed too earlyIvan Poddubny
pbx_spool used to delete/move the call file upon successful outgoing call completion, but did not delete it from in-memory list of files (dirlist, used only when compiled with inotify/kqueue support). That resulted in an extra attempt to process that filename after retrytime seconds. Then, if a new file with the same name appears that is scheduled in future further than the completed one plus its retrytime, then it gets executed earlier than expected. This patch fixes remove_from_queue function to also remove the entry from the dirlist. ASTERISK-17069 #close Reported by: Jeremy Kister ASTERISK-24442 #close Reported by: tootai Change-Id: If9ec9b88073661ce485d6b008fd0b2612e49a28b
2015-05-08configs/basic-pbx: Modified main IVR to play new Allison prompt.Rusty Newton
The main IVR was playing demo-congrats. I've switched it over to the basic-pbx-ivr-main file that we added in core sounds 1.4.27. This prompt has Allison prompting the user with the actual IVR menu. ASTERISK-24892 #close Change-Id: Ifb749616ff8e156a1031ddaddfcc9244767a095d
2015-05-08Merge "tcptls: Avoiding ERR_remove_state in OpenSSL." into 13Matt Jordan
2015-05-08res_rtp_asterisk: Issue ERROR if res_srtp is not found.Sean Bright
While trying to get WebRTC working with chan_pjsip, I was running into the following error: Attempted to set an invalid DTLS-SRTP configuration on RTP instance... Josh helpfully pointed out that res_srtp.so might not be loaded, and sure enough, it wasn't. This patch adds a ERROR indiciating as much to hopefully help others having a similar problem. Change-Id: I13aa477b47b299876728a21b130998a0ea6cd19f
2015-05-08sounds: Add Swedish sounds to Makefile and XMLRusty Newton
Added the necessary lines to the Makefile and sounds.xml so we'll have the Swedish sounds in all available formats in menuselect. See also: Swedish sounds were added into the core sounds release 1.4.27. ASTERISK-24744 #close Reported by: Tove Hjelm Tested by: Rusty Newton Change-Id: Ib6f4fd177afd1667b2402735034001d4d055a908
2015-05-08Merge "doc: Make progdocs play nice with git" into 13Joshua Colp
2015-05-08tcptls: Avoiding ERR_remove_state in OpenSSL.Alexander Traud
ERR_remove_state was deprecated with OpenSSL 1.0.0 and was replaced by ERR_remove_thread_state. ERR_load_SSL_strings and ERR_load_BIO_strings were called by SSL_load_error_strings already and got removed. These changes allow OpenSSL forks like BoringSSL to be used with Asterisk. ASTERISK-25043 #close Reported by: Alexander Traud patches: asterisk_with_BoringSSL.patch uploaded by Alexander Traud (License 6520) Change-Id: If1c0871ece21a7e0763fafbd2fa023ae49d4d629 (cherry picked from commit 247fef66537b59649e7571d64e2c574a106dbd65)
2015-05-07doc: Make progdocs play nice with gitGeorge Joseph
Moved contrib/asterisk-ng-doxygen to doc/asterisk-ng-doxygen.in Changed /Makefile to copy asterisk-ng-doxygen.in to asterisk-ng-doxygen then modify it with version instead of modifying asterisk-ng-doxygen directly. Updated clean targets as well. Updated /.gitignore and doc/.gitignore. Change-Id: I38712d3e334fa4baec19d30d05de8c6f28137622
2015-05-07Merge "res_pjsip_exten_state: Fix race condition between sending NOTIFY and ↵Joshua Colp
termination" into 13
2015-05-07contrib/editors: Fix vim syntax highlighting of comments in config filesIvan Poddubny
* Added a lookbehind to one-line comment matcher to skip escaped semicolons. * Added support for block comments. Change-Id: Id17dfaeda8ed4be572e8107a0c010066584aaee7
2015-05-07Merge "vector: Additional enhancements and fixes" into 13Matt Jordan
2015-05-07res_pjsip_exten_state: Fix race condition between sending NOTIFY and terminationJoshua Colp
The res_pjsip_exten_state module currently has a race condition between processing the extension state callback from the PBX core and processing the subscription shutdown callback from res_pjsip_pubsub. There is currently no synchronization between the two. This can present a problem as while the SIP subscription will remain valid the tree it points to may not. This is in particular a problem as a task to send a NOTIFY may get queued which will try to use the tree that may no longer be valid. This change does the following to fix this problem: 1. All access to the subscription tree is done within the task that sends the NOTIFY to ensure that no other thread is modifying or destroying the tree. This task executes on the serializer for the subscriptions. 2. A reference to the subscription serializer is kept to ensure it remains valid for the lifetime of the extension state subscription. 3. The NOTIFY task has been changed so it will no longer attempt to send a NOTIFY if the subscription has already been terminated. ASTERISK-25057 #close Reported by: Matt Jordan Change-Id: I0b3cd2fac5be8d9b3dc5e693aaa79846eeaf5643
2015-05-07Merge "chan_dahdi: Improve force_restart_unavailable_chans option ↵Matt Jordan
description." into 13
2015-05-07Merge "res_stasis_snoop: Spying on a single direction continually increases ↵Matt Jordan
CPU" into 13
2015-05-07Merge "features: Fix crash when transferee hangs up during DTMF attended ↵Joshua Colp
transfer." into 13
2015-05-06vector: Additional enhancements and fixesGeorge Joseph
After using the new vector stuff for real I found... A bug in AST_VECTOR_INSERT_AT that could cause a seg fault. The callbacks needed to be closer to ao2_callback in behavior WRT to CMP_MATCH and CMP_STOP behavior and the ability to return a vector of matched entries. A pre-existing issue with APPEND and REPLACE was also fixed. I also added a new macro to test.h that acts like ast_test_validate but also accepts a return code variable and a cleanup label. As well as printing the error, it sets the rc variable to AST_TEST_FAIL and does a goto to the specified label on error. I had a local version of this in test_vector so I just moved it. ASTERISK-25045 Change-Id: I05e5e47fd02f61964be13b7e8942bab5d61b29cc
2015-05-06res_stasis_snoop: Spying on a single direction continually increases CPUKevin Harwell
Creating a snoop channel in ARI and spying only on a single direction (in or out) results in CPU utilization continually increasing until the CPU is fully consumed. This occurs because frames are being put in the opposing direction's slin factory queue, but not being removed. Fixed the problem by always reading and disposing of frames from the opposite queue of the direction selected. ASTERISK-24938 #closes Change-Id: I935bfd15f1db958f364d9d6b3b45582c0113dd60
2015-05-06chan_dahdi: Improve force_restart_unavailable_chans option description.Richard Mudgett
ASTERISK-25034 Reported by: Richard Mudgett Change-Id: I1ff8f02124d2f4abd632a050da52c64285bb7f30
2015-05-06Merge "app_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameter" ↵Joshua Colp
into 13
2015-05-06Merge "res_ari_bridges: Add missing dependencies." into 13Matt Jordan
2015-05-05Merge "pbx_config: Register manager actions with module version of macro." ↵Matt Jordan
into 13
2015-05-05features: Fix crash when transferee hangs up during DTMF attended transfer.Richard Mudgett
A crash happens with this sequence of steps: 1) Party A is connected to party B. 2) Party B starts a DTMF attended transfer. 3) Party A hangs up while party B is dialing party C. When party A hangs up the bridge that party A and party B are in is dissolved and party B is kicked out of the bridge. When party B finishes dialing party C he attempts to move to the new bridge with party C. Since party B is no longer in a bridge the attempted move dereferences a NULL bridge_channel pointer and crashes. * Made the hold(), unhold(), ringing(), and the bridge_move() functions tolerant of the channel not being in a bridge. The assertion that party B is always in a bridge is not true if the bridged peer of party B hangs up and dissolves the bridge. Being tolerant of not being in a bridge allows the peer hangup stimulus to be processed by the FSM. * Made the bridge_move() function return void since where the return value for a failed move was checked generated a FSM coding ERROR message for a normal off-nominal condition. * Eliminated most uses of RAII_VAR in bridge_basic.c. ASTERISK-25003 #close Reported by: Artem Volodin Change-Id: Ie2c1b14e5e647d4ea6de300bf56d69805d7bcada
2015-05-05test_vector: Fix build breakage caused by ASTERISK_REGISTER_FILEGeorge Joseph
My 13 version of test_vector had an ASTERISK_REGISTER_FILE() macro call at the top which is only supported in master. Once removed builds are successful. Change-Id: I7cac8b669bed6de543bbf4e2eec3cffc9741acdd
2015-05-05app_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameterIvan Poddubny
This patch fixes EXITWITHTIMEOUT queue_log entry to always come with 3 parameters: position, original position and waiting time. ASTERISK-25038 #close Reported by: Etienne Lessard Change-Id: I0c62045922e26bee2125e93aee1dee17eee79618
2015-05-05Merge "stasis: Fix dial masquerade datastore lifetime" into 13Matt Jordan
2015-05-05Merge "vector: Traversal, retrieval, insert and locking enhancements" into 13Matt Jordan