Here are the details …
This is comms between two asterisk system using IAX …
First we are going to a Dahdi channel then to asterisk. (Note: the digital audio audio when it arrives at the Dahdi channel is encoded in alaw.) In so doing, we get the following transcoding as detailed above …
Name: DAHDI/1-1
…
NativeFormats: (alaw)
WriteFormat: slin48
ReadFormat: slin48
WriteTranscode: Yes (slin@48000)->(slin@8000)->(alaw@8000)
ReadTranscode: Yes (alaw@8000)->(slin@8000)->(slin@48000)
From there, we go from one asterisk system to another using the opus codec and IAX. This is the transcoding that we see …
Name: IAX2/ua_vip-12603
NativeFormats: (opus)
WriteFormat: slin48
ReadFormat: slin48
WriteTranscode: Yes (slin@48000)->(opus@48000)
ReadTranscode: Yes (opus@48000)->(slin@48000)
The part of the dialplan that concerns this is straightforward:
[globals]
FEATURES_LIST=PttOn#PttOff#J7#J8#J9#J0
[general]
autofallthrough=no
[inbound]
; ask the VIP where to route calls to 4-digit extensions
_exten => _XXXX,1,Set(_DYNAMIC_FEATURES=${FEATURES_LIST})
_exten => XXXX,n,Answer()
_exten => XXXX,n,Dial(DAHDI/1)
_exten => XXXX,n,Hangup()
Finally, here are relevant parts of codecs.conf, pjsip.conf and iax.conf:
codecs.conf:
[opus8]
type=opus
signal=voice
max_playback_rate=8000
fec=yes
pjsip.conf:
;================================ TRANSPORTS ==
; Our primary transport definition for UDP communication behind NAT.
[simpletransport]
type = transport
protocol = udp
bind = 0.0.0.0
; NAT settings
;local_net = 10.0.0.0/8
;external_media_address = 203.0.113.1
;external_signaling_address = 203.0.113.1
;=================================================
; remote-dial
;=================================================
[remote-dial]
type=endpoint
context=inbound
transport=simpletransport
disallow=all
allow=opus8:60
;allow=alaw, ulaw
aors=remote-dial
ice_support=no
rtp_timeout=15
[remote-dial]
type=aor
;So that registration can happen from anywhere
remove_existing=yes
max_contacts=1
[remote-dial]
type=identify
endpoint=remote-dial
match=uav
iax.conf:
[general]
autokill=yes
; Listener Addresses
;
; Use the ‘bindaddr’ and ‘bindport’ options to specify on which address and port
; the IAX2 channel driver will listen for incoming requests.
;
;
bindport=4569 ; The default port to listen on
bindaddr=192.168.40.198
bandwidth=low
;
; You can also fine tune codecs here using “allow” and “disallow” clauses with
; specific codecs. Use “all” to represent all formats.
;
;allow=all
;disallow=g723.1
disallow=all
allow=opus8:60
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Jitter Buffer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
jitterbuffer=yes
maxjitterbuffer=200
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; IAX2 Encryption
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; trunkfreq sets how frequently trunk messages are sent in milliseconds. This
; value is 20ms by default, which means the trunk will send all the data queued
; to it in the past 20ms. By increasing the time between sending trunk messages,
; the trunk’s payload size will increase as well. Note, depending on the size
; set by trunkmtu, messages may be sent more often than specified. For example
; if a trunk’s message size grows to the trunkmtu size before 20ms is reached
; that message will be sent immediately. Acceptable values are between 10ms and
; 1000ms.
;
trunkfreq=40 ; How frequently to send trunk msgs (in ms). This is 20ms by
_ ; default._
; Should we send timestamps for the individual sub-frames within trunk frames?
; There is a small bandwidth use for these (less than 1kbps/call), but they
; ensure that frame timestamps get sent end-to-end properly. If both ends of
; all your trunks go directly to TDM, and your trunkfreq equals the frame
; length for your codecs, you can probably suppress these. The receiver must
; also support this feature, although they do not also need to have it enabled.
;
trunktimestamps=yes
register => ground_vip:12345678@192.168.40.201
[ua_vip]
type=friend
host=192.168.40.201
trunk=yes
secret=12345678
;context=iax_incoming
context=inbound
disallow=all
allow=opus8:60
Thank you for looking into this!!!