Pjsip Failed to discconect audio

318 views Asked by At

Im using Python pjsip library but i have some issue disconnecting the WAV playing before answer the call this is the code

 if self.call.info().state == pj.CallState.EARLY:
                    call_slot = self.call.info().conf_slot
                    self.wav_player_id = pj.Lib.instance().create_player('ring.wav', loop=True)
                    self.wav_slot = pj.Lib.instance().player_get_slot(self.wav_player_id)
                    pj.Lib.instance().conf_connect(self.wav_slot, 0)


if self.call.info().state == pj.CallState.CONFIRMED:
                    print "connecting"
                    pj.Lib.instance().conf_disconnect(self.wav_slot, 0)
                    pj.Lib.instance().player_destroy(self.wav_player_id)

any ideas whats going on?

2

There are 2 answers

1
Cristea Bogdan On

When you disconnect the slot, shouldn't you wait for a disconnected callback before destroying the player ?

0
Jose Phillips On

i already solved the problem is EARLY is repeating 2 times and create two players

so the correct method is CALLING to put the wav to play