app_jabber

description

This asterisk application is a jabber client for use in the dialplan (extensions.conf). It supports multiple jabber accounts, SSL, message send and receive.

apps

There are two applications included in this module:

examples

for example... consider the following extensions.conf:
exten => 8013,1,Set(jid=arbeitszimmer/bef@arbeitszimmer)
exten => 8013,2,Set(JABBER_ACK_MSG=you are being called by ${CALLERIDNUM}.)
exten => 8013,3,JabberReceive(${jid},${JABBER_ACK_MSG})
exten => 8013,4,agi(speak.tcl,${JABBER_MSG})
exten => 8013,5,Set(JABBER_ACK_MSG="${JABBER_MSG}" read. please go ahead.)
exten => 8013,6,Goto(3)
exten => 8013,7,Hangup
arbeitszimmer is the name of the configuration section in jabber.conf and also the name of the jabber server (and as such the domain part of the JID).
This configuration is periodically trying to receive a message, which is then acknowledged after it has been read aloud by the festival spech synthesizer.
the CLI output looks like this:
    -- Executing Set("mISDN/1-u4", "jid=arbeitszimmer/bef@arbeitszimmer") in new stack
    -- Executing Set("mISDN/1-u4", "JABBER_ACK_MSG=you are being called by 2008.") in new stack
    -- Executing JabberReceive("mISDN/1-u4", "arbeitszimmer/bef@arbeitszimmer|you are being called by 2008.") in new stack
Dec  2 15:21:08 NOTICE[25812]: app_jabber.c:185 jabber_send_message: sending msg to bef@arbeitszimmer using arbeitszimmer
Dec  2 15:21:19 NOTICE[23001]: app_jabber.c:121 jabber_message_handler: incoming message from bef@arbeitszimmer/Psi: there is no such thing as magic
    -- Executing AGI("mISDN/1-u4", "speak.tcl|there is no such thing as magic") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/speak.tcl
    -- AGI Script speak.tcl completed, returning 0
    -- Executing Set("mISDN/1-u4", "JABBER_ACK_MSG="there is no such thing as magic" read. please go ahead.") in new stack
    -- Executing Goto("mISDN/1-u4", "3") in new stack
    -- Goto (inbound-isdn,8013,3)
    -- Executing JabberReceive("mISDN/1-u4", "arbeitszimmer/bef@arbeitszimmer|"there is no such thing as magic" read. please go ahead.") in new stack
Dec  2 15:21:23 NOTICE[25812]: app_jabber.c:185 jabber_send_message: sending msg to bef@arbeitszimmer using arbeitszimmer
  == Spawn extension (inbound-isdn, 8013, 3) exited non-zero on 'mISDN/1-u4'

or... if you just want to know the callerid of an incoming call which is incidentally diverted to the extension 8012, try
exten => 8012,1,Set(jid=arbeitszimmer/bef@arbeitszimmer)
exten => 8012,2,JabberSend(${jid},you are being called by ${CALLERIDNUM}.)
exten => 8012,3,Dial(...)

download

--- download area ---