Solved

Ubuntu/Asterisk after upgrade Wav issue

Posted on 2016-11-02
19
32 Views
Last Modified: 2016-11-10
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
Comment
Question by:Silas2
  • 10
  • 9
19 Comments
 
LVL 15

Expert Comment

by:Phonebuff
ID: 41874479
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
 

Author Comment

by:Silas2
ID: 41874511
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
 

Author Comment

by:Silas2
ID: 41874520
PS the lame file has:
-rwxr-xr-x 1 root root
0
 
LVL 15

Expert Comment

by:Phonebuff
ID: 41874530
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
 

Author Comment

by:Silas2
ID: 41874581
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
 
LVL 15

Expert Comment

by:Phonebuff
ID: 41874804
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
 

Author Comment

by:Silas2
ID: 41879308
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
 
LVL 15

Expert Comment

by:Phonebuff
ID: 41879337
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
 

Author Comment

by:Silas2
ID: 41880439
Is that Wait(15) you mean?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 15

Accepted Solution

by:
Phonebuff earned 500 total points
ID: 41880466
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
 

Author Comment

by:Silas2
ID: 41880592
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
 
LVL 15

Expert Comment

by:Phonebuff
ID: 41880619
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
 

Author Comment

by:Silas2
ID: 41880734
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
 
LVL 15

Expert Comment

by:Phonebuff
ID: 41880749
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
 

Author Comment

by:Silas2
ID: 41880820
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
 
LVL 15

Expert Comment

by:Phonebuff
ID: 41880830
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
 

Author Comment

by:Silas2
ID: 41880932
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
 
LVL 15

Expert Comment

by:Phonebuff
ID: 41880936
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
 

Author Comment

by:Silas2
ID: 41880953
I really appreciate your help.

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

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now