ARI, events do not work if they're sent with a bridge

Hey. I’m playing audio to a bridge with the following code:

    try:
        playback = bridge.play(media=media_url)
    except Exception as ex:
        return error_response(message=str(ex))

    # register event listeners
    playback.on_event("PlaybackStarted", playback_start_callback, channel=channel)
    playback.on_event("PlaybackFinished", playback_end_callback, channel=channel)

For some reason, this code does not work when I do “bridge.play”, but it does work when I do “channel.play”

Any idea why?`

You haven’t stated what happens or how it doesn’t work.

Well, nothing happens. I usually log “call.playback.started” and “call.playback.ended” in my event callbacks, and they will only show up in my log if I’m playing the audio to the channel. If I play the audio to the bridge, I will hear it on the call, but my callbacks don’t print anything.

@jcolp any idea?

Please don’t tag me or others. Personally if I have something to add to a post or want to participate then I respond.

I can say, though, that we have test coverage for those events from playback on a bridge[1] which is passing, and I just ran and confirmed the events work - which likely points to something in your environment/ARI application so you’d need to investigate from that perspective.

[1] testsuite/tests/rest_api/bridges/playback/basic at master · asterisk/testsuite · GitHub

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.