Asterisk 1.4.2 + G729 codecs

Hi guys,

I have installed 2x g729 codecs on Asterisk 1.42, when I do a show g729 via the asterisk CLI I see :

astbath*CLI> show g729 0/0 encoders/decoders of 2 licensed channels are currently in use

When I try to make a g729 call via a SIP client that has g729 enabled via sip.conf and via freepbx, or if it’s a SIP > ZAP trunk call I get :

[Nov 26 11:17:43] WARNING[17431] codec_g729a.c: out of G.729 decoder licenses [Nov 26 11:17:43] WARNING[17431] translate.c: g729tolin did not update samples 0

Whilst making the call if I do a show g729 it says that :

astbath*CLI> show g729 1/2 encoders/decoders of 2 licensed channels are currently in use

Is this a bug in my release of Asterisk or am I missing somethnig painfully obvious? :frowning:

Hi

Are you recording the calls ?

Ian

Yes Ian. Does that have an effect?

Yes, if you are using anything that has to decode the RTP stream it will use one of your decoders. Recording a bridged call most certainly needs to utilize a decoder. I have found a way around this.

Any time I need to record a call I just dump the two users into a dynamic MeetMe conference with the recording flag set. MeetMe decodes all inbound audio into s-linear (i believe) and records the already decoded stream, thus not requiring an additional license to record.

There is a bit of overhead, but it has worked fine for me.

I’m currently using Freepbx to manage Asterisk so the meetme work around may be a bit over my head.

I have tested your theory, you’re right, I disabled recording for that user and voila, call success! This g729 codec(s) are for our home users that VPN in, I wanted to reduce the load a bit.

I’m assuming if I purchased one more licence it wouldn’t resolve anything, or is that the scardy cat way out!

Hi yes it does

it has to decode it as well to record it.

you could add

transcode_via_sln = yes

to the asterisk.conf and see what the results are

[quote=“ianplain”]Hi yes it does

it has to decode it as well to record it.

you could add

transcode_via_sln = yes

to the asterisk.conf and see what the results are[/quote]

/etc/asterisk/asterisk.conf
/var/etc/asterisk/asterisk.conf

Hmm! Trying to work out which of those is in use, they’re both the same. I do however start asterisk wrapped up in amportal.

In
/etc/asterisk/asterisk.conf

and " service asterisk restrart "

to restart cleanly

Ian

[code]
cat /etc/asterisk/asterisk.conf

[directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk

Some other gubbins then at the bottom :

transcode_via_sln = yes[/code]

Beware, some of that gubbins may be a commented out section heading that needs enabling.

It was the [options] section regarding internal timing and system name.

It has to go in the options settings section

Ian

[options] itself was remmed out :stuck_out_tongue:

I’ll have to restart Asterisk tomorrow, currently have 100 people using it :frowning: Cheers for all the help guys, I’ll let you know how I get on.

Rubbish weather in Bath hey ianplain (I’m near Waitrose)!

[code][directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk

[options]
transcode_via_sln = yes
;internal_timing = yes
;systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues
; Changing the following lines may compromise your security.
;[files]
;astctlpermissions = 0660
;astctlowner = root
;astctlgroup = apache
;astctl = asterisk.ctl
[/code]

I put it in both asterisk.conf(s) files in case, but still no joy received the same error.

Hmm!

Hi

How are you recording the calls ? as MixMonitor transcodes to slin first. I would try monitor as this can record direct in g729 and then mix the channels.

Ian

I’ll have to do some research for you Ian. Freepbx handles that part of it so not sure what procedures it uses to actually record the calls. I configured this a year ago and haven’t had to touch it since!

[code]
[macro-record-enable]
exten => s,1,GotoIf($[${LEN(${BLINDTRANSFER})} > 0]?2:4)
exten => s,2,ResetCDR(w)
exten => s,3,StopMonitor()
; I haven’t figured out how, but occasionally a hung up
; call can end up here. If you don’t use DeadAGI (which does
; work fine as a normal AGI), asterisk deadlocks a thread,
; and ends up grumpy.
exten => s,4,DeadAGI(recordingcheck,${TIMESTAMP},${UNIQUEID})
exten => s,5,Noop(No recording needed)

;exten => s,6,AGI(timestamp.agi)
;exten => s,7,SetVar(CALLFILENAME=${timestamp}-${CALLERIDNUM}-${UNIQUEID})
;exten => s,8,Macro(dumpvars)

exten => s,999,MixMonitor(${CALLFILENAME}.wav)

;exten => s,999,MixMonitor(${TIMESTAMP}-${CALLERIDNUM}-${MACRO_EXTEN}.wav)
;exten => s,999,Monitor(wav,${CALLFILENAME}, mb)

;exten => s,3,BackGround(for-quality-purposes)
;exten => s,4,BackGround(this-call-may-be)
;exten => s,5,BackGround(recorded)[/code]

Hi

exten => s,999,MixMonitor(${CALLFILENAME}.wav)

it uses MixMonitor and saves them in wav format.
so will use licences as it has to transcode.

With Monitor you should be able to use g729 and then use sox to convert them I think its wav49 you need to use as the recording format but not 100% on that one.

Ian