Hi,
I’m running a dockerised version of Asterisk 19.3.1 using PJSIP Channel Driver on a MacOS host machine and I’m trying to make a call to it using Zoiper5 as the soft phone application. The registration process works well however the audio is not really.
Problem #1: Sometimes I hear the audio file played back by the Playback application through my audio output device but more often not when dialling 100 through the soft phone app.
Running as user 'asterisk'
Running under group 'asterisk'
Connected to Asterisk 19.3.1 currently running on ad896dda5165 (pid = 8)
-- Executing [100@incoming:1] Answer("PJSIP/zoiper-00000001", "") in new stack
> 0x7f665801f020 -- Strict RTP learning after remote address set to: 37.156.73.177:25864
-- Executing [100@incoming:2] Wait("PJSIP/zoiper-00000001", "1") in new stack
-- Executing [100@incoming:3] Playback("PJSIP/zoiper-00000001", "hello-world") in new stack
-- <PJSIP/zoiper-00000001> Playing 'hello-world.ulaw' (language 'en')
-- Executing [100@incoming:4] Hangup("PJSIP/zoiper-00000001", "") in new stack
== Spawn extension (incoming, 100, 4) exited non-zero on 'PJSIP/zoiper-00000001'
Problem #2: The recording ends instantly when dialling 200 and produces an empty wav file with 44 bytes. The same happens if I introduce a Wait before hanging up.
Running as user 'asterisk'
Running under group 'asterisk'
Connected to Asterisk 19.3.1 currently running on ad896dda5165 (pid = 8)
-- Executing [200@incoming:1] Answer("PJSIP/zoiper-00000000", "") in new stack
> 0x7f6658020fe0 -- Strict RTP learning after remote address set to: 37.156.73.177:28799
-- Executing [200@incoming:2] NoOp("PJSIP/zoiper-00000000", "Recording with "MixMonitor"") in new stack
-- Executing [200@incoming:3] NoOp("PJSIP/zoiper-00000000", "UNIQUEID: 1649443317.0") in new stack
-- Executing [200@incoming:4] Set("PJSIP/zoiper-00000000", "FILENAME=1649443317.0_20220408-184158.wav") in new stack
-- Executing [200@incoming:5] MixMonitor("PJSIP/zoiper-00000000", "1649443317.0_20220408-184158.wav,W(4)") in new stack
== Begin MixMonitor Recording PJSIP/zoiper-00000000
-- Executing [200@incoming:6] NoOp("PJSIP/zoiper-00000000", "Recording location: /var/spool/asterisk/monitor/1649443317.0_20220408-184158.wav") in new stack
-- Executing [200@incoming:7] Hangup("PJSIP/zoiper-00000000", "") in new stack
== Spawn extension (incoming, 200, 7) exited non-zero on 'PJSIP/zoiper-00000000'
== MixMonitor close filestream (mixed)
== End MixMonitor Recording PJSIP/zoiper-00000000
Running as user 'asterisk'
Running under group 'asterisk'
Connected to Asterisk 19.3.1 currently running on ad896dda5165 (pid = 8)
-- Executing [200@incoming:1] Answer("PJSIP/zoiper-00000000", "") in new stack
> 0x7f0c54020fc0 -- Strict RTP learning after remote address set to: 37.156.73.177:26193
-- Executing [200@incoming:2] NoOp("PJSIP/zoiper-00000000", "Recording with "MixMonitor"") in new stack
-- Executing [200@incoming:3] NoOp("PJSIP/zoiper-00000000", "UNIQUEID: 1649443180.0") in new stack
-- Executing [200@incoming:4] Set("PJSIP/zoiper-00000000", "FILENAME=1649443180.0_20220408-183940.wav") in new stack
-- Executing [200@incoming:5] MixMonitor("PJSIP/zoiper-00000000", "1649443180.0_20220408-183940.wav,W(4)") in new stack
-- Executing [200@incoming:6] NoOp("PJSIP/zoiper-00000000", "Recording location: /var/spool/asterisk/monitor/1649443180.0_20220408-183940.wav") in new stack
-- Executing [200@incoming:7] Wait("PJSIP/zoiper-00000000", "86400") in new stack
== Begin MixMonitor Recording PJSIP/zoiper-00000000
== Spawn extension (incoming, 200, 7) exited non-zero on 'PJSIP/zoiper-00000000'
== MixMonitor close filestream (mixed)
== End MixMonitor Recording PJSIP/zoiper-00000000
My related configuration and setup is described below.
rtp.conf
[general]
rtpstart=10000
rtpend=10099
[ice_host_candidates]
pjsip.conf
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
[zoiper]
type=endpoint
context=incoming
disallow=all
allow=ulaw
auth=zoiper_auth
aors=zoiper
[zoiper_auth]
type=auth
auth_type=userpass
password=1234
username=zoiper
[zoiper]
type=aor
max_contacts=1
extensions.conf
[globals]
MONITOR_DIR=/var/spool/asterisk/monitor
RECORDING_DIR=/var/spool/asterisk/recording
[incoming]
exten => 100,1,Answer()
same => n,Wait(1)
same => n,Playback(hello-world)
same => n,Hangup()
exten => 200,1,Answer()
same => n,NoOp(Recording with "MixMonitor")
same => n,NoOp(UNIQUEID: ${UNIQUEID})
same => n,Set(FILENAME=${UNIQUEID}_${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.wav)
same => n,MixMonitor(${FILENAME},W(4))
same => n,NoOp(Recording location: ${MONITOR_DIR}/${FILENAME})
;same => n,Wait(86400)
same => n,Hangup()
exten => 300,1,Answer()
same => n,NoOp(Recording with "Record")
same => n,NoOp(UNIQUEID: ${UNIQUEID})
same => n,Set(FILENAME=${UNIQUEID}_${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.wav)
same => n,Record(${FILENAME},,,qk)
same => n,NoOp(Recording location: ${RECORDING_DIR}/${FILENAME})
same => n,Hangup()
Docker
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ad896dda5165 asterisk "/bin/sh -c ./start.…" 23 minutes ago Up 23 minutes 0.0.0.0:5060->5060/udp, 0.0.0.0:10000-10099->10000-10099/udp asterisk
Network
Docker container IP: 172.17.0.2
Docker container Gateway: 172.17.0.1
Docker subnet: 192.168.65.0/24
Host IP from container: 192.168.65.2
Public IP: 37.156.73.177
Can you please advise on what’s wrong with my current setup and what do I need to change in order to resolve my RTP issues and make the audio working once and for all in both cases?
Thanks in advance!