Review Board 1.7.16


Support text messages outside of a call

Review Request #1042 - Created Dec. 1, 2010 and submitted

Russell Bryant
trunk
Reviewers
asterisk-dev
Asterisk
This branch contains a proposal for adding protocol independent support for processing text messages into and out of the dialplan, outside of a call.  The file doc/asterisk-messaging.txt contains more details on the proposal.  The introduction of the document is quoted here:

"    Asterisk has some limited support today for messaging.  The support that
exists primarily includes passing text messages in the context of a call.  The
SIP and IAX2 protocols have support for this, but that's it.

    There are a couple of other messaging protocols that are supported: Skype
and XMPP (Jabber).  The support of these is very minimal and not very integrated
into the architecture of Asterisk since these messages are not in the context of
a phone call.  They provide a combination of dialplan and manager interface
interfaces that are specific to each protocol.  There just is no current
architectural concept of dealing with text messages.

    The purpose of this proposal is to introduce text messaging into the
architecture of Asterisk.  For messaging support to exist in the true spirit of
Asterisk architecture, the design needs to achieve the following two goals:

    a) Protocol Independence
    b) Scriptable message routing

    The rest of this document goes through some details about how these goals
will be achieved in a way that is both architecturally compatible with Asterisk
as well as practical to implement."

----------

In addition to the documented proposal, I have made some good progress on implementation.  While the document includes some ideas for future enhancements, what is there so far should be usable.

 - core modifications to allow sending incoming messages through the dialplan
 - core modifications to allow outbound messages from the dialplan
 - modifications to res_jabber to allow inbound and outbound messages in the new architecture
 - changes to chan_sip to support inbound and outbound MESSAGE outside of a call
svn/testsuite/asterisk/team/russell/messaging:
  - This branch of the testsuite contains my tests for this branch, which include:
    - tests/sip/message_disabled
      - Ensure MESSAGE outside of a call is rejected when disabled.
    - tests/sip/message_unauth
      - When enabled, test sending a MESSAGE to Asterisk and send another back out from the dialplan.
    - tests/sip/message_auth
      - Same as the last test, but authenticate MESSAGE both inbound and outbound.
    - tests/sip/message_from_call
      - Set up a normal SIP call and send an out of call MESSAGE from the dialplan processing the call

I have also written some simple apps using the pjsua Python module from pjsip that can send and receive messages sent through Asterisk.

Lastly, I have done some manual testing of XMPP messages in and out of Asterisk using this code.
/trunk/CHANGES
Revision 321522 New Change
[20] 9 lines
[+20]
10

    
   
10

   
11
------------------------------------------------------------------------------
11
------------------------------------------------------------------------------
12
--- Functionality changes from Asterisk 1.8 to Asterisk 1.10 -----------------
12
--- Functionality changes from Asterisk 1.8 to Asterisk 1.10 -----------------
13
------------------------------------------------------------------------------
13
------------------------------------------------------------------------------
14

    
   
14

   

    
   
15
Text Messaging

    
   
16
--------------

    
   
17
 * Asterisk now has protocol independent support for processing text messages

    
   
18
   outside of a call.  Messages are routed through the Asterisk dialplan.

    
   
19
   SIP MESSAGE and XMPP are currently supported.  There are options in

    
   
20
   jabber.conf and sip.conf to allow enabling these features.

    
   
21
     -> jabber.conf: see the "sendtodialplan" and "context" options.

    
   
22
     -> sip.conf: see the "accept_outofcall_message" and "auth_message_requests"

    
   
23
        options.

    
   
24
   The MESSAGE() dialplan function and MessageSend() application have been

    
   
25
   added to go along with this functionality.  More detailed usage information

    
   
26
   can be found on the Asterisk wiki (http://wiki.asterisk.org/).

    
   
27

   
15
Parking
28
Parking
16
-------
29
-------
17
 * parkedmusicclass can now be set for non-default parking lots.
30
 * parkedmusicclass can now be set for non-default parking lots.
18
 * ParkedCall application can now specify a specific parkinglot.
31
 * ParkedCall application can now specify a specific parkinglot.
19

    
   
32

   
[+20] [20] 1796 lines
/trunk/channels/chan_sip.c
Diff Revision 1 Diff Revision 7
 
/trunk/channels/sip/include/sip.h
Diff Revision 1 Diff Revision 7
 
/trunk/configs/jabber.conf.sample
Diff Revision 1 Diff Revision 7
 
/trunk/configs/sip.conf.sample
Diff Revision 1 Diff Revision 7
 
/trunk/doc/asterisk-messaging.txt
Diff Revision 1 Diff Revision 7
 
/trunk/include/asterisk/_private.h
Diff Revision 1 Diff Revision 7
 
/trunk/include/asterisk/channel.h
Diff Revision 1 Diff Revision 7
 
/trunk/include/asterisk/jabber.h
Diff Revision 1 Diff Revision 7
 
/trunk/include/asterisk/message.h
Diff Revision 1 Diff Revision 7
 
/trunk/main/asterisk.c
Diff Revision 1 Diff Revision 7
 
/trunk/main/channel.c
Diff Revision 1 Diff Revision 7
 
/trunk/main/message.c
Diff Revision 1 Diff Revision 7
 
/trunk/res/res_jabber.c
Diff Revision 1 Diff Revision 7
 
/trunk/testsuite-tests/message_from_call/run-test
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_from_call/test-config.yaml
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_from_call/configs/ast1/extensions.conf
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_from_call/sipp/call.xml
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_from_call/sipp/message_recv.xml
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_unauth/run-test
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_unauth/test-config.yaml
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_unauth/configs/ast1/extensions.conf
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_unauth/sipp/message.xml
Diff Revision 1 Diff Revision 7 - File Reverted
 
/trunk/testsuite-tests/message_unauth/sipp/message_recv.xml
Diff Revision 1 Diff Revision 7 - File Reverted
 
  1. /trunk/CHANGES: Loading...
  2. /trunk/channels/chan_sip.c: Loading...
  3. /trunk/channels/sip/include/sip.h: Loading...
  4. /trunk/configs/jabber.conf.sample: Loading...
  5. /trunk/configs/sip.conf.sample: Loading...
  6. /trunk/doc/asterisk-messaging.txt: Loading...
  7. /trunk/include/asterisk/_private.h: Loading...
  8. /trunk/include/asterisk/channel.h: Loading...
  9. /trunk/include/asterisk/jabber.h: Loading...
  10. /trunk/include/asterisk/message.h: Loading...
  11. /trunk/main/asterisk.c: Loading...
  12. /trunk/main/channel.c: Loading...
  13. /trunk/main/message.c: Loading...
  14. /trunk/res/res_jabber.c: Loading...
  15. /trunk/testsuite-tests/message_from_call/run-test: Loading...
  16. /trunk/testsuite-tests/message_from_call/test-config.yaml: Loading...
  17. /trunk/testsuite-tests/message_from_call/configs/ast1/extensions.conf: Loading...
  18. /trunk/testsuite-tests/message_from_call/sipp/call.xml: Loading...
  19. /trunk/testsuite-tests/message_from_call/sipp/message_recv.xml: Loading...
  20. /trunk/testsuite-tests/message_unauth/run-test: Loading...
  21. /trunk/testsuite-tests/message_unauth/test-config.yaml: Loading...
  22. /trunk/testsuite-tests/message_unauth/configs/ast1/extensions.conf: Loading...
  23. /trunk/testsuite-tests/message_unauth/sipp/message.xml: Loading...
  24. /trunk/testsuite-tests/message_unauth/sipp/message_recv.xml: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.