So, we started with a very basic configuration. 2 PJSIP endpoints (snom phones) (500 and 501) and 2 PJSIP endpoints for WebRTC (510 and 520) using sipML5. Our configuration is:
pjsip.conf
[global]
type=global
user_agent=ASIPBX-18.0.1
default_outbound_endpoint=dpma_endpoint
endpoint_identifier_order=ip,username,anonymous,header,auth_username
default_outbound_endpoint=dpma_endpoint
[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
allow_reload=no
tos=cs3
cos=3
[transport_wss]
type=transport
bind=0.0.0.0
protocol=wss
[500]
type=endpoint
aors=500
auth=500-auth
tos_audio=ef
tos_video=af41
cos_audio=5
cos_video=4
allow=ulaw,alaw,gsm,g726,g722
context=from-internal
callerid=test 500 <500>
dtmf_mode=rfc4733
direct_media=yes
aggregate_mwi=yes
use_avpf=no
rtcp_mux=no
max_audio_streams=1
max_video_streams=1
bundle=no
ice_support=no
media_use_received_transport=no
trust_id_inbound=yes
media_encryption=no
timers=yes
timers_min_se=90
media_encryption_optimistic=no
refer_blind_progress=yes
refer_blind_progress=yes
send_pai=yes
rtp_symmetric=yes
rewrite_contact=yes
force_rport=yes
language=it
one_touch_recording=on
record_on_feature=apprecord
record_off_feature=apprecord
language=it
[505]
type=endpoint
aors=505
auth=505-auth
tos_audio=ef
tos_video=af41
cos_audio=5
cos_video=4
allow=ulaw,alaw,gsm,g726,g722
context=from-internal
callerid=Prova asistar <505>
dtmf_mode=rfc4733
direct_media=yes
aggregate_mwi=yes
use_avpf=no
rtcp_mux=no
max_audio_streams=1
max_video_streams=1
bundle=no
ice_support=no
media_use_received_transport=no
trust_id_inbound=yes
media_encryption=no
timers=yes
timers_min_se=90
media_encryption_optimistic=no
refer_blind_progress=yes
refer_blind_progress=yes
send_pai=yes
rtp_symmetric=yes
rewrite_contact=yes
force_rport=yes
language=it
one_touch_recording=on
record_on_feature=apprecord
record_off_feature=apprecord
language=it
[510]
type=endpoint
aors=510
auth=510-auth
webrtc=yes
disallow=all
allow=ulaw
context=from-internal
[520]
type=endpoint
aors=520
auth=520-auth
webrtc=yes
disallow=all
allow=ulaw
context=from-internal
[500]
type=aor
max_contacts=1
remove_existing=yes
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=60
[505]
type=aor
max_contacts=1
remove_existing=yes
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=60
[510]
type=aor
max_contacts=1
remove_existing=yes
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=60
[520]
type=aor
max_contacts=1
remove_existing=yes
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=60
[500-auth]
type=auth
auth_type=userpass
password=psw
username=500
[505-auth]
type=auth
auth_type=userpass
password=psw
username=505
[510-auth]
type=auth
auth_type=userpass
password=psw
username=510
[520-auth]
type=auth
auth_type=userpass
password=psw
username=520
and for the dialplan we have:
extensions.conf
exten => _5XX,1,Set(CHANNEL(language)=it)
exten => _5XX,n,Dial(PJSIP/${EXTEN},35,tT)
exten => 900,1,Playback(demo-congrats)
Now, if we call between the two snom phones everything seems fine. I then try to connect to sipML5 from a PC from the same LAN as asterisk using the following settings:
and it connects correctly, I can easily dial a PJSIP Endpoint and have it ring, or dial 900 and get the demo message playback. So far everything OK.
The issues start when I try to connect with my mobile phone, using 4G. It connects normally, without issues but when I try to dial it takes about 2 minutes for the SIP INVITE to reach asterisk, but then it works correctly with audio.
Now, if someone else in the office tries to do the same thing, they’ll connect, dial, wait about 2 minutes and they’ll have no audio, we are all using different ISPs, the only one that seems to work is TIM.
One fix I’ve found for this long time to dial is to set [] into the ICE Servers on sipML5, but when I do that then I’ll have no audio at all.
We then tried installing a TURN server (coTURN, to be precise), setting it both in the rtp.conf file and the ICE Servers in sipML5, this allows other mobile ISPs to receive audio when calling a snom phone, but when we try to call from a snom phone to a sipML5 endpoint, the calls ends always in a NOANSWER status, even if we accept the call on sipML5.
And still it always takes a few minutes before we get the SIP INVITE on Asterisk.
Now, I’ve been thinking for a while, the long time to dial a call could be because sipML5 is “looking” for a way to put the browser and asterisk in communication and only when it finds this “route”, the INVITE will be sent, but if it is so I have no idea how to fix it. I can’t understand if it’s a configuration issue, firewall issue or something else.
For the audio problem I’ve noticed that while RTP packets are sent to the sipML5 there is no RTP connection from sipML5 to Asterisk.
If you need more info, let me know