Skip to content
Snippets Groups Projects
  1. Apr 10, 2015
  2. Apr 07, 2015
    • Matthew Jordan's avatar
      ARI: Add the ability to intercept hold and raise an event · c2f50ba6
      Matthew Jordan authored
      For some applications - such as SLA - a phone pressing hold should not behave
      in the fashion that the Asterisk core would like it to. Instead, the hold
      action has some application specific behaviour associated with it - such as
      disconnecting the channel that initiated the hold; only playing MoH to channels
      in the bridge if the channels are of a particular type, etc.
      
      One way of accomplishing this is to use a framehook to intercept the
      hold/unhold frames, raise an event, and eat the frame. Tasty. This patch
      accomplishes that using a new dialplan function, HOLD_INTERCEPT.
      
      In addition, some general cleanup of raising hold/unhold Stasis messages was
      done, including removing some RAII_VAR usage.
      
      Review: https://reviewboard.asterisk.org/r/4549/
      
      ASTERISK-24922 #close
      ........
      
      Merged revisions 434216 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c2f50ba6
  3. Feb 27, 2015
  4. Feb 21, 2015
  5. Feb 12, 2015
    • Matthew Jordan's avatar
      ARI/PJSIP: Add the ability to redirect (transfer) a channel in a Stasis app · 29f66b04
      Matthew Jordan authored
      This patch adds a new feature to ARI to redirect a channel to another server,
      and fixes a few bugs in PJSIP's handling of the Transfer dialplan
      application/ARI redirect capability.
      
      *New Feature*
      A new operation has been added to the ARI channels resource, redirect. With
      this, a channel in a Stasis application can be redirected to another endpoint
      of the same underlying channel technology.
      
      *Bug fixes*
      In the process of writing this new feature, two bugs were fixed in the PJSIP
      stack:
      (1) The existing .transfer channel callback had the limitation that it could
          only transfer channels to a SIP URI, i.e., you had to pass
          'PJSIP/sip:foo@my_provider.com' to the dialplan application. While this is
          still supported, it is somewhat unintuitive - particularly in a world full
          of endpoints. As such, we now also support specifying the PJSIP endpoint to
          transfer to.
      (2) res_pjsip_multihomed was, unfortunately, trying to 'help' a 302 redirect by
          updating its Contact header. Alas, that resulted in the forwarding
          destination set by the dialplan application/ARI resource/whatever being
          rewritten with very incorrect information. Hence, we now don't bother
          updating an outgoing response if it is a 302. Since this took a looong time
          to find, some additional debug statements have been added to those modules
          that update the Contact headers.
      
      Review: https://reviewboard.asterisk.org/r/4316/
      
      ASTERISK-24015 #close
      Reported by: Private Name
      
      ASTERISK-24703 #close
      Reported by: Matt Jordan
      ........
      
      Merged revisions 431717 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      29f66b04
  6. Feb 09, 2015
  7. Jan 27, 2015
    • Matthew Jordan's avatar
      ARI: Improve wiki documentation · fb8a2e03
      Matthew Jordan authored
      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.
      
      Review: https://reviewboard.asterisk.org/r/4351
      ........
      
      Merged revisions 431145 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      fb8a2e03
  8. Jan 07, 2015
  9. Dec 09, 2014
  10. Dec 08, 2014
  11. Sep 20, 2014
  12. Aug 20, 2014
  13. Aug 11, 2014
  14. Aug 07, 2014
  15. Aug 05, 2014
    • Matthew Jordan's avatar
      Multiple revisions 420089-420090,420097 · 47bf7efc
      Matthew Jordan authored
      ........
        r420089 | mjordan | 2014-08-05 15:10:52 -0500 (Tue, 05 Aug 2014) | 72 lines
        
        ARI: Add channel technology agnostic out of call text messaging
        
        This patch adds the ability to send and receive text messages from various
        technology stacks in Asterisk through ARI. This includes chan_sip (sip),
        res_pjsip_messaging (pjsip), and res_xmpp (xmpp). Messages are sent using the
        endpoints resource, and can be sent directly through that resource, or to a
        particular endpoint.
        
        For example, the following would send the message "Hello there" to PJSIP
        endpoint alice with a display URI of sip:asterisk@mycooldomain.org:
        
        ari/endpoints/sendMessage?to=pjsip:alice&from=sip:asterisk@mycooldomain.org&body=Hello+There
        
        This is equivalent to the following as well:
        
        ari/endpoints/PJSIP/alice/sendMessage?from=sip:asterisk@mycooldomain.org&body=Hello+There
        
        Both forms are available for message technologies that allow for arbitrary
        destinations, such as chan_sip.
        
        Inbound messages can now be received over ARI as well. An ARI application that
        subscribes to endpoints will receive messages from those endpoints:
        
        {
          "type": "TextMessageReceived",
          "timestamp": "2014-07-12T22:53:13.494-0500",
          "endpoint": {
            "technology": "PJSIP",
            "resource": "alice",
            "state": "online",
            "channel_ids": []
          },
          "message": {
            "from": "\"alice\" <sip:alice@127.0.0.1>",
            "to": "pjsip:asterisk@127.0.0.1",
            "body": "Watson, come here.",
            "variables": []
          },
          "application": "testsuite"
        }
        
        The above was made possible due to some rather major changes in the message
        core. This includes (but is not limited to):
        - Users of the message API can now register message handlers. A handler has
          two callbacks: one to determine if the handler has a destination for the
          message, and another to handle it.
        - All dialplan functionality of handling a message was moved into a message
          handler provided by the message API.
        - Messages can now have the technology/endpoint associated with them.
          Various other properties are also now more easily accessible.
        - A number of ao2 containers that weren't really needed were replaced with
          vectors. Iteration over ao2_containers is expensive and pointless when
          the lifetime of things is well defined and the number of things is very
          small.
        
        res_stasis now has a new file that makes up its structure, messaging. The
        messaging functionality implements a message handler, and passes received
        messages that match an interested endpoint over to the app for processing.
        
        Note that inadvertently while testing this, I reproduced ASTERISK-23969.
        res_pjsip_messaging was incorrectly parsing out the 'to' field, such that
        arbitrary SIP URIs mangled the endpoint lookup. This patch includes the
        fix for that as well.
        
        Review: https://reviewboard.asterisk.org/r/3726
        
        ASTERISK-23692 #close
        Reported by: Matt Jordan
        
        ASTERISK-23969 #close
        Reported by: Andrew Nagy
      ........
        r420090 | mjordan | 2014-08-05 15:16:37 -0500 (Tue, 05 Aug 2014) | 2 lines
        
        Remove automerge properties :-(
      ........
        r420097 | mjordan | 2014-08-05 16:36:25 -0500 (Tue, 05 Aug 2014) | 2 lines
        
        test_message: Fix strict-aliasing compilation issue
      ........
      
      Merged revisions 420089-420090,420097 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      47bf7efc
  16. Jul 25, 2014
    • Matthew Jordan's avatar
      Multiple revisions 419565-419566 · 355dc3d2
      Matthew Jordan authored
      ........
        r419565 | mjordan | 2014-07-25 09:41:23 -0500 (Fri, 25 Jul 2014) | 21 lines
        
        ARI: report duration values in LiveRecording objects
        
        This patch adds three new fields to the LiveRecording model:
         - total_duration: the total length of the live recording
         - talking_duration: optional. The duration of talking energy that was
           detected while the recording was made.
         - silence_duration: optional. The duration of silence that was detected while
           the recording was made.
        
        These values are reported in the RecordingFinished ARI event.
        
        When a DSP is enabled on the channel during the recording - which occurs when
        the recording is created with max_silence_seconds (indicating that the user
        actually cares about how much silence is in the file), we will report the
        talking_duration and silence_duration in addition to the total_duration.
        
        Review: https://reviewboard.asterisk.org/r/3770/
        
        ASTERISK-24037 #close
        Reported by: Samuel Galarneau
      ........
        r419566 | mjordan | 2014-07-25 09:46:15 -0500 (Fri, 25 Jul 2014) | 1 line
        
        Update CHANGES for r419565
      ........
      
      Merged revisions 419565-419566 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      355dc3d2
  17. Jul 22, 2014
    • Matthew Jordan's avatar
      ARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech · bb87796f
      Matthew Jordan authored
      This patch serves two purposes:
      (1) It fixes some bugs with endpoint subscriptions not reporting all of the
          channel events
      (2) It serves as the preliminary work needed for ASTERISK-23692, which allows
          for sending/receiving arbitrary out of call text messages through ARI in a
          technology agnostic fashion.
      
      The messaging functionality described on ASTERISK-23692 requires two things:
      (1) The ability to send/receive messages associated with an endpoint. This is
          relatively straight forwards with the endpoint core in Asterisk now.
      (2) The ability to send/receive messages associated with a technology and an
          arbitrary technology defined URI. This is less straight forward, as
          endpoints are formed from a tech + resource pair. We don't have a
          mechanism to note that a technology that *may* have endpoints exists.
      
      This patch provides such a mechanism, and fixes a few bugs along the way.
      
      The first major bug this patch fixes is the forwarding of channel messages
      to their respective endpoints. Prior to this patch, there were two problems:
      (1) Channel caching messages weren't forwarded. Thus, the endpoints missed
          most of the interesting bits (such as channel creation, destruction, state
          changes, etc.)
      (2) Channels weren't associated with their endpoint until after creation.
          This resulted in endpoints missing the channel creation message, which
          limited the usefulness of the subscription in the first place (a major use
          case being 'tell me when this endpoint has a channel'). Unfortunately,
          this meant another parameter to ast_channel_alloc. Since not all channel
          technologies support an ast_endpoint, this patch makes such a call
          optional and opts for a new function, ast_channel_alloc_with_endpoint.
      
      When endpoints are created, they will implicitly create a technology endpoint
      for their technology (if one does not already exist). A technology endpoint is
      special in that it has no state, cannot have channels created for it, cannot
      be created explicitly, and cannot be destroyed except on shutdown. It does,
      however, have all messages from other endpoints in its technology forwarded to
      it.
      
      Combined with the bug fixes, we now have Stasis messages being properly
      forwarded. Consider the following scenario: two PJSIP endpoints (foo and bar),
      where bar has a single channel associated with it and foo has two channels
      associated with it. The messages would be forwarded as follows:
      
      channel PJSIP/foo-1 --
                            \
                             --> endpoint PJSIP/foo --
                            /                         \
      channel PJSIP/foo-2 --                           \
                                                        ---- > endpoint PJSIP
                                                      /
      channel PJSIP/bar-1 -----> endpoint PJSIP/bar --
      
      ARI, through the applications resource, can:
       - subscribe to endpoint:PJSIP/foo and get notifications for channels
         PJSIP/foo-1,PJSIP/foo-2 and endpoint PJSIP/foo
       - subscribe to endpoint:PJSIP/bar and get notifications for channels
         PJSIP/bar-1 and endpoint PJSIP/bar
       - subscribe to endpoint:PJSIP and get notifications for channels
         PJSIP/foo-1,PJSIP/foo-2,PJSIP/bar-1 and endpoints PJSIP/foo,PJSIP/bar
      
      Note that since endpoint PJSIP never changes, it never has events itself. It
      merely provides an aggregation point for all other endpoints in its technology
      (which in turn aggregate all channel messages associated with that endpoint).
      
      This patch also adds endpoints to res_xmpp and chan_motif, because the actual
      messaging work will need it (messaging without XMPP is just sad).
      
      Review: https://reviewboard.asterisk.org/r/3760/
      
      ASTERISK-23692
      ........
      
      Merged revisions 419196 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      bb87796f
  18. Jul 18, 2014
  19. Jul 08, 2014
  20. Jul 03, 2014
  21. May 30, 2014
  22. May 28, 2014
  23. May 22, 2014
    • Scott Griepentrog's avatar
      ARI: Add ability to raise arbitrary User Events · cf21644d
      Scott Griepentrog authored
      User events can now be generated from ARI.  Events can be signalled with
      arbitrary json variables, and include one or more of channel, bridge, or
      endpoint snapshots.  An application must be specified which will receive
      the event message (other applications can subscribe to it).  The message
      will also be delivered via AMI provided a channel is attached.  Dialplan
      generated user event messages are still transmitted via the channel, and
      will only be received by a stasis application they are attached to or if
      the channel is subscribed to.
      
      This change also introduces the multi object blob mechanism used to send
      multiple snapshot types in a single message.  The dialplan app UserEvent
      was also changed to use multi object blob, and a new stasis message type
      created to handle them.
      
      ASTERISK-22697 #close
      Review: https://reviewboard.asterisk.org/r/3494/
      ........
      
      Merged revisions 414405 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      cf21644d
  24. Apr 18, 2014
  25. Apr 17, 2014
  26. Mar 28, 2014
  27. Mar 19, 2014
  28. Mar 07, 2014
    • Scott Griepentrog's avatar
      uniqueid: channel linkedid, ami, ari object creation with id's · 80ef9a21
      Scott Griepentrog authored
      Much needed was a way to assign id to objects on creation, and
      much change was necessary to accomplish it.  Channel uniqueids
      and linkedids are split into separate string and creation time
      components without breaking linkedid propgation.  This allowed
      the uniqueid to be specified by the user interface - and those
      values are now carried through to channel creation, adding the
      assignedids value to every function in the chain including the
      channel drivers. For local channels, the second channel can be
      specified or left to default to a ;2 suffix of first.  In ARI,
      bridge, playback, and snoop objects can also be created with a
      specified uniqueid.
      
      Along the way, the args order to allocating channels was fixed
      in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
      masquerade occurs.
      
      (closes issue ASTERISK-23120)
      Review: https://reviewboard.asterisk.org/r/3191/
      ........
      
      Merged revisions 410157 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      80ef9a21
  29. Mar 06, 2014
  30. Feb 05, 2014
  31. Feb 01, 2014
  32. Jan 21, 2014
  33. Jan 14, 2014
  34. Dec 20, 2013
  35. Dec 18, 2013
  36. Dec 17, 2013
  37. Dec 14, 2013
Loading