Skip to content
Snippets Groups Projects
  1. Jan 09, 2014
  2. Jan 02, 2014
  3. Dec 19, 2013
    • Mark Michelson's avatar
      Fix a deadlock that occurred due to a conflict of masquerades. · 1b91ee6c
      Mark Michelson authored
      For the explanation, here is a copy-paste of the review board explanation:
      
      Initially, it was discovered that performing an attended transfer of a
      multiparty bridge with a PJSIP channel would cause a deadlock. A PBX thread
      started a masquerade and reached the point where it was calling the fixup()
      callback on the "original" channel. For chan_pjsip, this involves pushing a
      synchronous task to the session's serializer. The problem was that a task ahead
      of the fixup task was also attempting to perform a channel masquerade. However,
      since masquerades are designed in a way to only allow for one to occur at a
      time, the task ahead of the fixup could not continue until the masquerade
      already in progress had completed. And of course, the masquerade in progress
      could not complete until the task ahead of the fixup task had completed.
      Deadlock.
      
      The initial fix was to change the fixup task to be asynchronous. While this
      prevented the deadlock from occurring, it had the frightful side effect of
      potentially allowing for tasks in the session's serializer to operate on a
      zombie channel.
      
      Taking a step back from this particular deadlock, it became clear that the
      problem was not really this one particular issue but that masquerades
      themselves needed to be addressed. A PJSIP attended transfer operation calls
      ast_channel_move(), which attempts to both set up and execute a masquerade. The
      problem was that after it had set up the masquerade, the PBX thread had swooped
      in and tried to actually perform the masquerade. Looking at changes that had
      been made to Asterisk 12, it became clear that there never is any time now that
      anyone ever wants to set up a masquerade and allow for the channel thread to
      actually perform the masquerade. Everyone always is calling ast_channel_move(),
      performs the masquerade itself before returning.
      
      In this patch, I have removed all blocks of code from channel.c that will
      attempt to perform a masquerade if ast_channel_masq() returns true. Now, there
      is no distinction between setting up a masquerade and performing the
      masquerade. It is one operation. The only remaining checks for
      ast_channel_masq() and ast_channel_masqr() are in ast_hangup() since we do not
      want to interrupt a masquerade by hanging up the channel. Instead, now
      ast_hangup() will wait for a masquerade to complete before moving forward with
      its operation.
      
      The ast_channel_move() function has been modified to basically in-line the
      logic that used to be in ast_channel_masquerade(). ast_channel_masquerade() has
      been killed off for real. ast_channel_move() now has a lock associated with it
      that is used to prevent any simultaneous moves from occurring at once. This
      means there is no need to make sure that ast_channel_masq() or
      ast_channel_masqr() are already set on a channel when ast_channel_move() is
      called. It also means the channel container lock is not pulling double duty by
      both keeping the container locked and preventing multiple masquerades from
      occurring simultaneously.
      
      The ast_do_masquerade() function has been renamed to do_channel_masquerade()
      and is now internal to channel.c. The function now takes explicit arguments of
      which channels are involved in the masquerade instead of a single channel.
      While it probably is possible to do some further refactoring of this method, I
      feel that I would be treading dangerously. Instead, all I did was change some
      comments that no longer are true after this changeset.
      
      The other more minor change introduced in this patch is to res_pjsip.c to make
      ast_sip_push_task_synchronous() run the task in-place if we are already a SIP
      servant thread. This is related to this patch because even when we isolate the
      channel masquerade to only running in the SIP servant thread, we would still
      deadlock when the fixup() callback is reached since we would essentially be
      waiting forever for ourselves to finish before actually running the fixup. This
      makes it so the fixup is run without having to push a task into a serializer at
      all.
      
      (closes issue ASTERISK-22936)
      Reported by Jonathan Rose
      
      Review: https://reviewboard.asterisk.org/r/3069
      ........
      
      Merged revisions 404356 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      1b91ee6c
  4. Dec 14, 2013
  5. Dec 11, 2013
  6. Dec 09, 2013
  7. Dec 04, 2013
  8. Dec 01, 2013
  9. Nov 28, 2013
  10. Nov 23, 2013
    • Kevin Harwell's avatar
      res_pjsip: AMI commands and events. · 05cbf8df
      Kevin Harwell authored
      Created the following AMI commands and corresponding events for res_pjsip:
      
      PJSIPShowEndpoints - Provides a listing of all pjsip endpoints and a few
                           select attributes on each.
        Events:
          EndpointList - for each endpoint a few attributes.
          EndpointlistComplete - after all endpoints have been listed.
      
      PJSIPShowEndpoint - Provides a detail list of attributes for a specified
                          endpoint.
        Events:
          EndpointDetail - attributes on an endpoint.
          AorDetail - raised for each AOR on an endpoint.
          AuthDetail - raised for each associated inbound and outbound auth
          TransportDetail - transport attributes.
          IdentifyDetail - attributes for the identify object associated with
                           the endpoint.
          EndpointDetailComplete - last event raised after all detail events.
      
      PJSIPShowRegistrationsInbound - Provides a detail listing of all inbound
                                      registrations.
        Events:
          InboundRegistrationDetail - inbound registration attributes for each
                                      registration.
          InboundRegistrationDetailComplete - raised after all detail records have
                                      been listed.
      
      PJSIPShowRegistrationsOutbound  - Provides a detail listing of all outbound
                                        registrations.
        Events:
          OutboundRegistrationDetail - outbound registration attributes for each
                                       registration.
          OutboundRegistrationDetailComplete - raised after all detail records
                                       have been listed.
      
      PJSIPShowSubscriptionsInbound - A detail listing of all inbound subscriptions
                                      and their attributes.
        Events:
          SubscriptionDetail - on each subscription detailed attributes
          SubscriptionDetailComplete - raised after all detail records have
                                       been listed.
      
      PJSIPShowSubscriptionsOutbound - A detail listing of all outboundbound
                                      subscriptions and their attributes.
        Events:
          SubscriptionDetail - on each subscription detailed attributes
          SubscriptionDetailComplete - raised after all detail records have
                                       been listed.
      
      (issue ASTERISK-22609)
      Reported by: Matt Jordan
      Review: https://reviewboard.asterisk.org/r/2959/
      ........
      
      Merged revisions 403131 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      05cbf8df
  11. Nov 22, 2013
  12. Nov 08, 2013
  13. Oct 10, 2013
  14. Oct 08, 2013
  15. Oct 04, 2013
  16. Sep 27, 2013
  17. Sep 25, 2013
  18. Sep 23, 2013
    • Joshua Colp's avatar
      Fix crash in res_pjsip on load if error occurs, and prevent unloading of... · 85d6db6c
      Joshua Colp authored
      Fix crash in res_pjsip on load if error occurs, and prevent unloading of res_pjsip and res_pjsip_session.
      
      During load time in res_pjsip if an error occurred the operation would attempt to rollback all
      operations done during load. This is not permitted by PJSIP as it will assert if the operation has
      not been done. This fix changes the code so it will only rollback what has been initialized already.
      
      Further changes also prevent res_pjsip and res_pjsip_session from being unloaded. This is due to
      limitations within PJSIP itself. The library environment can only be changed to a certain extent
      and does not provide the ability, currently, to deinitialize certain required functionality.
      
      (closes issue ASTERISK-22474)
      Reported by: Corey Farrell
      ........
      
      Merged revisions 399624 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      85d6db6c
  19. Sep 13, 2013
  20. Sep 12, 2013
  21. Aug 30, 2013
    • Kevin Harwell's avatar
      Add a reloadable option for sorcery type objects · 9bad1dab
      Kevin Harwell authored
      Some configuration objects currently won't place nice if reloaded.
      Specifically, in this case the pjsip transport objects.  Now when
      registering an object in sorcery one may specify that the object is
      allowed to be reloaded or not.  If the object is set to not reload
      then upon reloading of the configuration the objects of that type
      will not be reloaded.  The initially loaded objects of that type
      however will remain.
      
      While the transport objects will not longer be reloaded it is still
      possible for a user to configure an endpoint to an invalid transport.
      A couple of log messages were added to help diagnose this problem if
      it occurs.
      
      (closes issue ASTERISK-22382)
      Reported by: Rusty Newton
      (closes issue ASTERISK-22384)
      Reported by: Rusty Newton
      Review: https://reviewboard.asterisk.org/r/2807/
      ........
      
      Merged revisions 398139 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      9bad1dab
  22. Aug 23, 2013
    • Mark Michelson's avatar
      e7c6f335
    • Matthew Jordan's avatar
      Update config framework/sorcery with types/options without documentation · e31bd332
      Matthew Jordan authored
      There are times when a configuration option should not have documentation.
      
      1. Some options are registered with a particular object merely as a warning to
         users. These options aren't even really 'deprecated' - which has its own
         separate API call - they are actually provided by a different configuration
         file. The options are merely registered so that the user gets a warning that
         a different configuration file provides the item.
      
      2. Some object types - most notably some used by modules that use sorcery - are
         completely internal and should never be shown to the user.
      
      3. Sorcery itself has several 'hidden' fields that should never be shown to a
         user.
      
      This patch updates the configuration framework and sorcery with additional API
      calls that allow a module to register types as internal and options as not
      requiring documentation. This bypasses the XML documentation checking.
      
      This patch also re-enables the strict XML documentation checking in trunk, as
      well as updates some documentation that was missing.
      
      Review: https://reviewboard.asterisk.org/r/2785/
      
      (closes issue ASTERISK-22359)
      Reported by: Matt Jordan
      
      (closes issue ASTERISK-22112)
      Reported by: Rusty Newton
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      e31bd332
  23. Aug 22, 2013
  24. Aug 20, 2013
  25. Aug 17, 2013
  26. Aug 06, 2013
  27. Aug 02, 2013
  28. Jul 30, 2013
  29. Jul 29, 2013
Loading