Problem:
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.
Code:
'#!/usr/bin/env python
import ari
import logging
logging.basicConfig(level=logging.ERROR)
client = ari.connect(‘http://192.168.91.130:8088’, ‘test’, ‘test’)
current_channels = client.channels.list()
if len(current_channels) == 0:
print “No channels currently :-(”
else:
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)
client.run(apps=‘channel-dump’)
’
So I know I’m logging into the ARI fine
etc/asterisk/extensions.conf
[mattest]
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!!!