summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2016-07-26Merge "codecs: Add iLBC 20."zuul
2016-07-22Merge "res_pjsip: Whitespace and comment cleanup."zuul
2016-07-22Merge "res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called ↵Joshua Colp
twice."
2016-07-22codecs: Add iLBC 20.Alexander Traud
Asterisk already supported iLBC 30. This change adds iLBC 20. Now, Asterisk defaults to iLBC 20 but falls back to iLBC 30, when the remote party requests this. ASTERISK-26218 #close ASTERISK-26221 #close Reported by: Aaron Meriwether Change-Id: I07f523a3aa1338bb5217a1bf69c1eeb92adedffa
2016-07-21res_pjsip: Whitespace and comment cleanup.Richard Mudgett
Change-Id: I11139a4a95df34e223ba622aa6227e33ab8f6c38
2016-07-21Merge "res_srtp: Enable AES-256 and AES-GCM."zuul
2016-07-21Merge "res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook."zuul
2016-07-21Merge "res_fax: Fix FAXOPT(faxdetect) timeout option."Joshua Colp
2016-07-21Merge "res_pjsip: Add fax_detect_timeout endpoint option."Joshua Colp
2016-07-21pbx: Create pbx_sw.c for management of 'struct ast_sw'.Corey Farrell
This changes context switches from a linked list to a vector, makes 'struct ast_sw' opaque to pbx.c. Although ast_walk_context_switches is maintained the procedure is no longer efficient except for the first call (inc==NULL). This functionality is replaced by two new functions implemented by vector macros. * ast_context_switches_count (AST_VECTOR_SIZE) * ast_context_switches_get (AST_VECTOR_GET) As with ast_walk_context_switches callers of these functions are expected to have locked contexts. Only a few places in Asterisk walked the switches, they have been converted to use the new functions. Change-Id: I08deb016df22eee8288eb03de62593e45a1f0998
2016-07-21res_pjsip_pubsub: fixed a bug when pjsip_tx_data_dec_ref is called twice.Alexei Gradinari
This patch removed call of pjsip_tx_data_dec_ref in send_notify if send_request failed. The pjsip_dlg_send_request deletes the message on error by itself. It seems this patch fixes next issues: ASTERISK-26199 ASTERISK-26166 ASTERISK-26174 Change-Id: I8b05917c93d993f95d604c042ace5f1a5500f59a
2016-07-21res_srtp: Enable AES-256 and AES-GCM.Alexander Traud
ASTERISK-26190 #close Change-Id: I11326d80edd656524a51a19450e586c583aa0a0b
2016-07-20Merge "Unit tests: Use AST_TEST_DEFINE in conditional code only."zuul
2016-07-20Merge "pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'."zuul
2016-07-20Merge "res_rtp_asterisk: Count a roll-over of the sequence number even on ↵zuul
lost packets."
2016-07-19res_fax.c: Fix deadlock potential in FAXOPT(faxdetect) framehook.Richard Mudgett
The fax_detect_framehook() has the potential to deadlock if an incoming fax happens during the Playback or similar application. * Fixed the potential deadlock by not calling ast_async_goto() with the channel lock held. * Made always eat the fax detection frame whether there is a fax extension or not. * Made only detach the framehook if we detected a fax and not on other possible frames. ASTERISK-26216 Reported by: Richard Mudgett Change-Id: I99da35c26d1cd802626ffb4c1b4eb5b015581b6d
2016-07-19res_fax: Fix FAXOPT(faxdetect) timeout option.Richard Mudgett
The fax detection timeout option did not work because basically the wrong variable was checked in fax_detect_framehook(). As a result, the timer would timeout immediately and disable fax detection. * Fixed ignoring negative timeout values. We'd complain and then go right on using the negative value. * Fixed destroy_faxdetect() in the off-nominal case of an incomplete object creation. * Added more range checking to FAXOPT(gateway) timeout parameter. ASTERISK-26214 #close Reported by: Richard Mudgett Change-Id: Idc5e698dfe33572de9840bc68cd9fc043cbad976
2016-07-19res_pjsip: Add fax_detect_timeout endpoint option.Richard Mudgett
The new endpoint option allows the PJSIP channel driver's fax_detect endpoint option to timeout on a call after the specified number of seconds into a call. The new feature is disabled if the timeout is set to zero. The option is disabled by default. ASTERISK-26214 Reported by: Richard Mudgett Change-Id: Id5a87375fb2c4f9dc1d4b44c78ec8735ba65453d
2016-07-18Unit tests: Use AST_TEST_DEFINE in conditional code only.Corey Farrell
If AST_TEST_DEFINE is not conditional to TEST_FRAMEWORK it produces dead code. This places all existing unit tests into a conditional block if they weren't already. ASTERISK-26211 #close Change-Id: I8ef83ee11cbc991b07b7a37ecb41433e8c734686
2016-07-18res_pjsip_mwi: remove unneeded check on endpoint's contacts.Alexei Gradinari
The function create_mwi_subscriptions_for_endpoint checks if there is active contacts by retrieving aors and contacts. This function is used to create all unsolicited mwi subscriptions on startup and is used when contact added. In both cases it's not necessary to check if there are contacts. The contacts are needed when asterisk sends mwi. ASTERISK-26200 #close Change-Id: I98e43bdc97f3c0829951cd9bf5f3c6348c6ac1fa
2016-07-18res_rtp_asterisk: Count a roll-over of the sequence number even on lost packets.Alexander Traud
With this change, the initial RTP sequence number is randomly chosen not between 0 and 65535 (0xffff) but 0 and 32767 (0x7fff). This assures, the roll-over counter (ROC) synchronization is not lost for sRTP, when the very first RTP packets get lost; see http://srtp.sourceforge.net/faq.html#Q6 ASTERISK-26207 #close Change-Id: I9a527e3aa3ce8f3becc5131d7ba32b57b5845464
2016-07-18pbx: Create pbx_ignorepat.c for management of 'struct ast_ignorepat'.Corey Farrell
This changes context ignore patterns from a linked list to a vector, makes 'struct ast_ignorepat' opaque to pbx.c. Although ast_walk_context_ignorepats is maintained the procedure is no longer efficient except for the first call (inc==NULL). This functionality is replaced by two new functions implemented by vector macros. * ast_context_ignorepats_count (AST_VECTOR_SIZE) * ast_context_ignorepats_get (AST_VECTOR_GET) As with ast_walk_context_ignorepats callers of these functions are expected to have locked contexts. Only a few places in Asterisk walked the ignorepats, they have been converted to use the new functions. Change-Id: I78f2157d275ef1b7d624b4ff7d770d38e5d7f20a
2016-07-15pbx: Create pbx_include.c for management of 'struct ast_include'.Corey Farrell
This changes context includes from a linked list to a vector, makes 'struct ast_include' opaque to pbx.c. Although ast_walk_context_includes is maintained the procedure is no longer efficient except for the first call (inc==NULL). This functionality is replaced by two new functions implemented by vector macros. * ast_context_includes_count (AST_VECTOR_SIZE) * ast_context_includes_get (AST_VECTOR_GET) As with ast_walk_context_includes callers of these functions are expected to have locked contexts. Only a few places in Asterisk walked the includes, they have been converted to use the new functions. const have been applied where possible to parameters for ast_include functions. Change-Id: Ib5c882e27cf96fb2aec67a39c18b4c71c9c83b60
2016-07-14Update support for SILK format.Mark Michelson
This commit adds scaffolding in order to support the SILK audio format on calls. Roughly, this is what is added: * Cached silk formats. One for each possible sample rate. * ast_codec structures for each possible sample rate. * RTP payload mappings for "SILK". In addition, this change overhauls the res_format_attr_silk file in the following ways: * The "samplerate" attribute is scrapped. That's native to the format. * There are far more checks to ensure that attributes have been allocated before attempting to reference them. * We do not SDP fmtp lines for attributes set to 0. These changes make way to be able to install a codec_silk module and have it actually work. It also should allow for passthrough silk calls in Asterisk. Change-Id: Ieeb39c95a9fecc9246bcfd3c45a6c9b51c59380e
2016-07-14Merge "res_rtp_asterisk: Enable Forward Secrecy (PFS) for DTLS."Joshua Colp
2016-07-14Merge "pjsip_options.c: Fix container operation."zuul
2016-07-14Merge "pjsip_configuration.c: Misc cleanups."zuul
2016-07-13Merge "res/res_corosync: Raise a Stasis message on node join/leave events"zuul
2016-07-13Merge "res/res_pjsip_session: Check for presence of an active negotiator"zuul
2016-07-13pjsip_options.c: Fix container operation.Richard Mudgett
aor_observer_deleted() needs to operate on all contacts found for the deleted AOR instead of only the first one found. This is really only a problem if there is more than one contact for the AOR. Change-Id: Id24ac0d5e8c931330231fb45dd2a331a84339dc1
2016-07-13pjsip_configuration.c: Misc cleanups.Richard Mudgett
* Fix some whitespace in various routines. * Rename i to iter in persistent_endpoint_update_state(). * Fix off-nominal copy/paste message wording in persistent_endpoint_contact_deleted_observer() Change-Id: Id8e34f5d09e7eebac3af22501c44c1110a3e29d8
2016-07-13res_rtp_asterisk: Enable Forward Secrecy (PFS) for DTLS.Alexander Traud
Since July 2014, TLS based protocols (SIP over TLS, Secure WebSockets, HTTPS) support PFS thanks to ASTERISK-23905. In July 2015, the same feature was added for DTLS. The source code from main/tcptls.c should have been re-used to ease security audits. Therefore, this change rolls back the change from July 2015 and re-uses the code from July 2014. This has the additional benefits to work under CentOS 7 and enabling not just ECDHE but DHE based cipher suites as well. ASTERISK-25659 #close Reported by: StefanEng86, urbaniak, pay123 Tested by: sarumjanuch, traud patches: res_rtp_asterisk.patch submitted by sarumjanuch dtls_centos_step_1.patch submitted by traud dtls_centos_step_2.patch submitted by traud Change-Id: I537cadf4421f092a613146b230f2c0ee1be28d5c
2016-07-13res/res_pjsip_session: Check for presence of an active negotiatorMatt Jordan
It is possible in a hypothetical situation for a session refresh to be invoked on a PJSIP when the negotiatior on the INVITE session has not yet been established. While this shouldn't occur with existing uses of ast_sip_session_refresh, the crashes that occur due to improperly calling PJSIP functions that expect a non-NULL negotiatior are avoidable. PJSIP will create the negotiator in pjsip_inv_reinvite; this means that simply checking for the presence of the negotiator before passing it to other PJSIP functions that use it is allowable. As such, this patch adds checks for the presence of the negotiator before calling PJSIP functions that assume it is non-NULL. Change-Id: I1028323e7e01b0a531865e5412a71b6f6ec4276d
2016-07-13res/res_pjsip_pubsub: Add additional debug statementsMatt Jordan
When something very sad and wrong occurs, it's challenging sometimes to figure out why. This patch adds some additional debug statements on off-nominal paths to try and make debugging easier. Change-Id: I7bffb73cc733b6f80193a23340881db4a102b640
2016-07-13res/res_corosync: Raise a Stasis message on node join/leave eventsMatt Jordan
When res_corosync detects that a node leaves or joins, it currently is informed of this via Corosync callbacks. However, there are a few limitations with the information presented: (1) While we have information that Corosync is aware of - such as the Corosync nodeid - that information is really only useful inside of Corosync or res_corosync. There's no way to translate a Corosync nodeid to some other internally useful unique identifier for the Asterisk instance that just joined or left the cluster. (2) While res_corosync is notified of the instance joining or leaving the cluster, it has no mechanism to inform the Asterisk core or other modules of this event. This limits the usefulness of res_corosync as a heartbeat mechanism for other modules. This patch addresses both issues. First, it adds the notion of a cluster discovery message both within the Stasis message bus, as well as the binary event messages that res_corosync uses to transmit data back and forth within the cluster. When Asterisk joins the cluster, it sends a discovery message to the other nodes in the cluster, which correlates the Corosync nodeid along with the Asterisk EID. res_corosync now maintains a hash of Corosync nodeids to Asterisk EIDs, such that it can map changes in cluster state with the Asterisk instance that has that nodeid. Likewise, when an Asterisk instance receives a discovery message from a node in the cluster, it now sends its own discovery message back to the originating node with the local Asterisk EID. This lets Asterisk instances within the cluster build a complete picture of the other Asterisk instances within the cluster. Second, it publishes the discovery messages onto the Stasis message bus. Said messages are published whenever a node joins or leaves the cluster. Interested modules can subscribe for the ast_cluster_discovery_type() message under the ast_system_topic() and be notified when changes in cluster state occur. Change-Id: I9015f418d6ae7f47e4994e04e18948df4d49b465
2016-07-13Merge "rest_api/channels: Fix multiple issues with create and dial"zuul
2016-07-13Merge "res_pjsip: Fix statsd regression."Joshua Colp
2016-07-12Merge "res_sorcery_realtime: fix bug when successful UPDATE is treated as ↵Joshua Colp
failed"
2016-07-12Merge "res_pjsip: Added "subscribe_context" to endpoint"Joshua Colp
2016-07-12rest_api/channels: Fix multiple issues with create and dialGeorge Joseph
* We weren't properly subscribing to the channel and it's originator on create. * We weren't doing a publish_dial after calling ast_call on dial. * We weren't calling depart_bridge when a channel left the dial bridge. The first 2 issues were causing events to not be generated and the third was actually causing channels to not get properly destroyed when hung up. Together these 3 issues were causing the new rest_apichannels/create_dial_bridge tests to fail. As a result of the fixes, the cdr state machine had to be slightly tweaked to allow bridge leave events without asserting and the tests themselves had to be updated to account for the channels now cleaning themselves up. Change-Id: Ibf23abf5a62de76e82afb4461af5099c961b97d8
2016-07-12res_pjsip: Fix statsd regression.Richard Mudgett
The ASTERISK-25904 change-id I8fad8aae9305481469c38d2146e1ba3a56d3108f patch introduced several regressions when the newly created "Updated" state goes out for each endpoint registration refresh. 1) It restarted any OPTIONS RTT ping cycle. 2) It would interfere with a currently active ping and throw off that ping's resulting RTT calculation. 3) It cleared the RTT time each time the endpoint was refreshed. 4) The cleared RTT time was sent out as a statsd update each time. 5) It created two AMI events for each update. * Revert the original patch and reimplement it. Now the current contact status state is re-sent instead of the state being momentarily toggled every time the endpoint refreshes its registration. The statsd events are not created for the re-sent refresh because they are sent after every OPTIONS ping. ASTERISK-26160 #close Reported by: Matt Jordan Change-Id: Ie072be790fbb2a8f5c1c874266e4143fa31f66d1
2016-07-12func_odbc: Fix connection deadlock.Joshua Colp
The func_odbc module was modified to ensure that the previous behavior of using a single database connection was maintained. This was done by getting a single database connection and holding on to it. With the new multiple connection support in res_odbc this will actually starve every other thread from getting access to the database as it also maintains the previous behavior of having only a single database connection. This change disables the func_odbc specific behavior if the res_odbc module is running with only a single database connection active. The connection is only kept for the duration of the request. ASTERISK-26177 #close Change-Id: I9bdbd8a300fb3233877735ad3fd07bce38115b7f
2016-07-08Merge "chan_sip/res_pjsip_t38: Handle a request to negotiate T.38 after it ↵Joshua Colp
is enabled."
2016-07-07res_sorcery_realtime: fix bug when successful UPDATE is treated as failedAlexei Gradinari
If the SQL UPDATE statement changes nothing then SQLRowCount returns 0. This value should be treated as success. But the function sorcery_realtime_update treats it as failed. This bug was found using stress tests on PJSIP. If there are 2 consecutive SIP REGISTER requests with the same contact data during 1 second then res_pjsip_registrar adds contact location on 1st request and tries to update contact location on 2nd. The update fails and res_pjsip_registrar even removes correct contact location. The test "object_update_uncreated" was removed from test_sorcery_realtime.c because it's now a valid situation. This patch also adds missing debug of extra SQL parameter. ASTERISK-26172 #close Change-Id: I05a7f3051455336c9dda29efc229decf86071303
2016-07-07chan_sip/res_pjsip_t38: Handle a request to negotiate T.38 after it is enabled.Joshua Colp
Some T.38 implementations may send another re-invite after the initial one which adds additional negotiation details (such as the max bitrate). Currently this will fail when passthrough is being done in chan_sip as we do nothing if T.38 is already active. Other handlers of T.38 inside of Asterisk (such as res_fax) handle this scenario so this change adds support for it to chan_sip and res_pjsip_t38. If a request to negotiate is received while T.38 is already enabled a new re-INVITE is sent and negotiation is done again. ASTERISK-26179 #close Change-Id: I0298494d3da6df3219bbfa4be9aa04015043145c
2016-07-07PJSIP: provide valid tcp nodelay option for reuseScott Griepentrog
When using TCP transport with chan_pjsip, the TCP_NODELAY option value was allocated on the stack, then passed as a pointer to the tcp transport configuration structure, and later re-used on subsequently created sockets when it was no longer valid. This patch changes the allocation to be a static. ASTERISK-26180 #close Reported by: Scott Griepentrog Change-Id: I3251164c7f710dbdab031282f00e30a9770626a0
2016-07-06res_pjsip: Added "subscribe_context" to endpointAlexei Gradinari
If specified, incoming SUBSCRIBE requests will be searched for the matching extension in the indicated context. If no "subscribe_context" is specified, then the "context" setting is used. ASTERISK-25471 #close Change-Id: I3fb7a15f5bc154079bd348c08b7ad1cdd2d5e514
2016-07-01Merge "res_pjsip_session.c: Don't send extra BYE if SDP invalid."Joshua Colp
2016-07-01Merge "res_pjsip_session.c: End call on initial invalid SDP negotiation."Joshua Colp
2016-07-01Merge "res_pjsip.c: Register PJMEDIA error code decoder."Joshua Colp