Hi. We are testing Jssip API with WebRTC and we have completly sucedeed with version 2.x and Asterisk 13.11.2. However we are trying new version of the API 3.x we are having some trouble when Asterisk has to send asynchronous SIP frames, for example, when sending an incoming call.
The error that appears in the CLI console is:
Really destroying SIP dialog ‘24188e5872f3b45034c618704a6eb7da@127.0.0.1:5060’ Method: INVITE
Really destroying SIP dialog ‘2cc2623d06a6cdbb523f4265799d8b9a@127.0.0.1:5060’ Method: INVITE
== DTLS ECDH initialized (secp256r1), faster PFS enabled
== Using SIP RTP CoS mark 5
Audio is at 10438
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.1.33:39466:
INVITE sip:76ejsbo0@o4di2ag4slb3.invalid;transport=ws SIP/2.0
Via: SIP/2.0/WS 192.168.3.178:5060;branch=z9hG4bK37e36339;rport
Max-Forwards: 70
From: “30000” sip:30000@192.168.3.178;tag=as0d3f1014
To: sip:76ejsbo0@o4di2ag4slb3.invalid;transport=ws
Contact: sip:30000@192.168.3.178:5060;transport=WS
Call-ID: 679d8e7d797430666c0ff8f6287676e3@192.168.3.178:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.11.2
Date: Thu, 04 May 2017 16:10:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-idllamada: 1493914233.1430
X-telefono: 100
Content-Type: application/sdp
Content-Length: 877
v=0
o=root 1861146601 1861146601 IN IP4 192.168.3.178
s=Asterisk PBX 13.11.2
c=IN IP4 192.168.3.178
t=0 0
m=audio 10438 RTP/SAVPF 8 3 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=ice-ufrag:3c170104446900d7450819506e839546
a=ice-pwd:0ccfa87b0640dd0b34dd0621270628a3
a=candidate:Hc0a803b2 1 UDP 2130706431 192.168.3.178 10438 typ host
a=candidate:S512fa4ad 1 UDP 1694498815 81.47.164.173 53867 typ srflx raddr 192.168.3.178 rport 10438
a=candidate:Hc0a803b2 2 UDP 2130706430 192.168.3.178 10439 typ host
a=candidate:S512fa4ad 2 UDP 1694498814 81.47.164.173 39511 typ srflx raddr 192.168.3.178 rport 10439
a=connection:new
a=setup:actpass
a=fingerprint:SHA-256 E1:9D:D7:9B:C6:2D:7C:53:76:87:38:07:8E:D0:7C:B2:85:EC:38:89:BB:90:08:48:4F:CE:B9:DE:F9:2C:BC:E0
a=sendrecv
[May 4 18:10:38] ERROR[30462][C-000000c2]: chan_sip.c:4258 __sip_reliable_xmit: Serious Network Trouble; __sip_xmit returns error for pkt data
– Called SIP/20005
== DTLS ECDH initialized (secp256r1), faster PFS enabled
== Using SIP RTP CoS mark 5
Really destroying SIP dialog ‘52473985563621bb540e909405e633eb@127.0.0.1:5060’ Method: INVITE
Really destroying SIP dialog ‘5491191d28ac9bb94f1c45cd7eeca5ad@127.0.0.1:5060’ Method: INVITE
Really destroying SIP dialog ‘70e1ffd336602c3568b75cce3cc15cfd@127.0.0.1:5060’ Method: INVITE
Really destroying SIP dialog ‘3b5597f0673db49c4f6900d55836b73c@127.0.0.1:5060’ Method: INVITE
If we try from javascript console to send any SIP message it arrives correctly to Asterisk, you can even unregister with no problem at all.
Please ask me for any log trace or config if necessary.
Thank you very much in advance.
EDIT:
Here’s sip config:
sip.conf
[general]
…
port=1661
transport=udp,ws,wss
websocket_enabled=true
tcpbindaddr=0.0.0.0
tcpenable=no
udpbindaddr=0.0.0.0
jbenable=yes
jbimpl=adaptive
…
#include sip_operador_plantilla.conf
#include sip_operador_extensiones.conf
sip_operador_plantilla.conf
[operadora](!)
type=peer
host=dynamic
context=operadoras_salida_general
nat=force_rport,comedia
udpbindaddr=0.0.0.0
type=peer
host=dynamic
disallow=all
allow=gsm
allow=alaw
allow=ulaw
requirecalltoken=no
transport=ws,wss,udp,tcp,tls
dtlsenable=yes
dtlsverify=no
dtlscertfile=/etc/asterisk/keys/2016-2017/commercial.crt
dtlscafile=/etc/asterisk/keys/2016-2017/commercial_ca.crt
dtlsprivatekey=/etc/asterisk/keys/2016-2017/commercial.key
dtlssetup=actpass
avpf=yes
icesupport=yes
directmedia=no
encryption=yes
force_avp=yes
sip_operador_extensiones.conf
[20005](operadora)
username=Nombre Apellidos<20005>
secret=password