I get this error when I try to establish a new call from pjsip:
pjsua_aud.c ..Error retrieving default audio device parameters: Unable to find default audio device (PJMEDIA_EAUD_NODEFDEV) [status=420006]
Exception: Object: {Account <sip:192.168.0.2:54496>}, operation=make_call(), error=Unable to find default audio device (PJMEDIA_EAUD_NODEFDEV)
I installed libasound2-dev
: sudo apt-get install libasound2-dev
, and recompiled pjsip, but still, it gives me the same result .. Am I missing something here?
N.B. I use Ubuntu 11.10 and the sound works fine with no problems, so please don't tell me I have problems in the sound card
Update
I configured and compiled the pjsip like this:
$ ./configure
$ make && make install
And like this:
$ ./configure --enable-shared --disable-static --enable-memalign-hack
$ make && make install
And also like this:
$ ./configure
$ make dep && make clean && make
And all ways gave me the same results.
Update 2
I made sure that all of below are installed, and still the problem persists:
sudo apt-get install portaudio19-dev libportaudio2 pulseaudio alsa-utils liboss4-salsa-dev alsa-base alsa-tools libasound2-plugins libasound2 libasound2-dev binutils binutils-dev libasound-dev pulseaudio-dev
Update 3
I ran it like below, and it worked:
pjproject-2.1.0/pjsip-apps/bin/pjsua-i686-pc-linux-gnu --capture-dev=-1 --playback-dev=-1
It can call the other party. But when I run it from a python script it gives me an error, even when I set the sound device like this:
lib.init(log_cfg = pj.LogConfig(level=LOG_LEVEL, callback=log_cb))
snd_dev = lib.get_snd_dev()
print snd_dev ## returns (-1,-2)
lib.set_snd_dev(0,0)
Error is:
12:39:55.753 os_core_unix.c !pjlib 2.1 for POSIX initialized 12:39:55.754 sip_endpoint.c .Creating endpoint instance... 12:39:55.754 pjlib .select() I/O Queue created (0x93f1a80) 12:39:55.754 sip_endpoint.c .Module "mod-msg-print" registered 12:39:55.754 sip_transport. .Transport manager created. 12:39:55.754 pjsua_core.c .PJSUA state changed: NULL --> CREATED 12:39:55.769
pjsua_core.c .pjsua version 2.1 for Linux-3.0.0.17/i686/glibc-2.13 initialized (-1, -2) 12:39:55.770 pjsua_aud.c .Error retrieving default audio device parameters: Invalid audio device (PJMEDIA_EAUD_INVDEV) [status=420004] Exception: Object: Lib, operation=set_current_sound_devices(), error=Invalid audio device (PJMEDIA_EAUD_INVDEV)
But weirdly worked, when I replaced the lib.set_snd_dev(0,0)
with this line lib.set_null_snd_dev()
, but of course the sound is not working, as I'm setting the sound device to null !!!