1
votes

My Asterisk set up is as follows: - I have 2 grandstream GXP 2000 phones connected to my router - My small linux server (with asterisk) is connected to the router as well

I have a dynamic ip from my isp provider, but I signed up for DynDNS

When I started I could call people and talk to them. If people rang me, the phone would ring, and I could hear them speak. They could not hear me. I found out this was because of the directmedia / canreinvite setting. So I set this to:

canreinvite=no directmedia=no

Now, people could call me and I could answer. However, due to this change I can call people, but as soon as they answer, I can't hear them, I only hear static. When I remove the two lines I add, everything is back as it was before.

What could be the issue ? The 5060 port is forwarded to my server ,as well as the 1000 - 2000 udp rang.

Regards, Digits

2

2 Answers

0
votes

First of all, you should probably read the sip.conf.sample file delivered with Asterisk. Specifically, read the NAT SUPPORT section. canreinvite and directmedia (which are the same setting by the way) attempt to set up the RTP streams directly between the UAs involved in a call, bypassing Asterisk. Thus, while that setting is affected by NAT, it does not necessarily control the channel driver behavior with respect to NAT - so its not surprising you're still having issues.

Without knowing whether or not the UAs in question are sending rport, its difficult to know for sure what your settings should be. That being said, based on your problem description, you may want to set the 'nat' parameter in your [general] section to either:

nat = force_rport,comedia
; or, depending your version
nat = yes

Note that you can set nat on a peer by peer basis, but that's discouraged for security reasons.

Additionally, you may also need to explore the extern* settings, such as externhost.

0
votes

Ok, some information for other people in the same situation: - check your codecs, make sure you get no errors in the Asterisk CLI (command line interface). I got errors, but it worked, so I didn't care. That was a mistake - upgrade to asterisk 1.8 - set directmedia = no - it's upd range 10000 to 20000 (I missed a 0).

This all fixed this problem.