asterisk / ari-py

Library for accessing the Asterisk REST Interface
Other
149 stars 106 forks source link

channel_obj.get('channel') - wrong code #11

Closed litnimax closed 9 years ago

litnimax commented 10 years ago

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')

channel = channel_obj.get('channel') TypeError: enrich_operation() takes exactly 0 arguments (1 given) Also there is no such attribute.

Please update the documentation here - https://wiki.asterisk.org/wiki/display/AST/ARI+and+Channels%3A+Handling+DTMF#ARIandChannels:HandlingDTMF-Playingthemenu and all other examples :-)

matt-jordan commented 9 years ago

It depends on what version of Asterisk you are using. While the StasisStart event changes that were made to add additional channels was a backwards compatible change, the ARI-py library didn't especially like them.

The code shown in the samples on the wiki and in ari-examples is correct for the most recent version of 12/13 and ARI (and has been for some time).