summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2016-07-01Merge "res_pjsip_session.c: Don't send extra BYE if SDP invalid." into 13Joshua Colp
2016-07-01Merge "res_pjsip_session.c: End call on initial invalid SDP negotiation." ↵Joshua Colp
into 13
2016-07-01Merge "res_pjsip.c: Register PJMEDIA error code decoder." into 13Joshua Colp
2016-07-01Merge "res_pjsip_session.c: Remove unused parameter from handle_incoming()." ↵Joshua Colp
into 13
2016-07-01Merge "res_pjsip: Add missing NULL checks when using ↵Joshua Colp
pjsip_inv_end_session()." into 13
2016-06-30Merge "res_pjsip: improve realtime performance #2" into 13Joshua Colp
2016-06-30res_pjsip_session.c: Don't send extra BYE if SDP invalid.Richard Mudgett
When an answer SDP is invalid we were disconnecting the outgoing call and sending two BYE requests. The first BYE was sent by PJPROJECT because of the invalid SDP answer. The second BYE was sent by Asterisk because it thought the canceled call was the result of the RFC5407 section 3.1.2 race condition. * Made not send the BYE on a canceled session if the SDP negotiation is incomplete because PJPROJECT has already sent a BYE for the failed negotiation. ASTERISK-25772 #close Reported by: Dmitriy Serov Change-Id: I44ad0bd0605e8eeb7035c890d6f97a1331f1a836
2016-06-30res_pjsip_session.c: End call on initial invalid SDP negotiation.Richard Mudgett
When an incoming call defers SDP negotiation and then sends us an invalid SDP in the ACK, we need to send a BYE to disconnect the call. In this case SDP negotiation has failed and we don't have valid media streams negotiated. ASTERISK-25772 Change-Id: Ia358516b0fc1e6c4c139b78246f10b9da7a2dfb8
2016-06-30res_pjsip.c: Register PJMEDIA error code decoder.Richard Mudgett
Registering the PJMEDIA error codes allows errors found when parsing an incoming SDP to be easier to figure out. "Missing SDP rtpmap for dynamic payload type (PJMEDIA_SDP_EMISSINGRTPMAP)" is much easier to understand than "Unknown error 220030". ASTERISK-25772 Change-Id: I44b2dcea656fedd7593171be9e845880a2c70ca0
2016-06-30res_pjsip_session.c: Remove unused parameter from handle_incoming().Richard Mudgett
Change-Id: Iedd182d189ec947c42edc2c66c4bda3c22060daa
2016-06-30res_pjsip: Add missing NULL checks when using pjsip_inv_end_session().Richard Mudgett
pjsip_inv_end_session() is documented as being able to return the passed in tdata parameter set to NULL on success. Change-Id: I09d53725c49b7183c41bfa1be3ff225f3a8d3047
2016-06-29Merge "siren: Add format attribute modules for Siren7 and Siren14." into 13zuul
2016-06-23siren: Add format attribute modules for Siren7 and Siren14.Joshua Colp
This change removes hardcoded SDP parsing and generation for Siren7 and Siren14 from chan_sip and moves it to format attribute modules so it can also be used by chan_pjsip. With this the fmtp lines for both are added with the bitrate information. ASTERISK-26021 Change-Id: Ibb004eda37a14c0a35ef0613f6237977fc800037
2016-06-22Merge "res_fax: Fix reference leak in fax_v21_session_new." into 13zuul
2016-06-22Merge "res_rtp_asterisk: Fix a self-comparison identified by gcc 6" into 13zuul
2016-06-22Merge "Fix Alembic upgrades." into 13zuul
2016-06-22Merge "res_pjproject.c: Replace inlined DEBUG_ATLEAST() with macro." into 13zuul
2016-06-22res_fax: Fix reference leak in fax_v21_session_new.Corey Farrell
fax_v21_session_new created a session details object but only released the allocation reference during error conditions. fax_session_new adds it's own reference to details if needed so the caller is always responsible for cleaning it's own reference. ASTERISK-26141 #close Change-Id: Ie7fc52a83b6596ce9ce2d5a2bd9f3e204f48fc88
2016-06-22res_rtp_asterisk: Fix a self-comparison identified by gcc 6George Joseph
gcc 6 caught a previously unidentified self-comparison in ice_candidate_cmp. Fixed it and re-ordered the predicates for better short-circuiting. ASTERISK-26140 #close Change-Id: I3da713c568e24064430257b3502fbdafd35af7a7
2016-06-22Fix Alembic upgrades.Mark Michelson
A non-existent constraint was being referenced in the upgrade script. This patch corrects the problem by removing the reference. This patch fixes another realtime problem as well. Our Alembic scripts store booleans as yes or no values. However, Sorcery tries to insert "true" or "false" instead. This patch updates Sorcery to use "yes" and "no" ASTERISK-26128 #close Change-Id: I366dbbf91418a9cb160b3ca74b0e59b5ac284bec
2016-06-22res_pjsip: improve realtime performance #2Alexei Gradinari
The patch removes updating all Endpoints' status on startup. Instead, only non-qualified aors with static contact and non-qualified non-expired contacts are retrieved from the realtime to update the endpoint status to ONLINE. The endpoint name was added to the contact object to simply find the endpoint that created this contact. The status of endpoints with qualified aors will be updated by 'qualify' functions. ASTERISK-26061 #close Change-Id: Id324c1776fa55d3741e0c5457ecac0304cb1a0df
2016-06-22res_rtp_asterisk: fix memory leak in dtlsTorrey Searle
ensure that cert bios get freed after creating the fingerprint ASTERISK-26129 #close Change-Id: I44d23aea07dce80176ca1ff877c5ace9452ef451
2016-06-21Merge "res_pjsip_pubsub: Address SEGV when attempting to terminate a ↵zuul
subscription" into 13
2016-06-21Merge "res_rtp_asterisk: Use latest DTLS version available by underlying ↵Joshua Colp
platform." into 13
2016-06-21Merge "res_pjsip_session: Handle race condition at shutdown with timer." into 13zuul
2016-06-21res_pjproject.c: Replace inlined DEBUG_ATLEAST() with macro.Richard Mudgett
Change-Id: I8799fb0a347ad76e747dafd0eacf1ea1086b9a8c
2016-06-21res_pjsip_pubsub: Address SEGV when attempting to terminate a subscriptionGeorge Joseph
Occasionally under load we'll attempt to send a final NOTIFY on a subscription that's already been terminated and a SEGV will occur down in pjproject's evsub_destroy function. This is a result of a race condition between all the paths that can generate a notify and/or destroy the underlying pjproject evsub object: * The client can send a SUBSCRIBE with Expires: 0. * The client can send a SUBSCRIBE/refresh. * The subscription timer can expire. * An extension state can change. * An MWI event can be generated. * The pjproject transaction timer (timer_b) can expire. Normally when our pubsub_on_evsub_state is called with a terminate, we push a task to the serializer and return at which point the dialog is unlocked. This is usually not a problem because the task runs immediately and locks the dialog again. When the system is heavily loaded though, there may be a delay between the unlock and relock during which another event may occur such as the subscription timer or timer_b expiring, an extension state change, etc. These may also cause a terminate to be processed and if so, we could cause pjproject to try to destroy the evsub structure twice. There's no way for us to tell that the evsub was already destroyed and the evsub's group lock can't tolerate this and SEGVs. The remedy is twofold. * A patch has been submitted to Teluu and added to the bundled pjproject which adds add/decrement operations on evsub's group lock. * In res_pjsip_pubsub: * configure.ac and pjproject-bundled's configure.m4 were updated to check for the new evsub group lock APIs. * We now add a reference to the evsub group lock when we create the subscription and remove the reference when we clean up the subscription. This prevents evsub from being destroyed before we're done with it. * A state has been added to the subscription tree structure so termination progress can be tracked through the asyncronous tasks. * The pubsub_on_evsub_state callback has been split so it's not doing double duty. It now only handles the final cleanup of the subscription tree. pubsub_on_rx_refresh now handles both client refreshes and client terminates. It was always being called for both anyway. * The serialized_on_server_timeout task was removed since serialized_pubsub_on_rx_refresh was almost identical. * Missing state checks and ao2_cleanups were added. * Some debug levels were adjusted to make seeing only off-nominal things at level 1 and nominal or progress things at level 2+. ASTERISK-26099 #close Reported-by: Ross Beer. Change-Id: I779d11802cf672a51392e62a74a1216596075ba1
2016-06-21res_rtp_asterisk: Use latest DTLS version available by underlying platform.Alexander Traud
Do not use DTLSv1_method() but DTLS_method() when available in OpenSSL of the underlying platform. This change enables DTLS 1.2 since OpenSSL 1.0.2, for WebRTC (DTLS-SRTP via SIP-over-WebSockets). This change enables AEAD-based cipher-suites. ASTERISK-26130 #close Change-Id: I41f24448d6d2953e8bdb97c9f4a6bc8a8f055fd0
2016-06-21PJSIP: provide transport type with received messagesScott Griepentrog
The receipt of a SIP MESSAGE may occur over any transport including TCP and TLS. When the message is received, the original URI is added to the message in the field PJSIP_RECVADDR, but this is insufficient to ensure a reply message can reach the originating endpoint. This patch adds the PJSIP_TRANSPORT field populated with the transport type. ASTERISK-26132 #close Change-Id: I28c4b1e40d573a056c81deb213ecf53e968f725e
2016-06-21Merge "fix: memory leaks, resource leaks, out of bounds and bugs" into 13zuul
2016-06-20res_pjsip_session: Handle race condition at shutdown with timer.Joshua Colp
When shutting down res_pjsip_session will get unloaded before res_pjsip. The act of unloading unregisters all the PJSIP services and sets their module IDs to -1. In some cases it is possible for a timer to occur after this happens which calls into res_pjsip_session. The res_pjsip_session module can then try to get the session from the INVITE session using the module ID. Since the module ID is now -1 this fails. This change stores a copy of the module ID and uses it for the timer callback scenario. If the module ID is -1 the callback immediately returns but if the module ID is valid then it continues as normal. This works as the original ID of the module is guaranteed to still be valid when used with the INVITE session. ASTERISK-26127 #close Change-Id: I88df72525c4e9ef9f19c13aedddd3ac4a335c573
2016-06-20fix: memory leaks, resource leaks, out of bounds and bugsAlexei Gradinari
ASTERISK-26119 #close Change-Id: Iecbf7d0f360a021147344c4e83ab242fd1e7512c
2016-06-20Merge "ARI: Ensure announcer channels are destroyed." into 13zuul
2016-06-20ARI: Ensure announcer channels are destroyed.Mark Michelson
Announcer channels were not being destroyed because the stasis_app_control structure that referenced them was not being destroyed. The control structure was not being destroyed because it was not being unlinked from its container. It was not being unlinked from its container because the after bridge callback for the announcer channel was not being run. The after bridge callback was not being run because the after bridge datastore was not being removed from the channel on destruction. The channel was not being destroyed because the hangup that used to destroy the channel was now only reducing the reference count to one. The reference count of the channel was only being reduced to one because the stasis_app_control structure was holding the final reference... The control structure used to not keep a reference to the channel, so that loop described above did not happen. The solution is to manually remove the control structure from its container when the playback on a bridge is complete. ASTERISK-26083 #close Reported by Joshua Colp Change-Id: I0ddc0f64484ea0016245800b409b567dfe85cfb4
2016-06-15res_pjsip_transport_management.c: Misc cleanups to survive shutdown.Richard Mudgett
* In unload_module(), reordered destroying things to minimize the window that the global transports container could be used by other threads on shutdown. When shutting down you need to stop things in the opposite order of creation. * Put the global transports container into an AO2_GLOBAL_OBJ_STATIC to eliminate the crash potential by other threads using the container on shutdown. * Made struct monitored_transport.sip_received not use ast_atomic_fetchadd_int() since it is used as a boolean value that is only set TRUE. It was previously incremented for every received SIP message and could theoretically overflow. * In monitored_transport_state_callback(), allocated the monitored transport object without a lock since the lock was unused. * In keepalive_global_loaded(), removed releasing the transports container if the keepalive_thread could not be started. I set it up to be tried again if the user reloads the configuration. Change-Id: I8d12d16ef564290fa6d25a32334bb5ce8fdf87ff
2016-06-14res_pjsip.c: Add check that timer actually got scheduled.Richard Mudgett
Change-Id: Iabaa2e5dccf0762c258101ea0eb1487cf6959ad1
2016-06-14Merge "res_pjsip_session.c: Reorganize ast_sip_session_terminate()." into 13zuul
2016-06-13res_rtp_multicast.c: Fix warning message typo.Richard Mudgett
Change-Id: Ic9928208b9957e09866abe3d9649030942ec52b3
2016-06-10res_pjsip_session.c: Reorganize ast_sip_session_terminate().Richard Mudgett
Change-Id: I68a2128bcba4830985d2d441e70dfd1ac5bd712b
2016-06-10chan_rtp: Backport changes from master.Richard Mudgett
* Deprecate chan_multicast_rtp. Change-Id: Ib5a45e58c75ee8abd0b4f9575379b5321feb853e
2016-06-09Merge "res_pjsip_registrar.c: Eliminate rx REGISTER request race condition." ↵Joshua Colp
into 13
2016-06-09Merge "sorcery: Add setting object type congestion levels." into 13Joshua Colp
2016-06-09Merge "taskprocessors: Implement high/low water mark alerts." into 13zuul
2016-06-09Merge "res_pjsip_session: Use distributor serializer for incoming calls." ↵zuul
into 13
2016-06-09Merge "res_pjsip_pubsub.c: Recreate subscriptions using distributor ↵zuul
serializer." into 13
2016-06-09Merge "res_pjsip_pubsub.c: Use distributor serializer for incoming ↵zuul
subscriptions." into 13
2016-06-09Merge "pjsip_distributor.c: Consistently pick a serializer for messages." ↵zuul
into 13
2016-06-09Merge "pjsip_distributor.c: Ignore messages until fully booted." into 13zuul
2016-06-08res_hep_{pjsip|rtcp}: Decline module loads if res_hep had not loadedMatt Jordan
A crash can occur in res_hep_pjsip or res_hep_rtcp if res_hep has not loaded and does not have a configuration file. Previously when this occurred, checks were put in to see if the configuration was loaded successfully. While this is a good idea - and has been added to the offending function in res_hep - the reality is res_hep_pjsip and res_hep_rtcp have no business running if res_hep isn't also running. As such, this patch also adds a function to res_hep that returns whether or not it successfully loaded. Oddly enough, ast_module_check returns "everything is peachy" even if a module declined its load - so it cannot be solely relied on. res_hep_pjsip and res_hep_rtcp now also check this function to see if they should continue to load; if it fails, they decline their load as well. ASTERISK-26096 #close Change-Id: I007e535fcc2e51c2ca48534f48c5fc2ac38935ea
2016-06-08Merge "ari/resource_channels: Add 'formats' to channel create/originate" ↵zuul
into 13