= Asterisk Component
:doctitle: Asterisk
:shortname: asterisk
:artifactid: camel-asterisk
:description: Interact with Asterisk PBX Server (VoIP).
:since: 2.18
:supportlevel: Stable
:tabs-sync-option:
:component-header: Both producer and consumer are supported
//Manually maintained attributes
:camel-spring-boot-name: asterisk

*Since Camel {since}*

*{component-header}*

The Asterisk component allows you to work easily with an Asterisk PBX Server http://www.asterisk.org/ using https://asterisk-java.org/[asterisk-java]

This component helps to interface with http://www.voip-info.org/wiki-Asterisk+manager+API[Asterisk Manager Interface]

Maven users will need to add the following dependency to their `pom.xml`
for this component:

[source,xml]
------------------------------------------------------------
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-asterisk</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>
------------------------------------------------------------

== URI format

----
asterisk:name[?options]
----

// component-configure options: START

// component-configure options: END

// component options: START
include::partial$component-configure-options.adoc[]
include::partial$component-endpoint-options.adoc[]
// component options: END

// endpoint options: START

// endpoint options: END

// component headers: START
include::partial$component-endpoint-headers.adoc[]
// component headers: END

== Action

Supported actions are:

* QUEUE_STATUS: Queue status
* SIP_PEERS: List SIP peers
* EXTENSION_STATE: Check extension status

== Examples

=== Producer Example

[source,java]
--------------------------------------------------------------------------------
from("direct:in")
  .to("asterisk://myVoIP?hostname=hostname&username=username&password=password&action=EXTENSION_STATE")
--------------------------------------------------------------------------------

=== Consumer Example

[source,java]
--------------------------------------------------------------------------------
from("asterisk:myVoIP?hostname=hostname&username=username&password=password")
  .log("Received a message - ${body}");
--------------------------------------------------------------------------------


include::spring-boot:partial$starter.adoc[]
