No Audio unless:

SYMPTOMS:

  1. Phones can register using using server’s internal ip address on LAN
  2. Phones can not register using externhost name UNLESS on WAN
  3. Phones receive no audio with the following exceptions:
    -When both phones registered on LAN internal ip address.
    -When dialing extension that plays a simple SAYALPHA() string.
    -When external client using externhost PAGE()s internal phone. Internal phone can hear audio from external client but not when DIAL()-ed.

NOTES:
-Self-hosted asterisk server with dynamic DNS setup
-Port forwarding for 5060 and 10000-20000 open for UDP and TCP.
-Assistance appreciated!

SIP.CONF:
[general]
context=internal
allowguest=no
disallow=all
allow=ulaw
bindport=5060
bindaddr=0.0.0.0
nat=force_rport,comedia
externhost=www.mydomain.com
;alwaysauthreject=yes
localnet=192.168.0.0/255.255.255.0
;directmedia=yes

[323]
type=friend
callerid=“DAD” <323>
username=323
host=dynamic
secret=0000
context=internal

EXTENSIONS.CONF:
[internal]
exten => 323,1,Answer()
exten => 323,2,Dial(SIP/323,20)
exten => 323,3,Playback(vm-nobodyavail)
exten => 323,4,VoiceMail(323@main)
exten => 323,5,Hangup()

exten => 567,1,Answer()
exten => 567,2,Dial(SIP/567,20)
exten => 567,3,Playback(vm-nobodyavail)
exten => 567,4,VoiceMail(567@main)
exten => 567,5,Hangup()

exten => *567,1,Answer()
exten => *567,2,SIPAddHeader(Call-Info: answer-after=0)
exten => *567,3,Page(SIP/567)
exten => *567,4,Hangup()

First thing to try is an explicit directmedia=no, and you need to add the external host name or address. However, you should be planning an urgent move to chan_pjsip, as chan_sip is no longer maintained, and has been removed from the latest code.

Note that, even with dynamic DNS asterisk requires a stable IP address, whilst running, even if it changes for every reboot.

username is normally not needed, and is often used where it has no effect.

Unless you really need type=friend, it can be a vulnerability and a source of misoperation.

It is best practice not to answer before Dial, although there may be cases where it is desirable.

1 Like

david551, you rock!

“directmedia=no” solved my issues. I’ll make those other changes too.

Your help and feedback is much appreciated.

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