summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-03-23pjproject-bundled: Cleanups for reported issuesGeorge Joseph
PortAudio should no longer be required PJSIP_MAX_PKT_LEN is now 6000 Older autoconf issue fixed. (CentOS 6) Change-Id: I463fa9586cbe7c6b3b603289f535bd8e361611dd
2016-03-21Merge "func_aes: fix misuse of strlen on binary data" into 13zuul
2016-03-19func_aes: fix misuse of strlen on binary dataGianluca Merlo
The encryption code for AES_ENCRYPT evaluates the length of the data to be encoded in base64 using strlen. The data is binary, thus the length of it can be underestimated at the first NULL character. Reuse the write pointer offset to evaluate it, instead. ASTERISK-25857 #close Change-Id: If686b5d570473eb926693c73461177b35b13b186
2016-03-18chan_pjsip: ref leak when checking direct_media_glareKevin Harwell
Fix the reference leak introduced in the following commit: 9444ddadf8525d1ce66a1faf1db97f9f6c265ca4 ASTERISK-25849 Change-Id: I5cfefd5ee6c1c3a1715c050330aaa10e4d2a5e85
2016-03-18chan_pjsip: transfers with direct media reinvite has wrong address/portKevin Harwell
During a transfer involving direct media a race occurs between when the transferer channel is swapped out, initiating rtp changes/updates, and the subsequent reinvites. When Alice, after speaking with Charlie (Bob is on hold), connects Bob and Charlie invites are sent to each in order to establish the call between them. Bob is taken off hold and Charlie is told to have his media flow through Asterisk. However, if before those invites go out the bridge updates Bob's and/or Charlie's rtp information with direct media data (i.e. address, port) then the invite(s) will contain the remote data in the SDP instead of the Asterisk data. The race occurs in the native bridge glue code when updating the peer. The direct_media_address can get set twice before sending out the first invite during call connection. This can happen because the checking/setting of the direct_media_address happened in one thread while the sending of the invite(s) happened in another thread. This fix removes the race condition by moving the checking/setting of the direct_media_address to be in the same thread as the sending of the invites(s). This serializes the checking/setting and sending so they can no longer happen out of order. ASTERISK-25849 #close Change-Id: Idfea590175e74f401929a601dba0c91ca1a7f873
2016-03-17Merge "install_prereq: Check if is installed aptitude otherwise to install." ↵zuul
into 13
2016-03-17Merge "install_prereq: Update repositories before install on Debian systems" ↵zuul
into 13
2016-03-17install_prereq: Update repositories before install on Debian systemsRodrigo Ramírez Norambuena
When to install packages the indexed local is more old of the version of software on the repository they have been upgraded by security update then get the package will give 404 not found. The patch prevent by update local index to repository for aptitude before install. ASTERISK-25495 #close Reporte by: Rodrigo Ramírez Norambuena Change-Id: I645959e553aac542805ced394cac2dca964051fa (cherry picked from commit 88f3dbaec9509bfba8bc1de7799aa0dc65304bb5)
2016-03-17install_prereq: Check if is installed aptitude otherwise to install.Rodrigo Ramírez Norambuena
If in Debian or system based, dont have aptitude installed the script do nothing. This patch checked if aptitude installed, if not installed. Also, if execute script with all packages installed yet, the script not show nothing and return exit 1 because the command 'grep' get nothing from pipe from 'awk'. ASTERISK-25113 #close Reported By: Rodrigo Ramírez Norambuena <decipher.hk@gmail.com> Change-Id: Iebdff55805d3917166e5e08e0a1e2176f36ff27f (cherry picked from commit 6737ded0581a9e1256bdfe30c1d747e7ca93f8b3)
2016-03-17res_pjsip_refer.c: Fix seg fault in process of Refer-to header.Sergio Medina Toledo
The "Refer-to" header of an incoming REFER request is parsed by pjsip_parse_uri(). That function requires the URI parameter to be NULL terminated. Unfortunately, the previous code added the NULL terminator by overwriting memory that may not be safe. The overwritten memory results could be benign, memory corruption, or a segmentation fault. Now the URI is NULL terminated safely by copying the URI to a new chunk of memory with the correct size to be NULL terminated. ASTERISK-25814 #close Change-Id: I32565496684a5a49c3278fce06474b8c94b37342
2016-03-17Merge "Add initial support to build Docker images" into 13zuul
2016-03-16chan_sip.c: Fix mwi resub deadlock potential.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. ASTERISK-25023 #close Change-Id: I96d429c57a48861fd8bde63dd93db4e92dc3adb6
2016-03-16chan_sip.c: Fix registration timeout and expire deadlock potential.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. ASTERISK-25023 Change-Id: I2e40de89efc8ae6e8850771d089ca44bc604b508
2016-03-16chan_sip.c: Fix t38id deadlock potential.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. ASTERISK-25023 Change-Id: If595e4456cd059d7171880c7f354e844c21b5f5f
2016-03-16chan_sip.c: Fix reinviteid deadlock potential.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. ASTERISK-25023 Change-Id: I9c11b9d597468f63916c99e1dabff9f4a46f84c1
2016-03-16chan_sip.c: Fix packet retransid deadlock potential.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. * Fix retrans_pkt() to call check_pendings() with both the owner channel and the private objects locked as required. * Refactor dialog retransmission packet list to safely remove packet nodes. The list nodes are now ao2 objects. The list has a ref and the scheduled entry has a ref. ASTERISK-25023 Change-Id: I50926d81be53f4cd3d572a3292cd25f563f59641
2016-03-16chan_sip.c: Fix waitid deadlock potential.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. * Made always run check_pendings() under the scheduler thread so scheduler ids can be checked safely. ASTERISK-25023 Change-Id: Ia834d6edd5bdb47c163e4ecf884428a4a8b17d52
2016-03-16chan_sip.c: Fix session timers deadlock potential.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. ASTERISK-25023 Change-Id: I6d65269151ba95e0d8fe4e9e611881cde2ab4900
2016-03-16chan_sip.c: Fix autokillid deadlock potential.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. * Fix clearing autokillid in __sip_autodestruct() even though we could reschedule. ASTERISK-25023 Change-Id: I450580dbf26e2e3952ee6628c735b001565c368f
2016-03-16chan_sip.c: Fix provisional_keepalive_sched_id deadlock.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Stopping a scheduled event can result in a deadlock if the scheduled event is running when you try to stop the event. If you hold a lock needed by the scheduled event while trying to stop the scheduled event then a deadlock can happen. The general strategy for resolving the deadlock potential is to push the actual starting and stopping of the scheduled events off onto the scheduler/do_monitor() thread by scheduling an immediate one shot scheduled event. Some restructuring may be needed because the code may assume that the start/stop of the scheduled events is immediate. ASTERISK-25023 Change-Id: I98a694fd42bc81436c83aa92de03226e6e4e3f48
2016-03-16chan_sip.c: Adjust how dialog_unlink_all() stops scheduled events.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. * Make dialog_unlink_all() unschedule all items at once in the sched thread. ASTERISK-25023 Change-Id: I7743072fb228836e8228b72f6dc46c8cc50b3fb4
2016-03-16chan_sip.c: Clear scheduled immediate events on unload.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. The reordering of chan_sip's shutdown is to handle any immediate events that get put onto the scheduler so resources aren't leaked. The typical immediate events at this time are going to be concerned with stopping other scheduled events. ASTERISK-25023 Change-Id: I3f6540717634f6f2e84d8531a054976f2bbb9d20
2016-03-16sip/dialplan_functions.c: Fix /channels/chan_sip/test_sip_rtpqos crash.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. Delaying destruction of the chan_sip sip_pvt structures caused the /channels/chan_sip/test_sip_rtpqos unit test to crash. That test registers a special test ast_rtp_engine with the rtp engine module. When the unit test completes it cleans up by unregistering the test ast_rtp_engine and exits. Since the delayed destruction of the sip_pvt happens after the unit test returns, the destructor tries to call the rtp engine destroy callback of the test ast_rtp_engine auto variable which no longer exists on the stack. * Change the test ast_rtp_engine auto variable to a static variable. Now the variable can still exist after the unit test exits so the delayed sip_pvt destruction can complete successfully. ASTERISK-25023 Change-Id: I61e34a12d425189ef7e96fc69ae14993f82f3f13
2016-03-16Merge "sched.c: Ensure oldest expiring entry runs first." into 13zuul
2016-03-16Merge "app_stasis: Don't hang up if app is not registered" into 13zuul
2016-03-16Merge "chan_sip.c: Simplify sip_pvt destructor call levels." into 13zuul
2016-03-16app_stasis: Don't hang up if app is not registeredAndrew Nagy
This prevents pbx_core from hanging up the channel if the app isn't registered. ASTERISK-25846 #close Change-Id: I63216a61f30706d5362bc0906b50b6f0544aebce
2016-03-15Merge "pjproject: Pass (dont_)optimize flags to pjproject and fix pjsua" ↵zuul
into 13
2016-03-15Merge "chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full()." into 13zuul
2016-03-15Merge "build_system: Split COMPILE_DOUBLE from DONT_OPTIMIZE" into 13zuul
2016-03-15sched.c: Ensure oldest expiring entry runs first.Richard Mudgett
This patch is part of a series to resolve deadlocks in chan_sip.c. * Updated sched unit test to check new behavior. ASTERISK-25023 Change-Id: Ib69437327b3cda5e14c4238d9ff91b2531b34ef3
2016-03-15Merge "build: Add configure check for proto field of PJSIP TLS transport ↵zuul
setting." into 13
2016-03-15Merge "res_pjsip_refer.c: Delay sending the initial SIP Notify with frag ↵Joshua Colp
100" into 13
2016-03-14chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full().Richard Mudgett
Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12
2016-03-14chan_sip.c: Simplify sip_pvt destructor call levels.Richard Mudgett
Remove destructor calling destroy_it calling really_destroy_it for no benefit. Just make the destructor the really_destroy_it function. Change-Id: Idea0d47b27dd74f2488db75bcc7f353d8fdc614a
2016-03-14build: Add configure check for proto field of PJSIP TLS transport setting.Joshua Colp
Older versions of PJSIP do not have the proto field on the TLS transport setting structure. This change adds a configure check so even if it is not present we will still be able to build. Change-Id: Ibf3f47befb91ed1b8194bf63888baa6fee05aba9
2016-03-13build_system: Split COMPILE_DOUBLE from DONT_OPTIMIZEGeorge Joseph
I can't ever recall actually needing the intermediate files or the checking that a double compile produces. What I CAN remember is every DONT_OPTIMIZE build needing 3 invocations of gcc instead of 1 just to do the checks and produce those intermediate files. Having said that, Richard pointed out that the reason for the double compile was that there were cases in the past where a submitted patch failed to compile because the submitter never tried it with the optimizations turned on. To get the best of both worlds, COMPILE_DOUBLE has been split into its own option. If DONT_OPTIMIZE is turned on, COMPILE_DOUBLE will also be selected BUT you can then turn it off if all you need are the debugging symbols. This way you have to make an informed decision about disabling COMPILE_DOUBLE. To allow COMPILE_DOUBLE to be both auto-selected and turned off, a new feature was added to menuselect. The <use> element can now contain an "autoselect" attribute which will turn the used member on but not create a hard dependency. The cflags.xml implementation for COMPILE_DOUBLE looks like this... <member name="DONT_OPTIMIZE" displayname="Disable Optimizations ..."> <use autoselect="yes">COMPILE_DOUBLE</use> <support_level>core</support_level> </member> <member name="COMPILE_DOUBLE" displayname="Pre-compile with ...> <depend>DONT_OPTIMIZE</depend> <support_level>core</support_level> </member> When DONT_OPTIMIZE is turned on, COMPILE_DOUBLE is turned on because of the use. When DONT_OPTIMIZE is turned off, COMPILE_DOUBLE is turned off because of the depend. When COMPILE_DOUBLE is turned on, DONT_OPTIMIZE is turned on because of the depend. When COMPILE_DOUBLE is turned off, DONT_OPTIMIZE is left as is because it only uses COMPILE_DOUBLE, it doesn't depend on it. I also made a few tweaks to the ncurses implementation to move things left a bit to allow longer descriptions. Change-Id: Id49ca930ac4b5ec4fc2d8141979ad888da7b1611
2016-03-12pjproject: Pass (dont_)optimize flags to pjproject and fix pjsuaGeorge Joseph
The pjproject Makefile now uses the Asterisk optimization flags which are determined by the setting of the DONT_OPTMIZE menuselect flag. The Makefile was also restructured so a change to the top level menuselect.makeopts will result in a rebuild of pjproject. Also, "--disable-resample" was removed from the pjproject configure options. Without resample, pjsua (which is used by the testsuite) can't make audio calls. When it can't, it segfaults. Change-Id: I24b0a4d0872acef00ed89b3c527a713ee4c2ccd4
2016-03-11app_chanspy: Fix occasional deadlock with ChanSpy and Local channels.Walter Doekes
Channel masquerading had a conflict with autochannel locking. When locking autochannel->channel, the channel is fetched from the autochannel and then locked. During the fetch, the autochannel -- which has no locks itself -- can be modified by someone who owns the channel lock. That means that the value of autochan->channel cannot be trusted until you hold the lock. In practice, this caused problems with Local channels getting masqueraded away while the ChanSpy attempted to get info from that channel. The old channel which was about to get removed got locked, but the new (replaced) channel got unlocked (no-op). Because the replaced channel was now locked (and would never get unlocked), it couldn't get removed from the channel list in a timely manner, and would now cause deadlocks when iterating over the channel list. This change checks the autochannel after locking the channel for changes to the autochannel. If the channel had been changed, the lock is reobtained on the new channel. In theory it seems possible that after this fix, the lock attempt on the old (wrong) channel can be on an already destroyed lock, maybe causing a crash. But that hasn't been observed in the wild and is harder induce than the current deadlock. Thanks go to Filip Frank for suggesting a fix similar to this and especially to IRC user hexanol for pointing out why this deadlock was possible and testing this fix. And to Richard for catching my rookie while loop mistake ;) ASTERISK-25321 #close Change-Id: I293ae0014e531cd0e675c3f02d1d118a98683def
2016-03-10Merge "install_prereq: Add packages for bundled pjproject" into 13Joshua Colp
2016-03-08Merge "res_pjsip_caller_id: Anonymize 'From' when caller id presentation is ↵zuul
prohibited" into 13
2016-03-08Merge "pjproject_bundled: Remove --with-external-pa from configure options." ↵zuul
into 13
2016-03-07pjproject_bundled: Remove --with-external-pa from configure options.George Joseph
Not sure why it was there in the first place as we already specify --disable-sound. Change-Id: Ia80a40e8b1e1acc287955ab11ba1fbd0c7d4cff9
2016-03-07res_pjsip: Strip spaces from items parsed from comma-separated listsGeorge Joseph
Configurations like "aors = a, b, c" were either ignoring everything after "a" or trying to look up " b". Same for mailboxes, ciphers, contacts and a few others. To fix, all the strsep(&copy, ",") calls have been wrapped in ast_strip. To facilitate this, ast_strip, ast_skip_blanks and ast_skip_nonblanks were updated to handle null pointers. In some cases, an ast_strlen_zero() test was added to skip consecutive commas. There was also an attempt to ast_free an ast_strdupa'd string in ast_sip_for_each_aor which was causing a SEGV. I removed it. Although this issue was reported for realtime, the issue was in the res_pjsip modules so all config mechanisms were affected. ASTERISK-25829 #close Reported-by: Mateusz Kowalski Change-Id: I0b22a2cf22a7c1c50d4ecacbfa540155bec0e7a2
2016-03-05install_prereq: Add packages for bundled pjprojectGeorge Joseph
RedHat/CentOS needs python-devel Debian/Ubuntu needs automake, libsrtp-dev and python-dev Ubuntu also needed libncurses5-dev for cmenuselect so while not needed for pjproject, I adedd it anyway. Change-Id: Idf5fa16e2d87c687439621507e122cb9461d7089
2016-03-04Merge "third_party/Makefile.rules: Replace unsupported != operator with ↵zuul
$(shell ...)" into 13
2016-03-04Merge "config_transport: Fix objects returned by ↵Joshua Colp
ast_sip_get_transport_states" into 13
2016-03-03Merge "alembic: Fix downgrade and tweak for sqlite" into 13zuul
2016-03-03res_pjsip_caller_id: Anonymize 'From' when caller id presentation is prohibitedGeorge Joseph
Per RFC3325, the 'From' header is now anonymized on outgoing calls when caller id presentation is prohibited. TID = trust_id_outbound PRO = Set(CALLERID(pres)=prohib) USR = endpoint/from_user DOM = endpoint/from_domain PAI = YES(privacy=off), NO(not sent), PRI(privacy=full) (assumes send_pai=yes) Conditions |Result --------------------|---------------------------------------------------- TID PRO USR DOM |PAI FROM --------------------|---------------------------------------------------- Y Y abc def.ghi |PRI "Anonymous" <sip:abc@def.ghi> Y Y abc |PRI "Anonymous" <sip:abc@anonymous.invalid> Y Y def.ghi |PRI "Anonymous" <sip:anonymous@def.ghi> Y Y |PRI "Anonymous" <sip:anonymous@anonymous.invalid> Y N abc def.ghi |YES <sip:abc@def.ghi> Y N abc |YES <sip:abc@<ip_address>> Y N def.ghi |YES "Caller Name" <sip:<caller_exten>@def.ghi> Y N |YES "Caller Name" <sip:<caller_exten>@<ip_address>> N Y abc def.ghi |NO "Anonymous" <sip:abc@def.ghi> N Y abc |NO "Anonymous" <sip:abc@anonymous.invalid> N Y def.ghi |NO "Anonymous" <sip:anonymous@def.ghi> N Y |NO "Anonymous" <sip:anonymous@anonymous.invalid> N N abc def.ghi |YES <sip:abc@def.ghi> N N abc |YES <sip:abc@<ip_address>> N N def.ghi |YES "Caller Name" <sip:<caller_exten>@def.ghi> N N |YES "Caller Name" <sip:<caller_exten>@<ip_address>> ASTERISK-25791 #close Reported-by: Anthony Messina Change-Id: I2c82a5ca1413c2c00fb62ea95b0ae8e97af54dc9
2016-03-03Merge "loader: Retry dlopen when loading fails" into 13zuul