SPA3000 Codec Problem

I am running a TrixBox setup with an SPA3000. I have my outgoing calls set up so that local calls use my PSTN and long distance calls use my Telasip account.

I just set this up and when I placed my first long distance call the recepient of my call was complaining that I was cutting in and out. I figured that I would try the g729a codec instead of the g711u. However, the second I change the codec of Line 1 from g711u to g729a the PSTN connection stops working…
When I make local calls I get one ring and then a fast busy signal. My VOIP still works, though. I am confused as to why a change on Line 1 would affect the PSTN line, but it seems to. Any suggestions? The PSTN line is set to g711u for preferred, btw.

If I leave both on g711u, both work. However, I would like to try increasing the quality of my VOIP signal by using g729a.

Thanks in advance.

If it helps, here is my sip.conf and my sip_additional.conf:

sip.conf:

[code]; Note: If your SIP devices are behind a NAT and your Asterisk
; server isn’t, try adding “nat=1” to each peer definition to
; solve translation problems.

[general]

port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
#allow=alaw
allow=g729
allow=g711
allow=g711u
externip = x.x.x.x
externhost = x.x.x.x
localnet=192.168.1.200/255.255.255.0
nat=yes

; If you need to answer unauthenticated calls, you should change this
; next line to ‘from-trunk’, rather than ‘from-sip-external’.
; You’ll know this is happening if when you call in you get a message
; saying "The number you have dialed is not in service. Please check the
; number and try again."
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown
tos=0x68

; #, in this configuration file, is NOT A COMMENT. This is exactly
; how it should be.
#include sip_nat.conf
#include sip_custom.conf
#include sip_additional.conf[/code]

sip_additional.conf:

[code]register=xxxx@gw4.telasip.com

[199]
username=199
type=friend
secret=xxxx
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=199@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=PSTN <199>

[200]
username=200
type=friend
secret=xxxx
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=200@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=Kevin - Desk <200>

[500]
username=500
type=friend
secret=xxxx
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=500@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=Cordless - Home <500>

[8800]
username=8800
type=friend
secret=xxxx
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=yes
mailbox=8800@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=Kevin - Remote <8800>

[99]
username=99
type=friend
secret=xxxx
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=99@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=PSTN Incoming <99>

[SipuraPSTN]
type=peer
secret=xxxx
port=5061
nat=no
host=dynamic
context=from-pstn
canreinvite=no

[telasip-gw]
username=me
type=peer
secret=xxxx
insecure=very
host=gw4.telasip.com
dtmfmode=rfc2833
disallow=all
context=from-pstn
allow=g729
[/code]

do you actually have the g729 module installed and loaded in Asterisk ?

Not that I know of, how can I check? From my reading I was given the impression that the SPA-3000 does the encoding and by telling the trunk to “allow=g729” it would allow this encoding to pass through un-touched. My VOIP provider (TelaSIP) supports g729, so they can do the decoding.

However, my problem isn’t with the VOIP service, it’s with my PSTN. For some reason, when I set the Line 1 in the SPA-3000 to g729 and leave the PSTN Line on g711u my PSTN line does not work. I get a ring followed by a fast busy signal. My VOIP continues to work just fine…

That’s the really confusing part, I’m not changing any of the settings for what’s breaking…

and where does Asterisk fit into this setup ? if Asterisk needs to do encoding/decoding as the ends of the call are wanting to use different codecs and are not re-inviting (or your setup means Asterisk has to stay in the mediastream), then you need to have the appropriate functionality in place.

you’d know if you had g729 as you would have installed it and possibly even paid for it.

if you set both interfaces on the 3000 to use g729 does it work as expected ?

“if you set both interfaces on the 3000 to use g729 does it work as expected?” No, if I set both to g729 the extension connected to the 3000 uses the voip instead of the PSTN and all the other extensions say “the person you are calling is unavailable, please try again”

However, here’s a new clue:
When Line 1 is set to g729 and PSTN is set to g711u, the softphone I have installed on my desktop (X-Lite) can still place PSTN calls just fine. (as well as VOIP calls)

I have read a lot of setup instructions for the SPA-3000 that recommend setting Line 1 to g729 but don’t mention anything about needing a license on the Asterisk server.
For example:
forums.whirlpool.net.au/forum-re … m?t=515204

if Asterisk doesn’t need to transcode, then you don’t need it.

g.729 does not give you better quality than g.711.

g.711 ulaw/alaw are the best quality codecs there are (pretty much). However they use a lot of bandwidth- 64kbit/sec plus IP overhead!

gsm is a good compromise of audio quality. It sounds pretty good and uses about 15kbit/sec plus overhead.

g.729 is about the smallest you can get. it compresses voice down to around 7kbit/sec, but uses a handful of CPU power to do it.
G.729 is protected by patents, and requires a license to use. You can buy this license from digium, it costs about $10/channel (ten bucks per concurrant call). Without it, g.729 will do next to nothing.

hope that helps!

Apparently it was a license issue. I purchased two g729 licenses from digium and that fixed my issue. I still don’t quite understand why I need a codec for this line but I needed the codec anyway to receive remote g729 calls.

yes that will work. Keep in mind though, ulaw has better quality than g729. Try gsm if you want a free alternative.

If you were getting audio skips, that means your QoS isn’t well setup or you don’t have enough bandwidht for ulaw…

lastly keep in mind that faxes/etc won’t work over g729, only ulaw.

My guess is bandwidth. My Asterisk server is not the only server I am running at my house…

Nice to know about faxes, I haven’t played with that yet but I would probably use my pstn for faxes and I would leave that ulaw.

Quick question since you brought faxes up: can an asterisk server tell the difference between a voice and data call and route it accordingly?

werent you basicaly trying to call to the PSTN from line1 which was setup as g729? It sounded like your setup was

ATA-line1 g729 → Asterisk → ATA-line2(aka PSTN) ulaw

in this case Asterisk would need a license to transcode. For what its worth you would have needed a license do hear voicemail, voice prompts, and anything else not already encoded as g729 on that asterisk machine.

There is a non licensed codec available for download but its definitely a copyright violation if you dont pay for the licenses. My biggest complaint about the digium binary is that should you, for any reason, exceed the license in any way, asterisk creates a no-audio call instead of dropping down to the next codec in the list. For this reason alone I use the non-license binary and purchase al the licenses from digium that way I pay for what I use but dont have to deal with trouble shooting a no audio call if my call count spiked.

The other downside is re-issuing a license file every time you change a NIC or the hardware platform itself. Personally I have gone through several pieces of hardware at various places and have installed additional NICs into hardware for reasons that result in an invalid license file. I consider this to be annoying but manageable had the first issue of not dropping down to another licensed codec been present.

As a result we pay for every license we use but load the quasi-free binaries to avoid all the hassle factor. $10 per seat is very reasonable in my opinion, esp when we can just pass those costs onto our end users anyway.