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

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 734
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 494
Once you have this working, you have verified that AMI is accepting connections via
a TCP connection.
AMI over HTTP
It is also possible to use the AMI over HTTP. In this section we will perform the same
actions as before, but over HTTP instead of the native TCP interface to the AMI. The
responses will be delivered over HTTP in the same format as the previous example,
since the rawman encoding type is being used. AMI-over-HTTP responses can be enco-
ded in other formats, such as XML. These response-formatting options are covered in
“AMI over HTTP” on page 467.
Accounts used for connecting to the AMI over HTTP are the same ac-
counts configured in /etc/asterisk/manager.conf.
This example demonstrates how to access the AMI over HTTP, log in, execute the
Ping action, and log off:
$ wget "http://localhost:8088/rawman?action=login&username=hello&secret=world" \
> --save-cookies cookies.txt -O -
--2010-08-31 12:34:23--
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8088... connected.
HTTP request sent, awaiting response... 200 OK
Length: 55 [text/plain]
Saving to: `STDOUT'
Response: Success
Message: Authentication accepted
2010-08-31 12:34:23 (662 KB/s) - written to stdout [55/55]
$ wget "http://localhost:8088/rawman?action=ping" --load-cookies cookies.txt -O -
--2010-08-31 12:34:23--
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:8088... connected.
HTTP request sent, awaiting response... 200 OK
Length: 63 [text/plain]
Saving to: `STDOUT'
Response: Success
Ping: Pong
Timestamp: 1283258063.040293
2010-08-31 12:34:23 (775 KB/s) - written to stdout [63/63]
Quick Start | 459
Vista de página 494
1 2 ... 490 491 492 493 494 495 496 497 498 499 500 ... 733 734

Comentários a estes Manuais

Sem comentários