开发者

Hosting phono (jquery softphone plugin) dependencies locally?

开发者 https://www.devze.com 2023-03-24 02:56 出处:网络
This may be too obscure a question, but perhaps 开发者_如何学编程someone can spot what I\'m doing wrong.

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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消