System information

Here is a simple example to get us started:
[LocalSets]
exten => 104,1,Answer()
; *** This line should not have any line breaks
same => n,JabberSend(asterisk,jim@shifteight.org,Incoming call from
${CALLERID(all)})
same => n,Dial(SIP/0000FFFF0002,30)
same => n,Hangup()
This example demonstrates how to use the JabberSend() application to send a message
to someone prior to dialing a device. Let’s break down the values we’ve used. The first
argument, asterisk, is the section header we defined in the jabber.conf file as
[asterisk]. In our jabber.conf example, we set up a user called asterisk@shif-
teight.org to send messages via the Google XMPP server, and asterisk is the section
name we defined. The second argument, jim@shifteight.org, is the buddy we’re send-
ing the message to. We can define any buddy here, either as a bare JID (as we’ve done
above) or as a full JID with a resource (e.g., jim@shifteight.org/laptop). The third ar-
gument to JabberSend() is the message we want to send to the buddy. In this case we’re
sending Incoming call from ${CALLERID(all)}, with the CALLERID() dialplan function
being used to enter the caller ID information in the message.
Obviously, we would have to further build out our dialplan to make this useful: spe-
cifically, we’d have to associate the buddy name (e.g., jim@shifteight.org) with the
device we’re calling (SIP/0000FFFF0002) so that we’re sending the message to the correct
buddy. You can save these associations in any one of several locations, such as the in
AstDB, in a relational database retrieved with func_odbc, or even in a global variable.
Receiving messages with JABBER_RECEIVE()
The JABBER_RECEIVE() dialplan function allows us to receive responses via XMPP mes-
sages, capture those responses, and presumably act on them. We would typically use
the JABBER_RECEIVE() function in conjunction with the JabberSend() dialplan applica-
tion, as we are likely to need to send a message to someone and prompt him with the
acceptable values he can return. We could use the JABBER_RECEIVE() function either
personally, to direct calls to a particular device such as a cell phone or desk phone, or
as a text version of an auto attendant to be used when people who are likely to have
difficulty hearing the prompts dial in (e.g., users who are deaf or work at noisy job
sites). In the latter case, the system would have to be preconfigured to know where to
send the messages to, perhaps based on the caller ID of the person calling.
Here is a simple example that sends a message to someone, waits for a response, and
then routes the call based on the response:
exten => 106,1,Answer()
; All text must be on a single line.
422 | Chapter 18:External Services