Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Feb 3, 2015
  1. Introduce .gitignore.

    In preparation for the eventual migration to git.
  2. Makefile: Add "tags" and "cscope" targets.

    When in the Asterisk directly a developer can now run:
      $ make tags cscope
    to create both a local tags file and the cscope database. You can
    also create either independently. I find that cscope is useful for
    some tasks but that ctags does a better job of locating definitions
    that have preprocessor macros.  Therefore, they are both useful to
    have when browsing through the source code.
    Signed-off-by: Shaun Ruffell <>
Commits on Jan 31, 2015
  1. @jcolp

    res_format_attr_h264: Fix crash when determining joint capability.

    jcolp committed
    The res_format_attr_h264 module currently incorrectly attempts to
    copy SPS and PPS information from the wrong attribute. This change
    fixes that.
    ASTERISK-24616 #close
    Reported by: Yura Kocyuba
    Merged revisions 431521 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
Commits on Jan 30, 2015
  1. app_agent_pool: Fix initial module load agent device state reporting.

    Richard Mudgett committed
    When the app_agent_pool module initially loads there is a race condition
    between the thread loading agents.conf and the device state internal
    processing thread.  If the device state internal processing thread handles
    the agent creation state updates before the thread that loaded agents.conf
    registers the device state provider callback then the cached agent state
    is "Invalid".  When a consumer module like app_queue asks for the agent state
    it gets the cached "Invalid" state instead of the real state from the provider.
    * Moved loading the agents.conf configuration to the last thing setup by
    app_agent_pool in load_module().  Now the device state provider callback
    is registered before the config is loaded so the agent creation state
    updates are guaranteed to get the initial device state.
    * Removed some now redundant config cleanup on error in load_config().
    * Added lock protection when accessing the device state in
    agent_pvt_devstate_get() and eliminated the RAII_VAR() usage.
    ASTERISK-24737 #close
    Reported by: Steve Pitts
    Merged revisions 431492 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  2. @kharwell

    res_pjsip_outbound_publish: eventually crashes when no response is ev…

    kharwell committed
    …er received
    When Asterisk attempts to send SIP outbound publish information and no response
    is ever received (no 200 okay, 412, 423) the system eventually crashes. A
    response is never received because the system Asterisk is attempting to send
    publish information to is not available. The underlying pjsip framework attempts
    to send publish information. After several attempts it calls back into the
    Asterisk outbound publish code. At this point if the "client->queue" is empty
    Asterisk attempts to schedule a refresh which utilizes "rdata" and since no
    response was received the given "rdata" struture is NULL. Attempting to
    dereference a NULL object of course results in a crash.
    The fix here removes the dependency on rdata for schedule_publish_refresh.
    Instead param->expiration is now passed to it as this is set to -1 if no
    response is received. Also added a notification when no response is received.
    ASTERISK-24635 #close
    Reported by: Marco Paland
    Merged revisions 431490 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  3. @superscrat

    HTTP: For httpd server, need option to define server name for securit…

    superscrat committed
    …y purposes
    Added a new config property [servername] to the http.conf file; updated the http server to use the new property when sending responses, for showing http status through the CLI and when reporting status through the 'httpstatus' webpage. In this version, [servername] is uncommented by default.
    ASTERISK-24316 #close
    Reported By: Andrew Nagy
    Merged revisions 431471 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  4. @putnopvut

    Fix some memory leaks.

    putnopvut committed
    These memory leaks were found and fixed by John Hardin. I'm just
    committing them for him.
    ASTERISK-24736 #close
    Reported by Mark Michelson
    Merged revisions 431468 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
Commits on Jan 29, 2015
  1. @sgriepentrog

    stasis transfer: fix stasis bridge push race part two

    sgriepentrog committed
    When swapping a Local channel in place of one already
    in a bridge (to complete a bridge attended transfer),
    the channel that was swapped out can actually be hung
    up before the stasis bridge push callback executes on
    the independant transfer thread.  This results in the
    stasis app loop dropping out and removing the control
    that has the the app name which the local replacement
    channel needs so it can re-enter stasis.
    To avoid this race condition a new push_peek callback
    has been added, and called from the ast_bridge_impart
    thread before it launches the independant thread that
    will complete the transfer.  Now the stasis push_peek
    callback can copy the stasis app name before the swap
    channel can hang up.
    Merged revisions 431450 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  2. @putnopvut

    Allow disabling of 100rel support on PJSIP endpoints.

    putnopvut committed
    Due to an inversion error, setting 100rel=no would not actually
    change the current value of the setting (which defaulted to "yes").
    With this fix, the inversion is corrected.
    Merged revisions 431420 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  3. @putnopvut

    Use SIPS URIs in Contact headers when appropriate.

    putnopvut committed
    RFC 3261 sections and 12.1.1 dictate specific
    scenarios when we are required to use SIPS URIs in Contact
    headers. Asterisk's non-compliance with this could actually
    cause calls to get dropped when communicating with clients
    that are strict about checking the Contact header.
    Both of the SIP stacks in Asterisk suffered from this issue.
    This changeset corrects the behavior in res_pjsip/chan_pjsip.c
    Merged revisions 431426 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  4. @putnopvut

    Use SIPS URIs in Contact headers when appropriate.

    putnopvut committed
    RFC 3261 sections and 12.1.1 dictate specific
    scenarios when we are required to use SIPS URIs in Contact
    headers. Asterisk's non-compliance with this could actually
    cause calls to get dropped when communicating with clients
    that are strict about checking the Contact header.
    Both of the SIP stacks in Asterisk suffered from this issue.
    This changeset corrects the behavior in chan_sip.
    ASTERISK-24646 #close
    Reported by Stephan Eisvogel
    Merged revisions 431423 from
    Merged revisions 431424 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  5. @gtjoseph

    res_pjsip_exten_state: Reduce log clutter... change a WARNING to a VE…

    gtjoseph committed
    Reduce log clutter by changing the "Watcher for hint %s (removed|deactivated)"
    message from WARNING to VERBOSE/2.
    Tested-by: George Joseph
    Merged revisions 431403 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  6. @jcolp

    res_rtp_asterisk: Fix DTLS when used with OpenSSL 1.0.1k

    jcolp committed
    A recent security fix for OpenSSL broke DTLS negotiation for many
    applications. This was caused by read ahead not being enabled when it
    should be. While a commit has gone into OpenSSL to force read ahead
    on for DTLS it may take some time for a release to be made and the
    change to be present in distributions (if at all). As enabling read
    ahead is a simple one line change this commit does that and fixes
    the issue.
    ASTERISK-24711 #close
    Reported by: Jared Biel
    Merged revisions 431384 from
    Merged revisions 431385 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
Commits on Jan 28, 2015
  1. @putnopvut

    Fix file descriptor leak in RTP code.

    putnopvut committed
    SIP requests that offered codecs incompatible with configured values
    could result in the allocation of RTP and RTCP ports that would not get
    reclaimed later.
    ASTERISK-24666 #close
    Reported by Y Ateya
    Merged revisions 431300 from
    Merged revisions 431303 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  2. @putnopvut

    Multiple revisions 431297-431298

    putnopvut committed
      r431297 | mmichelson | 2015-01-28 11:05:26 -0600 (Wed, 28 Jan 2015) | 17 lines
      Mitigate possible HTTP injection attacks using CURL() function in Asterisk.
      CVE-2014-8150 disclosed a vulnerability in libcURL where HTTP request injection
      can be performed given properly-crafted URLs.
      Since Asterisk makes use of libcURL, and it is possible that users of Asterisk may
      get cURL URLs from user input or remote sources, we have made a patch to Asterisk
      to prevent such HTTP injection attacks from originating from Asterisk.
      ASTERISK-24676 #close
      Reported by Matt Jordan
      r431298 | mmichelson | 2015-01-28 11:12:49 -0600 (Wed, 28 Jan 2015) | 3 lines
      Fix compilation error from previous patch.
    Merged revisions 431297-431298 from
    Merged revisions 431299 from
    Merged revisions 431301 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  3. @seanbright

    media formats: update res_format_attr_opus & silk

    seanbright committed
    In r419044, we changed how formats were handled, but the return value
    of the format_parse_sdp_fmtp functions in res_format_attr_opus and
    res_format_attr_silk were not updated, causing calls to fail.  Ran
    into this when getting codec_opus working with Asterisk 13.
    Once the return value was corrected, we were crashing in opus_getjoint
    because of NULL format attributes.  I've fixed this as well in this
    Merged revisions 431267 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  4. res_pjsip_outbound_registration: Fix reload race condition.

    Richard Mudgett committed
    Performing a CLI "module reload" command when there are new pjsip.conf
    registration objects defined frequently failed to load them correctly.
    What happens is a race condition between res_pjsip pushing its reload into
    an asynchronous task processor task and the thread that does the rest of
    the reloads when it gets to reloading the res_pjsip_outbound_registration
    module.  A similar race condition happens between a reload and the CLI/AMI
    show registrations commands.  The reload updates the current_states
    container and the CLI/AMI commands call get_registrations() which builds a
    new current_states container.
    * Made res_pjsip.c reload_module() use ast_sip_push_task_synchronous()
    instead of ast_sip_push_task() to eliminate two threads processing config
    reloads at the same time.
    * Made get_registrations() not replace the global current_states container
    so the CLI/AMI show registrations command cannot interfere with reloading.
    You could never add/remove objects in the container without the
    possibility of the container being replaced out from under you by
    * Added a registration loaded sorcery instance observer to purge any dead
    registration objects since get_registrations() cannot do this job anymore.
    The struct ast_sorcery_instance_observer callbacks must be used because
    the callback happens inline with the load process.  The struct
    ast_sorcery_observer callbacks are pushed to a different thread.
    * Added some global current_states NULL pointer checks in case the
    container disappears because of unload_module().
    * Made sorcery's struct ast_sorcery_instance_observer.object_type_loaded
    callbacks guaranteed to be called before any struct
    ast_sorcery_observer.loaded callbacks will be called.
    * Moved the check for non-reloadable objects to before the sorcery
    instance loading callbacks happen to short circuit unnecessary work.
    Previously with non-reloadable objects, the sorcery instance
    loading/loaded callbacks would always happen, the individual wizard
    loading/loaded would be prevented, and the non-reloadable type logging
    message would be logged for each associated wizard.
    ASTERISK-24729 #close
    Merged revisions 431243 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
Commits on Jan 27, 2015
  1. @kharwell

    tcptls: Bad file descriptor error when reloading chan_sip

    kharwell committed
    While running through some scenarios using chan_sip and tcp a problem would
    occur that resulted in a flood of bad file descriptor messages on the cli:
    tcptls.c:712 ast_tcptls_server_root: Accept failed: Bad file descriptor
    The message is received because the underlying socket has been closed, so is
    valid. This is probably happening because unloading of chan_sip is not atomic.
    That however is outside the scope of this patch. This patch simply stops the
    logging of multiple occurrences of that message.
    ASTERISK-24728 #close
    Reported by: Thomas Thompson
    Merged revisions 431218 from
    Merged revisions 431219 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  2. @jrrose

    Manager: Fix Manager Action ModuleLoad to give correct response when …

    jrrose committed
    Prior to this patch, ModuleLoad would respond with an error indicating that
    the requested module wasn't found in spite of finding and reloading the
    ASTERISK-24721 #close
    Merged revisions 431153 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  3. @kharwell

    chan_sip: stale nonce causes failure

    kharwell committed
    When refreshing (with a small expiration) a registration that was sent to
    chan_sip the nonce would be considered stale and reject the registration.
    What was happening was that the initial registration's "dialog" still existed
    in the dialogs container and upon refresh the dialog match algorithm would
    choose that as the "dialog" instead of the newly created one. This occurred
    because the algorithm did not check to see if the from tag matched if
    authentication info was available after the 401. So, it ended up assuming
    the original "dialog" was a match and stopped the search. The old "dialog"
    of course had an old nonce, thus the stale nonce message.
    This fix attempts to leave the original functionality alone except in the case
    of a REGISTER. If a REGISTER is received if searches for an existing "dialog"
    matching only on the callid. If the expires value is low enough it will reuse
    dialog that is there, otherwise it will create a new one.
    ASTERISK-24715 #close
    Reported by: John Bigelow
    Merged revisions 431187 from
    Merged revisions 431194 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  4. @kharwell

    res_pjsip: make it unloadable (take 2)

    kharwell committed
    Due to the original patch causing memory corruptions it was removed until the
    problem could be resolved. This patch is the original patch plus some added
    locking around stasis router subcription that was needed to avoid the memory
    Description of the original problem and patch (still applicable):
    The res_pjsip module was previously unloadable. With this patch it can now
    be unloaded.
    This patch is based off the original patch on the issue (listed below) by Corey
    Farrell with a few modifications. Namely, removed a few changes not required to
    make the module unloadable and also fixed a bug that would cause asterisk to
    crash on unloading.
    This patch is the first step (should hopefully be followed by another/others at
    some point) in allowing res_pjsip and the modules that depend on it to be
    unloadable. At this time, res_pjsip and some of the modules that depend on
    res_pjsip cannot be unloaded without causing problems of some sort.
    The goal of this patch is to get res_pjsip and only res_pjsip to be able to
    unload successfully and/or shutdown without incident (crashes, leaks, etc...).
    Other dependent modules may still cause problems on unload.
    Basically made sure, with the patch applied, that res_pjsip (with no other
    dependent modules loaded) could be succesfully unloaded and Asterisk could
    shutdown without any leaks or crashes that pertained directly to res_pjsip.
    ASTERISK-24485 #close
    Reported by: Corey Farrell
      pjsip_unload-broken-r1.patch submitted by Corey Farrell (license 5909)
    Merged revisions 431179 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  5. app_confbridge: Repeatedly starting and stopping recording ref leaks …

    Richard Mudgett committed
    …the recording channel.
    Starting and stopping conference recording more than once causes the
    recording channels to be leaked.  For v13 the channels also show up in the
    CLI "core show channels" output.
    * Reworked and simplified the recording channel code to use
    ast_bridge_impart() instead of managing the recording thread in the
    ConfBridge code.  The recording channel's ref handling easily falls into
    place and other off nominal code paths get handled better as a result.
    ASTERISK-24719 #close
    Reported by: John Bigelow
    Merged revisions 431135 from
    Merged revisions 431160 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  6. @jcolp

    bridge / res_pjsip_sdp_rtp: Fix issues with media not being reinvited…

    jcolp committed
    … during direct media.
    This change fixes two issues:
    1. During a swap operation bridging added the new channel before having the swap channel
    leave. This was not handled in bridge_native_rtp and could result in a channel not getting
    reinvited back to Asterisk. After this change the swap channel will leave first and the
    new channel will then join.
    2. If a re-invite was received after a session had been established any upstream elements
    (such as bridge_native_rtp) were not notified that they may want to re-evaluate things.
    After this change an UPDATE_RTP_PEER control frame is queued when this situation occurs
    and upstream can react.
    AST-1524 #close
    Merged revisions 431157 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  7. @matt-jordan

    ARI: Improve wiki documentation

    matt-jordan committed
    This patch improves the documentation of ARI on the wiki. Specifically, it
    addresses the following:
    * Allowed values and allowed ranges weren't documented. This was particularly
      frustrating, as Asterisk would reject query parameters with disallowed values
      - but we didn't tell anyone what the allowed values were.
    * The /play/id operation on /channels and /bridges failed to document all of
      the added media resource types.
    * Documentation for creating a channel into a Stasis application failed to
      note when it occurred, and that creating a channel into Stasis conflicts with
      creating a channel into the dialplan.
    * Some other minor tweaks in the mustache templates, including italicizing the
      parameter type, putting the default value on its own sub-bullet, and some
      other nicities.
    Merged revisions 431145 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  8. @matt-jordan

    app_confbridge: Restore user's menu name to CLI output of 'confbridge…

    matt-jordan committed
    … list'
    When issuing a 'confbridge list XXXX' CLI command, the resulting output no
    longer displays the menu associated with a ConfBridge participant.
    The issue was caused by ASTERISK-22760. When that patch was done, it removed
    the copying of the menu name associated with the user from the actual user
    This patch fixes the issue by copying the menu name over to the user profile
    when the menu hooks are applied to the user. Since that function now does a
    little bit more than just apply the hooks, the name of the function has been
    changed to cover the copying of the menu name over as well.
    In addition, there is a disparity between the menu name length as it is stored
    on the conf_menu structure and the confbridge_user structure; this patch makes
    the lengths match so that a strcpy can be used.
    ASTERISK-24723 #close
    Reported by: Steve Pitts
    Merged revisions 431134 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  9. @jcolp

    res_parking: Fix crash due to race condition when unloading.

    jcolp committed
    There is currently a race condition when unloading the res_parking
    module. Depending on the will of the universe the subscription
    invocation may occur AFTER the module is unloaded. This is because
    the module does NOT use stasis_unsubscribe_and_join when terminating
    the subscription. It merely uses stasis_unsubscribe.
    This change makes it use stasis_unsubscribe_and_join which is documented
    for usage in this exact scenario.
    AST-1520 #close
    Merged revisions 431114 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
Commits on Jan 26, 2015
  1. @leedm777

    Various fixes for OS X

    leedm777 committed
    This patch addresses compilation errors on OS X. It's been a while, so
    there's quite a few things.
     * Fixed __attribute__ decls in route.h to be portable.
     * Fixed htonll and ntohll to work when they are defined as macros.
     * Replaced sem_t usage with our ast_sem wrapper.
     * Added ast_sem_timedwait to our ast_sem wrapper.
     * Fixed some GCC 4.9 warnings using sig*set() functions.
     * Fixed some format strings for portability.
     * Fixed compilation issues with res_timing_kqueue (although tests still fail
       on OS X).
     * Fixed menuconfig /sbin/launchd detection, which disables res_timing_kqueue
       on OS X).
    ASTERISK-24539 #close
    Reported by: George Joseph
    ASTERISK-24544 #close
    Reported by: George Joseph
    Merged revisions 431092 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
Commits on Jan 25, 2015
  1. @matt-jordan

    dynamic realtime: Updates fail to work due to update fields being pas…

    matt-jordan committed
    …sed over
    When a crash was fixed due to usage of the REALTIME function in r423003, a
    regression was introduced into ast_update2_realtime where the update fields
    passed to the function would be skipped and the lookup field processed twice.
    The use of this function is a bit interesting: A variable argument list is
    used with two sentinel values - the first marks the end of the lookup
    fields/values; the second marks the end of the update fields/values.
    Unfortunately, ast_update2_realtime parses over the lookup fields twice, as
    opposed to parsing over the update fields. This causes the lookups to succeed,
    but the updates itself to have no effect.
    Note that the most common instance of this problem occurred in app_voicemail
    during the updating of a mailbox password.
    Thanks to the issue reporter, Paddy Grice, for pointing out the problem.
    ASTERISK-24626 #close
    Reported by: Paddy Grice
    Merged revisions 431072 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
Commits on Jan 23, 2015
  1. app_confbridge: Shorten CBRec channel names to CBRec/<conf_name>-<seq…

    Richard Mudgett committed
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  2. app_confbridge: Make CBRec channel names more unique.

    Richard Mudgett committed
    Channel names should be different from other channels in the system while
    the channel exists.
    * Use a sequence number for CBRec channels instead of a random number
    because the same random number could be picked again for the next CBRec
    Merged revisions 431052 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  3. app_confbridge: Whitespace

    Richard Mudgett committed
    Because there is sometimes no sence to any whitespace.
    Merged revisions 431049 from
    Merged revisions 431050 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  4. @leedm777

    Add depend on pjproject to res_pjsip_config_wizard.c

    leedm777 committed
    Merged revisions 431030 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  5. @kharwell

    Investigate and fix memory leaks in Asterisk

    kharwell committed
    Fixed memory leaks that were found in Asterisk.
    ASTERISK-24693 #close
    Reported by:  Kevin Harwell
    Merged revisions 430999 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
  6. @wdoekes

    Fix typo's (retrieve, specified, address).

    wdoekes committed
    Merged revisions 430996 from
    Merged revisions 430998 from
    git-svn-id: f38db490-d61c-443f-a65b-d21fe96a405b
Something went wrong with that request. Please try again.