[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

Ubuntu/Asterisk after upgrade Wav issue

I'm running Ubuntu and I've just upgraded and applied all the patches to 15.10.
I used to run this line with no trouble at the end of an asterisk call:
exten => s,n,System(/usr/bin/lame -B 16 /var/spool/asterisk/monitor/${CALLFILENAME}.wav /var/spool/asterisk/monitor/${CALLFILENAME}.mp3)
Now, the mp3 file is 0 length/empty.
If i run the command :
/usr/bin/lame -B 16 /var/spool/asterisk/monitor/${CALLFILENAME}.wav /var/spool/asterisk/monitor/${CALLFILENAME}.mp3
(hard-coding the filename in), it works fine, so the lame.exe is working ok, its just running under asterisk it doesn't like.
0
Silas2
Asked:
Silas2
  • 10
  • 9
1 Solution
 
PhonebuffCommented:
have you looked in /var/messages to see if you are logging an error of any kind --

Or maybe /var/log/asterisk/full -

Also check the permission an lame - They may have changed -
0
 
Silas2Author Commented:
Thanks for having a look for me.
Sorry, I'm a bit of a Linux newbie, but I have a folder  /var/log/asterisk, which has multiple files in it - many of which queue_log.x and messages.x + a couple of cdr folders,  I don't know if any of these relate to running an external process...+ I just tried purging syslog, then making a call, I didn't don't anything new in syslog, so maybe that's not a good place?

Re permissions on lame.exe, which permissions should I give it? (the max I can, i'm not worried about security issues with it)
0
 
Silas2Author Commented:
PS the lame file has:
-rwxr-xr-x 1 root root
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
PhonebuffCommented:
http://www.ubuntujourneyman.com/2011/05/23/decoding-the-ls-l-output/

So Root own it and is part of the group  --

But you have Owner, Group and Public Execution turned on -

/var/log/asterisk/  Look for a file called full --
0
 
Silas2Author Commented:
mmm....don't see a file called 'full' in /var/log/asterisk/
I've go cdr-csv, cdr-custom, cel-custom, master.db and a whole load of queue.x + messages.x files, maybe its an option I haven't enabled?

Re permissions, and reading that useful link, it looks like the last 'x' means everyone can execute, that looks about right doesn't it?
The truth is all the mp3 files are 144 bytes which I guess is enough for the filename, but something is being written.
0
 
PhonebuffCommented:
Strange - Never worked on a system where the Asterisk log was not written to something -

An usually it's /var/log/asterisk/full --  

You might try just watching the CLI  and see what you can see, but the log is better  

asterisk -vvvvvvr
0
 
Silas2Author Commented:
I've found a funny thing in that the System(/usr/bin/lame call works on a wav file which was created before the current call but not on the current call's wav file.
Its as if the call recording procedure isn't letting go of the wav file. This code has been running for a few years with no trouble up till now. I haven't upgraded the asterisk but I have upgraded the Ubuntu.
0
 
PhonebuffCommented:
If can add a sleep(15); in front of your call to lame.  That will give the system a few seconds to flush the cache -
0
 
Silas2Author Commented:
Is that Wait(15) you mean?
0
 
PhonebuffCommented:
No,

   Wait waits for a process to complete sleep waits n seconds before proceeding in the script --

   http://serverfault.com/questions/185796/scritp-to-wait-for-few-seconds-before-executing-next-line

   --
0
 
Silas2Author Commented:
So something like this in extensions.conf:
exten => s,n,sleep(15)

or maybe
exten => s,n,System(sleep(15))
?

(sorry to ask but I can't find anything on the web about sleep+asterisk)
0
 
PhonebuffCommented:
right idea --

I was thinking system(sleep 15;  /usr/bin/................................................

But just adding your statement to the context will work as well and is easier to read .

http://www.voip-info.org/wiki/view/Asterisk+cmd+Wait

You can get around this with 'System(path/to/sleep Xs)', where 'X' is the number of seconds to wait. Nasty, but it works.
0
 
Silas2Author Commented:
Mmmmm....unfortunately that didn't work. I can see in the CLI the sleep is definitely calling a sleep properly, but at the end of the call comes
MixMonitor close filestream (mixed)
Still the 144 byte file. It looks like MixMonitor is holding the file open till everything in the context is finished even with sleep (and it tried Wait as well for good measure)
0
 
PhonebuffCommented:
Think I have seen that before MixMonitor does not close the file to the call is hungUp.  

Not totally sure what you are doing here and with out the detail logs not sure I am going to be much more help -

Sorry --
0
 
Silas2Author Commented:
Right, I enabled
full => notice,warning,error,debug,verbose,dtmf,fax
and here is the content of 'full' after a single failed call/recording session, is there anything more I can do to show you?
[2016-11-09 16:38:14] Asterisk 11.18.0 built by root @ squirrel on a x86_64 running Linux on 2015-06-29 20:24:32 UTC
[2016-11-09 16:38:14] ERROR[32150] config_options.c: Unable to load config file 'acl.conf'
[2016-11-09 16:38:14] WARNING[32150] named_acl.c: Could not reload ACL config
[2016-11-09 16:38:14] NOTICE[32150] app_queue.c: queuerules.conf has not changed since it was last loaded. Not taking any action.
[2016-11-09 16:38:14] NOTICE[32150] cel_custom.c: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
[2016-11-09 16:38:14] NOTICE[32150] chan_skinny.c: Configuring skinny from skinny.conf
[2016-11-09 16:38:14] NOTICE[32150] pbx_ael.c: Starting AEL load process.
[2016-11-09 16:38:14] NOTICE[32150] pbx_ael.c: AEL load process: parsed config file name '/etc/asterisk/extensions.ael'.
[2016-11-09 16:38:14] NOTICE[32150] pbx_ael.c: AEL load process: checked config file name '/etc/asterisk/extensions.ael'.
[2016-11-09 16:38:14] NOTICE[32150] pbx_ael.c: AEL load process: compiled config file name '/etc/asterisk/extensions.ael'.
[2016-11-09 16:38:14] NOTICE[32150] pbx_ael.c: AEL load process: merged config file name '/etc/asterisk/extensions.ael'.
[2016-11-09 16:38:14] NOTICE[32150] pbx_ael.c: AEL load process: verified config file name '/etc/asterisk/extensions.ael'.
[2016-11-09 16:38:14] ERROR[32150] res_config_sqlite3.c: Missing config file 'res_config_sqlite3.conf'

Open in new window

0
 
PhonebuffCommented:
Interesting still - NO call detail there ---  

Really does not tell us anything -

Check here and make sure the file names are all correct down though here for both mixmonitor and lame -  -

http://www.asteriskguru.com/tutorials/mixmonitor.html
0
 
Silas2Author Commented:
This is the result of  logger show channels, are there any other ways of logging MixMonitor (I read that post you gave but I couldn't see anything about logging.
kittens*CLI> logger show channels
Channel                             Type     Status    Configuration
-------                             ----     ------    -------------
/var/log/asterisk/full              File     Enabled    - DEBUG NOTICE WARNING E              RROR VERBOSE DTMF FAX
/var/log/asterisk/messages          File     Enabled    - NOTICE WARNING ERROR S              ECURITY
                                    Console  Enabled    - NOTICE WARNING ERROR

Open in new window

0
 
PhonebuffCommented:
Sorry,

     I really don't know what else do for you..  Short of connecting to your system and looking at a few things myself.

     An unfortunately, I don't have the time to do that right now --
0
 
Silas2Author Commented:
I really appreciate your help.

I might go nuclear and run it as a cron job.....
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 10
  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now