Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-21-2012, 12:50 PM   #1
kpryde
Registered User
 
Join Date: Aug 2012
Posts: 1
Default Adobe Cirrus Issue (Caller doesn't receive information)

I'm trying to run the adobe cirrus sample application and it only works one way (the callee receives the caller's audio and visual information), but not vice versa.

I think the problems must be in the placecall and accept call script?:

private function placeCall(identity:String):void
{
status("Calling "+ identity + "=identity" + "\n");

if (identity.length != 64)
{
status("Invalid remote ID, call failed\n");
currentState = CallFailed;
return;
}

netConnection.call(Relay, null, identity, Invite);

// caller publishes media stream
outgoingStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
outgoingStream.addEventListener(NetStatusEvent.NET _STATUS, outgoingStreamHandler);
outgoingStream.publish("media-caller");

var o:Object = new Object
o.onPeerConnect = function(caller:NetStream):Boolean

{
status("Callee connecting to media stream: " + caller.farID + "\n");
return true;
}
outgoingStream.client = o;

startAudio();
startVideo();


// caller subscribes to callee's media stream
incomingStream = new NetStream(netConnection, identity);
incomingStream.addEventListener(NetStatusEvent.NET _STATUS, incomingStreamHandler);
incomingStream.play("media-callee");

// set volume for incoming stream
var st:SoundTransform = new SoundTransform(speakerVolumeSlider.value / 100);
incomingStream.soundTransform = st;

var i:Object = new Object;
i.onIm = function(name:String, text:String):void
{
textOutput.text += name + ": " + text + "\n";
}
incomingStream.client = i;

remoteVideo = new Video();
remoteVideo.width = 320;
remoteVideo.height = 240;
remoteVideo.attachNetStream(incomingStream);
remoteVideoDisplay.addChild(remoteVideo);

// remoteName = user;
remoteId = identity;

currentState = CallCalling;
}

// process successful response from id manager
private function idManagerEvent(e:Event):void
{
status("ID event: " + e.type + "\n");

if (e.type == "registerSuccess")
{
switch (currentState)
{
case LoginConnecting:
currentState = LoginConnected;
break;
case LoginDisconnecting:
case LoginNotConnected:
currentState = LoginNotConnected;
return;
case LoginConnected:
return;
}

currentState = CallReady;

}
else if (e.type == "lookupSuccess")
{
// party query response
var i:IdManagerEvent = e as IdManagerEvent;

placeCall(i.id);
}
else
{
// all error messages ar IdManagerError type
var error:IdManagerError = e as IdManagerError;
status("Error description: " + error.description + "\n")

onDisconnect();
}
}

// user clicked accept button
private function acceptCall():void
{
status('acceptCall()');
stopRing();

incomingStream.receiveAudio(true);
incomingStream.receiveVideo(true);

remoteVideo = new Video();
remoteVideo.width = 320;
remoteVideo.height = 240;
remoteVideo.attachNetStream(incomingStream);
remoteVideoDisplay.addChild(remoteVideo);

// callee publishes media
outgoingStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
outgoingStream.addEventListener(NetStatusEvent.NET _STATUS, outgoingStreamHandler);
outgoingStream.publish("media-callee");

var o:Object = new Object
o.onPeerConnect = function(caller:NetStream):Boolean
{
status("Caller connecting to media stream: " + caller.farID + "\n");

return true;
}
outgoingStream.client = o;

netConnection.call(Relay, null, remoteId, Accept, '');

startVideo();
startAudio();

currentState = CallEstablished;
}

logs:

Callee:

Connecting to rtmfp://p2p.rtmfp.net
NetConnection event: NetConnection.Connect.Success
Connected, my ID: b9584acd1f8abe5cbb617591b198db56b427568003ec9ca805 61011acb76f7c1
Request: invite from: 19d2ec9b027cc82430a13a9c748ddf9a21eeaf700495c37606 b786f4f584323fNetConnection event: NetStream.Connect.Success
Connection from: 19d2ec9b027cc82430a13a9c748ddf9a21eeaf700495c37606 b786f4f584323f
Incoming stream event: NetStream.Play.Reset
Incoming stream event: NetStream.Play.Start
acceptCall()Outgoing stream event: NetStream.Publish.Start


Caller (who still thinks he's calling):
Connecting to rtmfp://p2p.rtmfp.net
NetConnection event: NetConnection.Connect.Success
Connected, my ID: 19d2ec9b027cc82430a13a9c748ddf9a21eeaf700495c37606 b786f4f584323f
Calling b9584acd1f8abe5cbb617591b198db56b427568003ec9ca805 61011acb76f7c1=identity
Outgoing stream event: NetStream.Publish.Start
Callee connecting to media stream: b9584acd1f8abe5cbb617591b198db56b427568003ec9ca805 61011acb76f7c1
Outgoing stream event: NetStream.Play.Reset
Outgoing stream event: NetStream.Play.Start
NetConnection event: NetStream.Connect.Success
Connection from: b9584acd1f8abe5cbb617591b198db56b427568003ec9ca805 61011acb76f7c1
Incoming stream event: NetStream.Play.PublishNotify
Incoming stream event: NetStream.Play.PublishNotify
kpryde is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:51 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.