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
|