Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: AttributeError: 'dict' object has no attribute 'answer' #19

Open
synox opened this issue Oct 17, 2015 · 1 comment
Open

Error: AttributeError: 'dict' object has no attribute 'answer' #19

synox opened this issue Oct 17, 2015 · 1 comment

Comments

@synox
Copy link

synox commented Oct 17, 2015

I installed the ari-py from source with sudo ./setup.py install on a raspberry pi 2.

I use example.py and just added logging in order to see the error:

import logging
logging.basicConfig()

The client registers with asterisk and then receives an event. But then i get the error message:

ERROR:ari.client:Event listener threw exception
Traceback (most recent call last):
  File "build/bdist.linux-armv7l/egg/ari/client.py", line 100, in __run
    callback(msg_json, *args, **kwargs)
  File "build/bdist.linux-armv7l/egg/ari/client.py", line 198, in extract_objects
    event_cb(obj, event, *args, **kwargs)
  File "<stdin>", line 2, in on_start
AttributeError: 'dict' object has no attribute 'answer'

Same result with release 0.1.3

when I print the channel type and object i get:

{u'channel': Channel(1445097806.30)}
{u'timestamp': u'2015-10-17T18:03:26.842+0200', u'args': [], u'type': u'StasisStart', u'channel': {u'accountcode': u'', u'name': u'SIP/softphone-0000000f', u'language': u'en', u'caller': {u'name': u'softphone', u'number': u'+41790000003'}, u'creationtime': u'2015-10-17T18:03:26.837+0200', u'state': u'Ring', u'connected': {u'name': u'', u'number': u''}, u'dialplan': {u'priority': 3, u'exten': u'100', u'context': u'incoming'}, u'id': u'1445097806.30'}, u'application': u'hello'}

Thanks

@synox
Copy link
Author

synox commented Oct 17, 2015

The following example works: https://github.com/asterisk/ari-examples/blob/master/channel-playback-monkeys/example.py

there you also unwrap the channel before using:

    channel = channel_obj.get('channel')

maybe you have to update your examples in this repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant