summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2015-12-04Merge "res_format_attr_vp8: In SDP, forward max-fr and max-fs for ↵Matt Jordan
video-codec VP8." into 13
2015-12-04Merge "res_format_attr_opus: Update to latest RFC 7587." into 13Matt Jordan
2015-12-04res_format_attr_vp8: In SDP, forward max-fr and max-fs for video-codec VP8.Alexander Traud
ASTERISK-25584 #close Change-Id: Iae00071b4ff1ae76f24995aeac4d00284fd14f91
2015-12-04res_format_attr_opus: Update to latest RFC 7587.Alexander Traud
Beside that, the format-attribute module sends only non-default values in the line fmtp, now. This avoids unnecessary overhead in SDP messages. Furthermore, previously the parameter stereo was not parsed when being the first parameter. ASTERISK-25583 #close Change-Id: Iae85ba3e5960bfd5d51cf65bcffad00dd4875a73
2015-12-03Merge "res_pjsip: Use a MD5 hash for static Contact IDs" into 13Joshua Colp
2015-12-03Merge "res_pjsip: Update logging to show contact->uri in messages" into 13Joshua Colp
2015-12-03res_pjsip: Use a MD5 hash for static Contact IDsGeorge Joseph
When 90d9a70789 was merged, it mostly tested dynamic contacts created as a result of registering a PJSIP endpoint. Contacts generated in this fashion typically have a long alphanumeric string as their object identifier, which maps reasonably well for StatsD. Unfortunately, this doesn't work in the general case. StatsD treats both '.' and ':' characters as special characters. In particular, having a ':' appear in the middle of a StatsD metric will result in the metric being rejected. This causes some obvious issues with SIP URIs. The StatsD API should not be responsible for escaping the metric name passed to it. The metric is treated as a single long string, and it would be challenging to know what to escape in the string passed to the function. Likewise, we don't want to escape the metric in PJSIP, as that involves overhead that is wasted when either res_statsd isn't loaded or enabled. This patch takes an alternative approach. The Contact ID has been changed to be "aor@@uri_hash" instead of "aor@@uri". This (a) won't contain any of the aforementioned special characters, (b) can be done on Contact creation, which has minimal impact on run-time performance, and (c) also conforms to an earlier commit that changed the ID for dynamic contacts. The downside of this is that StatsD users will have to map SHA1 hashes back to the Contacts that are emitting the statistics. To that end, the CLI commands have been updated to include the first 10 characters of the MD5 hash, which should be enough to match what is shown in Graphite (or some other StatsD backend). ASTERISK-25595 #close Change-Id: Ic674a3307280365b4a45864a3571c295b48a01e2 Reported-by: Matt Jordan Tested-by: George Joseph
2015-12-02res_pjsip: Update logging to show contact->uri in messagesGeorge Joseph
An earlier commit changed the id of dynamic contacts to contain a hash instead of the uri. This patch updates status change logging to show the aor/uri instead of the id. This required adding the aor id to contact and contact_status and adding uri to contact_status. The aor id gets added to contact and contact_status in their allocators and the uri gets added to contact_status in pjsip_options when the contact_status is created or updated. ASTERISK-25598 #close Reported-by: George Joseph Tested-by: George Joseph Change-Id: I56cbec1d2ddbe8461367dd8b6da8a6f47f6fe511
2015-12-01res_sorcery_memory_cache.c: Fix off nominal ref leak.Richard Mudgett
Change-Id: If83d63cf11cbc6df9b15251848b01feb570ade49
2015-11-25fastagi: record file closed after sending resultKevin Harwell
The fastagi record-file testsuite test sometimes fails reporting an empty recorded file. This was happening because Asterisk was sending the agi result notification prior to actually closing the file and the data, being buffered, had not been written to the file yet when the test attempts to check the file size. This patch makes it so the record file stream is closed prior to sending the agi result notification. ASTERISK-25593 #close Change-Id: I6b2b3be3ae37f7c7b18e672c419a89b3b8513cde
2015-11-24Merge "Fixed some typos" into 13Matt Jordan
2015-11-24Fixed some typosDavid M. Lee
Fixes some minor typos in the CHANGES file, plus an embarrasing typo in the StatsD API. Change-Id: I9ca4858c64a4a07d2643b81baa64baebb27a4eb7
2015-11-24res_pjsip_notify: Fix CLI usage infoCorey Farrell
The usage info for 'pjsip send notify' previously referenced the chan_sip configuration sip_notify.conf. Fix this to reference the correct configuration pjsip_notify.conf. ASTERISK-25590 #close Change-Id: I3898271a8e8a8b1db201741e790ebe2c6bf5cdea
2015-11-23Merge "res_sorcery_realtime.c: Fix crash from NULL sorcery object type." into 13Mark Michelson
2015-11-23res_sorcery_realtime.c: Fix crash from NULL sorcery object type.Richard Mudgett
If the sorcery object type is not found a NULL is returned. Unfortunately, sorcery_realtime_filter_objectset() will crash after complaining about not finding the object type and saying to expect errors. * Use ao2_cleanup() instead of ao2_ref() to prevent the crash. ASTERISK-25165 Reported by Corey Farrell Change-Id: Ic3b64453ea3058cb68d5c26d97d4fe7b8eea2e97
2015-11-23Merge "chan_pjsip: Handle T.38 faxes with direct media bridges" into 13Matt Jordan
2015-11-23Merge "res/res_endpoint_stats: Add module to emit endpoint StatsD ↵Matt Jordan
statistics" into 13
2015-11-23Merge "res_pjsip/pjsip_options: Add StatsD statistics for PJSIP contacts" ↵Matt Jordan
into 13
2015-11-23Merge "res/res_pjsip_outbound_registration: Add registration statistics for ↵Matt Jordan
StatsD" into 13
2015-11-23Merge "res_statsd: Add functions that support variable arguments" into 13Matt Jordan
2015-11-22Merge "StatsD: Add res_statsd compatibility" into 13Matt Jordan
2015-11-22chan_pjsip: Handle T.38 faxes with direct media bridgesMatt Jordan
When a channel is in a direct media bridge, a re-INVITE may arrive that forces Asterisk to re-negotiate the media to a T.38 fax. When this occurs, the bridge must change its technology to a simple bridge, and re-INVITE the media back to Asterisk. Generally, this logic mostly already exists in Asterisk. However, prior to this patch, there were a few bugs: (1) The T.38 framehook currently prevents a channel capable of T.38 faxes from ever entering into a direct media bridge. This applies even when the only media being passed over the channel is audio. This patch fixes this bug by having the framehook specify that it defers caring about any frame type. This allows the channels to enter into a direct media bridge, which will be broken when a re-INVITE is received. (2) When a re-INVITE is received, nothing instructed the bridging layer to re-inspect the allowed bridging technology. This now occurs when either a re-INVITE is received from a peer, or when a response is received from the far end (that is, when the T.38 state changes to either T38_PEER_REINVITE or T38_LOCAL_REINVITE). (3) chan_pjsip needs to do a small amount of work to prevent a direct media bridge from being chosen when a T.38 session is in progress. When a T.38 session supplement has a t38 datastore - which is added when we detect we should start thinking about T.38 on a channel - we now refuse a native RTP bridge. (4) When a BYE request is received, we don't terminate the T.38 session. If the other side of a T.38 fax survives the hangup (due to the 'g' flag in Dial, for example), we don't currently re-INVITE the media on the other channel back to audio. This patch now has res_pjsip_t38 intercept BYE requests and inform the far side that the T.38 session is terminated. This naturally causes the correct re-INVITEs to be sent. ASTERISK-25582 Change-Id: Iabd6aa578e633d16e6b9f342091264e4324a79eb
2015-11-21Merge "res/res_pjsip_t38: Add debug statements" into 13Joshua Colp
2015-11-21Merge "res_pjsip_outbound_registration.c: Be tolerant of short registration ↵Matt Jordan
timeouts." into 13
2015-11-21res/res_pjsip_t38: Add debug statementsMatt Jordan
This patch adds some debug statements to res_pjsip_t38. These statements help to determine which SDP negotiation callbacks are being executed, and, when a particular callback exits, why a callback may not have applied its logic to the local or remote SDP. Change-Id: I61b3fb9183b7ebbb5da8e9f48b59a5d9d7042d77
2015-11-20Merge "res_pjsip_outbound_registration.c: Fix 423 response handling." into 13Mark Michelson
2015-11-20Merge "res_format_attr_h264: Do not reset string buffer." into 13Joshua Colp
2015-11-19res/res_endpoint_stats: Add module to emit endpoint StatsD statisticsMatt Jordan
This patch adds a module that emits StatsD statistics about Asterisk endpoints. This includes: * A GUAGE statistic for endpoint states, tracking how many endpoints are in a particular state. * A GUAGE statistic for each endpoint, counting the number of channels currently associated with an endpoint. ASTERISK-25572 Change-Id: If7e1333c5aeda8d136850b30c2101c0ee1c97305
2015-11-19res_pjsip/pjsip_options: Add StatsD statistics for PJSIP contactsMatt Jordan
This patch adds the ability to send StatsD statistics related to the state of PJSIP contacts. This includes: * A GUAGE statistic measuring the count of contacts in a particular state. This measures how many contacts are reachable, unreachable, etc. * The RTT time for each contact, if those contacts are qualified. This provides StatsD engines useful time-based data about each contact. ASTERISK-25571 Change-Id: Ib8378d73afedfc622be0643b87c542557e0b332c
2015-11-19res/res_pjsip_outbound_registration: Add registration statistics for StatsDMatt Jordan
This patch adds outbound registration statistics for StatsD. This includes the following: * A GUAGE metric for the overall count of outbound registrations. * A GUAGE metric for each state an outbound registration can be in. As the outbound registrations change state, the overall count of how many outbound registrations are in the particular state is changed. These statistics are particularly useful for systems with a large number of SIP trunks, and where measuring the change in state of the trunks is useful for monitoring. ASTERISK-25571 Change-Id: Iba6ff248f5d1c1e01acbb63e9f0da1901692eb37
2015-11-19res/res_pjsip_outbound_registration: Apply configuration on object type loadMatt Jordan
When Asterisk is configured to use a dynamic sorcery backend (such as res_sorcery_astdb) with 'registration' objects, it will fail to create the internal state objects associated with the registration objects on module load. This is due to nothing actually querying for the specific objects and calling their sorcery apply handler during module load. This patch fixes that by calling get_registrations in the sorcery observer's object_type_loaded handler. Doing this causes the sorcery backends to be asked for the current state of all registration objects, which causes the apply handler to be called and the internal run-time state to be created. ASTERISK-25575 #close Change-Id: Ie9306e797098c6d4da7bcf4a5434a15891508b23
2015-11-19res_format_attr_h264: Do not reset string buffer.Alexander Traud
When no parameter is present, Asterisk does not generate the line fmtp, as expected. However, because a buffer was reset, even rtpmap and fmtp of previous media codecs got removed. Now, Asterisk does not reset other codecs in case of no parameter for H.264. ASTERISK-25573 #close Change-Id: I93811331f4a28c45418a9e14ee46c0debd47a286
2015-11-18res_statsd: Add functions that support variable argumentsMatt Jordan
Often, the metric names of statistics we are generating for StatsD have some dynamic component to them. This can be the name of a particular resource, or some internal status label in Asterisk. With the current set of functions, callers of the statsd API must first build the metric name themselves, then pass this to the API functions. This results in a large amount of boilerplate code and usage of either fixed length static buffers or dynamic memory allocation, neither of which is desireable. This patch adds two new functions to the StatsD API that support a printf style format specifier for constructing the metric name. A dynamic string, allocated in threadstorage, is used to build the metric name. This eases the burden on users of the StatsD API. Change-Id: If533c72d1afa26d807508ea48b4d8c7b32f414ea
2015-11-18res_pjsip_outbound_registration.c: Be tolerant of short registration timeouts.Richard Mudgett
Change-Id: Ie16f5053ebde0dc6507845393709b4d6a3ea526d
2015-11-18res_pjsip_outbound_registration.c: Fix 423 response handling.Richard Mudgett
Receiving a 423 Interval Too Brief response after authentication for an outbound registration attempt results in assuming that the registrar has rejected the registration permanently. If there are no configured retries for fatal responses then the outbound registration is stopped for that endpoint. For registrations, PJSIP/PJPROJECT intercepts the handling of 423 responses and does not include any authentication in the updated registration request. When the updated request is challenged then the Asterisk code assumes that we were challenged again because the peer rejected the authentication we sent earlier. * Made registration challenges keep track of the CSeq number to determine if the received challenge response was for the request we thought we sent. If the response's CSeq number differs from the CSeq number we last sent with authentication then authenticate again because it is a challenge to a different request. Change-Id: I81b4bd36d1be095bab606e34b8b44e6302971b09
2015-11-18StatsD: Add res_statsd compatibilitytcambron
Added a new api to res_statsd.c to allow it to receive a character pointer for the value argument. This allows for a '+' and a '-' to easily be sent with the value. ASTERISK-25419 Reported By: Ashley Sanders Change-Id: Id6bb53600943d27347d2bcae26c0bd5643567611
2015-11-18Merge "res_pjsip_rfc3326.c: Fix crash when channel goes away." into 13Matt Jordan
2015-11-16res/res_pjsip: Fix off nominal crash with requests that fail and have a timerMatt Jordan
When a request is sent using pjsip_endpt_send_request and fails, a condition exists where the request wrapper, which is an AO2 object, may be de-ref'd more times than it should. This occurs when the request's callback is called, and, in the callback, the timer on the PJSIP heap is cancelled. When that occurs, the request wrapper's lifetime is decremented. When pjsip_endpt_send_request fails, we unilaterally decrement the lifetime of the request wrapper again, even though we've already cancelled the reference associated with the timer. This patch checks the return result of pj_timer_heap_cancel_if_active before removing the reference associated with the timer. We now only decrement it in this case if a timer is cancelled as a result of the function call. Change-Id: I21332343a1a019c1117076f9bf2df27be2850102
2015-11-13res_pjsip_rfc3326.c: Fix crash when channel goes away.Richard Mudgett
If an authenticated incoming caller does not respond to our 200 OK INVITE response with an ACK then PJSIP will hangup the call. Unfortunately, there is a chance that the session's channel will go away between one use of the channel pointer and another when building the BYE request because the BYE is being built by the monitor thread and not the call's serializer thread. * Added a check to ensure that the thread trying to add the Reason header is the call's serializer thread. This ensures that the channel will not go away on us. Change-Id: I866388d2b97ea2032eaae3f3ab3f1ca6cbd2df89
2015-11-13Taskprocessors: Increase high-water markMark Michelson
In practical tests, we have seen certain taskprocessors, specifically Stasis subscription taskprocessors, cross the recently-added high-water mark and emit a warning. This high-water mark warning is only intended to be emitted when things have tanked on the system and things are heading south quickly. In the practical tests, the Stasis taskprocessors sometimes had a max depth of 180 tasks in them, and Asterisk wasn't in any danger at all. As such, this ups the high-water mark to 500 tasks instead. It also redefines the SIP threadpool request denial number to be a multiple of the taskprocessor high-water mark. Change-Id: Ic8d3e9497452fecd768ac427bb6f58aa616eebce
2015-11-12res_pjsip distributor: Don't send 503 response to responses.Mark Michelson
When the SIP threadpool is backed up with tasks, we send 503 responses to ensure that we don't try to overload ourselves. The problem is that we were not insuring that we were not trying to send a 503 to an incoming SIP response. This change makes it so that we only send the 503 on incoming requests. Change-Id: Ie2b418d89c0e453cc6c2b5c7d543651c981e1404
2015-11-12res_pjsip: Deny requests when threadpool queue is backed up.Mark Michelson
We have observed situations where the SIP threadpool may become deadlocked. However, because incoming traffic is still arriving, the SIP threadpool's queue can continue to grow, eventually running the system out of memory. This change makes it so that incoming traffic gets rejected with a 503 response if the queue is backed up too much. Change-Id: I4e736d48a2ba79fd1f8056c0dcd330e38e6a3816
2015-11-12Further fixes to improper usage of schedulerSteve Davies
When ASTERISK-25449 was closed, a number of scheduler issues mentioned in the comments were missed. These have since beed raised in ASTERISK-25476 and elsewhere. This patch attempts to collect all of the scheduler issues discovered so far and address them sensibly. ASTERISK-25476 #close Change-Id: I87a77d581e2e0d91d33b4b2fbff80f64a566d05b
2015-11-11Merge "res_pjsip_sdp_rtp: Enable Opus to be negotiated via SIP/SDP." into 13Matt Jordan
2015-11-09ast_format_cap_get_names: To display all formats, the buffer was increased.Alexander Traud
ASTERISK-25533 #close Change-Id: Ie1a9d1a6511b3f1a56b93d04475fbf8a4e40010a
2015-11-06res_pjsip_sdp_rtp: Enable Opus to be negotiated via SIP/SDP.Alexander Traud
In SIP/SDP, Opus has two channels always (see RFC 7587 section 7). The actual amount of channels is negotiated in-band. Therefore now, the Opus codec and its attribute rtpmap are registered with two channels. ASTERISK-24779 #close Reported by: PowerPBX Tested by: Alexander Traud patches: asterisk-24779.patch submitted by Sean Bright (license #5060) Change-Id: Ic7ac13cafa1d3450b4fa4987350924b42cbb657b
2015-11-04res_pjsip/location: Destroy contact_status objects on contact deletionMatt Jordan
The contact_status Sorcery objects are currently not destroyed when a contact is deleted. This causes the contact's last known RTT/status to be 'sticky' when the contact itself may no longer exist. This patch causes the contact_status objects associated with both dynamic and static contacts to be destroyed if the AoR holding those contacts is also destroyed (or via other paths where a contact may be deleted.) Change-Id: I7feec8b9278cac3c5263a4c0483f4a0f3b62426e
2015-11-04Merge "pjsip_configuration: On delete, remove the persistent version of an ↵Matt Jordan
endpoint" into 13
2015-11-03pjsip_configuration: On delete, remove the persistent version of an endpointMatt Jordan
When an endpoint is deleted (such as through an API), the persistent endpoint currently continues to lurk around. While this isn't harmful from a memory consumption perspective - as all persistent endpoints are reclaimed on shutdown - it does cause Stasis endpoint related operations to continue to believe that the endpoint may or may not exist. This patch causes the persistent endpoint related to a PJSIP endpoint to be destroyed if the PJSIP endpoint is deleted. Change-Id: I85ac707b4d5e6aad882ac275b0c2e2154affa5bb
2015-11-02res_pjsip: Set threadpool max size default to 50.Mark Michelson
During a stress test of subscriptions, a huge blast of subscription-related traffic resulted in the threadpool expanding to a ridiculous number of threads. The balooning of threads resulted in an increase of memory, which led to a crash due to being out of memory. An easy fix for the particular test was to limit the size of the threadpool, thus reining in the amount of memory that would be used. It was decided that there really is no downside to having a non-infinite default value for the maximum size of the threadpool, so this change introduces 50 threads as the maximum threadpool size for the SIP threadpool. ASTERISK-25513 #close Reported by John Bigelow Change-Id: If0b9514f1d9b172540ce1a6e2f2ffa1f2b6119be