# TringMe API

**URL:** <https://forum.kirupa.com/t/tringme-api/299811>\
**Category:** flash\
**Created:** [November 11, 2009, 10:51am UTC](https://forum.kirupa.com/t/tringme-api/299811 "2009-11-11T10:51:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaji](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@shaji](https://forum.kirupa.com/u/shaji)\
**Post date:** [November 11, 2009, 10:51am UTC](https://forum.kirupa.com/t/tringme-api/299811/1 "2009-11-11T10:51:10Z")

</div>

I have been trying to use API provided by tringme to create widget to make a call. I am unable to get more information from tringme support about connecting. I assumed that the call wasn’t through due to insufficient credit. Even with sufficient credit the call doesn’t happen. Have any of you people work on it any time?

I have written the code as per the API, \<uid\> has been replaced with a valid uder id.

```auto

var tringMeURL:String = "rtmp://sip.tringme.com/voicemail/<uid>";

var randomstreamname = "63e457425defb24e8a5ca80de80d2e3817ea5c1b";

NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;

var nc:NetConnection;

call_btn.addEventListener(MouseEvent.CLICK, callHandler, false, 0, true);
close_btn.addEventListener(MouseEvent.CLICK, closeCallHandler, false, 0, true);

function callHandler(evt:MouseEvent):void{
    nc = new NetConnection();
    nc.addEventListener(NetStatusEvent.NET_STATUS, connectionStatushandler, false, 0, true);
    nc.connect(tringMeURL);
}

function closeCallHandler(evt:MouseEvent):void{
    nc.close();
}

function connectionStatushandler(evt:NetStatusEvent):void{
    var info:Object = evt.info;
    trace(info.code);
    
    status_txt.text = String(info.code);
    
    if (info.code == "NetConnection.Connect.Success") {
        
        var nsc:NetStream = new NetStream(nc);
        var mic:Microphone = Microphone.getMicrophone();
        mic.rate = 8;
        mic.setSilenceLevel(0);
        nsc.publish(randomstreamname, "record");
        nsc.attachAudio(mic);
        
        var nsc1:NetStream = new NetStream(nc);
        nsc1.play("tring", -1);
    }
}

```

I am not that familiar with netstream and netconnection, so unable do much.
