---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    funktion.fabric8.io/kind: Connector
  name: asterisk
data:
  deployment.yml: |
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        funktion.fabric8.io/kind: Subscription
        connector: asterisk
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            funktion.fabric8.io/kind: Subscription
            connector: asterisk
        spec:
          containers:
          - image: funktion/connector-asterisk:${project.version}
            name: connector
  schema.yml: |
    ---
    component:
      kind: component
      scheme: asterisk
      syntax: asterisk:name
      title: Asterisk
      description: The asterisk component is used to interact with Asterisk PBX Server Asterisk PBX Server.
      label: voip
      deprecated: false
      async: false
      javaType: org.apache.camel.component.asterisk.AsteriskComponent
      groupId: org.apache.camel
      artifactId: camel-asterisk
      version: 2.18.3
    componentProperties: {}
    properties:
      name:
        kind: path
        group: common
        required: true
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: Logical name
        order: 0
      hostname:
        kind: parameter
        group: common
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The hostname of the asterix server
        order: 1
      password:
        kind: parameter
        group: common
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: true
        description: Login password
        order: 2
      username:
        kind: parameter
        group: common
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: true
        description: Login username
        order: 3
      bridgeErrorHandler:
        kind: parameter
        group: consumer
        label: consumer
        type: boolean
        javaType: boolean
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        defaultValue: false
        description: Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 4
      exceptionHandler:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: object
        javaType: org.apache.camel.spi.ExceptionHandler
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        description: To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 5
      exchangePattern:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: string
        javaType: org.apache.camel.ExchangePattern
        enum:
        - InOnly
        - RobustInOnly
        - InOut
        - InOptionalOut
        - OutOnly
        - RobustOutOnly
        - OutIn
        - OutOptionalIn
        deprecated: false
        secret: false
        description: Sets the exchange pattern when the consumer creates an exchange.
        order: 6
      action:
        kind: parameter
        group: producer
        label: producer
        type: string
        javaType: org.apache.camel.component.asterisk.AsteriskActionEnum
        enum:
        - QUEUE_STATUS
        - SIP_PEERS
        - EXTENSION_STATE
        deprecated: false
        secret: false
        description: What action to perform such as getting queue status sip peers or extension state.
        order: 7
      synchronous:
        kind: parameter
        group: advanced
        label: advanced
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
        order: 8
  documentation.adoc: |
    [[AsteriskComponent-AsteriskComponent]]
    Asterisk Component
    ~~~~~~~~~~~~~~~~~~~

    *Available as of Camel 2.18*

    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 help 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>
    ------------------------------------------------------------

    [[AsteriskComponent-URIformat]]
    URI format
    ^^^^^^^^^^

    [source,java]
    -------------------------------------------------------------------------------------------------------------------------
    asterisk:name[?options]
    -------------------------------------------------------------------------------------------------------------------------

    [[AsteriskComponent-Options]]
    Options
    ^^^^^^^

    // component options: START
    The Asterisk component has no options.
    // component options: END

    // endpoint options: START
    The Asterisk component supports 9 endpoint options which are listed below:

    {% raw %}
    [width="100%",cols="2,1,1m,1m,5",options="header"]
    |=======================================================================
    | Name | Group | Default | Java Type | Description
    | name | common |  | String | *Required* Logical name
    | hostname | common |  | String | The hostname of the asterix server
    | password | common |  | String | Login password
    | username | common |  | String | Login username
    | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
    | action | producer |  | AsteriskActionEnum | What action to perform such as getting queue status sip peers or extension state.
    | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
    |=======================================================================
    {% endraw %}
    // endpoint options: END

    [[Asterisk-Actions]]
    Action
    ^^^^^^
    Supported actions are:

    * QUEUE_STATUS, Queue Status
    * SIP_PEERS, List SIP Peers
    * EXTENSION_STATE, Check Extension Status
