summaryrefslogtreecommitdiff
path: root/res
AgeCommit message (Collapse)Author
2016-05-31Merge "ARI: Re-implement the ARI dial command, allowing for early bridging."zuul
2016-05-31Merge "res_pjsip_mwi_body_generator: Re-order the body items"zuul
2016-05-31Merge "res_pjsip: add "via_addr", "via_port", "call_id" to contact"Joshua Colp
2016-05-31Merge "res_pjsip: Add clarifying documentation to PJSIP_HEADER help text"zuul
2016-05-31Merge "multicast RTP: Add dialing options"zuul
2016-05-31Merge "res_pjsip: chatty verbose messages"zuul
2016-05-30res_pjsip_mwi_body_generator: Re-order the body itemsGeorge Joseph
Re-ordered the body items so Message-Account is second. Messages-Waiting: no Message-Account: sip:1571@<IP Removed>:5060 Voice-Message: 0/0 (0/0) ASTERISK-26065 #close Reported-by: Ross Beer Change-Id: If5d35a64656eac98c2dd5e490cc0b2807bed80c3
2016-05-27res_pjsip: Add clarifying documentation to PJSIP_HEADER help textRusty Newton
Added notes about when you can read or write headers. Specifically about being able to read on the inbound channel and write on an outbound channel. ASTERISK-26063 #close Reported by: Private Name Tested by: Rusty Newton Change-Id: Ibeb64af17d1f6451028b3c29855a3f151a01d8c5
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-26res_pjsip: chatty verbose messagesAlexei Gradinari
There are a lot of verbose messages about Endpoint and Contact status changes if there are many dynamic endpoints. The patch sets verbose level 2 for Endpoint status changes and verbose level 3 for Contact status changes. ASTERISK-26055 #close Change-Id: Ie64e261ddbbc41bfff0f0190241152cc123fe6d7
2016-05-26pjsip_distributor.c: Use correct rdata info access method.Richard Mudgett
The pjproject doxygen for rdata->msg_info.info says to call pjsip_rx_data_get_info() instead of accessing the struct member directly. You need to call the function mostly because the function will generate the struct member value if it is not already setup. Change-Id: Iafe8b01242b7deb0ebfdc36685e21374a43936d2
2016-05-25Merge "res_pjsip_outbound_publish: Ensure publish is valid when explicitly ↵zuul
destroying."
2016-05-24Merge "res_pjsip: Only check transaction on transaction state events."zuul
2016-05-24res_pjsip_outbound_publish: Ensure publish is valid when explicitly destroying.Joshua Colp
Recent changes to res_pjsip_outbound_publish have introduced a race condition at shutdown where an outbound publish may be shutdown twice. In this case the first succeeds as a result of the unpublish. In the second invocation since it's been unpublished a task is queued to just destroy the client. This task holds no ref to the publish and as a result the publish may be destroyed before the task is run, causing a crash. This explicit destruction task now holds a reference to the publish to ensure it remains valid. ASTERISK-26053 #close Change-Id: I10789b98add3e50292ee3b33a55a1d9061cec94b
2016-05-23Merge "ARI: Add the ability to download the media associated with a stored ↵Joshua Colp
recording"
2016-05-22res_pjsip: Only check transaction on transaction state events.Joshua Colp
The send request callback function currently assumes that it will only ever be called on transaction state changes. This is not always true. If our own timer callback occurs we will call the callback with a timer event instead of a transaction state change event. In this case the transaction on the event is invalid and accessing it will result in a crash. ASTERISK-26049 #close Change-Id: I623211c8533eb73056b0250b4580b49ad4174dfc
2016-05-20res_pjsip: Match dialogs on responses better.Mark Michelson
When receiving an incoming response to a dialog-starting INVITE, we were not matching the response to the INVITE dialog. Since we had not recorded the to-tag to the dialog structure, the PJSIP-provided method to find the dialog did not match. Most of the time, this was not a problem, because there is a fall-back that makes the response get routed to the same serializer that the request was sent on. However, in cases where an asynchronous DNS lookup occurs in the PJSIP core, the thread that sends the INVITE is not actually a threadpool serializer thread. This means we are unable to record a serializer to handle the incoming response. Now, imagine what happens when an INVITE is sent on a non-serialized thread, and an error response (such as a 486) arrives. The 486 ends up getting put on some random threadpool thread. Eventually, a hangup task gets queued on the INVITE dialog serializer. Since the 486 is being handled on a different thread, the hangup task can execute at the same time that the 486 is being handled. The hangup task assumes that it is the sole owner of the INVITE session and channel, so it ends up potentially freeing the channel and NULLing the session's channel pointer. The thread handling the 486 can crash as a result. This change has the incoming response match the INVITE transaction, and then get the dialog from that transaction. It's the same method we had been using for matching incoming CANCEL requests. By doing this, we get the INVITE dialog and can ensure that the 486 response ends up being handled by the same thread as the hangup, ensuring that the hangup runs after the 486 has been completely handled. ASTERISK-25941 #close Reported by Javier Riveros Change-Id: I0d4cc5d07e2a8d03e9db704d34bdef2ba60794a0
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-19res_sorcery_astdb: Filter fields to only the registered ones.Joshua Colp
This change introduces the same filtering that is done in res_sorcery_realtime to the res_sorcery_astdb module. This allows persisted sorcery objects that may contain unknown fields to still be read in from the AstDB and used. This is particularly useful when switching between different versions of Asterisk that may have introduced additional fields. ASTERISK-26014 #close Change-Id: Ib655130485a3ccfd635b7ed5546010ca14690fb2
2016-05-19Merge "res_pjsip_empty_info: Respond to empty SIP INFO packets"Joshua Colp
2016-05-19Merge "res_pjsip: Endpoint IP Access Controls"Joshua Colp
2016-05-19res_pjsip_empty_info: Respond to empty SIP INFO packetssnuffy
Some SBCs require responses to empty SIP INFO packets after establishing call via INVITE, if not responded to they may drop your call after unspecified timeout of X minutes. They are identified by having no Content-Type, check for this and respond with 200 - OK message. ASTERISK-24986 #close Reported-by: Ilya Trikoz, Federico Santulli Change-Id: Ib27e4f07151e5aef28fa587e4ead36c5b87c43e0
2016-05-19Merge "res_hep: Provide an option to pick the UUID type"Joshua Colp
2016-05-19Merge "res/res_hep_pjsip: Fix reported local IP address when bound to 'any'"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-18Merge "ARI: Add the ability to play multiple media URIs in a single operation"Joshua Colp
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-16res_pjsip_outbound_registration: Clean up state when registration is deletedGeorge Joseph
Nothing was cleaning up the registration state object when ast_sorcery_delete was called on a registration. So, the registration was deleted from sorcery but the state object went right on refreshing the registration (or failing to refresh the registration) with the peer. * Added a 'deleted' observer on registration that removes the state object. ASTERISK-25964 #close Reported-by Matt Jordan Change-Id: I2db792145cdb1f72ebbf57dd9099596dbbf12c23
2016-05-15res_pjsip: Set TCP_NODELAY on TCP transportsGeorge Joseph
Although it's perfectly legal to place multiple SIP messages in the same packet, it can cause problems because the Linux default is to enable Path MTU Discovery which sets the Don't Fragment bit on the packets. If adding a second message to the packet causes the MTU to be exceeded, and the destination isn't equipped to send a FRAGMENTATION NEEDED response to a large packet, the packet will just be dropped. We can't specifically tell the stack to send only 1 message per packet, but we can turn on TCP_NODELAY when we create the transport. This will at least tell the stack to send packets as soon as possible. ASTERISK-26005 #close Reported-by: Ross Beer Change-Id: I820f23227183f2416ca5e393bec510e8fe1c8fbd
2016-05-14res/res_hep_pjsip: Fix reported local IP address when bound to 'any'Matt Jordan
When bound to an 'any' address, e.g., 0.0.0.0, PJSIP reports as its local address the 'any' address, as opposed to the IP address we actually received the packet on. This can cause some confusion in Homer, as it will dutifully report what we send it. This patch uses the PJSIP inspection routines to determine which IP address we probably received the packet on based on the remote party's IP address. In the event that this fails, it falls back to the IP address natively reported by the transport. Change-Id: I076f835d2aef489e1ee1d01595b211eb2ce62da3
2016-05-14res_ari: Correct Location headers returned by some ARI resourcesSean Bright
The Location headers returned by: * /bridges/{bridgeId}/play * /bridges/{bridgeId}/record * /channels/{channelId}/play * /channels/{channelId}/record Did not have the '/ari' prefix, and in the case of the 'play' resources, were using 'playback' instead of 'playbacks.' Change-Id: I957c58a3a1471bf477dae7c67faa1b74fcd9241c
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-13Merge "config_transport: Tell pjproject to allow all SSL/TLS protocols"zuul
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-13Merge "pjsip_distributor: Add missing newline to NOTICE"zuul
2016-05-12Merge "res_pjsip_outbound_registration: generate correct Contact URI for TLS"zuul
2016-05-12pjsip_distributor: Add missing newline to NOTICEGeorge Joseph
There was a newline missing from the end of the "no matching endpoint" notice. Change-Id: Idc11fe5bc0354072291663dbffe648c471e39181
2016-05-12res_pjsip_outbound_registration: generate correct Contact URI for TLSSebastian Damm
There are two types of SIP URIs indicating a secure transport: * sips:user@example.org * sip:user@example.org;transport=tls When using a sips URI, Asterisk checks incoming INVITEs and answers from the other side for sips URIs, and rejects the packet if there are only sip URIs. So Asterisk should only generate a sips Contact URI if the other side supports it. This patch makes Asterisk generate either a sip or sips Contact URI depending on the format of the server URI. If you want a sip URI, use: server_uri=sip:example.org\;transport=tls If you want a sips URI, use: server_uri=sips:example.org ASTERISK-25990 #close Reported-by: Sebastian Damm Change-Id: I5ae57d6531ce940b5fc64d5cd2673e60db0f9ba2
2016-05-11Merge "res_pjsip_outbound_publish: state potential dropped on ↵Joshua Colp
reloads/realtime fetches"
2016-05-11Merge "res_pjsip_outbound_publishing: After unloading the library won't load ↵Joshua Colp
again"
2016-05-11Merge "res_pjsip_outbound_publish: Won't unload if condition wait times out"Joshua Colp
2016-05-11Merge "res_pjsip_outbound_publish: Ref leak in off nominal callback paths"Joshua Colp
2016-05-11Merge "res_pjsip_outbound_publish: Potential crash due to off nominal path"Joshua Colp
2016-05-11Merge "res_pjsip: improve realtime performance"Joshua Colp
2016-05-11Merge "res_fax/t38_gateway: Peer V.21 session is created on wrong channel"zuul
2016-05-09Merge "res_pjsip_authenticator_digest: Don't use source port in nonce ↵zuul
verification"
2016-05-09Merge "res_pjsip_pubsub: Use common datastores container API."Joshua Colp