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
Diff Revision 6 Diff Revision 7
[20] 25 lines
[+20]
26
   can be found on the Asterisk wiki (http://wiki.asterisk.org/).
26
   can be found on the Asterisk wiki (http://wiki.asterisk.org/).
27

    
   
27

   
28
Parking
28
Parking
29
-------
29
-------
30
 * parkedmusicclass can now be set for non-default parking lots.
30
 * parkedmusicclass can now be set for non-default parking lots.

    
   
31
 * ParkedCall application can now specify a specific parkinglot.
31

    
   
32

   
32
Asterisk Manager Interface
33
Asterisk Manager Interface
33
--------------------------
34
--------------------------
34
 * PeerStatus now includes Address and Port.
35
 * PeerStatus now includes Address and Port.
35
 * Added Hold events for when the remote party puts the call on and off hold
36
 * Added Hold events for when the remote party puts the call on and off hold
36
   for chan_dahdi ISDN channels.
37
   for chan_dahdi ISDN channels.
37
 * Added new action MeetmeListRooms to list active conferences (shows same
38
 * Added new action MeetmeListRooms to list active conferences (shows same
38
   data as "meetme list" at the CLI).
39
   data as "meetme list" at the CLI).

    
   
40
 * DAHDIShowChannels, SIPshowpeer, SIPpeers, and IAXpeers now contains a

    
   
41
   Description field that is set by 'description' in the channel configuration

    
   
42
   file.

    
   
43
 * Added Uniqueid header to UserEvent.
39

    
   
44

   
40
Asterisk HTTP Server
45
Asterisk HTTP Server
41
--------------------------
46
--------------------------
42
 * The HTTP Server can bind to IPv6 addresses.
47
 * The HTTP Server can bind to IPv6 addresses.
43

    
   
48

   

    
   
49
chan_dahdi

    
   
50
--------------------------

    
   
51
 * Busy tone patterns featuring 2 silence and 2 tone lengths can now be used

    
   
52
   with busydetect.  usage example: busypattern=200,200,200,600

    
   
53

   
44
CLI Changes
54
CLI Changes
45
--------------------------
55
--------------------------
46
 * New 'gtalk show settings' command showing the current settings loaded from
56
 * New 'gtalk show settings' command showing the current settings loaded from
47
   gtalk.conf.
57
   gtalk.conf.
48
 * The 'logger reload' command now supports an optional argument, specifying an
58
 * The 'logger reload' command now supports an optional argument, specifying an
49
   alternate configuration file to use.
59
   alternate configuration file to use.

    
   
60
 * 'dialplan add extension' command will now automatically create a context if

    
   
61
   the specified context does not exist with a message indicated it did so.

    
   
62
 * 'sip show peers', 'iax show peers', and 'dahdi show peers' now contains a

    
   
63
   Description field which can be populated with 'description' in the channel

    
   
64
   configuration files (sip.conf, iax2.conf, and chan_dahdi.conf).
50

    
   
65

   
51
CDR
66
CDR
52
--------------------------
67
--------------------------
53
 * The filter option in cdr_adaptive_odbc now supports negating the argument,
68
 * The filter option in cdr_adaptive_odbc now supports negating the argument,
54
   thus allowing records which do NOT match the specified filter.
69
   thus allowing records which do NOT match the specified filter.
55

    
   
70

   
56
CODECS
71
CODECS
57
--------------------------
72
--------------------------
58
 * Ability to define custom SILK formats in codecs.conf.
73
 * Ability to define custom SILK formats in codecs.conf.
59
 * Addition of speex32 audio format with translation.
74
 * Addition of speex32 audio format with translation.
60

    
   
75

   

    
   
76
ConfBridge

    
   
77
--------------------------

    
   
78
 * New highly optimized and customizable ConfBridge application capable of

    
   
79
   mixing audio at sample rates ranging from 8khz-96khz.

    
   
80
 * CONFBRIDGE dialplan function capable of creating dynamic ConfBridge user

    
   
81
   and bridge profiles on a channel.

    
   
82

   
61
Dialplan Variables
83
Dialplan Variables
62
------------------
84
------------------
63
 * Added ASTETCDIR, ASTMODDIR, ASTVARLIBDIR, ASTDBDIR, ASTKEYDIR, ASTDATADIR,
85
 * Added ASTETCDIR, ASTMODDIR, ASTVARLIBDIR, ASTDBDIR, ASTKEYDIR, ASTDATADIR,
64
   ASTAGIDIR, ASTSPOOLDIR, ASTRUNDIR, ASTLOGDIR which hold the equivalent
86
   ASTAGIDIR, ASTSPOOLDIR, ASTRUNDIR, ASTLOGDIR which hold the equivalent
65
   variables from asterisk.conf.
87
   variables from asterisk.conf.
66

    
   
88

   
67
Dialplan Functions
89
Dialplan Functions
68
------------------
90
------------------

    
   
91
 * Addition of the JITTERBUFFER dialplan function. This function allows

    
   
92
   for jitterbuffering to occur on the read side of a channel.  By using

    
   
93
   this function conference applications such as ConfBridge and MeetMe can

    
   
94
   have the rx streams jitterbuffered before conference mixing occurs.
69
 * Added DB_KEYS, which lists the next set of keys in the Asterisk database
95
 * Added DB_KEYS, which lists the next set of keys in the Asterisk database
70
   hierarchy.
96
   hierarchy.

    
   
97
 * Added STRREPLACE function.  This function let's the user search a variable

    
   
98
   for a given string to replace with another string as many times as the

    
   
99
   user specifies or just throughout the whole string.

    
   
100
 * Added option to CHANNEL(pickupgroup) allow reading and setting the pickupgroup of channel.
71

    
   
101

   
72
libpri channel driver (chan_dahdi) DAHDI changes
102
libpri channel driver (chan_dahdi) DAHDI changes
73
--------------------------
103
--------------------------
74
 * Added moh_signaling option to specify what to do when the channel's bridged
104
 * Added moh_signaling option to specify what to do when the channel's bridged
75
   peer puts the ISDN channel on hold.
105
   peer puts the ISDN channel on hold.
[+20] [20] 4 lines
[+20]
80

    
   
110

   
81
Calendaring
111
Calendaring
82
--------------------------
112
--------------------------
83
 * Added setvar option to calendar.conf to allow setting channel variables on
113
 * Added setvar option to calendar.conf to allow setting channel variables on
84
   notification channels.
114
   notification channels.

    
   
115
 * Added "calendar show types" CLI command to list registered calendar

    
   
116
   connectors.
85

    
   
117

   
86
MixMonitor
118
MixMonitor
87
--------------------------
119
--------------------------
88
 * Added two new options, r and t with file name arguments to record 
120
 * Added two new options, r and t with file name arguments to record 
89
   single direction (unmixed) audio recording separate from the bidirectional
121
   single direction (unmixed) audio recording separate from the bidirectional
90
   (mixed) recording.  The mixed file name argument is optional now as long
122
   (mixed) recording.  The mixed file name argument is optional now as long
91
   as at least one recording option is used.
123
   as at least one recording option is used.
92

    
   
124

   

    
   
125
FollowMe

    
   
126
--------------------------

    
   
127
 * Added a new option, l, which will disable local call optimization for

    
   
128
   channels involved with the FollowMe thread.  Use this option to improve

    
   
129
   compatability for a FollowMe call with certain dialplan apps, options, and

    
   
130
   functions.

    
   
131

   

    
   
132
CEL

    
   
133
--------------------------

    
   
134
 * cel_pgsql now supports the 'extra' column for data added using the

    
   
135
   CELGenUserEvent() application.

    
   
136

   

    
   
137
pbx_lua

    
   
138
--------------------------

    
   
139
 * Support for defining hints has been added to pbx_lua.  See the 'hints' table

    
   
140
   in the sample extensions.lua file for syntax details.

    
   
141
 * Applications that perform jumps in the dialplan such as Goto will now

    
   
142
   execute properly.  When pbx_lua detects that the context, extension, or

    
   
143
   priority we are executing on has changed it will immediatly return control

    
   
144
   to the asterisk PBX engine.  Currently the engine cannot detect a Goto to

    
   
145
   the priority after the currently executing priority.

    
   
146
 * An autoservice is now started by default for pbx_lua channels.  It can be

    
   
147
   stopped and restarted using the autoservice_stop() and autoservice_start()

    
   
148
   functions.

    
   
149

   
93
------------------------------------------------------------------------------
150
------------------------------------------------------------------------------
94
--- Functionality changes from Asterisk 1.6.2 to Asterisk 1.8 ----------------
151
--- Functionality changes from Asterisk 1.6.2 to Asterisk 1.8 ----------------
95
------------------------------------------------------------------------------
152
------------------------------------------------------------------------------
96

    
   
153

   
97
SIP Changes
154
SIP Changes
[+20] [20] 59 lines
[+20]
157
   available in device configurations as well as in the dial plan.
214
   available in device configurations as well as in the dial plan.
158
 * Addition of the 'subscribe_network_change' option for turning on and off
215
 * Addition of the 'subscribe_network_change' option for turning on and off
159
   res_stun_monitor module support in chan_sip.
216
   res_stun_monitor module support in chan_sip.
160
 * Addition of the 'auth_options_requests' option for turning on and off
217
 * Addition of the 'auth_options_requests' option for turning on and off
161
   authentication for OPTIONS requests in chan_sip.
218
   authentication for OPTIONS requests in chan_sip.

    
   
219
 * Add T38 support for REJECTED state where T.38 Negotiation is explicitly rejected.
162

    
   
220

   
163

    
   
221

   
164
IAX2 Changes
222
IAX2 Changes
165
-----------
223
-----------
166
 * Added rtsavesysname option into iax.conf to allow the systname to be saved
224
 * Added rtsavesysname option into iax.conf to allow the systname to be saved
[+20] [20] 96 lines
[+20]
263
   notices a change.
321
   notices a change.
264
 * Voicemail now includes rdnis within msgXXXX.txt file.
322
 * Voicemail now includes rdnis within msgXXXX.txt file.
265
 * Added 'D' command to ExternalIVR full details in doc/externalivr.txt
323
 * Added 'D' command to ExternalIVR full details in doc/externalivr.txt
266
 * Added 'v' option to MeetMe to play voicemail greetings when a user joins/leaves
324
 * Added 'v' option to MeetMe to play voicemail greetings when a user joins/leaves
267
   a MeetMe conference
325
   a MeetMe conference

    
   
326
 * Added ability to include '@parkinglot' to ParkedCall extension in order to specify

    
   
327
   a specific parkinglot on which to search the extension.
268

    
   
328

   
269
Dialplan Functions
329
Dialplan Functions
270
------------------
330
------------------
271
 * SRVQUERY and SRVRESULT functions added. This can be used to query and iterate
331
 * SRVQUERY and SRVRESULT functions added. This can be used to query and iterate
272
   over SRV records associated with a specific service. From the CLI, type
332
   over SRV records associated with a specific service. From the CLI, type
[+20] [20] 245 lines
[+20]
518
 * A DBGetComplete event now follows a DBGetResponse, to make the DBGet action
578
 * A DBGetComplete event now follows a DBGetResponse, to make the DBGet action
519
   conform more closely to similar events.
579
   conform more closely to similar events.
520
 * Added a new eventfilter option per user to allow whitelisting and blacklisting
580
 * Added a new eventfilter option per user to allow whitelisting and blacklisting
521
   of events.
581
   of events.
522
 * Added optional parkinglot variable for park command.
582
 * Added optional parkinglot variable for park command.

    
   
583
 * Added ConnectedLineNum and ConnectedLineName headers to AMI events/responses

    
   
584
   if CallerIDNum and CallerIDName headers are also present.
523

    
   
585

   
524
Channel Event Logging
586
Channel Event Logging
525
---------------------
587
---------------------
526
 * A new interface, CEL, is introduced here. CEL logs single events, much like
588
 * A new interface, CEL, is introduced here. CEL logs single events, much like
527
   the AMI, but it differs from the AMI in that it logs to db backends much
589
   the AMI, but it differs from the AMI in that it logs to db backends much
[+20] [20] 1239 lines
/trunk/channels/chan_sip.c
Diff Revision 6 Diff Revision 7
 
/trunk/channels/sip/include/sip.h
Diff Revision 6 Diff Revision 7
 
/trunk/configs/jabber.conf.sample
Diff Revision 6 Diff Revision 7
 
/trunk/configs/sip.conf.sample
Diff Revision 6 Diff Revision 7
 
/trunk/doc/asterisk-messaging.txt
Diff Revision 6 Diff Revision 7
 
/trunk/include/asterisk/_private.h
Diff Revision 6 Diff Revision 7
 
/trunk/include/asterisk/channel.h
Diff Revision 6 Diff Revision 7
 
/trunk/include/asterisk/jabber.h
Diff Revision 6 Diff Revision 7
 
/trunk/include/asterisk/message.h
Diff Revision 6 Diff Revision 7
 
/trunk/main/asterisk.c
Diff Revision 6 Diff Revision 7
 
/trunk/main/channel.c
Diff Revision 6 Diff Revision 7
 
/trunk/main/message.c
Diff Revision 6 Diff Revision 7
 
/trunk/res/res_jabber.c
Diff Revision 6 Diff Revision 7
 
  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...

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.