summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-06-09cel: Ensure only one dial status per channel exists.Joshua Colp
CEL wrongly assumed that a channel would only have a single dial event on it. This is incorrect. Particularly in a queue each call attempt to a member will result in a dial event, adding a new dial status in CEL without removing the old one. This would cause the container to grow with only one dial status being removed when the channel went away. The other dial status entries would remain leaking memory. This change fixes the memory leak by ensuring that only one dial status will only ever exist for each channel. The behavior during the scenario where multiple events are received has also been improved. For failure cases the first failure will be the dial status. If an answer dial status is received, though, it will take priority and the dial status for the channel will be answer. Memory usage has also been decreased by storing the minimal amount of information and the code has been cleaned up slightly. ASTERISK-25262 #close Change-Id: I5944eb923db17b6a0faa7317ff6abc9307c009fe
2016-06-07res_srtp: Instead of libSRTP use OpenSSL as random source.Alexander Traud
Since libSRTP 1.5, its Random Number Generator (RNG) is not maintained anymore. Therefore, the symbol RAND_bytes is used instead of crypto_get_random. ASTERISK-24436 #close Change-Id: Iea0bae4d4e3c9aa0926ea442b6484b5159789d96
2016-06-06Merge "core/dial: New channel variable FORWARDERNAME" into 13zuul
2016-06-02alembic: Fix migration.Joshua Colp
The 81b01a191a46_pjsip_add_contact_reg_server.py script was attempting to use UniqueConstraint and failing. It was not imported and after importing it also continued to fail. I've changed the script to use the explicit name of the constraint instead. Change-Id: I2438b0be90b7ce583b47dd27983c0c1a02cea5b9
2016-06-01Merge "pjsip_distributor.c: Use correct rdata info access method (Part 2)." ↵Joshua Colp
into 13
2016-06-01Merge "logging,cdr,cel: Fix stringfield memory leak." into 13zuul
2016-06-01Merge "pjproject_bundled: Move to pjproject 2.5" into 13zuul
2016-06-01logging,cdr,cel: Fix stringfield memory leak.Richard Mudgett
The stringfields refactor to allow adding stringfields to the end of a structure (f6f4cf459f43f072604927209b39646f84aaa2e2) exposed some incomplete cleanup code by some stringfield users. The most noticeable leaker is the logging system where there is a leak for every log message generated. ASTERISK-26078 #close Reported by: Etienne Lessard Patches: jira_asterisk_26078_v13.patch (license #5621) patch uploaded by Richard Mudgett Change-Id: If6a08b31336b492c3de6f9dfd07c447f8d5a8782
2016-05-31core/dial: New channel variable FORWARDERNAMEAlexei Gradinari
Added a new channel variable FORWARDERNAME which indicates which channel was responsible for a forwarding requests received on dial attempt. Fixed a bug in the app_queue: FORWARD_CONTEXT is not used. ASTERISK-26059 #close Change-Id: I34e93e8c1b5e17776a77b319703c48c8ca48e7b2
2016-05-31pjsip_distributor.c: Use correct rdata info access method (Part 2).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: I4d519385a577f3e9d9193a88125e493cf17fa799
2016-05-31Merge "res_pjsip_mwi_body_generator: Re-order the body items" into 13zuul
2016-05-31Merge "res_pjsip: add "via_addr", "via_port", "call_id" to contact" into 13Joshua Colp
2016-05-31Merge "res_pjsip: Add clarifying documentation to PJSIP_HEADER help text" ↵zuul
into 13
2016-05-31Merge "res_pjsip: chatty verbose messages" into 13zuul
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-30pjproject_bundled: Move to pjproject 2.5George Joseph
Although all the patches we had against 2.4.5 were applied by Teluu, a new bug was introduced preventing re-use of tcp and tls transports This patch removes all the previous patches against 2.4.5, updates the version to 2.5, and adds a new patch to correct the transport re-use problem. Change-Id: I0dc6c438c3910f7887418a5832ca186aea23d068
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-26Merge "app_voicemail: fix bugs, imap mm_status log change to debug" into 13Joshua Colp
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-26app_voicemail: fix bugs, imap mm_status log change to debugAlexei Gradinari
Fixed some bugs: - create dirpath when save downloading message from IMAP storage. - create IMAP folder if not exists when saving to IMAP storage - check if file successfully opened before write to it - some IMAP checks - remove non-standard flag 'Unseen' etc Change to debug IMAP mm_status log instead of verbose. Remove unused X-Asterisk-VM-Caller-channel message header for security reason. The clients should not know name of peer/endpoint. ASTERISK-26045 #close Change-Id: I7f83d88b69b36934e2539c114b9fb612deed971b
2016-05-25res_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-25res_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-24threadpool: Fix potential data race.Corey Farrell
worker_start checked for ZOMBIE status without holding a lock. All other read/write of worker status are performed with a lock, so this check should do the same. ASTERISK-25777 #close Change-Id: I5e33685a5c26fdb300851989a3b82be8c4e03781
2016-05-24Merge "func_odbc: single database connection should be optional" into 13zuul
2016-05-23Merge "Makefile: remove OSARCH check for init install" into 13zuul
2016-05-23Merge "func_curl: Don't trim response text on non-ASCII characters" into 13zuul
2016-05-23Merge "parking.h: Update ast_parking_park_call() doxygen to reality." into 13zuul
2016-05-21Makefile: remove OSARCH check for init installTzafrir Cohen
There are more specific checks for the platform. Specifically this allows installing OS/X init scripts. ASTERISK-26038 #close Change-Id: If08933621145b10362a0cfe73c079301d9c13f50 Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
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-20func_odbc: single database connection should be optionalAlexei Gradinari
func_odbc was changed in Asterisk 13.9.0 to make func_odbc use a single database connection per DSN because of reported bug ASTERISK-25938 with MySQL/MariaDB LAST_INSERT_ID(). This is drawback in performance when func_odbc is used very often in dialplan. Single database connection should be optional. ASTERISK-26010 Change-Id: I57d990616c957dabf7597dea5d5c3148f459dfb6
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-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" into 13Joshua Colp
2016-05-19Merge "res_pjsip_outbound_publishing: After unloading the library won't load ↵Joshua Colp
again" into 13
2016-05-19Merge "res_pjsip: Endpoint IP Access Controls" into 13Joshua 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_pjsip_outbound_publish: Ref leak in off nominal callback paths" ↵Joshua Colp
into 13
2016-05-19Merge "udptl: Don't eat sequence numbers until OK is received" into 13Joshua Colp
2016-05-19Merge "res/res_hep_pjsip: Fix reported local IP address when bound to 'any'" ↵Joshua Colp
into 13
2016-05-19Merge "res_pjsip_outbound_publish: state potential dropped on ↵Joshua Colp
reloads/realtime fetches" into 13
2016-05-19Merge "res_pjsip_outbound_publish: Potential crash due to off nominal path" ↵Joshua Colp
into 13
2016-05-18Merge "res_pjsip_outbound_publish: Won't unload if condition wait times out" ↵Joshua Colp
into 13
2016-05-18Merge "chan_sip: Prevent extra Session-Expires headers from being added" ↵Joshua Colp
into 13
2016-05-18udptl: Don't eat sequence numbers until OK is receivedGeorge Joseph
Scenario: Local fax -> Asterisk w/ firewall -> Provider -> Remote fax * Local fax starts rtp call to remote fax * Remote fax starts t38 call back to local fax. * Local fax sends t38 no-signal to Asterisk before sending an OK. * udptl processes the frame and increments the expected sequence number. * chan_sip drops the frame because the call isn't up so nothing goes out the external interface to open the port for incoming packets. * Local fax sends OK and Asterisk sends OK to the remote fax. * Remote fax sends t38 packets which are dropped by the firewall. * Local fax re-sends t38 no-signal with the same sequence number. * udptl drops the frame because it thinks it's a dup. * Still no outgoing packets to open the firewall. * t38 negotiation fails. The patch drops frames t38 received before udptl sequence processing when the call hasn't been answered yet. The second no-signal frame is then seen as new and is relayed out the external interface which opens the port and allows negotiation to continue. ASTERISK-26034 #close Change-Id: I11744b39748bd2ecbbe8ea84cdb4f3c5943c5af9
2016-05-17chan_sip: Prevent extra Session-Expires headers from being addedGeorge Joseph
When chan_sip does a re-INVITE to refresh a session and authentication is required, the INVITE with the Authorization header containes a second Session-Expires header without the ";refersher=" parameter. This is causing some proxies to return a 400. Also, when Asterisk is the uas and the refresher, it is including the Session-Expires and Min-SE headers in OPTIONS messages which is not allowed per RFC4028. This patch (based on the reporter's) Checks to see if a Session-Expires header is already in the message before adding another one. It also checks that the method is INVITE or UPDATE. ASTERISK-26030 #close Change-Id: I58a7b07bab5a3177748d8a7034fb8ad8e11ce1d9
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-16Merge "configs/samples/pjsip.conf.sample: Fix typo" into 13zuul
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-14configs/samples/pjsip.conf.sample: Fix typoMatt Jordan
A ':' is not a valid token for starting a comment. Change-Id: I123592d93a83d1bdde3e352822881eb9da85e5ad