Asterisk 1.8.4.3 SIP trunk with a provider failing with "Peer doesn't provide audio"

Hello,

We have an issue creating a SIP trunk with an external SIP provider.

His configuration has a separate media server IP and I am not sure whether this is causing the problem.

Also, our SIP servers are behind our firewall and is NATted to the public IP address with no port redirections. (It is a one-to-one NATTing).

A SIP debug log is as follows…

Any help is appreciated.

Many thanks
Best regards
Baalki


<— SIP read from UDP:80.X.X.X4:5060 —>
INVITE sip:1…[email protected] SIP/2.0
Via: SIP/2.0/UDP 80.X.X.X4:5060;branch=z9hG4bK5e57af85aa5af350156e30582b7da61c
From: sip:[email protected];tag=3518239296-435310
To: sip:[email protected]:5060
Call-ID: [email protected]
CSeq: 1 INVITE
Contact: sip:[email protected]:5060
Max-forwards: 0
Session-expires: 3600;refresher=uac
Min-se: 600
Supported: timer
Supported: 100rel
Expires: 300
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Content-Type: application/sdp
Call-Info: sip:80.X.X.X4;method="NOTIFY;Event=telephone-event;Duration=1000"
Content-Length: 399

v=0
o=ETSSSW1 859138 0 IN IP4 80.X.X.X4
s=sip call
c=IN IP4 80.X.X.X5
t=0 0
m=audio 0 RTP/AVP 18 0 8 4 2 98 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=yes
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=fmtp:4 bitrate=5.3
a=rtpmap:2 G726-32/8000
a=rtpmap:98 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=silenceSupp:off - - - -
a=inactive
<------------->
— (17 headers 18 lines) —
Sending to 80.X.X.X4:5060 (no NAT)
Using INVITE request as basis request - [email protected]
Found peer ‘sip_etisalcom’ for ‘3…2’ from 80.X.X.X4:5060
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 18
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 4
Found RTP audio format 2
Found RTP audio format 98
Found RTP audio format 101
Found audio description format G729 for ID 18
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format G723 for ID 4
Found audio description format G726-32 for ID 2
Found audio description format G726-32 for ID 98
Found audio description format telephone-event for ID 101
Capabilities: us - 0x10f (g723|gsm|ulaw|alaw|g729), peer - audio=0x90d (g723|ulaw|alaw|g726|g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x10d (g723|ulaw|alaw|g729)
Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x1 (telephone-event|), combined - 0x0 (nothing)
Peer doesn’t provide audio
Looking for 1…1 in etisalcom-in (domain 87.X.X.X4 )

<— Reliably Transmitting (no NAT) to 80.X.X.X4:5060 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 80.X.X.X4:5060;branch=z9hG4bK5e57af85aa5af350156e30582b7da61c;received=80.X.X.X4
From: sip:[email protected];tag=3518239296-435310
To: sip:[email protected]:5060;tag=as61114fbf
Call-ID: [email protected]
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.4.3
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘[email protected]’ in 32000 ms (Method: INVITE)

<— SIP read from UDP:80.X.X.X4:5060 —>
ACK sip:1…[email protected]/2.0
Via: SIP/2.0/UDP 80.X.X.X4:5060;branch=z9hG4bK5e57af85aa5af350156e30582b7da61c
From: sip:[email protected];tag=3518239296-435310
To: sip:[email protected]:5060;tag=as61114fbf
Call-ID: [email protected]
CSeq: 1 ACK
Contact: sip:[email protected]:5060
Max-forwards: 0
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Really destroying SIP dialog ‘[email protected]’ Method: ACK

Media is handled by the address in the SDP invite for RTP so that’s not a problem.

You did not tell us anything about your system or the trunk and NAT settings you have tried. Without this data nobody can help you.

Thanks Skyking…
I am using Asterisk 1.8.4.3

My trunk details has the following entries in sip.conf

register => A…[email protected]…X4:5060
type=friend
context=etisalcom-in
host=80…X4
port=5060
username=A…a
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g729
allow=g723
;dtmfmode=rfc2833
canreinvite=no
transport=udp,tcp
nat=comedia
insecure=port,invite
directrtpsetup=yes
directmedia=yes
externaddr=80…X5
externaddr=80…X4

related entries in extensions.conf
[etisalcom-in]
exten => s,1,Log(NOTICE, Incoming call from ${CALLERID(all)})
exten => s,n,Goto(OOH323/[email protected],1)
exten => s,n,Hangup()

Hope this helps you identify the problem. Thanks already for taking your time off to help me…

Best regards
Baalki

Wow, it really amazes me when I see these chicken soup trunk setups. Do you actually think that taking bits and pieces from other configs and stringing them together would possible result in a positive outcome.

The idea of a peer is the least number of settings to identify the peer and authenticate with the other end, not to convolute the config beyond recognition.

Suggested reading, the Asterisk sample sip.conf and http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf

Also, is this even a FreePBX system? If so you don’t put anything in sip.conf. If it is not why are you asking for help in the FreePBX forum?

At first glance:

  1. Why are you using a custom context and not the built in from-trunk?
  2. You don't use multiple allow statements, concatenate with &
  3. Why do you have alaw and ulaw?
  4. Do you really have g.729 and g.723 CODEC's allowed?
  5. Do you need GSM CODEC?
  6. Why is DTMFMODE commented out?
  7. Why are you using TCP and UDP transport?
  8. You can only have one external address.
  9. External address declarations don't go in peers they go in the general section
  10. Why did you not mention the H.323, the problem is more than likely CODEC mismatch.

Hi Skyking,

That was a good bashing indeed. I am doing this for the very first time with absolutely no exposure to this area…

After some more additional reading, my sip configuration file looks as follows…

We have a G700 for our other telephony needs and we just wanted to insert Asterisk into the scheme of things to receive calls from a sip trunk provided by a sip provider.

Calls from our SIP extensions to our G700 extensions are going through properly.

Calls from the external SIP trunk (public number) is coming through also to our internal extensions; but with no audio. That is the problem…!

In the initial invite from the sip provider, I found a string for audio …
m=audio 0 RTP/AVP 18 0 8 4 2 98 101

The second column must contain the port for the audio channel, which is zero. We know that the SIP server IP and media server IP are different from the SIP provider’s side. The second question is: how do I include this in my configuration? Is there any other place, where we may need to look?

Thanks for all your help…
Best regards
Baalki

[sip_et…m]
register => A…[email protected]…X4:5060
type=friend
context=etisalcom-in
host=80…X4
port=5060
username=A…a
insecure=very
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g729
allow=g723
dtmfmode=info
canreinvite=no
transport=udp,tcp
directmedia=no
externaddr=80…X5
nat=auto

Hi Skyking,

Got the issue sorted. It was NAT configuration issue in the Asterisk side and is now working well.

Thanks for the support.

Best regards
Baalki

I am glad you got it sorted out. I don’t know if you will answer this. My problem and attitude was you are using Asterisk and not FreePBX.

You did not mention this, nor what version of Asterisk you are running.

This is a FreePBX forum, did you think it is general help?

It is very rude to barge in and ask questions on an unrelated topic and try and obscure the fact that you are not running FreePBX.

Despite all of this I still provided you with useful information to resolve your problem.

If you don’t have the g.729 CODEC license installed you should remove that statement.