#!/bin/bash

  # Create a channel
  echo "Creating channel: my-test-channel-001..."
  curl -X POST 'http://foobar:foobar@localhost:8088/ari/channels/my-test-channel-001?endpoint=PJSIP/test&app=foobar'
  echo
  echo

sleep 3

  # Create a bridge
  echo "Creating bridge: my-test-bridge-001..."
  curl -X POST 'http://foobar:foobar@localhost:8088/ari/bridges/my-test-bridge-001'
  echo
  echo

sleep 3

  # List the subscriptions
  echo "Subscriptions:"
  curl 'http://foobar:foobar@localhost:8088/ari/applications/foobar'
  echo
  echo

sleep 3

  # Add channel to bridge
  echo "Adding channel my-test-channel-001 to bridge my-test-bridge-001..."
  curl -X POST 'http://foobar:foobar@localhost:8088/ari/bridges/my-test-bridge-001/addChannel?channel=my-test-channel-001'
  echo
  echo

sleep 3

  # List the subscriptions
  echo "Subscriptions:"
  curl 'http://foobar:foobar@localhost:8088/ari/applications/foobar'
  echo
  echo
