[Asterisk-Users] answer on # key?
Donny Kavanagh
kavando at trn.ca
Thu Oct 21 11:36:44 MST 2004
I did this for a click to talk prototype application, hope this helps.
There is no error checking in this "prototype" aka it will time out
indefinitally on the menu until they hangup etc. It was just a proof of
concept. Temp.agi called text2wave from festival and generated a wav
file. Badly named, but this was hacked together in an afternoon.
In macro-clicktotalk Read seems to require you play a file before input
(or at least that's how I was able to get it working) hence the playing
of beep, ideally all these messages would be recorded and not using TTS
there for the message "you have a CTT call" would just be played in the
read.
Some of the options in the dial may not be required, I was playing
around with this code somewhat trying to get it to transfer so it
woudn't use up to zap channels while the call was active. The ideal
solution is just to transfer, however then you have no ability to
control both sides of the call.
I wrote my own agi because calling Festival() was finicky and only
seemed to work for me via the pri/zap and not sip?? This agi will work
on unpatched festival as well. If you have any further questions, or
want the code for temp.agi (should be named tts.agi) feel free to
contact me off list if you choose to.
Donny
-- code --
[clicktotalk]
exten=> s,1,Answer
exten=> s,2,Wait(2)
exten=> s,3,AGI,temp.agi|This is a call from the C T T service of <where
I work>
exten=> s,4,AGI,temp.agi|To accept the call press 1 to refuse the call
press 2.
exten=> 1,1,AGI,temp.agi|Please wait while we make contact with an agent
exten=> 1,2,AGI,temp.agi|You may expirence a short wait and a peroid of
silence. Please remain on the line.
exten=> 1,3,Goto(clicktotalk-agent,s,1)
exten=> 2,1,AGI,temp.agi|Since you have indicated you do not wish to
accept this call
exten=> 2,2,AGI,temp.agi|your request will be canceled.
exten=> 2,3,Hangup
exten=> t,1,Goto(clicktotalk,s,1)
[clicktotalk-agent]
exten=> s,1,Dial(Zap/g1/82979022,30,tTmgM(clicktotalk))
exten=> s,2,Hangup
[macro-clicktotalk]
exten=> s,1,AGI,temp.agi|You have a CTT Call. Please press any key.
exten=> s,2,Read(XInput,beep,1)
exten=> s,3,Gotoif(${XInput}?10:20)
exten=> s,10,Goto(Z,1)
exten=> s,20,Goto(s,1)
exten=> t,1,Goto(s,1)
exten=> Z,1,AGI,temp.agi|The refrence number is 1 1 1 1.
exten=> Z,2,AGI,temp.agi|We are now connecting you to the client.
exten=> Z,3,Wait(5)
-----Original Message-----
From: Matthew Simpson [mailto:matthew at txlink.net]
Sent: Thursday, October 21, 2004 1:47 PM
To: asterisk-users at lists.digium.com
Subject: [Asterisk-Users] answer on # key?
I thought I read somewhere on the Wiki that one could give Dial() an
argument that would first dial the extension, but not bridge the
connection
until the called party hit the "#" key. It must have been during one of
those late night coding sessions because now I can't find anything to do
with that other than options to allow hangup of the call by hitting "*".
Does such an option exist?
If not, is anyone using a Macro to do that?
I have a system that attempts to do a Dial out to a cell phone number
with a
15 second timer as a find me type of application. If the cell phone is
off
or out of range, the 15 seconds of ring time isn't reached and the
caller
gets connected to the cell phone's voicemail instead of the Asterisk
voicemail like I want. Having the # to connect option would fix this
problem.
_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list