I can't hear any audio in my Asterisk application

Hi guys,
I cant seem to hear any audio in my Asterisk application. This is my sip.conf file

[13131313] ;sip test user
type=friend
context=from13131313
defaultuser=13131313
accountcode=13131313
secret=great
host=dynamic
port=5060
disallow=all
allow=gsm
allow=ulaw
allow=alaw
dtmfmode=rfc2833
directmedia=no
nat=force_rport,comedia

But my Asterisk server does not deliver audio

A little bit more information about your network is needed!

Also, have you opened the RTP port ranges.

You have work around options for NAT, but you have no way of traversing NAT configured.

Thats probably what I have except for the extensions.conf file which is just to play a music and then hangup. I just need to hear the playback audio, is it necessary to use NAT.

Networks are wire, silicon, boxes, etc., forming PCs, routers, switches, cables, etc. not Asterisk files.

Whether you need NAT depends on the answer to the first question, but you seem to have added configuration that only makes sense if there is NAT in your environment.

I would fix the easy errors first. Tne no application one should be trivial to fix.

The timeout one is worrying. To my previous question, please add the make and model of peer. As this point I also need the complete SIP dialogue for the call (e.g. from sip set debug on). Please edit out entries not related to the session in question (in particular OPTIONS). Also please paste as text not as an image. Make sure you pasted it as unformatted text. https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

By LAN do you mean that you have a fully routable network, if so, what was your reason for overriding the default setting for nat=?

At the moment, it looks like either your network is overloaded or your peer device is buggy.

What do you need me to provide, when I set debug to ON. I have many text on my console. I would appreciate if you can view my PC on teamviewer cos I have been hanging on this for days now. It was working before but suddenly it stops. Also my reasons for overriding is not justified as I am a beginner to Asterisk.

Hi, I have fixed it by setting the externip and localnet address. Please I enabled rtp on the CLI, how can I disable it

“rtp set debug off”?

Thank you, also I added an audio to /var/lib/asterisk/moh directory so I can play audio while phone dial

But when I tried to Dial(SIP/${destination}@gateway-${gateway},20,m(lighthouse))

//Lighthouse == The filename of the audio

But I get the error Lighthouse is not loaded in memory.

Also help me with the following func_odbc query, I can see ${VAL} and ${ARG}. What is the difference and when can each be used. I am trying to create a writesql statement like this

writesql = INSERT into calls(date, user_id, source, destination, channel)
writesql += VALUES(‘2016-12-23:08:99:00’, ‘${VAL1}’, ‘${VAL2}’, ‘${VAL3}’, ‘${VAL4}’)

But it is not working. Where should I use the ${VAL} and ${ARG} variables.

Also, does func_odbc has current datetime to insert current datetime.

Music on hold must be configured in musiconhold.conf, you can’t just specify a filename as a class.

Okay, @jcolp, I have to specify the filename there?

It takes a directory, and there’s a description of file based music on hold in the sample musiconhold.conf file.

Yes, I have opened the directory, I saw the [general], [default] tag. What am I to do to add my filename to it, so Asterisk can read. Which section?

The directory itself.

This is what I added

[default]
mode=files
directory=/var/lib/asterisk/moh/lighthouse

Is that a directory or is it a file?

Woops, thank you. Lighthouse is a file, I made a mistake

so I correct it as

/var/lib/asterisk/moh which is the directory

If I want to specify a specific audio file, like lighthouse, how do I do that?

Put it in the directory. It must have the correct file extension for its format.

When I added

directory = /var/lib/asterisk/moh/lighthouse.sln

It gives warning cannot open dir /var/lib/asterisk/moh/lighthouse.sln cos it does not exist.

I want to make sure when user dials number, they hear the lighthouse music and not rings