Hello all
I am very new to asterisk, webrtc and SIP
I am trying asterisk and what I am doing here is I have a asterisk server running in an instance and I am trying to make SIP calls using pion webrtc client. So I have my pjsip configured as below
[general]
realm = 127.0.0.1
[1060]
username = 1060
[1061]
username = 1061
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Non mapped elements end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--;
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0
[transport-ws]
type = transport
protocol = ws,wss
bind = 0.0.0.0
[1060]
type = aor
max_contacts = 1
[1060]
type = auth
username = 1060
password = password
[1060]
type = endpoint
context = default
ice_support = yes
direct_media = no
use_avpf = yes
auth = 1060
outbound_auth = 1060
media_encryption = dtls
dtls_verify = fingerprint
dtls_cert_file = /etc/asterisk/keys/asterisk.pem
dtls_setup = actpass
aors = 1060
transport = transport-ws
[1060]
type = registration
line = yes
server_uri = 1060:127.0.0.1
client_uri = 1060:hello@127.0.0.1
contact_user = 1060
endpoint = 1060
transport = transport-ws
[1061]
type = aor
max_contacts = 1
[1061]
type = auth
username = 1061
password = password
[1061]
type = endpoint
context = default
auth = 1061
outbound_auth = 1061
aors = 1061
Now I was able to connect to asterisk websocket, Now in the next step I am trying to register a endpoint
REGISTER sip:127.0.0.1:8089 SIP/2.0
Supported: path,ice
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER, REGISTER
User-Agent: Pion WebRTC SIP Client
Contact: <sip:1060@127.0.0.1;transport=ws>;expires=200
Via: SIP/2.0/WS 127.0.0.1;branch=z9hG4bKab6773ab-99ec-4f9c-85b8-c2e1b3356046
To: <sip:1060@127.0.0.1>
Call-ID: 24110630-9a1c-4304-b19c-d4298c058fbd
From: <sip:1060@127.0.0.1>;tag=39d4758e-d8db-4e04-8bbf-8817d4d5c91a
Organization: ACE MEDIAS TOOLS
CSeq: 8082 REGISTER
Content-Length: 0
Max-Forwards: 70
When I try to write this message to websocket I get response as 401 and I don’t any log in asterisk CLI except on error client getting disconnected to websocket. I have a feeling that my pjsip.conf is not proper or the request is not sent correct.
Please help me. Thanks in advance