Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To analyze the code, let's take the version of file click-to-call.js with hash 26fc5afa246baea80867fa011305da811edab1f066cc393, which is available here and  and can be downloaded with corresponding build 0.5.28.52753.1894133.

1. Initialization of the API

Flashphoner.init() code

Code Block
languagejs
themeRDark
Flashphoner.init({flashMediaProviderSwfLocation: '../../../../media-provider.swf'});

2. Connection to server.

createSession() code

Object with connection options is passed to the method when session is created

...

ConnectionStatusEvent ESTABLISHED code

On this event, outgoing call is created

...

session.createCall(), call() code

The following parameters are passed when call is created

...

5. Call hangup

call.hangup() code

Code Block
languagejs
themeRDark
    $("#callBtn").text("Hangup").removeClass("btn-success").addClass("btn-danger").off('click').click(function(){
        $(this).prop('disabled', true);
	    outCall.hangup();
    }).prop('disabled', false);