Hello,
I need to run several linphone-daemons at once on the one Linux
machine with an Asterisk server. I have set this up so that each
daemon loads a separate config file with a unique UDP/TCP port and SIP
username and corresponding entries in Asterisk's sip.conf. All the
servers use the PulseAudio Jack sink to enable audio to be played
concurrently with that of other processes.
While each daemon works successfully on its own, the daemons only
sometimes work properly when run together. For example if daemon 1 is
on a call and I send a call message through to daemon 2 to make
another call, the outcome is unpredictable, sometimes both can be
heard, other times the sound of one is blocked and yet other times
both audio streams get jittery.
There are no problems with CPU or memory. Also, i don't believe it is
a problem with the Jack sink as i can run multiple other audio
programs concurrently through the sink successfully, including ones in
addition to the linphone-daemon itself. Also, if i call in from
several different Android phones with SIP software (again Linphone) to
extensions in Asterisk (but not the server-based phones), the sound
streams with no problems.
One difference I see is that the SIP phones all have different IPs,
whereas all the server-based phones are on the same IP. Might this be it?
Can anyone please offer some suggestions?
I'll paste below the script that I use to launch the daemons, a script
to send call messages to the servers and also the entries in
Asterisk's sip.conf.
I've also uploaded a log file of one of the daemons here which
includes log info of an event where the audio stopped (towards the end):
https://ufile.io/088vjf45
Relevant looking messages include:
mediastreamer-message-MSAudio_stream_iterate[0x55d89bd96ff0], local
statistics available:
Local current jitter buffer size: 0.0ms
ortp-warning-ortp_loss_rate_estimator_process 0x55d89bd5c1d0:
Suspected discontinuity in sequence numbering from 503 to 250
ortp-warning-Receiving packet with unknown payload type 0
Hope someone can help,
Iain
#!/bin/bash
# startlinphones.sh
# Start 3 linphone-daemons
process=$(pgrep linphone-daemon)
set -- $process
process=$1
if [ -z $process ]; # to check if at least one daemon is already running
then
echo "Starting linphone-daemon 1. Please wait a few seconds."
$(/home/iain/linphone-desktop/build/OUTPUT/bin/linphone-daemon \
--config /home/iain/.config/linphone/linphonerc1 \
--disable-stats-events \
--log /home/iain/tmp/daemon1.log \
--pipe linphone-daemon1.soc)&
echo "Starting linphone-daemon 1. Please wait a few seconds."
$(/home/iain/linphone-desktop/build/OUTPUT/bin/linphone-daemon \
--config /home/iain/.config/linphone/linphonerc2 \
--disable-stats-events \
--log /home/iain/tmp/daemon2.log \
--pipe linphone-daemon2.soc)&
echo "Starting linphone-daemon 3. Please wait a few seconds."
$(/home/iain/linphone-desktop/build/OUTPUT/bin/linphone-daemon \
--config /home/iain/.config/linphone/linphonerc3 \
--disable-stats-events \
--log /home/iain/tmp/daemon3.log \
--pipe linphone-daemon3.soc)&
else
echo "linphone-daemons already running"
fi
exit 0
--------------------------------------------
#!/bin/bash
# callnumber.sh
# call number on a linphone-daemon
daemonnum=$1
phonenum=$2
if ( [ -z $phonenum ] || [ -z $daemonnum ] );
then
echo "Requires both daemon number and phone number as arguments"
else
process=$(pgrep linphone-daemon)
set -- $process
process=$1 # the 1st number in list
if [ -z $process ];
then
echo "Starting linphone-daemons"
startlinphones.sh
sleep 5
fi
echo "Calling"
$(echo "call sip:$phonenum@127.0.0.1" | \
socat STDIN UNIX-CONNECT:/tmp/linphone-daemon$daemonnum.soc)
fi
exit 0
--------------------------------------------------
excerpt from sip.conf
[daemon1]
type=friend
context=outgoing
host=dynamic
username=daemon1
secret=mypassword
disallow=all
;allow=opus
allow=gsm
allow=ulaw
;direct_media=true
direct_media=false
language=pt_BR
[daemon2]
type=friend
context=outgoing
host=dynamic
username=daemon2
secret=mypassword
disallow=all
;allow=opus
allow=ulaw
;direct_media=true
language=pt_BR
[daemon3]
type=friend
context=outgoing
host=dynamic
username=daemon3
secret=mypassword
disallow=all
;allow=opus
allow=gsm
allow=ulaw
;direct_media=true
direct_media=false
language=pt_BR
----------------------------------
The conf files for each daemon specify unique port numbers
_______________________________________________
Linphone-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-users