Hey,
I just figured out the problem is because of ALSA ( I am using Ubuntu 14.04 ). It is because of ALSA that I am not able to get the audio. Can someone help me how to go about the whole ALSA thing to get the audioOn Tue, May 31, 2016 at 2:46 PM, Gianni Massi <g.massi@xxxxxxxxxxxxxxx> wrote:
You might need to put the conf_connect calls in the onMediaState() callback. See if that works.
Gianni
Da: pjsip [mailto:pjsip-bounces@xxxxxxxxxxxxxxx] Per conto di Kaushik Turlapaty
Inviato: martedì 31 maggio 2016 10:57
A: pjsip@xxxxxxxxxxxxxxx
Oggetto: Re: PJSIP call, play music and hangup in python
This is the logic of the goal I am trying to achieve. It should call, when confirmed, should play an audio wav file and hangup after thatI am able to call, but when the call is lift, I cannot hear the audio.if self.call.info().state == pjsua.CallState.DISCONNECTED:current_call = Noneprint 'Current call is', current_callin_call = Falseelif self.call.info().state == pjsua.CallState.CONFIRMED:#Call is Answredprint "Call Answred"wfile = wave.open("message.wav")time = (1.0 * wfile.getnframes ()) / wfile.getframerate ()print str(time) + "ms"wfile.close()call_slot = self.call.info().conf_slotself.wav_player_id=pjsua.Lib.instance().create_player('message.wav',loop=False)self.wav_slot=pjsua.Lib.instance().player_get_slot(self.wav_player_id)pjsua.Lib.instance().conf_connect(self.wav_slot, call_slot)sleep(time)pjsua.Lib.instance().player_destroy(self.wav_player_id)self.call.hangup()in_call = FalseThis is some part of the log when I run the program
17:03:26.375 pjsua_aud.c .....Creating file player: test.wav..
17:03:26.375 wav_player.c ......File player 'test.wav' created: samp.rate=16000, ch=1, bufsize=4KB, filesize=166KB
17:03:26.375 pjsua_aud.c ......Player created, id=0, slot=2
17:03:26.375 pjsua_aud.c .....Conf connect: 2 --> 1
17:03:26.375 pjsua_aud.c ......Set sound device: capture=-99, playback=-99
17:03:26.376 pjsua_aud.c .......No changes in capture and playback devices
17:03:26.376 conference.c ......Port 2 (test.wav) transmitting to port 1 (sip:***********@*****.*****.com)
17:03:28.141 pjsua_aud.c .....Destroying player 0..
17:03:28.141 pjsua_call.c .....Call 0 hanging up: code=603..
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org