[AsteriskBrasil] RES: RES: Web e Asterisk
[SERGICON] Leandro Melo
leandro em sergicon.com.br
Quinta Janeiro 12 17:42:31 BRT 2006
Veja o readme do API abaixo.....
Last Update March 30, 2004
comments to: Peter Koegel (HYPERLINK
"mailto:pkoegel em azxws.com"pkoegel em azxws.com)
Installation Steps and Troubleshooting
Everyhing changes on a daily base. If you need more help, send me an eMail
to: Peter Koegel (header add) taci and/or XOF to: HYPERLINK
"mailto:pkoegel em azxws.com"pkoegel em azxws.com
1) Make sure manager.conf is setup, sample below
/------------- sample manager.conf
[general]
enabled = yes
port = 5038
bindaddr = 127.0.0.1
[office]
secret = mypass
permit=192.168.1.0/255.255.255.0
deny=0.0.0.0/0.0.0.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
\----------- end manager.conf
NOTE: I believe you can bind to all IPs by skipping the bindaddr.
If you setup the interface an the outside IP, be sure to restrict access
by using asterisk IP permit and deny rules, AND/OR firewall rules.
2) restart asterisk and test your the interface "by hand"
#asterisk -rx "restart when convenient"
Then test....
$telnet 127.0.0.1 5038
>Trying 127.0.0.1...
>Connected to 127.0.0.1.
>Escape character is '^]'.
>Asterisk Call Manager/1.0
-- You can login like so ---
action: login
username: office
secret: mysecret
--- then hit return twice, you'll see --
>Response: Success
>Message: Authentication accepted
--- Then I typed ---
Action: Originate
Channel: SIP/12345
Exten: 5551212
Context: default
-- This tries to place a call from SIP account 12345
-- to phone number 5551212 in the context default.
-- Replace with your real information
-- most systems won't allow dialout in the default context
-- Asterisk will show your call progress. (and all other calls too.)
NOTE: I don't supply CallerID, if this is important add it or request it.
3) Setup the taci.pl script with your information, and pop it in your
webserver's cgi-bin directory
NOTE: You may also need Net::Telnet installed, use CPAN, a package, or
download and make by hand.
You need to setup your Asterisk username and password (and IP address)
inside taci.pl.
Make sure it is executable.
#chmod +x taci.pl
Test the script from the command line like so:
$./taci.pl exten=5551212 account=12345 context=default
4) Test it from the web.
You should password protect and/or limit the script by IP, referrer, etc.
This could help fend of phone DoS attacks.
(Imagine some making all your phones ring and then call international
numbers... UGH.)
You may decide to lock the script down to a certain context.
You can certainly extend the script and use it for your own purposes. If you
have a really neat trick, feel free to let me know.
FROM HERE AND WHERE IT GETS INTERESTING:
You can also use URLs from other apps (think groupware or web phone
directories).
Hack the user preferences (or supply a cookie) to supply a context and sip
account.
Then add a Click to dial right from the app.
HYPERLINK
"http://voip.example.com/cgi-bin/taci.pl?account=101&context=default&exten=5
551212"http://voip.example.com/cgi-bin/taci.pl?account=101&context=default&e
xten=5551212
You have the ever desired "Click to Dial" Phone App.
---------------
PHP Hack example - from addrbook's list.lib.php
if (preg_match("/[0-9][0-9][0-9].[0-9][0-9][0-9][0-9]/i", $l[$idx][$v][0]))
{
//echo "<tr><td><strong>$v:</strong></td>";
$charstoremove=array ("(",")","-", " ");
$phone=str_replace($charstoremove,"",$l[$idx][$v][0]);
echo "<td><A HREF=cgi-bin/taci.pl?exten=$phone>".$l[$idx][$v][0]."</td>";
}
_____
De: asteriskbrasil-bounces em listas.asteriskbrasil.org
[mailto:asteriskbrasil-bounces em listas.asteriskbrasil.org] Em nome de Victor
Carvalho
Enviada em: quinta-feira, 12 de janeiro de 2006 15:45
Para: asteriskbrasil em listas.asteriskbrasil.org
Assunto: Re: [AsteriskBrasil] RES: Web e Asterisk
Ah foi mal, hehe
Mas como para usar uma interface web como cliente SIP?
Com isso é possível?
Em 12/01/06, Caio Begotti <HYPERLINK
"mailto:caio em ueberalles.net"caio em ueberalles.net> escreveu:
On Thursday 12 January 2006 15:43, Victor Carvalho wrote:
> > HYPERLINK
"http://voip.example.com/cgi-bin/taci.pl?account=101&context=default&exten"h
ttp://voip.example.com/cgi-bin/taci.pl?account=101&context=default&exten
> >=55 51212
> A API permite ao usuário realizar chamadas numa página web?
> Leandro, o link não funcionou...
O link é um exemplo...
--
Caio Begotti (caio1982)
HYPERLINK "http://caio.ueberalles.net"http://caio.ueberalles.net
_______________________________________________
LIsta de discussões AsteriskBrasil.org
HYPERLINK
"mailto:AsteriskBrasil em listas.asteriskbrasil.org"AsteriskBrasil em listas.aster
iskbrasil..org
HYPERLINK
"http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil"http://lis
tas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil
_______________________________________________
Acesse o wiki AsteriskBrasil.org:
HYPERLINK "http://www.asteriskbrasil.org"http://www..asteriskbrasil.org
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.17/227 - Release Date: 11/1/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.17/227 - Release Date: 11/1/2006
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: http://listas.asteriskbrasil.org/pipermail/asteriskbrasil/attachments/20060112/dd54b0a3/attachment-0001.html
Mais detalhes sobre a lista de discussão AsteriskBrasil