Sound not coming after receive Call using node.js

hello,
I am able to originate a call using AMI + node.js
But when I receive a call at my mobile softfone [Mizudroid], I am not able to hear anything at my laptop from softfone.
I have already connected my speaker with my laptop to hear the sound. but no luck.
please advice

You haven’t even said which channel technology you are using! I don’t know of causes of one way audio on analogue lines, other than hardware faults.

For VoIP this is normally a NAT or firewall problem. You will need to tell us the channel technology driver in use (most VoIP users should be using chan_pjsip, although most are probably using chan_sip), and provide the general configuration and that relating to both parties, together with a protocol trace showing the media negotiation (SDP exchange for SIP). An extract from media debugging, e.g. rtp debug, for SIP, showing from which parties media is being received is also likely ot be helpful.

I am using the below code for node.js

.then(() => { // any second action
              return client.action({Action:'Originate',
              Channel:'SIP/David',
              Context:'incoming',
              Exten:100,
              Priority:1,
              CallerID:100}, true);
      })

I am using chan_sip.
Also below is my configuration for AMI:
[test]
secret =xxxx
deny=0.0.0.0/0.0.0.0
permit=x.x.x.x/x.x.x.x
read=all

Please advice

You are using the deprecated chan_sip. You will need to set verbose 3, enable the full log, and capture the complete INVITE transactions for both sides use “sip set debug on”. You should also use rtp debug to confirm whether the media is arriving.

We will also need details of routing and firewall considerations, and, in particular, the use of NAT. The information supplied above indicates that you have not configured to support NAT, so hopefully there is no NAT in your system, in which case the problem is likely to be due to a firewall.

Please find the below log from sip set debug on

<--- SIP read from UDP:103.77.138.22:17796 --->
REGISTER sip:xx.xx.xx.xx SIP/2.0
Via: SIP/2.0/UDP 103.77.138.22:17796;rport;branch=z9hG4bK-33p3510064339084291672r
From: <sip:David@xx.xx.xx.xx>;tag=4g6424359133123048918m
To: <sip:David@xx.xx.xx.xx>
Call-ID: 2e4982225005416187279k34392rmwp
CSeq: 27066 REGISTER
Max-Forwards: 70
Expires: 90
Authorization: Digest username="David",realm="asterisk",nonce="5b027aa5",uri="sip:xx.xx.xx.xx",response="6db                                                         9890dd6137b77707d49a3ca716bc2",algorithm=MD5
Contact: <sip:David@103.77.138.22:17796>
User-Agent: MizuDroid/3.1.0
X-DeviceID: 3c8e1387f1b68ee7
Supported: replaces
Allow: ACK,PRACK,BYE,CANCEL,INVITE,UPDATE,MESSAGE,INFO,OPTIONS,SUBSCRIBE,NOTIFY,REFER
Allow-Events: presence,refer,telephone-event,keep-alive,dialog
Accept: application/sdp,application/dtmf-relay,text/plain
Content-Length: 0

<------------->
--- (17 headers 0 lines) ---
Sending to 103.77.138.22:17796 (no NAT)
Reliably Transmitting (NAT) to 103.77.138.22:17796:
OPTIONS sip:David@103.77.138.22:17796 SIP/2.0
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK2093ece1;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@xx.xx.xx.xx>;tag=as5d7c39f9
To: <sip:David@103.77.138.22:17796>
Contact: <sip:asterisk@xx.xx.xx.xx:5060>
Call-ID: 3efdd1b26d102aa55afd8ce801982f37@xx.xx.xx.xx:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 16.7.0
Date: Fri, 26 Jun 2020 11:34:54 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<--- SIP read from UDP:103.77.138.22:17796 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK2093ece1;received=xx.xx.xx.xx;rport=5060
From: "asterisk" <sip:asterisk@xx.xx.xx.xx>;tag=as5d7c39f9
To: <sip:David@103.77.138.22:17796>;tag=37p7439192546469470103h
Call-ID: 3efdd1b26d102aa55afd8ce801982f37@xx.xx.xx.xx:5060
CSeq: 102 OPTIONS
Contact: <sip:David@103.77.138.22:17796>
User-Agent: MizuDroid/3.1.0
X-DeviceID: 3c8e1387f1b68ee7
Supported: replaces
Allow: ACK,PRACK,BYE,CANCEL,INVITE,UPDATE,MESSAGE,INFO,OPTIONS,SUBSCRIBE,NOTIFY,REFER
Accept: application/sdp,application/dtmf-relay,text/plain
Accept-Encoding: identity
Accept-Language: en
Content-Length: 0

Please advice

There are no calls (INVITE transactions) in that log.

Sorry for wrong log update…

  -- Called David
Retransmitting #1 (NAT) to 103.77.138.22:19856:
INVITE sip:David@103.77.138.22:19856 SIP/2.0
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK5eb7ef29;rport
Max-Forwards: 70
From: <sip:100@xx.xx.xx.xx>;tag=as5f4f18f2
To: <sip:David@103.77.138.22:19856>
Contact: <sip:100@xx.xx.xx.xx:5060>
Call-ID: 1b59543a3e84d3ab53ed72957f480af9@xx.xx.xx.xx:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 16.7.0
Date: Fri, 26 Jun 2020 13:03:34 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 265

v=0
o=root 1165858017 1165858017 IN IP4 xx.xx.xx.xx
s=Asterisk PBX 16.7.0
c=IN IP4 xx.xx.xx.xx
t=0 0
m=audio 12336 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:103.77.138.22:19856 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK5eb7ef29;received=xx.xx.xx.xx;rport=5060
From: <sip:100@xx.xx.xx.xx>;tag=as5f4f18f2
To: <sip:David@103.77.138.22:19856>;tag=305p3942103720143178456h
Call-ID: 1b59543a3e84d3ab53ed72957f480af9@xx.xx.xx.xx:5060
CSeq: 102 INVITE
User-Agent: MizuDroid/3.1.0
X-DeviceID: 723cd476e0101fd8
Supported: replaces
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---

<--- SIP read from UDP:103.77.138.22:19856 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK5eb7ef29;received=xx.xx.xx.xx;rport=5060
From: <sip:100@xx.xx.xx.xx>;tag=as5f4f18f2
To: <sip:David@103.77.138.22:19856>;tag=305p3942103720143178456h
Call-ID: 1b59543a3e84d3ab53ed72957f480af9@xx.xx.xx.xx:5060
CSeq: 102 INVITE
Contact: <sip:David@103.77.138.22:19856>
User-Agent: MizuDroid/3.1.0
X-DeviceID: 723cd476e0101fd8
Supported: replaces
Allow: ACK,PRACK,BYE,CANCEL,INVITE,UPDATE,MESSAGE,INFO,OPTIONS,SUBSCRIBE,NOTIFY,REFER
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---
sip_route_dump: route/path hop: <sip:David@103.77.138.22:19856>
    -- SIP/David-00000020 is ringing

<--- SIP read from UDP:103.77.138.22:19856 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK5eb7ef29;received=xx.xx.xx.xx;rport=5060
From: <sip:100@xx.xx.xx.xx>;tag=as5f4f18f2
To: <sip:David@103.77.138.22:19856>;tag=305p3942103720143178456h
Call-ID: 1b59543a3e84d3ab53ed72957f480af9@xx.xx.xx.xx:5060
CSeq: 102 INVITE
Contact: <sip:David@103.77.138.22:19856>
User-Agent: MizuDroid/3.1.0
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
sip_route_dump: route/path hop: <sip:David@103.77.138.22:19856>
    -- SIP/David-00000020 is ringing
Retransmitting #7 (no NAT) to 45.143.220.164:64205:
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 45.143.220.164:64205;branch=z9hG4bK2039960102;received=45.143.220.164
From: <sip:86629@xx.xx.xx.xx>;tag=1654103352
To: <sip:000441792959010@xx.xx.xx.xx>;tag=as4d2eefcf
Call-ID: 2110888531-1137663994-1329120494
CSeq: 1 INVITE
Server: Asterisk PBX 16.7.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0



Are all xx.xx.xx.xx’s the same? Are they public or private addresses?

There are two calls here. The later (outgoing) call has not reached a final status, and MizuDroid hasn’t provided any media address for early media, so it is impossible for media to flow towards it. The call is stalled in MizuDroid.

The earlier (inbound) calls is failing badly at two levels. First it has been made to an unknown extension on Asterisk, and secondly the final response code indicating this is failing to be acknowledged. The latter point suggest that there is no route to 45.143.220.164:64205, from Asterisk, given that there is no Contact header being sent by Asterisk, and the initial INVITE must have arrived (although it is possible that a temporary firewall rule was opened by the INVITE, but cannot be reopened by the ACK.

xx.xx.xx.xx is my Public IP address where Asterisk is running.

I have opened the NAT port from my service provider [5060].
Still I am not able to get the sound from either Side. Please note I am trying to call using AMI + node.js
Please find the below log as below :

SIP/2.0 200 OK
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK605f8267;received=xx.xx.xx.xx;rport=5060
From: <sip:741@xx.xx.xx.xx>;tag=as57dad2d8
To: <sip:David@103.77.138.139:13968>;tag=29p5932031078520192092h
Call-ID: 0c8c68bc14d95baf0a482e3d635c3c3a@xx.xx.xx.xx:5060
CSeq: 102 INVITE
Contact: <sip:David@103.77.138.139:13968>
User-Agent: MizuDroid/3.1.0
X-DeviceID: 3c8e1387f1b68ee7
Supported: replaces
Allow: ACK,PRACK,BYE,CANCEL,INVITE,UPDATE,MESSAGE,INFO,OPTIONS,SUBSCRIBE,NOTIFY,REFER
Content-Type: application/sdp
Content-Length: 201

v=0
o=David 980 688 IN IP4 10.28.113.30
s=mizudroid
c=IN IP4 10.28.113.30
t=0 0
m=audio 12734 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
<------------->
--- (13 headers 10 lines) ---
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|h263|h263p|vp8|vp9), peer - audio=(alaw)/video=(nothing)/text=(nothing), combined - (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.28.113.30:12734
sip_route_dump: route/path hop: <sip:David@103.77.138.139:13968>
Transmitting (NAT) to 103.77.138.139:13970:
ACK sip:David@103.77.138.139:13968 SIP/2.0
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK28a9636c;rport
Max-Forwards: 70
From: <sip:741@xx.xx.xx.xx>;tag=as57dad2d8
To: <sip:David@103.77.138.139:13968>;tag=29p5932031078520192092h
Contact: <sip:741@xx.xx.xx.xx:5060>
Call-ID: 0c8c68bc14d95baf0a482e3d635c3c3a@xx.xx.xx.xx:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 16.7.0
Content-Length: 0


---
 == Using SIP VIDEO CoS mark 6
 == Using SIP RTP CoS mark 5
Audio is at 18478
Adding codec alaw to SDP
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 103.77.138.139:13970:
INVITE sip:David@103.77.138.139:13968 SIP/2.0
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK4fe62a2e;rport
Max-Forwards: 70
From: <sip:741@xx.xx.xx.xx>;tag=as1e101172
To: <sip:David@103.77.138.139:13968>
Contact: <sip:741@xx.xx.xx.xx:5060>
Call-ID: 5d1290692a9491ed11732ccc53a39aa5@xx.xx.xx.xx:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 16.7.0
Date: Tue, 30 Jun 2020 09:59:46 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 265

v=0
o=root 1622387964 1622387964 IN IP4 xx.xx.xx.xx
s=Asterisk PBX 16.7.0
c=IN IP4 xx.xx.xx.xx
t=0 0
m=audio 18478 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

please advice …

Have you opened the media port range?

Yes… I have opened the port for rtp. The default port for udp based SIP signaling is port 5060.

Please find the below log for rtp details

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK70e434b1;received=xx.xx.xx.xx;rport=5060
From: <sip:741@xx.xx.xx.xx>;tag=as639891fc
To: <sip:David@10.28.113.30:13676>;tag=117p3841241157573274112h
Call-ID: 1b7f50d0439576cc7780158876cc7e73@xx.xx.xx.xx:5060
CSeq: 102 INVITE
Contact: <sip:David@10.28.113.30:13676>
User-Agent: MizuDroid/3.1.0
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
sip_route_dump: route/path hop: <sip:David@10.28.113.30:13676>
    -- SIP/David-000000aa is ringing
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014225, ts 001120, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002607, ts 089374, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014226, ts 001280, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002608, ts 089534, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014227, ts 001440, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002609, ts 089694, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014228, ts 001600, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002610, ts 089854, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014229, ts 001760, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002611, ts 090014, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014230, ts 001920, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014231, ts 002080, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002612, ts 090174, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014232, ts 002240, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002613, ts 090334, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014233, ts 002400, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002614, ts 090494, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014234, ts 002560, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002615, ts 090654, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014235, ts 002720, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002616, ts 090814, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014236, ts 002880, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002617, ts 090974, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014237, ts 003040, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002618, ts 091134, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014238, ts 003200, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002619, ts 091294, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014239, ts 003360, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002620, ts 091454, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014240, ts 003520, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002621, ts 091614, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014241, ts 003680, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002622, ts 091774, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014242, ts 003840, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002623, ts 091934, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014243, ts 004000, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002624, ts 092094, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014244, ts 004160, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002625, ts 092254, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014245, ts 004320, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002626, ts 092414, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014246, ts 004480, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002627, ts 092574, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014247, ts 004640, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002628, ts 092734, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014248, ts 004800, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002629, ts 092894, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014249, ts 004960, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002630, ts 093054, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014250, ts 005120, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002631, ts 093214, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014251, ts 005280, len 000160)
Got  RTP packet from    103.77.138.139:12734 (type 08, seq 002632, ts 093374, len 000160)
Sent RTP packet to      103.77.138.139:12734 (type 08, seq 014252, ts 005440, len 000160)

When I am receiving the call automatically there Line 2 has been opened at Mizudroid.

Please advice

You have media flowing on one leg. I assume the call is not bridged (there is no second leg).

You need to follow the sent packets through the network, as they are being sent.

Also the configuration for AMI

[general]
enabled = yes
webenabled = yes

port = 5038
bindaddr = 0.0.0.0

[User]
secret =xxx
deny=0.0.0.0/0.0.0.0

permit=0.0.0.0/0.0.0.0
read=all
write=all

Is there is any specific configuration for this ? Please advice

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.