Skip to content
Snippets Groups Projects
  1. Nov 21, 2018
  2. Jan 24, 2018
    • Corey Farrell's avatar
      Remove redundant module checks and references. · 527cf5a5
      Corey Farrell authored
      This removes references that are no longer needed due to automatic
      references created by module dependencies.
      
      In addition this removes most calls to ast_module_check as they were
      checking modules which are listed as dependencies.
      
      Change-Id: I332a6e8383d4c72c8e89d988a184ab8320c4872e
      527cf5a5
  3. Jan 15, 2018
    • Corey Farrell's avatar
      loader: Add dependency fields to module structures. · 9cfdb81e
      Corey Farrell authored
      * Declare 'requires' and 'enhances' text fields on module info structure.
      * Rename 'nonoptreq' to 'optional_modules'.
      * Update doxygen comments.
      
      Still need to investigate dependencies among modules I cannot compile.
      
      Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
      9cfdb81e
  4. Nov 06, 2017
  5. Feb 15, 2017
    • George Joseph's avatar
      res_pjsip_pubsub: Correctly implement persisted subscriptions · 4bdf5d32
      George Joseph authored
      This patch fixes 2 original issues and more that those 2 exposed.
      
      * When we send a NOTIFY, and the client either doesn't respond or
        responds with a non OK, pjproject only calls our
        pubsub_on_evsub_state callback, no others.  Since
        pubsub_on_evsub_state (which does the sub_tree cleanup) does not
        expect to be called back without the other callbacks being called
        first, it just returns leaving the sub_tree orphaned.  Now
        pubsub_on_evsub_state checks the event for PJSIP_EVENT_TSX_STATE
        which is what pjproject will set to tell us that it was the
        transaction that timed out or failed and not the subscription
        itself timing our or being terminated by the client. If is
        TSX_STATE, pubsub_on_evsub_state now does the proper cleanup
        regardless of the state of the subscription.
      
      * When a client renews a subscription, we don't update the
        persisted subscription with the new expires timestamp.  This causes
        subscription_persistence_recreate to prune the subscription if/when
        asterisk restarts.  Now, pubsub_on_rx_refresh calls
        subscription_persistence_update to apply the new expires timestamp.
        This exposed other issues however...
      
      * When creating a dialog from rdata (which sub_persistence_recreate
        does from the packet buffer) there must NOT be a tag on the To
        header (which there will be when a client refreshes a
        subscription).  If there is one, pjsip_dlg_create_uas will fail.
        To address this, subscription_persistence_update now accepts a flag
        that indicates that the original packet buffer must not be updated.
        New subscribes don't set the flag and renews do.  This makes sure
        that when the rdata is recreated on asterisk startup, it's done
        from the original subscribe packet which won't have the tag on To.
      
      * When creating a dialog from rdata, we were setting the dialog's
        remote (SUBSCRIBE) cseq to be the same as the local (NOTIFY) cseq.
        When the client tried to resubscribe after a restart with the
        correct cseq, we'd reject the request with an Invalid CSeq error.
      
      * The acts of creating a dialog and evsub by themselves when
        recreating a subscription does NOT restart pjproject's subscription
        timer.  The result was that even if we did correctly recreate the
        subscription, we never removed it if the client happened to go away
        or send a non-OK response to a NOTIFY.  However, there is no
        pjproject function exposed to just set the timer on an evsub that
        wasn't created by an incoming subscribe request.  To address this,
        we create our own timer using ast_sip_schedule_task.  This timer is
        used only for re-establishing subscriptions after a restart.
      
        An earlier approach was to add support for setting pjproject's
        timer (via a pjproject patch) and while that patch is still included
        here, we don't use that call at the moment.
      
      While addressing these issues, additional debugging was added and
      some existing messages made more useful.  A few formatting changes
      were also made to 'pjsip show scheduled tasks' to make displaying
      the subscription timers a little more friendly.
      
      ASTERISK-26696
      ASTERISK-26756
      
      Change-Id: I8c605fc1e3923f466a74db087d5ab6f90abce68e
      4bdf5d32
  6. Jul 06, 2016
    • Alexei Gradinari's avatar
      res_pjsip: Added "subscribe_context" to endpoint · 1c949eea
      Alexei Gradinari authored
      If specified, incoming SUBSCRIBE requests will be searched for the matching
      extension in the indicated context. If no "subscribe_context" is specified,
      then the "context" setting is used.
      
      ASTERISK-25471 #close
      
      Change-Id: I3fb7a15f5bc154079bd348c08b7ad1cdd2d5e514
      1c949eea
  7. May 18, 2016
    • Joshua Colp's avatar
      res_pjsip_exten_state: Use the extension for publishing to. · d4b77dad
      Joshua Colp authored
      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
      d4b77dad
  8. May 09, 2016
    • Joshua Colp's avatar
      res_pjsip_pubsub: Use common datastores container API. · d03e170a
      Joshua Colp authored
      This migrates res_pjsip_pubsub over to using the newly
      introduce common datastores management API instead of using
      its own implementations for both subscriptions and
      publications.
      
      As well the extension state data now provides a generic
      datastores container instead of a subscription. This allows
      the dialog-info+xml body generator to work for both
      subscriptions and publications.
      
      ASTERISK-25999 #close
      
      Change-Id: I773f9e4f35092da0f653566736a8647e8cfebef1
      d03e170a
  9. Apr 29, 2016
    • Richard Mudgett's avatar
      res_pjsip_exten_state: Create PUBLISH messages. · 2c46063d
      Richard Mudgett authored
      Create PUBLISH messages to update a third party when an extension state
      changes because of either a device or presence state change.
      
      A configuration example:
      
      [exten-state-publisher]
      type=outbound-publish
      server_uri=sip:instance1@172.16.10.2
      event=presence
      ; Optional regex for context filtering, if specified only extension state
      ; for contexts matching the regex will cause a PUBLISH to be sent.
      @context=^users
      ; Optional regex for extension filtering, if specified only extension
      ; state for extensions matching the regex will cause a PUBLISH to be sent.
      @exten=^[0-9]*
      ; Required body type for the PUBLISH message.
      ;
      ; Supported values are:
      ; application/pidf+xml
      ; application/xpidf+xml
      ; application/cpim-pidf+xml
      ; application/dialog-info+xml (Planned support but not yet)
      @body=application/pidf+xml
      
      The '@' extended variables are used because the implementation can't
      extend the outbound publish type as it is provided by the outbound publish
      module.  That means you either have to use extended variables, or
      implement some sort of custom extended variable thing in the outbound
      publish module.  Another option would be to refactor that stuff to have an
      option which specifies the use of an alternate implementation's
      configuration and then have that passed to the implementation.  JColp
      opted for the extended variables method originally.
      
      ASTERISK-25972 #close
      
      Change-Id: Ic0dab4022f5cf59302129483ed38398764ee3cca
      2c46063d
  10. Apr 28, 2016
  11. Apr 26, 2016
    • Joshua Colp's avatar
      res_pjsip_exten_state: Add config support for exten state publishers. · 81ea80b7
      Joshua Colp authored
      This change adds the ability to configure outbound publishing of
      extension state. Right now stuff is merely set up to store the
      configuration and to register a global extension state callback. The
      act of constructing the body and sending is not yet complete.
      
      Configurable elements right now are a regex for filtering the context,
      a regex for filtering the extension, and the body type to publish.
      
      ASTERISK-25922 #close
      
      Change-Id: Ia7e630136dfc355073c1cadff8ad394a08523d78
      81ea80b7
  12. Apr 07, 2016
  13. Oct 22, 2015
    • Mark Michelson's avatar
      res_pjsip_pubsub: Solidify lifetime and ownership of objects. · ac0194da
      Mark Michelson authored
      There have been crashes and general instability seen in the pubsub code,
      so this patch introduces three changes to increase the stability.
      
      First, the ownership model for subscriptions has been modified. Due to
      RLS, subscriptions are stored in memory as a tree structure. Prior to my
      patch, the PJSIP subscription was the owner of the subscription tree.
      When the PJSIP subscription told us that it was terminating, we started
      destroying the subscription tree along with all of the individual leaf
      subscriptions that belong to the tree. The problem with this model is
      that the two actors in play here, the PJSIP subscription and the
      individual leaf subscriptions, need to have joint ownership of the
      subscription tree. So now, the PJSIP subscription and the individual
      leaf subscriptions each have a reference to the subscription tree. This
      way, we will not actually free memory until no players are left that
      care. The PJSIP subscription is a bigger stakeholder, in that if the
      PJSIP subscription's reference to the subscription tree is removed, the
      subscription tree instructs the leaf subscriptions to shut down and drop
      their references to the subscription tree when possible. The individual
      leaf subscriptions, upon being told to shut down, can drop their stasis
      subscriptions or whatever they use to learn of new state, and then drop
      their reference to the subscription tree once they are ready to die.
      
      Second, the lifetime of a PJSIP subscription's reference to our
      subscription tree has been altered. As I learned from doing a deep dive,
      the PJSIP evsub code can tell Asterisk multiple times that the
      subscription has been terminated, and not all of these times
      are especially helpful. I have altered the message flow that we use for
      SIP subscriptions such that we will always drop the PJSIP subscription's
      reference to the subscription tree when we send the NOTIFY that
      terminates a SIP subscription. This also means that we will now queue
      NOTIFY requests to be sent after responding to incoming SUBSCRIBEs so
      that we can have predictable state changes from the PJSIP evsub code.
      
      Third, the synchronization of operations has been improved. PJSIP can
      call into our code from a serializer thread (e.g. upon receiving an
      incoming request) or from the monitor thread (e.g. when a subscription
      times out). Because of this, there is the possibility of competing
      threads stepping on each other. PJSIP attempts to do some
      synchronization on its own by always keeping the dialog lock held when
      it calls into us. However, since we end up pushing tasks into the
      serializer, the result was that serialized operations were not grabbing
      the dialog lock and could, as a result, step on something that was being
      attempted by a different thread. Now we ensure that serialized
      operations grab the dialog lock, then check for extenuating
      circumstances, then proceed with their operation if they can.
      
      Change-Id: Iff2990c40178dad9cc5f6a5c7f76932ec644b2e5
      ac0194da
  14. May 22, 2015
    • Matt Jordan's avatar
      res/res_pjsip_exten_state: Fix confusing NOTICE message · ad7192a8
      Matt Jordan authored
      When a SUBSCRIBE request is made to a dialplan hint that doesn't exist,
      the current NOTICE message informing users of this swaps the context and
      extension parameters. This can cause a bit of confusion.
      
      Thanks to CptBurger in #asterisk for helping to point this out.
      
      Change-Id: Ie584d1a58ae217385c87a450ca25b55ca0e36e43
      ad7192a8
  15. May 13, 2015
  16. May 07, 2015
    • Joshua Colp's avatar
      res_pjsip_exten_state: Fix race condition between sending NOTIFY and termination · e33682ca
      Joshua Colp authored
      The res_pjsip_exten_state module currently has a race condition between
      processing the extension state callback from the PBX core and processing
      the subscription shutdown callback from res_pjsip_pubsub. There is currently
      no synchronization between the two. This can present a problem as while
      the SIP subscription will remain valid the tree it points to may not.
      This is in particular a problem as a task to send a NOTIFY may get queued
      which will try to use the tree that may no longer be valid.
      
      This change does the following to fix this problem:
      
      1. All access to the subscription tree is done within the task that
      sends the NOTIFY to ensure that no other thread is modifying or
      destroying the tree. This task executes on the serializer for the
      subscriptions.
      
      2. A reference to the subscription serializer is kept to ensure it
      remains valid for the lifetime of the extension state subscription.
      
      3. The NOTIFY task has been changed so it will no longer attempt
      to send a NOTIFY if the subscription has already been terminated.
      
      ASTERISK-25057 #close
      Reported by: Matt Jordan
      
      Change-Id: I0b3cd2fac5be8d9b3dc5e693aaa79846eeaf5643
      e33682ca
  17. Apr 09, 2015
    • Matthew Jordan's avatar
      clang compiler warnings: Fix autological comparisons · ea009872
      Matthew Jordan authored
      This fixes autological comparison warnings in the following:
       * chan_skinny: letohl may return a signed or unsigned value, depending on the
         macro chosen
       * func_curl: Provide a specific cast to CURLoption to prevent mismatch
       * cel: Fix enum comparisons where the enum can never be negative
       * enum: Fix comparison of return result of dn_expand, which returns a signed
         int value
       * event: Fix enum comparisons where the enum can never be negative
       * indications: tone_data.freq1 and freq2 are unsigned, and hence can never be
         negative
       * presencestate: Use the actual enum value for INVALID state
       * security_events: Fix enum comparisons where the enum can never be negative
       * udptl: Don't bother to check if the return value from encode_length is less
         than 0, as it returns an unsigned int
       * translate: Since the parameters are unsigned int, don't bother checking
         to see if they are negative. The cast to unsigned int would already blow
         past the matrix bounds.
       * res_pjsip_exten_state: Use a temporary value to cache the return of
         ast_hint_presence_state
       * res_stasis_playback: Fix enum comparisons where the enum can never be
         negative
       * res_stasis_recording: Add an enum value for the case where the recording
         operation is in error; fix enum comparisons
       * resource_bridges: Use enum value as opposed to -1
       * resource_channels: Use enum value as opposed to -1
      
      Review: https://reviewboard.asterisk.org/r/4533
      ASTERISK-24917
      Reported by: dkdegroot
      patches:
        rb4533.patch submitted by dkdegroot (License 6600)
      ........
      
      Merged revisions 434469 from http://svn.asterisk.org/svn/asterisk/branches/11
      ........
      
      Merged revisions 434470 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      ea009872
  18. Feb 14, 2015
  19. Jan 29, 2015
  20. Jan 07, 2015
  21. Oct 30, 2014
  22. Oct 16, 2014
  23. Sep 18, 2014
  24. Aug 07, 2014
  25. Jul 25, 2014
  26. Jul 07, 2014
  27. Jun 25, 2014
  28. Jun 12, 2014
  29. May 01, 2014
  30. Feb 25, 2014
  31. Jan 31, 2014
    • Kevin Harwell's avatar
      res_pjsip_exten_state: Exporting global symbols caused load order issues · f5bb5b3e
      Kevin Harwell authored
      Removed the exportation of global symbols from the module as it is no longer
      needed and it could potentially cause load problems as on some systems it
      would try to load before res_pjsip_pubsub
      ........
      
      Merged revisions 407034 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      f5bb5b3e
    • Mark Michelson's avatar
      Decouple subscription handling from NOTIFY/PUBLISH body generation. · f55abe9c
      Mark Michelson authored
      When the PJSIP pubsub framework was created, subscription handlers were required
      to state what event they handled along with what body types they knew how to
      generate. While this serves well when implementing a base RFC, it has problems
      when trying to extend the body to support non-standard or proprietary body
      elements. The code also was NOTIFY-specific, meaning that when the time comes
      that we start writing code to send out PUBLISH requests with MWI or presence
      bodies, we would likely find ourselves duplicating code that had previously been
      written.
      
      This changeset introduces the concept of body generators and body supplements. A
      body generator is responsible for allocating a native structure for a given body
      type, providing the primary body content, converting the native structure to a
      string, and deallocating resources. A body supplement takes the primary body
      content (the native structure, not a string) generated by the body generator and
      adds nonstandard elements to the body. With these elements living in their own
      module, it becomes easy to extend our support for body types and to re-use
      resources when sending a PUBLISH request.
      
      Body generators and body supplements register themselves with the pubsub core,
      similar to how subscription and publish handlers had done. Now, subscription
      handlers do not need to know what type of body content they generate, but they
      still need to inform the pubsub core about what the default body type for a
      given event package is. The pubsub core keeps track of what body generators and
      body supplements have been registered. When a SUBSCRIBE arrives, the pubsub core
      will check that there is a subscription handler for the event in the SUBSCRIBE,
      then it will check that there is a body generator that can provide the content
      specified in the Accept header(s).
      
      Because of the nature of body generators and supplements, it means
      res_pjsip_exten_state and res_pjsip_mwi have been completely gutted. They no
      longer worry about body types, instead calling
      ast_sip_pubsub_generate_body_content() when they need to generate a NOTIFY body.
      
      Review: https://reviewboard.asterisk.org/r/3150
      ........
      
      Merged revisions 407016 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      f55abe9c
  32. 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
  33. Aug 22, 2013
  34. Aug 06, 2013
  35. Jul 30, 2013
    • Mark Michelson's avatar
      The large GULP->PJSIP renaming effort. · 735b30ad
      Mark Michelson authored
      The general gist is to have a clear boundary between old SIP stuff
      and new SIP stuff by having the word "SIP" for old stuff and "PJSIP"
      for new stuff. Here's a brief rundown of the changes:
      
      * The word "Gulp" in dialstrings, functions, and CLI commands is now
        "PJSIP"
      * chan_gulp.c is now chan_pjsip.c
      * Function names in chan_gulp.c that were "gulp_*" are now "chan_pjsip_*"
      * All files that were "res_sip*" are now "res_pjsip*"
      * The "res_sip" directory is now "res_pjsip"
      * Files in the "res_pjsip" directory that began with "sip_*" are now "pjsip_*"
      * The configuration file is now "pjsip.conf" instead of "res_sip.conf"
      * The module info for all PJSIP-related files now uses "PJSIP" instead of "SIP"
      * CLI and AMI commands created by Asterisk's PJSIP modules now have "pjsip" as
      the starting word instead of "sip"
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      735b30ad
  36. Jul 11, 2013
  37. Jun 22, 2013
    • Joshua Colp's avatar
      Merge in current pimp_my_sip work, including: · 77002bc3
      Joshua Colp authored
      1. Security events
      2. Websocket support
      3. Diversion header + redirecting support
      4. An anonymous endpoint identifier
      5. Inbound extension state subscription support
      6. PIDF notify generation
      7. One touch recording support (special thanks Sean Bright!)
      8. Blind and attended transfer support
      9. Automatic inbound registration expiration
      10. SRTP support
      11. Media offer control dialplan function
      12. Connected line support
      13. SendText() support
      14. Qualify support
      15. Inband DTMF detection
      16. Call and pickup groups
      17. Messaging support
      
      Thanks everyone!
      
      Side note: I'm reminded of the song "How Far We've Come" by Matchbox Twenty.
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      77002bc3
Loading