How do I Hangup up call in Asterisk Event
<p>I am connecting to Asterisk server using Python Asterisk manager. How do I hangup calls from the AMI.</p>

<pre><code>def hangup_event(event, manager):
with ctx:

    if event.name == 'Hangup':
        data = {
            "channel":event.message['Channel'],
            "unique_id":event.message['Uniqueid'],
            "cause":event.message['Cause'],
        }

 manager.register_event('*', hangup_event)
 channel = 'SIP/356256266262'
 res = manager.send_action({'Action':'Hangup', 'Channel':channel})
</code></pre>

<p>My objective is to end the call but it isn't working.</p>

<p>Use ami action COMMAND. Issue command </p>

<pre><code>channel request hangup channel_name_here
</code></pre>

python asterisk