?
Solved

Asterisk sound recording for dial plan

Posted on 2009-02-08
14
Medium Priority
?
889 Views
Last Modified: 2013-11-15
I am attempting to create sound files with asterisk via a sip phone with the the following in extensions.conf

exten => _66XX,1,Wait(2)
exten => _66XX,n,Record(/tmp/prompt${EXTEN:2}:wav)
exten => _66XX,n,Wait(1)
exten => _66XX,n,Playback(/tmp/prompt${EXTEN:2})
exten => _66XX,n,Wait(2)
exten => _66XX,n,Hangup()

When I do this, I get the follwing error from the cli:

[Feb  8 20:49:19] WARNING[12786]: file.c:655 ast_openstream_full: File //tmp/prompt00 does not exist in any format

[Feb  8 20:49:19] WARNING[12786]: file.c:945 ast_streamfile: Unable to open //tmp/prompt00 (format 0x4 (ulaw)): No such file or directory

[Feb  8 20:49:19] WARNING[12786]: app_playback.c:439 playback_exec: ast_streamfile failed on SIP/linksys1-40005e40 for //tmp/prompt00

Any ideas?? Thanks!


0
Comment
Question by:jkockler
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 36

Expert Comment

by:grblades
ID: 23588312
Using ':' to specify the format of the recording was the asterisk 1.0 way of doing it. I suspect you are running a much newer version so the 2nd line should read :-
exten => _66XX,n,Record(/tmp/prompt${EXTEN:2}.wav)
0
 
LVL 19

Expert Comment

by:feptias
ID: 23588320
It just looks like a typo on line 2 - should be a full stop, not a semi-colon before wav:
exten => _66XX,n,Record(/tmp/prompt${EXTEN:2}.wav)
0
 
LVL 19

Expert Comment

by:feptias
ID: 23588323
snap
0
[Video] Oticon Case Study

Open office environments can create the dynamics for innovation, but they also bring some challenges. With over 1,000 employees in an open office, Oticon needed a solution that would preserve the environment while mitigating disruptive background noises.

Watch how they did it.

 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 23588348
remove the first / from the config file
0
 
LVL 4

Author Comment

by:jkockler
ID: 23591426
Tried all of it but still having the same issue after reload .. Here is what it looks like now, to verify I did it right:

exten => _66XX,1,Wait(2)
exten => _66XX,n,Record(tmp/prompt${EXTEN:2}.wav)
exten => _66XX,n,Wait(10)
exten => _66XX,n,Playback(tmp/prompt${EXTEN.2})
exten => _66XX,n,Wait(2)
exten => _66XX,n,Hangup()


Here is the error:


[Feb  9 11:20:09] WARNING[8998]: file.c:655 ast_openstream_full: File tmp/prompt does not exist in any format

[Feb  9 11:20:09] WARNING[8998]: file.c:945 ast_streamfile: Unable to open tmp/prompt (format 0x4 (ulaw)): No such file or directory
[Feb  9 11:20:09] WARNING[8998]: app_playback.c:439 playback_exec: ast_streamfile failed on SIP/linksys1-f400a510 for tmp/prompt



Thanks !!
0
 
LVL 36

Expert Comment

by:grblades
ID: 23591537
exten => _66XX,n,Playback(tmp/prompt${EXTEN.2})
should be :-
exten => _66XX,n,Playback(tmp/prompt${EXTEN:2})
0
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 23591540
that's because this

${EXTEN:2}

doesn't mean anything for the config file parser.. This is not a bash script, you can't use regexps
0
 
LVL 36

Expert Comment

by:grblades
ID: 23591576
${EXTEN:2} means 'the number dialed with the first two digits removed'.
0
 
LVL 4

Author Comment

by:jkockler
ID: 23592732
Same problem... Tried all steps including removing the $EXTEN:2 ... same error either way..
0
 
LVL 16

Expert Comment

by:ai_ja_nai
ID: 23592793
No such file or directory means that you (asterisk) are (is) searching the wrong path: tmp/prompt is supposed to be found in the local path of interest for asterisk. Try moving that directory in a more familiar environment for the program (i.e., the directory of the program?)
0
 
LVL 36

Accepted Solution

by:
grblades earned 2000 total points
ID: 23593073
The default directory for sound playback/recording is /var/spool/asterisk/sounds so within that directory you will need a corectory called 'tmp' otherwise asterisk wont be able to write the new file.
You didnt need to remove the leading '/' from the filename as previously mentioned. Having the leading / just signals an absolute pathname which is what you want if the file is to be saved in the system temp directory.

I would put the leading '/' back infront of the name in the record and playback commands.
Then connect to asteris using 'asterisk -r -vvv' and paste here the output shown on the screen when you do a test.
0
 
LVL 4

Author Comment

by:jkockler
ID: 23593092
same problem after changing the directory path.  
0
 
LVL 4

Author Comment

by:jkockler
ID: 23593118
ok grblades, I will try that.  
0
 
LVL 4

Author Comment

by:jkockler
ID: 23593477
Ok,

That seemed to work.. Connecting to asterisk with the -r -vvv is showing me a lot more.  

Some of the stuff I saw worried me a bit but I will post in a new thread.  Thanks again !
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Almost all Internet protocol telephones have built-in switches at the back that allow you to connect your personal computer to one port and use the other port to connect your phone to to a Cisco switch.   Why we need to connect the PC to the pho…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

829 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