Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting phono (jquery softphone plugin) dependencies locally?

This may be too obscure a question, but perhaps someone can spot what I'm doing wrong.

Phono (jquery plugin for javascript/flash-based softphone built on top of Tropo/Voxeo) loads a couple of dependencies from the phono.com servers. Namely,

  • flensed.js
  • checkplayer.js
  • swfobject.js
  • phono.audio.swf

I would very much like to avoid loading these dependencies from an external server (for obvious reasons) and going by this thread on their forums (which I can't register for because it appears every possible username has been "taken") , it should be possible to host them locally.

Here's a prettified source for the main jquery plugin. Maybe I'm just bad at looking, but I could not find a commented, un-minified version either in their full SDK or on github.

So after changing

base_path: "http://s.phono.com/deps/flensed/1.0/"

and

swf: "http://s.phono.com/releases/" + Phono.version + "/plugins/audio/phono.audio.swf"

... all dependencies seem to load just fine, phono successfully grabs a session ID and chats by SIP appear to be working. When I try to dial out or call the session id/SIP, however, I get a javascript error:

Uncaught TypeError: Cannot call method 'start' of null

referring to line 770 : h.start().

this.$flash.play(g, j); appears to return null or undefined. I suck at javascript and can't figure out why.

EDIT - if anyone would be so adventurous as to try this out, you can just grab their "kitchen sink" demo and slap it up on a server without much hassle.

like image 248
Greg Avatar asked Nov 04 '22 17:11

Greg


2 Answers

Okay -- this is ridiculous and I'm an idiot for not catching it sooner.

Flash was trying to load the ringtones off my server at the URL that requires authentication. Unfortunately, flash is not a user with a valid session. Hence, flash was grabbing big handful of nothing. Sorry.

like image 60
Greg Avatar answered Nov 09 '22 09:11

Greg


You can download the PhonoSDK and all of the samples (including the kitchen sink demo) and run it on your localhost. Here's the link: http://s.phono.com/releases/PhonoSDK-0.2.zip. It's open source, do you can also fork/contribute to the project as well - https://github.com/phono

I just tried it using Apache on my localhost it worked without editing anything.

like image 29
Chris Matthieu Avatar answered Nov 09 '22 08:11

Chris Matthieu