ATech Machine LIBRA-02 M Informações Técnicas Página 459

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 734
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 458
same => n,JabberSend(asterisk,[email protected],Incoming call from
${CALLERID(all)}. Press 1 to route to desk. Press 2 to send to voicemail.)
same => n,Set(JabberResponse=${JABBER_RECEIVE(asterisk,[email protected])})
same => n,GotoIf($["${JabberResponse}" = "1"]?dial,1)
same => n,GotoIf($["${JabberResponse}" = "2"]?voicemail,1)
same => n,Goto(dial,1)
exten => dial,1,Verbose(2,Calling our desk)
same => n,Dial(SIP/0000FFFF0002,6)
same => n,Goto(voicemail,1)
exten => voicemail,1,Verbose(2,VoiceMail)
; *** This line should not have any line breaks
same => n,Set(VoiceMailStatus=${IF($[${ISNULL(${DIALSTATUS})}
| "${DIALSTATUS}" = "BUSY"]?b:u)})
same => n,Playback(silence/1)
same => n,VoiceMail(100@lmentinc,${VoiceMailStatus})
same => n,Hangup()
Unfortunately, the JabberSend() application requires all of the message
to be sent on a single line. If you wish to break up the text onto multiple
lines, you will need to send it as multiple messages on separate lines
using JabberSend().
Our simple dialplan first sends a message to a Jabber account ([email protected]) via
our systems’ Jabber account (asterisk), as configured in jabber.conf. We then use the
JABBER_RECEIVE() dialplan function to wait for a response from [email protected]. The
default timeout is 5 seconds, but you can specify a different timeout with a third argu-
ment to JABBER_RECEIVE(). For example, to wait 10 seconds for a response, we could
have used a line like this:
Set(JabberResponse=${JABBER_RECEIVE(asterisk,[email protected],10)})
Once we’ve either received a response or the timeout has expired, we move on to the
next line of the dialplan, which starts checking the response saved to the
${JabberResponse} channel variable. If the value is 1, we continue our dialplan at dial,
1 of the current context. If the response is 2, we continue our dialplan at voicemail,1.
If no response (or an unknown response) is received, we continue the dialplan at
dial,1.
The dialplan at dial,1 and voicemail,1 should be fairly self-evident. This is a non-
production example; some additional dialplan should be implemented to make the
values dynamic.
There is a disadvantage to the way we’ve implemented the JABBER_RECEIVE() function,
though. Our function blocks, or waits, for a response from the endpoint. If we set the
response value low to minimize delay, we don’t give the user we sent the message to
Using XMPP (Jabber) with Asterisk | 423
Vista de página 458
1 2 ... 454 455 456 457 458 459 460 461 462 463 464 ... 733 734

Comentários a estes Manuais

Sem comentários