[asterisk-users] two steps when calling from web!

A J Stiles asterisk_list at earthshod.co.uk
Tue Nov 12 03:53:10 CST 2013


(re-ordered correctly)

On Tuesday 12 November 2013, akhilesh chand wrote:
> I'm making a call from web(click to dial) and able to successfully dial to
> number but problem with when i dial a number call goes to first client and
> after that call come into  my softphone show me "Answer" and "Decline"
> bottoms, and then I have to click Answer to call the number. it seems it is
> two step to calling the number. If I type the number direct to my client
> softphone, it calls directly the number without show me to choose Answer to
> calling.
> 
> I want integrate web application with softphone suppose to I will click on
> dial button on web call goes to via my softphone or i will get ringing(or
> ISDN status of call) sound.
 
As I already pointed out, you have to pick your handset up to cause a call to 
be set up.  That is just the way telephony works.  It's been like that ever 
since "Mr Watson, come here at once. I want you".

If your softphone can be made to pick up by means of a special SIP header, 
then you might be able to insert this.  Probably the easiest way is by 
creating a special context in your dialplan which will send the necessary 
header, and having your call file use this context.

Otherwise, it's more complicated; but -- assuming you can pass parameters to 
your softphone to invoke it with the handset up and dialling a number; it 
probably has a manpage, so look there first -- still just about within the 
bounds of doability.  You will have to create a little daemon on your local 
machine which runs as your UID, and invokes your softphone client with a 
number ready to dial.  The chapter on "sockets" in your book on your favourite 
programming language will help you with writing this.  Then, your "click-to-
call" CGI script must, instead of generating a call file, fire off a request to 
your softphone-starting daemon.

(If you can spare the resources to run a web server on your local machine, 
then use that; and start the softphone from an ordinary CGI script.  The IOCCC 
version of Hibachi is Public Domain, and not subject to the restrictive 
licence of later versions which includes legally-unenforcible terms.)

N.B.  As this involves a network request initiating a program, you need to 
MAKE SURE THAT WHATEVER PORT YOU USE FOR THE DAEMON TO LISTEN ON IS FIREWALLED 
OFF FROM THE OUTSIDE WORLD!

-- 
AJS

Answers come *after* questions.



More information about the asterisk-users mailing list