System working, but can't use example apps

I can’t get the channel dump example to work, I think it’s related to the conf setup as the system can’t seem to find the stasis app.

Set Up:

Jitsu Soft Phones
VM With Asterisk 13 on CentOS VM (13 because our live system is 13)
Python 3 + ARI Library

Logging into Asterisk on the VM with asterisk -vvvvvr works,
When Jitsu makes a call I can see it show up on the system.

Using the git python example, it logs in fine and shows:
‘No channels currently’
and on Asterisk it shows
'Activating Statis app ‘channel-dump’

So I know it’s all connected.
Also when I make a call on Jitsu it shows up on Asterisk terminal.

Even trying hello-world example nothing happens.


'#!/usr/bin/env python

import ari
import logging


client = ari.connect(‘’, ‘test’, ‘test’)

current_channels = client.channels.list()
if len(current_channels) == 0:
print “No channels currently :-(”
print “Current channels:”
for channel in current_channels:
print channel.json.get(‘name’)

def stasis_start_cb(channel_obj, ev):
“”“Handler for StasisStart event”""

channel = channel_obj.get('channel')
print "Channel %s has entered the application" % channel.json.get('name')

for key, value in channel.json.items():
    print "%s: %s" % (key, value)

def stasis_end_cb(channel, ev):
“”“Handler for StasisEnd event”""

print "%s has left the application" % channel.json.get('name')

client.on_channel_event(‘StasisStart’, stasis_start_cb)
client.on_channel_event(‘StasisEnd’, stasis_end_cb)‘channel-dump’)

So I know I’m logging into the ARI fine


exten => s,1,Noop()
same => n,Answer()
same => n,Stasis(channel-dump)
same => n,Hangup()

I also tried with [default]
and extan => 1000,1,Noop()

I only have extensions 9 + 10 set up on Asterisk, so I tried the above with 9,1,Noop
and read s covers all so tried that.

Please help!!!

You are using FreePBX which generates the configuration files and dialplan. You have to use its functionality to add a custom context and route the call accordingly. I don’t work on FreePBX so I can’t explicitly state what that is.

1 Like

Ahhh that makes a lot of sense, thanks for the quick reply!


edit /etc/asterisk/extensions_custom.conf:

; make sure 1000 doesn't conflict with an extension already on the system
exten => 1000,1,NoOp(entering ${CONTEXT} as defined in extensions_custom.conf)
 same => n,Answer()
 same => n,Stasis(hello-world)
 same => n,Hangup()

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.