CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Noob question: user INPUT to change text file input

 



kapacheperlboob
New User

Aug 25, 2012, 6:09 PM

Post #1 of 3 (623 views)
Noob question: user INPUT to change text file input Can't Post

Hi,

I am new at perl, I've been reading and watching online videos, so far I've gotten somewhat okay with perl. I want to write my first script that takes user input and uses that input to update text file.

Here's an example.

I want users to get asked to change DID and extension to what they want to use

"test.call"(the actual program that I use for trixbox-c to make outbound test calls)

Channel: Local/DID@internal
Context: main
Extension: s
Priority: 1
Callerid: extension

Here's what I got so far


$ask ="change DID and name to the number and extension that you will be using: \n";

print "$ask";
$change=<>;

if($change =~ /Y/i){


}
#$call="/root/test.call"

I am stuck at the if statement block part. what should I do there?


any help will do


BillKSmith
Veteran

Aug 26, 2012, 6:13 AM

Post #2 of 3 (613 views)
Re: [kapacheperlboob] Noob question: user INPUT to change text file input [In reply to] Can't Post

I really do not understand your question. I think that you want a script that prompts the user for two "numbers" and then calls test.call with that data.

Notes on your code:

You prompt your user to "change...". He will have no idea how to do this. It should say something like "Enter your required DID and extension (separated by a space): "

You will have to parse the input. I cannot help without knowing what a "DID" and "extension" really are. Are they all numbers???
Good Luck,
Bill


FishMonger
Veteran / Moderator

Aug 26, 2012, 7:08 AM

Post #3 of 3 (611 views)
Re: [kapacheperlboob] Noob question: user INPUT to change text file input [In reply to] Can't Post

Bill,
A DID is a "Direct Inward Dialing Number" and trixbox is a port of Asterisk PBX (an open source VoIP PBX).

kapacheperlboob,
Doesn't trixbox have a web interface for maintaining the config files?

Are you trying to setup hot desking for your queues? If so, then why not handle that directly in the dialplan?

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives