Hi all,
I installed a brand new Asterisk 20.4.0 on an Amazon EC2 server. The idea is to replace an existing instance based on Asterisk 16.6.1 (also on Amazon EC2). The big difference is of course migration from SIP to PJSIP.
For the first tests, I’m using MicroSIP softphone on my laptop.
The softphone registers correctly in Asterisk.
I’m also able to call the softphone (ringing at least) by using this command in the CLI : originate pjsip/MYENDPOINT1 extension
However, if I try to call from the softphone, nothing appears in the CLI nor in PJSIP log. And I finally get a “Request Timeout” message from the softphone.
For information, here below are the pjsip.conf, extensions.conf, pjsip log on registration and pjsip log when using the command “originate”.
The public ip of the EC2 instance has been replaced with : EC2_public_ip
The private ip of the EC2 instance has been replaced with : EC2_private_ip
The WAN ip of my router (at home) has been replaced with : Router_WAN_ip
The pjsip.conf is more or less a conversion based on the sip.conf of the Asterisk 16 instance.
I’m a bit lost and some help would be much appreciated ;-).
What puzzles me a bit is the contact value :
Contact: sip:MYENDPOINT1@192.168.2.117:56278;ob
Is it normal to have the LAN ip there ?
Many many thanks in advance for your help !
pjsip.conf :
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:56278
local_net=EC2_private_ip/255.255.240.0
external_signaling_address=EC2_public_ip
external_media_address=EC2_public_ip;templates
endpoint_internal
type=endpoint
transport=transport-udp
context=MYENDPOINT
disallow=all
allow=ulaw
direct_media=no
force_rport=yes
rtp_symmetric=yes
rewrite_contact=yesauth_userpass
type=auth
auth_type=userpassaor_dynamic
type=aor
max_contacts=2;endpoints
MYENDPOINT1
auth=MYENDPOINT1
aors=MYENDPOINT1MYENDPOINT1
password=MYENDPOINT1
username=MYENDPOINT1MYENDPOINT2
auth=auth_MYENDPOINT2
aors=MYENDPOINT2auth_MYENDPOINT2
password=MYENDPOINT2
username=MYENDPOINT2
extensions.conf :
[MYENDPOINT]
exten=>6001,1,Dial(PJSIP/MYENDPOINT1,120)
exten=>6002,1,Dial(PJSIP/MYENDPOINT2,120)
pjsip log on registration :
<— Received SIP request (533 bytes) from UDP:Router_WAN_ip:56278 —>
REGISTER sip:EC2_public_ip:56278 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.117:56278;rport;branch=z9hG4bKPjbc36e96a01d7417490b56d7a51c3c31b
Max-Forwards: 70
From: sip:MYENDPOINT1@EC2_public_ip;tag=5a063ea8a72f4ccab544c7df0a1424aa
To: sip:MYENDPOINT1@EC2_public_ip
Call-ID: ee0824619e4549f7b23ed83069a0617a
CSeq: 22741 REGISTER
User-Agent: MicroSIP/3.21.3
Contact: sip:MYENDPOINT1@192.168.2.117:56278;ob
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0<— Transmitting SIP response (562 bytes) to UDP:Router_WAN_ip:56278 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.2.117:56278;rport=56278;received=Router_WAN_ip;branch=z9hG4bKPjbc36e96a01d7417490b56d7a51c3c31b
Call-ID: ee0824619e4549f7b23ed83069a0617a
From: sip:MYENDPOINT1@EC2_public_ip;tag=5a063ea8a72f4ccab544c7df0a1424aa
To: sip:MYENDPOINT1@EC2_public_ip;tag=z9hG4bKPjbc36e96a01d7417490b56d7a51c3c31b
CSeq: 22741 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1696628628/944010cc40597d2ad635e7a4f573bf77”,opaque=“4dc319266572fca7”,algorithm=MD5,qop=“auth”
Server: Asterisk PBX 20.4.0
Content-Length: 0<— Received SIP request (830 bytes) from UDP:Router_WAN_ip:56278 —>
REGISTER sip:EC2_public_ip:56278 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.117:56278;rport;branch=z9hG4bKPj816e202c2b894e18a9c8ade4c0184453
Max-Forwards: 70
From: sip:MYENDPOINT1@EC2_public_ip;tag=5a063ea8a72f4ccab544c7df0a1424aa
To: sip:MYENDPOINT1@EC2_public_ip
Call-ID: ee0824619e4549f7b23ed83069a0617a
CSeq: 22742 REGISTER
User-Agent: MicroSIP/3.21.3
Contact: sip:MYENDPOINT1@192.168.2.117:56278;ob
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Authorization: Digest username=“MYENDPOINT1”, realm=“asterisk”, nonce=“1696628628/944010cc40597d2ad635e7a4f573bf77”, uri=“sip:EC2_public_ip:56278”, response=“d3d7e2f2deeefea070b95709513d6a0a”, algorithm=MD5, cnonce=“28bb24c896654323968bf947df2db8c2”, opaque=“4dc319266572fca7”, qop=auth, nc=00000001
Content-Length: 0-- Added contact 'sip:MYENDPOINT1@Router_WAN_ip:56278;ob;x-ast-orig-host=192.168.2.117:56278' to AOR 'MYENDPOINT1' with expiration of 300 seconds
<— Transmitting SIP response (517 bytes) to UDP:Router_WAN_ip:56278 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.2.117:56278;rport=56278;received=Router_WAN_ip;branch=z9hG4bKPj816e202c2b894e18a9c8ade4c0184453
Call-ID: ee0824619e4549f7b23ed83069a0617a
From: sip:MYENDPOINT1@EC2_public_ip;tag=5a063ea8a72f4ccab544c7df0a1424aa
To: sip:MYENDPOINT1@EC2_public_ip;tag=z9hG4bKPj816e202c2b894e18a9c8ade4c0184453
CSeq: 22742 REGISTER
Date: Fri, 06 Oct 2023 21:43:48 GMT
Contact: sip:MYENDPOINT1@192.168.2.117:56278;ob;expires=299
Expires: 300
Server: Asterisk PBX 20.4.0
Content-Length: 0== Endpoint MYENDPOINT1 is now Reachable
pjsip log on originate :
asterisk*CLI> originate pjsip/MYENDPOINT1 extension
– Called MYENDPOINT1
<— Transmitting SIP request (937 bytes) to UDP:Router_WAN_ip:56278 —>
INVITE sip:MYENDPOINT1@Router_WAN_ip:56278;ob SIP/2.0
Via: SIP/2.0/UDP EC2_public_ip:56278;rport;branch=z9hG4bKPj7a29fd64-5ba1-4e35-9208-22b9efc64931
From: “Anonymous” sip:anonymous@anonymous.invalid;tag=3584dc6d-f36f-4d3c-80a4-dd51defcf59b
To: sip:MYENDPOINT1@Router_WAN_ip;ob
Contact: sip:asterisk@EC2_public_ip:56278
Call-ID: 29857119-6b8f-4dbe-951a-da0502a8bbdd
CSeq: 7315 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 20.4.0
Content-Type: application/sdp
Content-Length: 235v=0
o=- 334890010 334890010 IN IP4 EC2_public_ip
s=Asterisk
c=IN IP4 EC2_public_ip
t=0 0
m=audio 11136 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv<— Received SIP response (364 bytes) from UDP:Router_WAN_ip:56278 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP EC2_public_ip:56278;rport=56278;received=EC2_public_ip;branch=z9hG4bKPj7a29fd64-5ba1-4e35-9208-22b9efc64931
Call-ID: 29857119-6b8f-4dbe-951a-da0502a8bbdd
From: “Anonymous” sip:anonymous@anonymous.invalid;tag=3584dc6d-f36f-4d3c-80a4-dd51defcf59b
To: sip:MYENDPOINT1@Router_WAN_ip;ob
CSeq: 7315 INVITE
Content-Length: 0<— Received SIP response (548 bytes) from UDP:Router_WAN_ip:56278 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP EC2_public_ip:56278;rport=56278;received=EC2_public_ip;branch=z9hG4bKPj7a29fd64-5ba1-4e35-9208-22b9efc64931
Call-ID: 29857119-6b8f-4dbe-951a-da0502a8bbdd
From: “Anonymous” sip:anonymous@anonymous.invalid;tag=3584dc6d-f36f-4d3c-80a4-dd51defcf59b
To: sip:MYENDPOINT1@Router_WAN_ip;ob;tag=5d5d9545bd2f442aa959c58dfe4cb1a1
CSeq: 7315 INVITE
Contact: sip:MYENDPOINT1@192.168.2.117:56278;ob
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0-- PJSIP/MYENDPOINT1-00000002 is ringing
<— Received SIP response (502 bytes) from UDP:Router_WAN_ip:56278 —>
SIP/2.0 486 Busy Here
Via: SIP/2.0/UDP EC2_public_ip:56278;rport=56278;received=EC2_public_ip;branch=z9hG4bKPj7a29fd64-5ba1-4e35-9208-22b9efc64931
Call-ID: 29857119-6b8f-4dbe-951a-da0502a8bbdd
From: “Anonymous” sip:anonymous@anonymous.invalid;tag=3584dc6d-f36f-4d3c-80a4-dd51defcf59b
To: sip:MYENDPOINT1@Router_WAN_ip;ob;tag=5d5d9545bd2f442aa959c58dfe4cb1a1
CSeq: 7315 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0<— Transmitting SIP request (451 bytes) to UDP:Router_WAN_ip:56278 —>
ACK sip:MYENDPOINT1@Router_WAN_ip:56278;ob SIP/2.0
Via: SIP/2.0/UDP EC2_public_ip:56278;rport;branch=z9hG4bKPj7a29fd64-5ba1-4e35-9208-22b9efc64931
From: “Anonymous” sip:anonymous@anonymous.invalid;tag=3584dc6d-f36f-4d3c-80a4-dd51defcf59b
To: sip:MYENDPOINT1@Router_WAN_ip;ob;tag=5d5d9545bd2f442aa959c58dfe4cb1a1
Call-ID: 29857119-6b8f-4dbe-951a-da0502a8bbdd
CSeq: 7315 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 20.4.0
Content-Length: 0