Setting calling party's codec in the dialplan

jbh

Guru
Joined
Dec 16, 2008
Messages
180
Reaction score
0
This may be well known, but took me a while to figure out.

To make a phone originating a call use a particular codec (ulaw) when calling out via a trunk, I added this to extensions_custom.conf:

[from-internal-custom]
; Do not use an Answer() command
; It breaks it- at least it does in Asterisk 1.6.1.10
;Use ulaw when dialling via an outbound route with prefix 9

exten => _9.,1,Set(SIP_CODEC=ulaw)
exten => _9.,n,Dial(SIP/${EXTEN})
exten => _9.,n,Hangup()
 
Could you not add these lines in the FreePBX trunk "Outgoing Settings"?

disallow=all
allow=ulaw

Add them to this example trunk outgoing settings:

SIPtrunkAdd3.JPG
 
My method would force the trunk but it may not force the calling phone. Interesting problem. But then again, the extension may negotiate with the trunk for the proper codec. Need someone smarter than me to confirm if this would work or not.
 
In my settup putting the rule in the trunk forces the outgoing codec in the trunk but may leave the PBX needing to transcode. This is one method to avoid the transcoding.
 

Members online

No members online now.

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top