summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2016-06-08Merge "ari/resource_channels: Add 'formats' to channel create/originate"Joshua Colp
2016-06-03ari/resource_channels: Add 'formats' to channel create/originateGeorge Joseph
If you create a local channel and don't specify an originator channel to take capabilities from, we automatically add all audio formats to the new channel's capabilities. When we try to make the channel compatible with another, the "best format" functions pick the best format available, which in this case will be slin192. While this is great for preserving quality, it's the worst for performance and overkill for the vast majority of applications. In the absense of any other information, adding all formats is the correct thing to do and it's not always possible to supply an originator so a new parameter 'formats' has been added to the channel create/originate functions. It's just a comma separated list of formats to make availalble for the channel. Example: "ulaw,slin,slin16". 'formats' and 'originator' are mutually exclusive. To facilitate determination of format names, the format name has been added to "core show codecs". ASTERISK-26070 #close Change-Id: I091b23ecd41c1b4128d85028209772ee139f604b
2016-05-31Merge "ARI: Re-implement the ARI dial command, allowing for early bridging."zuul
2016-05-31Merge "res_pjsip: add "via_addr", "via_port", "call_id" to contact"Joshua Colp
2016-05-27multicast RTP: Add dialing optionsMark Michelson
This adds a new parameter to the end of a multicast RTP dialing string. This parameter defines the following options: * i: Set the interface from which multicast RTP is sent * l: Set whether multicast packets are looped back to the sender * t: Set the TTL for multicast packets * c: Set the codec to use for RTP ASTERISK-26068 #close Reported by Mark Michelson Change-Id: I033b706b533f0aa635c342eb738e0bcefa07e219
2016-05-27ARI: Re-implement the ARI dial command, allowing for early bridging.Mark Michelson
ARI dial had been implemented using the Dial API. This made great sense when dialing was 100% separate from bridging. However, if a channel were to be added to a bridge during the dial attempt, there would be a conflict between the dialing thread and the bridging thread. Each would be attempting to read frames from the dialed channel and act on them. The initial attempt to make the two play nice was to have the Dial API suspend the channel in the bridge and stay in charge of the channel until the dial was complete. The problem with this was that it was riddled with potential race conditions. It also was not well-suited for the case where the channel changed which bridge it was in during the dial. This new approach removes the use of the Dial API altogether. Instead, the channel we are dialing is placed into an invisible ARI dialing bridge. The bridge channel thread handles incoming frames from the channel. If the channel is added to a real bridge, it is departed from the invisible bridge and then added to the real bridge. Similarly, if the channel is removed from the real bridge, it is automatically added back to the invisible bridge if the dial attempt is still active. This approach keeps the threading simple by always having the channel being handled by bridge channel threads. ASTERISK-25925 Change-Id: I7750359ddf45fcd45eaec749c5b3822de4a8ddbb
2016-05-26res_pjsip: add "via_addr", "via_port", "call_id" to contactAlexei Gradinari
As res_pjsip_nat rewrites contact's address, only the last Via header can contain the source address of registered endpoint. Also Call-Id header may contain the source address of registered endpoint. Added "via_addr", "via_port", "call_id" to contact. Added new fields ViaAddress, CallID to AMI event ContactStatus. ASTERISK-26011 Change-Id: I36bcc0bf422b3e0623680152d80486aeafe4c576
2016-05-25Merge "Bridging: introduce "invisible" bridges."Joshua Colp
2016-05-23Merge "ARI: Add the ability to download the media associated with a stored ↵Joshua Colp
recording"
2016-05-23Bridging: introduce "invisible" bridges.Mark Michelson
Invisible bridges function the same as normal bridges, but they have the following restrictions: * They never show up in CLI, AMI, or ARI queries. * They do not have Stasis messages published about them. Invisible bridges' main use is for when use of the bridging system is desired, but the bridge should not be known to users of the Asterisk system. ASTERISK-25925 Change-Id: I804a209d3181d7c54e3d61a60eb462e7ce0e3670
2016-05-23Merge "func_curl: Don't trim response text on non-ASCII characters"Joshua Colp
2016-05-21func_curl: Don't trim response text on non-ASCII charactersIvan Poddubny
The characters 0x80-0xFF were trimmed as well as 0x00-0x20 because of a signed comparison. ASTERISK-25669 #close Reported by: Jesper patches: strings.curl.trim.patch submitted by Jesper (License 5518) Change-Id: Ia51e169f24e3252a7ebbaab3728630138ec6f60a
2016-05-20parking.h: Update ast_parking_park_call() doxygen to reality.Richard Mudgett
ASTERISK-26029 Change-Id: I2db14d102a48d3224010e6d1c69e856373cc1260
2016-05-20ARI: Add the ability to download the media associated with a stored recordingMatt Jordan
This patch adds a new feature to ARI that allows a client to download the media associated with a stored recording. The new route is /recordings/stored/{name}/file, and transmits the underlying binary file using Asterisk's HTTP server's underlying file transfer facilities. Because this REST route returns non-JSON, a few small enhancements had to be made to the Python Swagger generation code, as well as the mustache templates that generate the ARI bindings. ASTERISK-26042 #close Change-Id: I49ec5c4afdec30bb665d9c977ab423b5387e0181
2016-05-19Merge "res_pjsip: Endpoint IP Access Controls"Joshua Colp
2016-05-19Merge "logger: Support JSON logging with Verbose messages"Joshua Colp
2016-05-19Merge "res_hep: Provide an option to pick the UUID type"Joshua Colp
2016-05-18res_pjsip_exten_state: Use the extension for publishing to.Joshua Colp
This change uses the newly added multi-user support for outbound publish to publish to the specific user that an extension state change is for. This also extends the res_pjsip_outbound_publish support to include the user specific From and To URI information in the outbound publishing of extension state. Since the URI is used when constructing the body it is important to ensure that the correct local and remote URIs are used. Finally the max string growths for the dialog-info+xml body generator has been increased as through testing it has proven to be too conservative. ASTERISK-25965 Change-Id: I668fdf697b1e171d4c7e6f282b2e1590f8356ca1
2016-05-18res_pjsip_outbound_publish: Add multi-user support per configurationKevin Harwell
Added a new multi_user option that when specified allows a particular configuration to be used for multiple users. It does this by replacing the user portion of the server uri with a dynamically created one. Two new API calls have been added in order to make use of the new functionality: ast_sip_publish_user_send - Sends an outgoing publish message based on the given user. If state for the user already exists it uses that, otherwise it dynamically creates new outbound publishing state for the user at that time. ast_sip_publish_user_remove - Removes all outbound publish state objects associated with the user. This essentially stops outbound publishing for the user. ASTERISK-25965 #close Change-Id: Ib88dde024cc83c916424645d4f5bb84a0fa936cc
2016-05-17ARI: Add the ability to play multiple media URIs in a single operationMatt Jordan
Many ARI applications will want to play multiple media files in a row to a resource. The most common use case is when building long-ish IVR prompts made up of multiple, smaller sound files. Today, that requires building a small state machine, listening for each PlaybackFinished event, and triggering the next sound file to play. While not especially challenging, it is tedious work. Since requiring developers to write tedious code to do normal activities stinks, this patch adds the ability to play back a list of media files to a resource. Each of the 'play' operations on supported resources (channels and bridges) now accepts a comma delineated list of media URIs to play. A single Playback resource is created as a handle to the entire list. The operation of playing a list is identical to playing a single media URI, save that a new event, PlaybackContinuing, is raised instead of a PlaybackFinished for each non-final media URI. When the entire list is finished being played, a PlaybackFinished event is raised. In order to help inform applications where they are in the list playback, the Playback resource now includes a new, optional attribute, 'next_media_uri', that contains the next URI in the list to be played. It's important to note the following: - If an offset is provided to the 'play' operations, it only applies to the first media URI, as it would be weird to skip n seconds forward in every media resource. - Operations that control the position of the media only affect the current media being played. For example, once a media resource in the list completes, a 'reverse' operation on a subsequent media resource will not start a previously completed media resource at the appropiate offset. - This patch does not add any new operations to control the list. Hopefully, user feedback and/or future patches would add that if people want it. ASTERISK-26022 #close Change-Id: Ie1ea5356573447b8f51f2e7964915ea01792f16f
2016-05-14logger: Support JSON logging with Verbose messagesMatt Jordan
When 2d7a4a3357 was merged, it missed the fact that Verbose log messages are formatted and handled by 'verbosers'. Verbosers are registered functions that handle verbose messages only; they exist as a separate class of callbacks. This was done to handle the 'magic' that must be inserted into Verbose messages sent to remote consoles, so that the consoles can format the messages correctly, i.e., the leading tabs/characters. In reality, verbosers are a weird appendage: they're a separate class of formatters/message handlers outside of what handles all other log messages in Asterisk. After some code inspection, it became clear that simply passing a Verbose message along with its 'sublevel' importance through the normal logging mechanisms removes the need for verbosers altogether. This patch removes the verbosers, and makes the default log formatter aware that, if the log channel is a console log, it should simply insert the 'verbose magic' into the log messages itself. This allows the console handlers to interpret and format the verbose message themselves. This simplifies the code quite a lot, and should improve the performance of printing verbose messages by a reasonable factor: (1) It removes a number of memory allocations that were done on each verobse message (2) It removes the need to strip the verbose magic out of the verbose log messages before passing them to non-console log channels (3) It now performs fewer iterations over lists when handling verbose messages Since verbose messages are now handled like other log messages (for the most part), the JSON formatting of the messages works as well. ASTERISK-25425 Change-Id: I21bf23f0a1e489b5102f8a035fe8871552ce4f96
2016-05-14res_hep: Provide an option to pick the UUID typeMatt Jordan
At one point in time, it seemed like a good idea to use the Asterisk channel name as the HEP correlation UUID. In particular, it felt like this would be a useful identifier to tie PJSIP messages and RTCP messages together, along with whatever other data we may eventually send to Homer. This also had the benefit of keeping the correlation UUID channel technology agnostic. In practice, it isn't as useful as hoped, for two reasons: 1) The first INVITE request received doesn't have a channel. As a result, there is always an 'odd message out', leading it to be potentially uncorrelated in Homer. 2) Other systems sending capture packets (Kamailio) use the SIP Call-ID. This causes RTCP information to be uncorrelated to the SIP message traffic seen by those capture nodes. In order to support both (in case someone is trying to use res_hep_rtcp with a non-PJSIP channel), this patch adds a new option, uuid_type, with two valid values - 'call-id' and 'channel'. The uuid_type option is used by a module to determine the preferred UUID type. When available, that source of a correlation UUID is used; when not, the more readily available source is used. For res_hep_pjsip: - uuid_type = call-id: the module uses the SIP Call-ID header value - uuid_type = channel: the module uses the channel name if available, falling back to SIP Call-ID if not For res_hep_rtcp: - uuid_type = call-id: the module uses the SIP Call-ID header if the channel type is PJSIP and we have a channel, falling back to the Stasis event provided channel name if not - uuid_type = channel: the module uses the channel name ASTERISK-25352 #close Change-Id: Ide67e59a52d9c806e3cc0a797ea1a4b88a00122c
2016-05-13res_pjsip: Endpoint IP Access ControlsAlexei Gradinari
With the old SIP module we can use IP access controls per peer. PJSIP module missing this feature. This patch added next configuration Endpoint options: "acl" - list of IP ACL section names in acl.conf "deny" - List of IP addresses to deny access from "permit" - List of IP addresses to permit access from "contact_acl" - List of Contact ACL section names in acl.conf "contact_deny" - List of Contact header addresses to deny "contact_permit" - List of Contact header addresses to permit This patch also better logging failed request: add custom message instead of "No matching endpoint found" add SIP method to logging ASTERISK-25900 Change-Id: I456dea3909d929d413864fb347d28578415ebf02
2016-05-09Merge "pjproject_bundled: Check for python-dev and TEST_FRAMEWORK"Joshua Colp
2016-05-09res_pjsip_pubsub: Use common datastores container API.Joshua Colp
This migrates res_pjsip_pubsub over to using the newly introduce common datastores management API instead of using its own implementations for both subscriptions and publications. As well the extension state data now provides a generic datastores container instead of a subscription. This allows the dialog-info+xml body generator to work for both subscriptions and publications. ASTERISK-25999 #close Change-Id: I773f9e4f35092da0f653566736a8647e8cfebef1
2016-05-09datastore: Add common container based datastores API.Joshua Colp
This change introduces a common container based datastores management API. This has been done in a few places across the tree but this consolidates all of the logic into one place in a generic fashion. ASTERISK-25999 Change-Id: I72eb15941dcdbc2a37bb00a33ce00f8755bd336a
2016-05-08pjproject_bundled: Check for python-dev and TEST_FRAMEWORKGeorge Joseph
The pjsua and pjsystest apps are now built only if TEST_FRAMEWORK is set. The python bindings are now built only if TEST_FRAMEWORK is set and a python development package is installed. libresample was also disabled. ASTERISK-25993 #close Reported-by: Joshua Colp Change-Id: If4e91c503a02f113d5b71bc8b972081fa3ff6f03
2016-05-03res_pjsip/AMI: add contact.updated eventAlexei Gradinari
With the old SIP module AMI sends PeerStatus event on every successfully REGISTER requests, ie, on start registration, update registration and stop registration. With PJSIP AMI sends ContactStatus only when status is changed. Regarding registration: on start registration - Created on stop registration - Removed but on update registration nothing This patch added contact.updated event. ASTERISK-25904 Change-Id: I8fad8aae9305481469c38d2146e1ba3a56d3108f
2016-05-03Merge "pjsip: Added "reg_server" to contacts."zuul
2016-05-02pjsip: Added "reg_server" to contacts.Alexei Gradinari
If the Asterisk system name is set in asterisk.conf, it will be stored into the "reg_server" field in the ps_contacts table to facilitate multi-server setups. ASTERISK-25931 Change-Id: Ia8f6bd2267809c78753b52bcf21835b9b59f4cb8
2016-04-29res_pjsip_exten_state: Create PUBLISH messages.Richard Mudgett
Create PUBLISH messages to update a third party when an extension state changes because of either a device or presence state change. A configuration example: [exten-state-publisher] type=outbound-publish server_uri=sip:instance1@172.16.10.2 event=presence ; Optional regex for context filtering, if specified only extension state ; for contexts matching the regex will cause a PUBLISH to be sent. @context=^users ; Optional regex for extension filtering, if specified only extension ; state for extensions matching the regex will cause a PUBLISH to be sent. @exten=^[0-9]* ; Required body type for the PUBLISH message. ; ; Supported values are: ; application/pidf+xml ; application/xpidf+xml ; application/cpim-pidf+xml ; application/dialog-info+xml (Planned support but not yet) @body=application/pidf+xml The '@' extended variables are used because the implementation can't extend the outbound publish type as it is provided by the outbound publish module. That means you either have to use extended variables, or implement some sort of custom extended variable thing in the outbound publish module. Another option would be to refactor that stuff to have an option which specifies the use of an alternate implementation's configuration and then have that passed to the implementation. JColp opted for the extended variables method originally. ASTERISK-25972 #close Change-Id: Ic0dab4022f5cf59302129483ed38398764ee3cca
2016-04-29Merge "res_pjsip_exten_state: Check if body generator is available."Joshua Colp
2016-04-28Merge "res_pjsip_pubsub.h: Fix doxygen association."zuul
2016-04-28res_pjsip_exten_state: Check if body generator is available.Richard Mudgett
When starting the extension state publishers, check if the requested message body generator is available. If not available give error message and skip starting that publisher. * res_pjsip_pubsub.c: Create new API if type/subtype generator registered. * res_pjsip_exten_state.c: Use new body generator API for validation. ASTERISK-25922 Change-Id: I4ad69200666e3cc909d4619e3c81042d7f9db25c
2016-04-28res_pjsip_pubsub.h: Fix doxygen association.Richard Mudgett
Change-Id: I110d3e3572598289fcd4215d966cf0c858f98632
2016-04-27res_pjsip: Add ability to identify by Authorization usernameGeorge Joseph
A feature of chan_sip that service providers relied upon was the ability to identify by the Authorization username. This is most often used when customers have a PBX that needs to register rather than identify by IP address. From my own experiance, this is pretty common with small businesses who otherwise don't need a static IP. In this scenario, a register from the customer's PBX may succeed because From will usually contain the PBXs account id but an INVITE will contain the caller id. With nothing recognizable in From, the service provider's Asterisk can never match to an endpoint and the INVITE just stays unauthorized. The fixes: A new value "auth_username" has been added to endpoint/identify_by that will use the username and digest fields in the Authorization header instead of username and domain in the the From header to match an endpoint, or the To header to match an aor. This code as added to res_pjsip_endpoint_identifier_user rather than creating a new module. Although identify_by was always a comma-separated list, there was only 1 choice so order wasn't preserved. So to keep the order, a vector was added to the end of ast_sip_endpoint. This is only used by res_pjsip_registrar to find the aor. The res_pjsip_endpoint_identifier_* modules are called in globals/endpoint_identifier_order. Along the way, the logic in res_pjsip_registrar was corrected to match most-specific to least-specific as res_pjsip_endpoint_identifier_user does. The order is: username@domain username@domain_alias username Auth by username does present 1 problem however, the first INVITE won't have an Authorization header so the distributor, not finding a match on anything, sends a securty_alert. It still sends a 401 with a challenge so the next INVITE will have the Authorization header and presumably succeed. As a result though, that first security alert is actually a false alarm. To address this, a new feature has been added to pjsip_distributor that keeps track of unidentified requests and only sends the security alert if a configurable number of unidentified requests come from the same IP in a configurable amout of time. Those configuration options have been added to the global config object. This feature is only used when auth_username is enabled. Finally, default_realm was added to the globals object to replace the hard coded "asterisk" used when an endpoint is not yet identified. The testsuite tests all pass but new tests are forthcoming for this new feature. ASTERISK-25835 #close Reported-by: Ross Beer Change-Id: I30ba62d208e6f63439600916fcd1c08a365ed69d
2016-04-27Merge "res_pjsip: disable multi domain to improve realtime performace"Joshua Colp
2016-04-27Merge "res_pjsip: Add serialized scheduler (res_pjsip/pjsip_scheduler.c)"zuul
2016-04-27res_pjsip: disable multi domain to improve realtime performaceAlexei Gradinari
This patch added new global pjsip option 'disable_multi_domain'. Disabling Multi Domain can improve Realtime performance by reducing number of database requests. ASTERISK-25930 #close Change-Id: I2e7160f3aae68475d52742107949a799aa2c7dc7
2016-04-26Merge changes from topic 'system_stress_patches'Joshua Colp
* changes: test_message.c: Wait longer in case dialplan also processes the test message. Manager: Short circuit AMI message processing. manager.c: Eliminate most RAII_VAR usage.
2016-04-25Merge "Bridge system: Fix memory leaks and double frees on impart failure."zuul
2016-04-25Merge "bridge_softmix.c: Fix crash if channel fails to join mixing tech."zuul
2016-04-22Merge "bridge: Hold off more than one imparting channel at a time."zuul
2016-04-22Bridge system: Fix memory leaks and double frees on impart failure.Richard Mudgett
You cannot reference the passed in features struct after calling ast_bridge_impart(). Even if the call fails. Change-Id: I902b88ba0d5d39520e670fb635078a367268ea21
2016-04-22bridge_softmix.c: Fix crash if channel fails to join mixing tech.Richard Mudgett
softmix_bridge_join() failed because of an allocation failure. To address this, the softmix bridge technology now checks if the channel failed to join softmix successfully. In addition, the bridge now begins the process of kicking the channel out of the bridge so we don't have channels partially in the bridge for very long. * Fix the test_channel_feature_hooks.c unit tests. The test channel must have a valid codec to join the simple_bridge technology. This patch makes joining a bridge more strict by not allowing partially joined channels to remain in the bridge. Change-Id: I97e2ade6a2bcd1214f24fb839fda948825b61a2b
2016-04-22Manager: Short circuit AMI message processing.Richard Mudgett
Improve AMI message processing performance if there are no consumers listening for the messages. We now skip creating the AMI event message text strings. Change-Id: I7b22fc5ec4e500d00635c1a467aa8ea68a1bb2b3
2016-04-20bridge: Hold off more than one imparting channel at a time.Richard Mudgett
An earlier patch blocked the ast_bridge_impart() call until the channel either entered the target bridge or it failed. Unfortuantely, if the target bridge is stasis and the imprted channel is not a stasis channel, stasis bounces the channel out of the bridge to come back into the bridge as a proper stasis channel. When the channel is bounced out, that released the block on ast_bridge_impart() to continue. If the impart was a result of a transfer, then it became a race to see if the swap channel would get hung up before the imparted channel could come back into the stasis bridge. If the imparted channel won then everything is fine. If the swap channel gets hung up first then the transfer will fail because the swap channel is leaving the bridge. * Allow a chain of ast_bridge_impart()'s to happen before any are unblocked to prevent the race condition described above. When the channel finally joins the bridge or completely fails to join the bridge then the ast_bridge_impart() instances are unblocked. ASTERISK-25947 Reported by: Richard Mudgett ASTERISK-24649 Reported by: John Bigelow ASTERISK-24782 Reported by: John Bigelow Change-Id: I8fef369171f295f580024ab4971e95c799d0dde1
2016-04-14res_pjsip: Add serialized scheduler (res_pjsip/pjsip_scheduler.c)George Joseph
There are several places that do scheduled tasks or periodic housecleaning, each with its own implementation: * res_pjsip_keepalive has a thread that sends keepalives. * pjsip_distributor has a thread that cleans up expired unidentified requests. * res_pjsip_registrar_expire has a thread that cleans up expired contacts. * res_pjsip_pubsub uses ast_sched directly and then calls ast_sip_push_task. * res_pjsip_sdp_rtp also uses ast_sched to send keepalives. There are also places where we should be doing scheduled work but aren't. A good example are the places we have sorcery observers to start registration or qualify. These don't work when changes are made to a backend database without a pjsip reload. We need to check periodically. As a first step to solving these issues, a new ast_sip_sched facility has been created. ast_sip_sched wraps ast_sched but only uses ast_sched as a scheduled queue. When a task is ready to run, ast_sip_task_pusk is called for it. This ensures that the task is executed in a PJLIB registered thread and doesn't hold up the ast_sched thread so it can immediately continue processing the queue. The serializer used by ast_sip_sched is one of your choosing or a random one from the res_pjsip pool if you don't choose one. Another feature is the ability to automatically clean up the task_data when the task expires (if ever). If it's an ao2 object, it will be dereferenced, if it's a malloc'd object it will be freed. This is selectable when the task is scheduled. Even if you choose to not auto dereference an ao2 task data object, the scheduler itself maintains a reference to it while the task is under it's control. This prevents the data from disappearing out from under the task. There are two scheduling models. AST_SIP_SCHED_TASK_PERIODIC specifies that the invocations of the task occur at the specific interval. That is, every "interval" milliseconds, regardless of how long the task takes. If the task takes longer than the interval, it will be scheduled at the next available multiple of interval. For exmaple: If the task has an interval of 60 secs and the task takes 70 secs (it better not), the next invocation will happen at 120 seconds. AST_SIP_SCHED_TASK_DELAY specifies that the next invocation of the task should start "interval" milliseconds after the current invocation has finished. Also, the same ast_sched facility for fixed or variable intervals exists. The task's return code in conjunction with the AST_SIP_SCHED_TASK_FIXED or AST_SIP_SCHED_TASK_VARIABLE flags controls the next invocation start time. One res_pjsip.h housekeeping change was made. The pjsip header files were added to the top. There have been a few cases lately where I've needed res_pjsip.h just for ast_sip calls and had compiles fail spectacularly because I didn't add the pjsip header files to my source even though I never referenced any pjsip calls. Finally, a few new convenience APIs were added to astobj2 to make things a little easier in the scheduler. ao2_ref_and_lock() calls ao2_ref() and ao2_lock() in one go. ao2_unlock_and_unref() does the reverse. A few macros were also copied from res_phoneprov because I got tired of having to duplicate the same hash, sort and compare functions over and over again. The AO2_STRING_FIELD_(HASH|SORT|CMP)_FN macros will insert functions suitable for aor_container_alloc into your source. This facility can be used immediately for the situations where we already have a thread that wakes up periodically or do some scheduled work. For the registration and qualify issues, additional sorcery and schema changes would need to be made so that we can easily detect changed objects on a periodic basis without having to pull the entire database back to check. I'm thinking of a last-updated timestamp on the rows but more on this later. Change-Id: I7af6ad2b2d896ea68e478aa1ae201d6dd016ba1c
2016-04-13stringfields: Update extended string fields for master only.George Joseph
In 13, the new ast_string_field_header structure had to be dynamically allocated and assigned to a pointer in ast_string_field_mgr to preserve ABI compatability. In master, it can be converted to being a structure-in-place in ast_string_field_mgr to eliminate the extra alloc and free calls. Change-Id: Ia97c5345eec68717a15dc16fe2e6746ff2a926f4
2016-04-11res_pjsip contact: Lock expiration/addition of contactsGeorge Joseph
Contact expiration can occur in several places: res_pjsip_registrar, res_pjsip_registrar_expire, and automatically when anyone calls ast_sip_location_retrieve_aor_contact. At the same time, res_pjsip_registrar may also be attempting to renew or add a contact. Since none of this was locked it was possible for one thread to be renewing a contact and another thread to expire it immediately because it was working off of stale data. This was the casue of intermittent registration/inbound/nominal/multiple_contacts test failures. Now, the new named lock functionality is used to lock the aor during contact expire and add operations and res_pjsip_registrar_expire now checks the expiration with the lock held before deleting the contact. ASTERISK-25885 #close Reported-by: Josh Colp Change-Id: I83d413c46a47796f3ab052ca3b349f21cca47059