playback a speech file and record it automatically: the record application doesn't generate any file - sip

I have two asterisk servers, the first is a call initiator and the second is a call receiver. What I want is that a call initiated by the first gets recorded automatically in the second.
The configuration of the first server is as follows:
sip.conf
[general]
register => AS2AS1:welcome#192.168.1.67
[AS1AS2]
type=friend
disallow=all
allow=iLBC
secret=welcome
host=dynamic
context=startcall
username=AS2AS1
dtmfmode=rfc2833
qualify=1000
extensions.conf
[startcall]
exten => 333,1,Playback(sa11)
and the configuration of the second server is as follows
sip.conf
[general]
register => AS1AS2:welcome#192.168.1.66
[AS2AS1]
disallow=all
allow=iLBC
type=friend
secret=welcome
host=dynamic
username=AS1AS2
context=recordcall
dtmfmode=rfc2833
qualify=1000
extensions.conf
[recordcall]
exten => 333,1,Answer()
exten => 333,2,Set(curtime=$(STRFTIME(,,%s)})
exten => 333,3,Record(/home/basma/recorded/${curtime}.wav)
exten => 333,4,Hangup()
the call file(in the call initiator server):
Channel:SIP/AS1AS2/333
Context:startcall
Extension:333
but when the call is completed i find nothing in the recorded directory!

Can be anything, including "asterisk not able call out at all"
To see more info, connect to asterisk using
asterisk -r
core set verbose 10
and see output while calling.
But note, you call file is incorrect. Have be Priority.
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out

Try adding any action after Record() for example Playback(hello-world) or Wait(10)
[recordcall]
exten => 333,1,Answer()
exten => 333,n,Set(curtime=${STRFTIME(${EPOCH},,%s)})
exten => 333,n,Record(/home/basma/recorded/${curtime}.wav)
exten => 333,n,Playback(hello-world)
exten => 333,n,Hangup()
The beep you hear from Record application, but after that Hangup is called and call is ended.
Also make sure asterisk or user that runs * has write permissions to /home/basma/recorded/
check which user runs * with
ps aux | grep asterisk
and then
chown -R <user>:<user> /home/basma/recorded/

I finally solve the problem and the recorded file is generated after some modifications in extensions.conf in both initiator and receiver servers.
In the initiator server extensions.conf is as follows:
[startcall]
exten => 333,1,Wait(1)
exten => 333,n,Playback(sa11)
exten => 333,n,WaitExten(10)
And in the receiver server extensions.conf is:
[recordcall]
exten => 333,1,Answer()
exten => 333,n,Set(curtime=${STRFTIME(,,%s)})
exten => 333,n,Record(/home/basma/recorded/${curtime}.wav,0,5)
exten => 333,n,Wait(3)
exten => 333,n, Hangup()

Related

run a macro on dial cmd Asterisk 18

i want run a macro on dial cmd,
this is my macro `
[macro-subrao]
exten => s,1,AMD()
exten => s,n,Set(RAO=${AMDSTATUS})
`
this is my dialplan
`
exten => _+33.,n,Set(FILENAME=${EXTEN}_${SIPCALLID})
exten => _+33.,n,Monitor(wav,${FILENAME},b)
exten => _+33.,n,Dial(${SIPTrunk}/${EXTEN},,M(subrao))
`
i get this error
[Dec 6 08:03:40] WARNING[27509][C-00000001]: app.c:297 ast_app_exec_macro: Cannot run 'Macro(subrao)'. The application is not available.
In asterisk above version 13 app_macro is depricated. You have build it manually if you need it using "make menuconfig" while compiling.
You can replace it by gosub application.
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Dial
All samples was rewrited for use gosub.

Running stanford moss because of institution proxy

I am running moss by Stanford.
I am using Perl script sent by Stanford at the time of registration.
but it is giving error as :
Checking files . . .
OK
Could not connect to server moss.stanford.edu: Connection refused
I tried adding institute proxy also in the code as follows :
$sock = new IO::Socket::INET (
ProxyAddr => '10.3.100.207',
ProxyPort => '8080',
PeerAddr => $server,
PeerPort => $port,
Proto => 'tcp',
);
But it is giving the same error as above.
One possible solution is to set up a virtual environment and run the script.
But what can be another solution ?
Here is what I did and it worked.
I used Google colab for it.
I uploaded the files to be checked for plagiarism and the perl script to colab and then ran the perl script in the notebook
!perl moss.pl -l python -m 53 -c "Files" ./*.py

Not able to use 'copy_perm' option in Net::SFTP::Foreign module

I want to copy the file from remote host to the local host with the preservation of file permission, hence i tried to use the 'copy_perm' option as per the documentation of Net::SFTP::Foreign as mentioned below -
my $sftp = Net::SFTP::Foreign->new(
host => $host,
key_path => $ssh_key_path,
copy_perm => 1,
more => [ -o => 'Compression yes' ]
);
But I am getting the below error -
Invalid option 'copy_perm' or bad combination of options at test.pl at line 101.
The line 101 is the Net::SFTP::Foreign object creation as mentioned above.
Did i miss anything or anyone has faced same issue before?
That's because copy_perm isn't an option for the new method. You use it in get and put.

Invalid opus configuration for gstreamer

I'm struggling to figure out how to install opus plugin for gstreamer. I have installed
opus-tools & libopus0 by apt-get (everything happens on Ubuntu 14.04). I have also gstreamer-plugins-bad installed.
After multiple trials, bugs, etc. gstreamer displays the following error each time I try to call gst-inspect-1.0:
*(gst-plugin-scanner:17408): GStreamer-WARNING **: Failed to load plugin '/opt/gstreamer-1.4.0/lib/gstreamer-1.0/libgstopus.so': /opt/gstreamer-1.4.0/lib/gstreamer-1.0/libgstopus.so: undefined symbol: opus_multistream_encode*
What could have gone wrong during opus installation process that could cause this error?
If it's of any use here's result of ldd /opt/gstreamer-1.4.0/lib/libgstopus.so
*/opt/gstreamer-1.4.0/lib$ ldd /opt/gstreamer-1.4.0/lib/libgstopus.so
linux-vdso.so.1 => (0x00007fff859fe000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4f9004f000)
libgstaudio-1.0.so.0 => /opt/gstreamer-1.4.0/lib/libgstaudio-1.0.so.0 (0x00007f4f8fe08000)
libgsttag-1.0.so.0 => /opt/gstreamer-1.4.0/lib/libgsttag-1.0.so.0 (0x00007f4f8fbcf000)
libgstrtp-1.0.so.0 => /opt/gstreamer-1.4.0/lib/libgstrtp-1.0.so.0 (0x00007f4f8f9b5000)
libgstbase-1.0.so.0 => /opt/gstreamer-1.4.0/lib/libgstbase-1.0.so.0 (0x00007f4f8f75c000)
libgstreamer-1.0.so.0 => /opt/gstreamer-1.4.0/lib/libgstreamer-1.0.so.0 (0x00007f4f8f450000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f4f8f1ff000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f4f8eef7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4f8ecd8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4f8e912000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f4f8e6f9000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f4f8e4f4000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4f8e2f0000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f4f8e0e7000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f4f8dea9000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4f90587000)*
I must have missed something when installing opus, however i've no more ideas what to do, so I'm counting someone can give me some hint where to look for, or what could have gone wrong?
Thanks for any help :)
your error means that opus library has not been correctly linked into your gstreamer.
Did you install gstreamer-plugins-bad yourself? while doing so, when you run the configuration script from the plugin-bad package, you could add following options:
./configure --host=xxxx --with-plugin=opus --prefix=xxxxx

zend_db query on connect

I want the query 'SET NAMES utf8' to execute before any other queries.
But, if I execute it in the beginning of my app, it forces Zend_Db to connect to the Database, even if I'm not running any other queries. It isn't cool: My app processes lots of requests without any queries, only using cache.
How to ask Zend_Db to run 'SET NAMES utf8' right after connection?
Sure, simply pass the 'charset' option in with the adapter params. You can do this via Zend_Config or in code:
$params = array(
'host' => '127.0.0.1',
'username' => 'webuser',
'password' => 'xxxxxxxx',
'dbname' => 'test',
'charset' => 'utf8'
);
$db = Zend_Db::factory('Pdo_Mysql', $params);
Reference: http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.connecting.parameters
check this link for config option , its more easier
How to make PDO run SET NAMES utf8 each time I connect, In ZendFramework.