News & Reviews
More How-To's & Tips More News
More Reviews Device Configuration Tools
No account yet? Create one
Forgot your Username or Password?

Welcome to the Voxilla VoIP Forum.

Voxilla has been a trusted source for accurate, up-to-date information on the IP Communications industry since 2002. A dedicated staff of reporters and engineers produce feature articles and product reviews to keep industry watchers abreast of the people, companies, and trends driving a fast moving market.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.





Closed Thread
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old May 12th, 2006, 07:54 PM
SpaceBass SpaceBass is offline
Junior Member
 
Join Date: Apr 2006
Posts: 24
SpaceBass
Default AGI and a bash script

hey folks.
I'm working on having Asterisk@home do some 'outside the box' work via bash scripts.
I have written a script and placed it in /var/lib/asterisk/agi-bin.
in my dial-plan i have:

[custom-myscript]
exten => s,1, wait(1)
exten => s,2, background(custom-myscript)
exten => 1,1,AGI(myscript|arg1)
exten => 2,1,AGI(myscript|arg2)

I can run the script from the bash promt just fine:
$ myscript 1

When I try and do it from Asterisk the CLI shows that it exits 0 but it never actually works.

For testing sake myscript is a BASH script that just does a touch to create a file.

Anyone have any clues?

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2 (permalink)  
Old May 13th, 2006, 08:38 AM
mberlant's Avatar
mberlant mberlant is offline
Senior Member
 
Join Date: Aug 2004
Location: USA or Japan
Posts: 5,013
mberlant is an unknown quantity at this point
Default RE: AGI and a bash script

Unfortunately, there are some holes (poorly documented) that are at work here. I have clues for you, but not enough knowledge to give you a solution. Here goes...

First, what is the nature of custom-myscript? Does it ask the caller to press 1 for this and 2 for that? If so, you need to include DigitTimeout and ResponseTimeout lines. Without these lines Asterisk won't be listening for the caller's input.

Second, what is the difference between arg1 and arg2? Do they perform, perhaps, a different offset in your touch command?
__________________
Please do not send technical questions via PM.
Please post all questions to the forum.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3 (permalink)  
Old May 13th, 2006, 04:31 PM
chandave chandave is offline
Senior Member
 
Join Date: Jul 2005
Posts: 362
chandave is an unknown quantity at this point
Send a message via MSN to chandave
Default Re: AGI and a bash script

Quote:
Originally Posted by SpaceBass
hey folks.
I'm working on having Asterisk@home do some 'outside the box' work via bash scripts.
I have written a script and placed it in /var/lib/asterisk/agi-bin.
in my dial-plan i have:

[custom-myscript]
exten => s,1, wait(1)
exten => s,2, background(custom-myscript)
exten => 1,1,AGI(myscript|arg1)
exten => 2,1,AGI(myscript|arg2)

I can run the script from the bash promt just fine:
$ myscript 1

When I try and do it from Asterisk the CLI shows that it exits 0 but it never actually works.

For testing sake myscript is a BASH script that just does a touch to create a file.

Anyone have any clues?

Thanks!
  1. Is the first line of your script:
    #!/bin/bash
    If not, then the execl() family of system functions will not know which script interpreter to use to execute the script.
  2. For the current testing version of "myscript", when "touch"ing the file, is the complete path specified or are you leaving it a relative path? If it's relative, are you sure the bash script has write access to the directory from which it is executing?
  3. Try changing the first line to:
    #!/bin/bash -x
    and then run the AGI from Asterisk. Check your /var/log/asterisk/messages, to see if you see your AGI executing.
  4. Since your current testing version of "myscript" just touches a file, post it verbatim to this forum.

See ya...

d.c.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:



Similar Threads for: AGI and a bash script
Thread Thread Starter Forum Replies Last Post
Help with AA script on SPA9000 JoWeaver Linksys SPA9000/SPA400 Support Forum 0 June 28th, 2006 03:32 PM
asterisk script help hi_reach Asterisk Support Forum 1 April 7th, 2006 04:32 PM
AGI troubleshooting issues firstone Asterisk Support Forum 0 March 20th, 2006 07:24 PM
GET VARIABLE in AGI PHP lamy Asterisk Support Forum 0 September 14th, 2005 08:50 AM
Asterisk Euro-Bash Planned (comment) PhoneBoy General discussion 0 March 28th, 2005 04:37 PM



All times are GMT. The time now is 08:54 AM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd. SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc. Logos and trademarks are the property of Voxilla or their respective owner. All other content © 2003-2007 by Voxilla, Inc.