Dear All, I want to read telnet packet continuously whenever a new call is originated and store into a variable after that pass into window server. I have written a Perl script to read telnet packet but problem is that whenever I executed Perl script then got a telnet packet( mean Only when i execute Perl script) here I want to put scheduler,event or other technique whenever a new call will come Perl script automatically run. Regards Akhilesh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20131011/4f8c52ce/attachment.html>
On Fri, Oct 11, 2013 at 11:34:48AM +0530, akhilesh chand wrote:> Dear All, > > I want to read telnet packet continuously whenever a new call is originated > and store into a variable after that pass into window server. I have > written a Perl script to read telnet packet but problem is that whenever I > executed Perl script then got a telnet packet( mean Only when i execute > Perl script) here I want to put scheduler,event or other technique whenever > a new call will come Perl script automatically run.You can use a packet sniffer such as tcpdump or wireshark instead. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com
On Friday 11 October 2013, akhilesh chand wrote:> Dear All, > > I want to read telnet packet continuously whenever a new call is originated > and store into a variable after that pass into window server. I have > written a Perl script to read telnet packet but problem is that whenever I > executed Perl script then got a telnet packet( mean Only when i execute > Perl script) here I want to put scheduler,event or other technique whenever > a new call will come Perl script automatically run.This is really a Perl question, not an Asterisk question, and you might have more joy asking on a Perl list or forum. Anyway, there are two ways to accomplish what you want. The easy way is to have inetd start your Perl script whenever a packet is sent to a particular port; when the script starts, its STDIN and STDOUT will already be connected to the port. The other way is to have your Perl script run as a daemon; then fork off a clone of itself to deal with requests as they come in. After a fork, the child process will inherit a copy of the socket object; and this will persist even after you undef it in the parent process. If you want to invoke a Perl script from within the dialplan, you can either use a full-on AGI script (which will even allow you to pass variables back and forth and do other funky stuff) or use System() for a "quick and dirty" call to a script that doesn't need to send anything back. -- AJS Answers come *after* questions.
Reasonably Related Threads
- I'm not able to install asterisk in AWS cloud
- I'm not able to register Softphone(X-lite) in asterisk(Which is installed in EC2 Cloud).
- I'm not able to register Softphone(X-lite) in asterisk(Which is installed in EC2 Cloud).
- I'm not able to register Softphone(X-lite) in asterisk(Which is installed in EC2 Cloud).
- Communicate with barge agent