Topics

To assist our developers to quickly build enterprise grade voice enable applications, TringMe has released source code for it's widgets. It can be downloaded from here.

Below are sample examples of how easy it is to use TringMe APIs.

TringMe Class

Following is an implementation of TringMe class to be used in Flash Widgets.

class TringMe {
var nc:NetConnection;
var ns:NetStream;
var nsplay:NetStream;
var mic:Microphone;
// initiallize random string
var randomstreamname = "dashd9ada9sdaskjdhask";

var TringMeURI = "rtmp://sip.tringme.com/" + _root.cookie + "/" +
_root.destination;
static var app:TringMe;

// entry point
static function main (mc) {
app = new TringMe();
}

//constructor
function TringMe() {
var flashversion = getVersion();
// other initialization
_root.stop();
}

function ConnectStatus( pInfo:Object ) {
if ( pInfo.code == "NetConnection.Connect.Success" ) {
//close
} else if ( pInfo.code == "NetConnection.Connect.Closed" ||
pInfo.code == "NetConnection.Connect.Rejected" ) {
//close
}
}

// call from user interface to make a call
function MakeCall() {
nc = new NetConnection();
nc.onStatus = ConnectStatus;
var ncres = nc.connect(TringMeURI);

ns = new NetStream(nc);
mic = Microphone.get();
mic.setRate(8);
mic.setSilenceLevel(0);
ns.attachAudio(mic);
ns.publish(randomstreamname, "record");

nsplay = new NetStream(nc);
nsplay.play("tring", -1);
}

// call from user interface to end a call
function EndCall() {
ns.close();
nsplay.close();
}
}

If you are an enterprise and would like to know better how TringMe can help you reduce cost and at the same time benefit you,
please send a mail to bizdev@tringme.com