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

Not able to generate event #29

Open
debadityamandal opened this issue Mar 1, 2021 · 4 comments
Open

Not able to generate event #29

debadityamandal opened this issue Mar 1, 2021 · 4 comments

Comments

@debadityamandal
Copy link

When I am sending action(CoreShowChannels) in Asterisk terminal, I am getting events details. If I send the same action to Asterisk server by using pystrix library, I am not getting events details and it is happening only with show related command. I am not able to listen the events generated by the action command also but I have registered those events before sending the command. How will I solve this problem? How will I listen the generated events using pystrix?

@clearinterface
Copy link
Collaborator

what version of asterisk are you using?

@debadityamandal
Copy link
Author

Asterisk 16

@karthicraghupathi
Copy link
Collaborator

Are you able to post some sample code that you are using so we can replicate the issue? It would be great if you can also post the output of said code.

@debadityamandal
Copy link
Author

debadityamandal commented Mar 11, 2021

After writing the login code I wrote the following code to send (CoreShowChannel) action-

def show_channels(self):
        return self._manager.send_action(
            pystrix.ami.core.CoreShowChannels()
        )

This action supposed to generate two different events(CoreShowChannel,CoreShowChannelsComplete). To register those events I wrote following code-

self._manager.register_callback(
            pystrix.ami.core_events.CoreShowChannel, self._handle_event
        )
        self._manager.register_callback(
            pystrix.ami.core_events.CoreShowChannelsComplete, self._handle_event
        )

I supposed to get following output-

{
  'Event': 'CoreShowChannel',
  'ActionID': 'giuser-H110M-S2-00000001',
  'Channel': 'SIP/asterisk99-000033e4',
  'ChannelState': '6',
  'ChannelStateDesc': 'Up',
  'CallerIDNum': '9999',
  'CallerIDName': '<unknown>',
  'ConnectedLineNum': '9999',
  'ConnectedLineName': '<unknown>',
  'Language': 'en',
  'AccountCode': 'icicidel_loanbkt1~35127877',
  'Context': 'siptest',
  'Exten': '6393200700',
  'Priority': '11',
  'Uniqueid': '1614662067.26502',
  'Linkedid': '1614662067.26502',
  'Application': 'AGI',
  'ApplicationData': 'Voicebot_Python_Asterisk/vb_agi_2.py',
  'Duration': '00:04:24',
  'BridgeId': ''
}{
  'Event': 'CoreShowChannelsComplete',
  'ActionID': 'giuser-H110M-S2-00000001',
  'EventList': 'Complete',
  'ListItems': '43'
}

CoreShowChannel event may come multiple times but it will be followed by CoreShowChannelsComplete

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

3 participants