Direct SIP Calls and Codecs

tabbertmj

Member
Joined
Jul 23, 2008
Messages
176
Reaction score
0
I thought I had figured this out, but alas, I have failed.

Is there a way to change the preferred order of codecs used when you make a direct call with SIP? it always defaults to ulaw. That eats a lot of bandwidth. I would rather it first tried GSM or g729 first. Is there a way to change this? Will it also change when someone makes a direct call to me?

Thanks,
Mike
 
Hi

I believe it works in order, so in your trunk definition, something like: -

disallow=all
allow=gsm
allow=g729 ; if you have installed the codecs.
allow=ulaw

should give you gsm first, then g729 and finally ulaw, providing of course that those codecs are compatible with the other end.

Joe
 
But when you do a direct SIP call, like ENUM, there is no trunk configured.
 
In which case it will take the settings in order configured in sip.conf or it's #includes.

Same prrinciples apply as described for a trunk, the codecs are set globally, then over-ridden by subsequent settings such as in the trunks or the extensions.

locate the allow statements in the sip config files and place them in the order you want them.

Joe
 
If the incoming call asks for ulaw as first choice and my server lists it as third choice, which codec is chosen?

The FreePBX generated file Sip_general.conf lists disallow=all, allow=ulaw and allow=alaw. What is the proper way to override this with these new choices and give the correct priority?
 
I put it in sip_general_custom.conf as this is included in sip.conf. As I understand it, these will be set to the last file processed. Unlike extensions that the second one that is named the same is ignored. Yet it always uses ulaw.
 
I tried just gsm & just g729 in both sip_general_custom.conf & sip_custom_post.conf but nothing changed. I looked at the log and couldn't find any reference to establishing a common codec. I'll figure how to get more debug detail and try again later.
 
I tried an outbound SIP call with just gsm, then just g729 in both sip_general_custom.conf, then sip_custom_post.conf, but again every call used ulaw. I then manually edited sip_general_additional.conf by commenting out ulaw & alaw, then added GSM, then g729. I made several test calls, both in & out through several providers and SIP URI. This worked on each codec. Not every call worked on each codec, but Asterisk completed the calls using the codec I entered. Please give this a try and confirm my tests.

The problem is, this file will be re-written every time I do a FreePBX reload. This is probably a FreePBX issue. Is there a way to edit this file from FreePBX? Which file can I manually edit that will override sip_general_additional.conf?
 
I tried my custom codec settings in sip_custom.conf, but again it did not override sip_general_additional.conf. This file seems to be the only way to change the global system codec. My goal is to use less bandwidth for a conference I hold weekly. Callers use IPKall and SIP/URI. The only way to force IPKall to use another codec is to make that codec the only option. If I allow ulaw in any order the call uses it, probably because IPKall requests it. The conference call works well at any codec, but I can’t offer any other option which can cause other issues, like my extensions can not call the conference without changing their codec.

Could I create a context for incoming IPKall allowing only GSM that wouldn’t affect other calls? How, and where should I put it? Is the way FreePBX handles these files a bug I should report?
 
For IPkall, create a trunk with disallow=all and allow=GSM.

I have that working. I think we will need to find out what creates the sip_general_additional.conf and modify that.
 
Here is what I have set up for my SIP trunk for IPKall. I have not been able to get IAX2 working. If you did, let me know what the trick was.


context=from-pstn
host=66.54.140.46
type=peer
qualify=no
disallow=all
allow=gsm
nat=yes
 
That 1 entry worked for both my IPKall numbers. Thanks.

Here is what FreePBX says ... it doesn't work.

sip_general_additional.conf

1. This is where FreePBX places all of it's general context settings. If you need to override one of these or add a new one please do so in sip_general_custom.conf.

sip_general_custom.conf

1. This is the proper location for placing any of the [general] context option lines that you might need to add to your setup. This is also the place to add those lines needed to enable the nat'ing of SIP when you go through a firewall.

freepbx.org/support/documentation/administration-guide/file-ownership-and-what-files-you-can-edit
 
I think IAX2 is a custom option IPKall must enable.

http://forum.voxilla.com/ipkall-support-forum/

For the moment, you can comment out sip_general_additional.conf in sip.conf. This file says it is written by FreePBX but that doesn't seem to be correct. You can then add the contents of sip_general_additional.conf to sip_custom_post.conf, edit to your specs, save, reload and it should perform as you expect. Don't count on the same behavior after the next update.
 

Members online

No members online now.

Forum statistics

Threads
26,687
Messages
174,410
Members
20,257
Latest member
Dempan
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