I am trying to connect audio call with web socket. But when it going to connect with web phone, following error occurred.
-- Executing [7@English_lang_testing:3] Dial("PJSIP/registrar-00000000", "PJSIP/6002,60,tTmL()") in new stack
-- Called PJSIP/6002
-- Started music on hold, class 'default', on channel 'PJSIP/registrar-00000000'
-- PJSIP/6002-00000001 is ringing
[May 8 14:28:21] NOTICE[17619][C-00000001]: translate.c:603 ast_translate: 923 lost frame(s) 924/0 (gsm@8000)->(slin@8000)->(ulaw@8000)
> 0x562ea5107330 -- Strict RTP learning after remote address set to: 124.43.67.53:56192
[May 8 14:28:22] WARNING[17561]: channel.c:5765 set_format: Unable to find a codec translation path: (opus) -> (ulaw)
[May 8 14:28:22] WARNING[17561]: channel.c:5765 set_format: Unable to find a codec translation path: (ulaw) -> (opus)
-- PJSIP/6002-00000001 answered PJSIP/registrar-00000000
-- Stopped music on hold on PJSIP/registrar-00000000
[May 8 14:28:22] WARNING[17619][C-00000001]: channel.c:6756 ast_channel_make_compatible_helper: No path to translate from PJSIP/6002-00000001 to PJSIP/registrar-00000000
[May 8 14:28:22] WARNING[17619][C-00000001]: app_dial.c:3381 dial_exec_full: Had to drop call because I couldn't make PJSIP/registrar-00000000 compatible with PJSIP/6002-00000001
== Spawn extension (English_lang_testing, 7, 3) exited non-zero on 'PJSIP/registrar-00000000'
This is my PJSIP.CONF file code
[general]
max_forwards=70
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlsprivatekey=/etc/asterisk/keys/asterisk.pem
[system]
type=system
timer_t1=500
timer_b=32000
disable_tcp_switch=yes
[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0:5060
allow_reload=yes
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
allow_reload=yes
[transport-tls]
type=transport
protocol=tls
bind=0.0.0.0:5061
method=tlsv1_2 ; Make sure this is correctly spelled and placed
cert_file=/etc/asterisk/keys/dmsca.pem
priv_key_file=/etc/asterisk/keys/dmscakey.pem
cipher=ADH-AES256-SHA,ADH-AES128-SHA
[transport-ws]
type=transport
protocol=ws ; Use `wss` for WebSocket Secure
bind=0.0.0.0:8088 ; Adjust the IP and port as necessary
[transport-wss]
type=transport
protocol=wss ; WebSocket Secure
bind=0.0.0.0:8089 ; Adjust the IP and port as necessary
cert_file=/etc/asterisk/keys/asterisk.pem ; SSL certificate file
priv_key_file=/etc/asterisk/keys/asterisk.pem ; SSL private key file
[authentication]
[basic-options](!)
dtmfmode=rfc2833
context=from-office
type=friend
[natted-phone](!,basic-options)
directmedia=no
host=dynamic
[public-phone](!,basic-options)
directmedia=yes
[my-codecs](!)
disallow=all
allow=ilbc
allow=g729
allow=gsm
allow=g723
allow=ulaw
[ulaw-phone](!)
disallow=all
allow=ulaw
[registrar]
type=identify
endpoint=registrar
match=172.16.1.1
match=172.20.10.86
[registrar]
type=aor
contact=sip:*@172.20.10.86:5060
[registrar]
type=endpoint
transport=transport-udp
context=from_external ;dmse_IVR
disallow=all
allow=ulaw
allow=opus
aors=registrar
force_rport=yes
direct_media=no
rtp_symmetric=yes
rtp_timeout=120
[6002]
type=endpoint
transport=transport-wss
context=from_external
disallow=all
allow=opus
allow=ulaw
aors=6002
auth=6002
media_encryption=dtls
dtls_auto_generate_cert=yes
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
direct_media=no
force_rport=yes
rewrite_contact=yes
webrtc=yes
[6002]
type=auth
auth_type=userpass
password=12345
username=6002
[6002]
type=aor
max_contacts=100
remove_existing=yes
Sangoma provides a binary codec_opus which is not installed by default. It can be installed by going into menuselect and choosing it in the Codecs section, and then installing Asterisk again.
dms*CLI> core show translation paths opus
--- Translation paths SRC Codec "opus" sample rate 48000 ---
opus:48000 To amr:8000 : No Translation Path
opus:48000 To amrwb:16000 : No Translation Path
opus:48000 To codec2:8000 : No Translation Path
opus:48000 To g723:8000 : No Translation Path
opus:48000 To ulaw:8000 : No Translation Path
opus:48000 To alaw:8000 : No Translation Path
opus:48000 To gsm:8000 : No Translation Path
opus:48000 To g726:8000 : No Translation Path
opus:48000 To g726aal2:8000 : No Translation Path
opus:48000 To adpcm:8000 : No Translation Path
opus:48000 To slin:8000 : No Translation Path
opus:48000 To slin:12000 : No Translation Path
opus:48000 To slin:16000 : No Translation Path
opus:48000 To slin:24000 : No Translation Path
opus:48000 To slin:32000 : No Translation Path
opus:48000 To slin:44100 : No Translation Path
opus:48000 To slin:48000 : No Translation Path
opus:48000 To slin:96000 : No Translation Path
opus:48000 To slin:192000 : No Translation Path
opus:48000 To lpc10:8000 : No Translation Path
opus:48000 To g729:8000 : No Translation Path
opus:48000 To speex:8000 : No Translation Path
opus:48000 To speex:16000 : No Translation Path
opus:48000 To speex:32000 : No Translation Path
opus:48000 To ilbc:8000 : No Translation Path
opus:48000 To g722:16000 : No Translation Path
opus:48000 To siren7:16000 : No Translation Path
opus:48000 To siren14:32000 : No Translation Path
opus:48000 To testlaw:8000 : No Translation Path
opus:48000 To g719:48000 : No Translation Path
opus:48000 To none:8000 : No Translation Path
opus:48000 To silk:8000 : No Translation Path
opus:48000 To silk:12000 : No Translation Path
opus:48000 To silk:16000 : No Translation Path
opus:48000 To silk:24000 : No Translation Path