No audio - DIDWW to Asterisk SIP Trunk

hi,

I’ve a SIP trunk between DIDWW to Asterisk SIP Trunk. The call comes in to the Asterisk but there is no IVR sound.

Asterisk Trunk Configuration

context=from-trunk
dtmfmode=rfc2833
dtmf=rfc2833
host=X.X.X.X
insecure=very
type=peer
nat=never (I tried “yes” and “route” - nothing helps)
allow=g729 (I tried ulaw, alaw & all - nothing helps)

Please find the logs below from Asterisk.

-- Executing [300@from-pstn:1] NoOp("SIP/DIDWW-0000002a", "Catch-All DID Mat                                                                                        ch - Found 300 - You probably want a DID for this.") in new stack
-- Executing [300@from-pstn:2] Goto("SIP/DIDWW-0000002a", "ext-did,s,1") in                                                                                         new stack
-- Goto (ext-did,s,1)
-- Executing [s@ext-did:1] Set("SIP/DIDWW-0000002a", "__FROM_DID=s") in new                                                                                         stack
-- Executing [s@ext-did:2] Gosub("SIP/DIDWW-0000002a", "app-blacklist-check,                                                                                        s,1") in new stack
-- Executing [s@app-blacklist-check:1] GotoIf("SIP/DIDWW-0000002a", "0?black                                                                                        listed") in new stack
-- Executing [s@app-blacklist-check:2] Set("SIP/DIDWW-0000002a", "CALLED_BLA                                                                                        CKLIST=1") in new stack
-- Executing [s@app-blacklist-check:3] Return("SIP/DIDWW-0000002a", "") in n                                                                                        ew stack
-- Executing [s@ext-did:3] ExecIf("SIP/DIDWW-0000002a", "0 ?Set(CALLERID(nam                                                                                        e)=+966114405457)") in new stack
-- Executing [s@ext-did:4] Set("SIP/DIDWW-0000002a", "__CALLINGPRES_SV=allow                                                                                        ed_not_screened") in new stack
-- Executing [s@ext-did:5] Set("SIP/DIDWW-0000002a", "CALLERPRES()=allowed_n                                                                                        ot_screened") in new stack
-- Executing [s@ext-did:6] Goto("SIP/DIDWW-0000002a", "ivr-3,s,1") in new st                                                                                        ack
-- Goto (ivr-3,s,1)
-- Executing [s@ivr-3:1] Set("SIP/DIDWW-0000002a", "MSG=custom/Welcome") in                                                                                         new stack
-- Executing [s@ivr-3:2] Set("SIP/DIDWW-0000002a", "LOOPCOUNT=0") in new sta                                                                                        ck
-- Executing [s@ivr-3:3] Set("SIP/DIDWW-0000002a", "__DIR-CONTEXT=") in new                                                                                         stack
-- Executing [s@ivr-3:4] Set("SIP/DIDWW-0000002a", "_IVR_CONTEXT_ivr-3=") in                                                                                         new stack
-- Executing [s@ivr-3:5] Set("SIP/DIDWW-0000002a", "_IVR_CONTEXT=ivr-3") in                                                                                         new stack
-- Executing [s@ivr-3:6] GotoIf("SIP/DIDWW-0000002a", "0?begin") in new stac                                                                                        k
-- Executing [s@ivr-3:7] Answer("SIP/DIDWW-0000002a", "") in new stack
-- Executing [s@ivr-3:8] Wait("SIP/DIDWW-0000002a", "1") in new stack
-- Executing [s@ivr-3:9] Set("SIP/DIDWW-0000002a", "TIMEOUT(digit)=3") in ne                                                                                        w stack
-- Digit timeout set to 3.000
-- Executing [s@ivr-3:10] Set("SIP/DIDWW-0000002a", "TIMEOUT(response)=10")                                                                                         in new stack
-- Response timeout set to 10.000
-- Executing [s@ivr-3:11] Set("SIP/DIDWW-0000002a", "__IVR_RETVM=") in new s                                                                                        tack
-- Executing [s@ivr-3:12] ExecIf("SIP/DIDWW-0000002a", "1?Background(custom/                                                                                        Welcome)") in new stack
-- <SIP/DIDWW-0000002a> Playing 'custom/Welcome.slin' (language 'en')
-- Executing [s@ivr-3:13] WaitExten("SIP/DIDWW-0000002a", ",") in new stack
-- Timeout on SIP/DIDWW-0000002a, going to 't'
-- Executing [t@ivr-3:1] Set("SIP/DIDWW-0000002a", "MSG=custom/Welcome") in new stack
-- Executing [t@ivr-3:2] Goto("SIP/DIDWW-0000002a", "loop,1") in new stack
-- Goto (ivr-3,loop,1)
-- Executing [loop@ivr-3:1] Set("SIP/DIDWW-0000002a", "LOOPCOUNT=1") in new stack
-- Executing [loop@ivr-3:2] GotoIf("SIP/DIDWW-0000002a", "0?hang,1") in new stack
-- Executing [loop@ivr-3:3] Goto("SIP/DIDWW-0000002a", "ivr-3,s,begin") in new stack
-- Goto (ivr-3,s,9)
-- Executing [s@ivr-3:9] Set("SIP/DIDWW-0000002a", "TIMEOUT(digit)=3") in new stack
-- Digit timeout set to 3.000
-- Executing [s@ivr-3:10] Set("SIP/DIDWW-0000002a", "TIMEOUT(response)=10") in new stack
-- Response timeout set to 10.000
-- Executing [s@ivr-3:11] Set("SIP/DIDWW-0000002a", "__IVR_RETVM=") in new stack
-- Executing [s@ivr-3:12] ExecIf("SIP/DIDWW-0000002a", "1?Background(custom/Welcome)") in new stack
-- <SIP/DIDWW-0000002a> Playing 'custom/Welcome.slin' (language 'en')

– Executing [s@ivr-3:13] WaitExten(“SIP/DIDWW-0000002a”, “,”) in new stack
== Spawn extension (ivr-3, s, 13) exited non-zero on ‘SIP/DIDWW-0000002a’
– Executing [h@ivr-3:1] Hangup(“SIP/DIDWW-0000002a”, “”) in new stack
== Spawn extension (ivr-3, h, 1) exited non-zero on ‘SIP/DIDWW-0000002a’

Regards,

The IVR is working. I suspect you have a NAT or firewall problem that is preventing media getting through.

If you are inside NAT, the key options are those which tell Asterisk how to find its own address, not the nat= one.

Incidentally note that very is deprecated or obsolete as a parameter of insecure. Also the default is to allow all codecs, so allowing one explicitly without disallowing others has no effect.

You can use “rtp set debug on” to see if media is arriving and “sip set debug on” to see what addresses are being exchanged.

Appreciate your response…

What can I use instead of "Insecure=very"
I made the codec to allow=all

As per your suggestion, I ran the debugs and the output follows…

Retransmitting #8 (NAT) to 46.19.210.14:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 46.19.210.14;branch=z9hG4bKnvoTBaT0;received=46.19.210.14;rport=5060
From: +966114405457 sip:+966114405457@46.19.210.14;tag=4376B38B-580DCB53000AD6B3-203AE700
To: sip:300@178.20.146.250;tag=as4c18471b
Call-ID: 11-2B9BC43D-580DCB53000AD73E-203AE700
CSeq: 10 INVITE
Server: FPBX-2.8.1(1.8.7.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:300@178.20.146.250:5060
Content-Type: application/sdp
Content-Length: 262

v=0
o=root 472582435 472582435 IN IP4 178.20.146.250
s=Asterisk PBX 1.8.7.0
c=IN IP4 178.20.146.250
t=0 0
m=audio 11360 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=ptime:20
a=sendrecv


Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063564, ts 184096, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063565, ts 184256, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063566, ts 184416, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063567, ts 184576, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063568, ts 184736, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063569, ts 184896, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063570, ts 185056, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063571, ts 185216, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063572, ts 185376, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063573, ts 185536, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063574, ts 185696, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063575, ts 185856, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063576, ts 186016, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063577, ts 186176, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063578, ts 186336, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063579, ts 186496, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063580, ts 186656, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063581, ts 186816, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063582, ts 186976, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063583, ts 187136, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063584, ts 187296, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063585, ts 187456, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063586, ts 187616, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063587, ts 187776, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063588, ts 187936, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063589, ts 188096, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063590, ts 188256, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063591, ts 188416, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063592, ts 188576, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063593, ts 188736, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063594, ts 188896, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063595, ts 189056, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063596, ts 189216, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063597, ts 189376, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063598, ts 189536, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063599, ts 189696, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063600, ts 189856, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063601, ts 190016, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063602, ts 190176, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063603, ts 190336, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063604, ts 190496, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063605, ts 190656, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063606, ts 190816, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063607, ts 190976, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063608, ts 191136, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063609, ts 191296, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063610, ts 191456, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063611, ts 191616, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063612, ts 191776, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063613, ts 191936, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063614, ts 192096, len 000160)
Sent RTP packet to 46.19.210.39:42430 (type 00, seq 063615, ts 192256, len 000160)
– Executing [s@ivr-3:13] WaitExten(“SIP/DIDWW-00000005”, “,”) in new stack
Retransmitting #9 (NAT) to 46.19.210.14:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 46.19.210.14;branch=z9hG4bKnvoTBaT0;received=46.19.210.14;rport=5060
From: +966114405457 sip:+966114405457@46.19.210.14;tag=4376B38B-580DCB53000AD6B3-203AE700
To: sip:300@178.20.146.250;tag=as4c18471b
Call-ID: 11-2B9BC43D-580DCB53000AD73E-203AE700
CSeq: 10 INVITE
Server: FPBX-2.8.1(1.8.7.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:300@178.20.146.250:5060
Content-Type: application/sdp
Content-Length: 262

v=0
o=root 472582435 472582435 IN IP4 178.20.146.250
s=Asterisk PBX 1.8.7.0
c=IN IP4 178.20.146.250
t=0 0
m=audio 11360 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=ptime:20
a=sendrecv


ElastixCLI> sip set debug off
SIP Debugging Disabled
== Spawn extension (ivr-3, s, 13) exited non-zero on ‘SIP/DIDWW-00000005’
– Executing [h@ivr-3:1] Hangup(“SIP/DIDWW-00000005”, “”) in new stack
== Spawn extension (ivr-3, h, 1) exited non-zero on 'SIP/DIDWW-00000005’
Elastix
CLI> sip set debug off
SIP Debugging Disabled
Elastix*CLI>

regards,

Please mark the log as unformatted text, otherwise everything in angle brackets gets hidden.

insecure does two things:

  1. with invite, doesn’t try to authenticate incoming calls. This tends to be necessary with ITSP’s, as they generally only operate one way authentication. However, in recent versions of Asterisk, I consider that using remotesecret, rather than secret, is a less obscure way of doing this.

  2. with port, ignores the source port number. This is particularly necessary for TCP, but might be necessary in some other cases.

You need to evaluate your specific requirements and use an appropriate combination of these options,but only the minimum needed as they remove security checks.

As well as not receiving any inbound media, which indicates that 178.20.146.25011360 is not routable, to you, from the peer, you are also not receiving an ACK, which suggests that either the hidden information in your Contact header is not acceptable to them, or that 46.19.210.14:5060 doesn’t actually route back to them. The lack of media could also be because 46.19.210.14:5060 is not routable from you.