I am running asterisk 1.6.12
We are trying to set up call files to auto call from an orion solarwinds box when ever we have an issue. Now solarwinds will allow us to launch an application or script when there is a warning. So that part is fine.
my call file looks like this basically:
Same setup but with a different sound file. This works every time. Dials my number playsback on answer. no problem.
Now my issue comes when I try to right a script that will allow me to move my call file from the solarwinds box to my asterisk box. Using pscp.exe I can move the file over to asterisk. Now I need to beable to have my script change the ownership and the group of the file to asterisk. I know to use the chmod and chown commands, but how to I launch them from a windows box? Or is there a better way that I am missing.
voip-info.org/tiki-index.php … o-dial+out
this site lacks in the changing ownership department.
Any ideas would be great
This doesn’t make sense from a security point of view. You are using a non-root Asterisk (which tends to cause problems for many people), but you want an external system to be able to change file ownership, which means it has to have root access!
you can get into tricky situations, specially if the linux box has selinux activated.
to copy with the right owner, you need to setup ssh for this user, and then do a scp myfile.call user@host:/directory
I dont specifically know tscp, but if it is a correct implementation, it should support this syntax.
Alternatively, you can replace the call files with the use of AMI.
so we use the asterisk user account cause I did not set it up. So… I have a script that will do most every thing. my question is how can I launch my script from outside of the linux … I need to get it to launch on the asterisk box but I need a way of calling it from my monitoring system. The AMI might be a good start I am just not familiar with it.
you need to use ssh - there must be a client implementation for windows.
You might consider mounting a shared Windows folder from Linux using SAMBA. Then via /etc/crontab on Linux, move files from this folder to /var/spool/asterisk/outgoing, every minute.
could I use php and call a web page? maybe.
or Orion lets me launch a VB script. Can I call a php file from that VB script?
EDIT: Nevermind. Didn’t read the post fully. Above should be a good solution.
Ok so follow me children.
Right a shell or bash script to copy the file from your directory and change the owner and then mv it.
example : cp /var/spool/asterisk/tmp/call/* /var/spool/asterisk/tmp
chown asterisk:asterisk /var/spool/asterisk/tmp/*
mv /var/spool/asterisk/tmp/* /var/spool/asterisk/outgoing
Copys all files in the Call directory. Changes the owner and then moves the files to outgoing
Down load plink.exe and putty.exe from here chiark.greenend.org.uk/~sgta … nload.html
be sure to place plink and putty in the same location like C:\call
Creat a batch file to run plink
example: C:\call\plink.exe -pw xxxx root@nameofserver /path/to/your/file/yourfile.sh
Set Orion to launch batch file.
Works every time.