Enter phone number in webpage / call number and play recording

blackice912
Posts: 9
Member Since:
2007-05-06

Hey,

I've got this idea floating around that I'd like to put into use.

What I want to do is have a PHP webpage where you can enter a phone number. Once you enter the number and click submit, Trixbox will call that number, play a recording, and hangup.

I can probably figure out the Trixbox side since I have created custom entries before, but the question I have is: What is the best way to pass information from a PHP webpage to Trixbox?

Thanks!

--

-Brad B



jeb
Posts: 176
Member Since:
2006-08-22
call and play a message

Brad,

There are lots of ways to do this.

Visit http://nerdvittles.com and check out TeleYapper. If this doesn't fit your needs you can always tweak the code.

-- James Bennett
www.jebsolutions.com



eoo
Posts: 448
Member Since:
2006-10-30
Search for Unattended

Search for Unattended Outbound Caller. There are a number of threads on this.



jrglass
Posts: 17
Member Since:
2006-07-26
Enter phone number in webpage / call number and play recording

Look for a click 2 call script

Jeff



Yondaime
Posts: 24
Member Since:
2007-05-31
Use the Asterisk Manager

Use the Asterisk Manager API:

http://www.voip-info.org/wiki-Asterisk+manager+API

--

Erol M. Fornoles



pcasado
Posts: 31
Member Since:
2007-04-24
I believe I saw that on..

I believe I saw that on.. nerd vittles.

That you just go to a page on your trixbox followed by the number (using a dialing rule and also to one of your ext. #)...

if my memory don't fool me I think, it was something like callme.php ... but am not sure

search nerd vittles



dickson
Posts: 1831
Member Since:
2006-06-02
thats easy. check back in 24

thats easy.
check back in 24 hours, ill post the code for that.



dickson
Posts: 1831
Member Since:
2006-06-02
4 Hours ahead of

4 Hours ahead of schedule!!!!

This is BETA .9 code allows you to goto a web page, enter in a phone number and click a button. Have tested, but please test yourself thoroughly.
This will initiate a call to an extension of your choice!

HOW IT WORKS:
You goto the web page link with the .php code.
Put in your phone number and click submit
PHP code runs a script in the /etc/asterisk directory and builds a .call file.
This file contains the number of the remote phone in a variable, and the local number which is currently hard coded.
Once the person answers their phone, this initiates the local call and the callers are bridged.

INSTALLATION
1- Goto /var/www/html/
2- make a directory called /clickcall
3- run this command
chown asterisk clickcall

4- create a file called index.html and put the following code in that file

[html]
[body]
[form action="clickcall_1.php" method="post"] Please enter your extension number
[input type="text" name="value1"]
[input type="submit" value="Call Number"]
[/form]
[/body]
[/html]

(change the above [ ] to < > respectively. )
(Guys, how do we post straight HTML code without the forum interpreting it? Makes no sense to me in a forum of this type to need that feature.)

5- save that file, and create a new file called " clickcall_1.php "
6- edit that file and put in the following:

<?php
$output = shell_exec("/etc/asterisk/./clickcall.sh ".$_POST["value1"]."");
echo "$output";
?>

7- save those changes and goto /etc/asterisk
8- create a new file in there called clickcall.sh
9- put in the following code in that file

#!/bin/bash
echo Channel: Local/$1@from-internal > /etc/asterisk/$1.call
echo MaxRetries: 0 >> /etc/asterisk/$1.call
echo RetryTime: 5 >> /etc/asterisk/$1.call
echo WaitTime: 20 >> /etc/asterisk/$1.call
echo Context: from-internal >> /etc/asterisk/$1.call
echo Extension: 4095 >> /etc/asterisk/$1.call
echo Priority: 1 >> /etc/asterisk/$1.call
chown asterisk:asterisk /etc/asterisk/$1.call
mv /etc/asterisk/$1.call /var/spool/asterisk/outgoing

10 - the line Extension 4095, you can change that to the local extension number you want to send the external caller to to play your file. If you want to specify an external trunk trigger, the "Channel" line, put in Local/9$1 (or whatever you want to use for outbound trunk lines)

11 - TRY IT! :)
goto http://TrixboxIP/clickcall/
enter in your phone number click on submit.

Let me know!



eoo
Posts: 448
Member Since:
2006-10-30
You might want to add a

You might want to add a cautionary note: if you put this on a public web page, there is a real risk of abuse. It should be located such that there is some level of traceability to who is initiating and who is receiving the call otherwise you run the risk of mischief makers using this to call people in the middle of the night and randomly playing your announcements or whatever. Of course, you should not be putting your TB web interface on the internet in the first place. This is a bit like handing someone a box of matches and saying go play so let's all be careful!



dickson
Posts: 1831
Member Since:
2006-06-02
Eoo makes a good point. I

Eoo makes a good point.
I was sort of under the impression that this was an internal thing, but it should be noted that as it stand, there is very little restriction on what they can do with this..which is a fair bit!
If its for internal users, I could add in a level of protection, such as a password that would have to go with it? For example, if its a user on your system, they would have to enter in their voicemail password or something like that?

Let me know...



pcasado
Posts: 31
Member Since:
2007-04-24
risky business

it is very risky to use a page like that on without the proper security (beware of site and code exploitations)

Eoo is right pointing that advice... and you should check your security and network delimitation "BEFORE" posting a page like that one in your trixbox, using a log/password is a good idea but also try to ad some "secure" or "encapsulated" connection, so NOT everyone have access to not just the dial, but also the page and site... and if so, you should be noticed and to know what is happening...

good luck in your deployment....



bins
Posts: 279
Member Since:
2006-06-14
I was (still am) after

I was (still am) after something similar, dating back a while.

My idea is that the webpage would basically act like a softphone, where you log into your server and dial away!

--

The UK Asterisk User Group - www.asteriskug.co.uk

Setup (UK):
1x tb1.2.3
2 x tb2.4
2 with AX100P FXO (working for incoming POTS only)
1 with AX400P/2 FXO's
SIP voip supply by voipfone.co.uk
SIP/IAX extensions (internal)
IAX remote extensions



pcasado
Posts: 31
Member Since:
2007-04-24
NV:Getting Remote Dialtone With Asterisk

NerdVittles: Getting Remote Dialtone With Asterisk

http://nerdvittles.com/index.php?p=73
http://www.freepbx.org/forums/viewtopic.php?p=322

Something like the GIZMO call-page (https://www.gizmocall.com/).



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.