Obviously, you can not make Java Script Phone.
JS technology simply does not allow it.
However, it is possible with Flashphoner JavaScript API.

How does it work?
The scheme is very simple.
Flashphoner server provides an API for flash applications allows you create your own flash-phones.
We made it as a library flashphoner_api.swc.
(API description here)

Using this library you can make phone on the Flash (ActionScript) technology.
As a result you will have flashphoner – flash app with phone interface and phone functionality
(please check example at the www.flashphoner.com main page)

But we go ahead! and use flashphoner_api.swc library for creating
an application flashphoner_js_api.swf. This flash app has no user interface,
this is just a library for creating Java Script phones!

That means you can make web phone using the JavaScript technology.
and this phone will call to regular phones via flashphoner_js_api.swf.

This flash app will appear in the page only in two cases
1. When you must allow to use the camera or microphone
2. When you want to watch/send video during the videocall (yes, videocalls also insluded!)
and will be hidden in the other cases, so you can play with GUI
without difficulty of ActionScript compiling

There is the scheme:
JavaScript –> flashphoner_api_js.swf –> Flashphoner server –> VOIP server –> Mobile/PSTN

Flash – makes all related to publishing and playing the streams
JavaScript – makes all related to user interface and call management
And it’s really usefull!

We made our JS phone as an example.
It turned out pretty easy and very convenient.
We also used JQuery, and it made it more easier.

We invite all try Java Script Phone!
We will release it in the next week,
we will keep you posted.