sksushilkumar / red5phone

Automatically exported from code.google.com/p/red5phone
0 stars 0 forks source link

openlaszlo red5phone not working - I know the sollution #71

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. open index.html
2. click on "Openlaszlo Phone Template"
3. connect, register
4. try to make a call from other instance to registered user.
Error -> no incoming call

What is the expected output? What do you see instead?
incoming call should be seen in logs. Also after registration
"registrationSucess" should be visible in the openlaszlo logs.

What version of the product are you using? On what operating system?
red5 0.8.0

Please provide any additional information below.

Here is the code that works fine (you need to move some part of code from
init to on_nc handler):

<method name="init">
    <![CDATA[
        super.init();

        this.myMic =  Microphone.get();
        this.myMic.setRate(8);
    ]]>
    </method>

    <handler name="on_nc"><![CDATA[
        this._nc.registrationSucess = function(msg){

            // if (debug) 
            Debug.write("SIP: registrationSucess:", msg);
            this.t.registrationSucess.sendEvent(msg);
        }

        this._nc.registrationFailure = function(msg){

            // if (debug) 
            Debug.write("SIP: registrationFailure:", msg);
            this.t.registrationFailure.sendEvent(msg);
        }

        this._nc.incoming = function(iSource, iSourceName, iDestination,
iDestinationName){
            this.t.source = iSource;
            this.t.sourceName = iSourceName;
            this.t.destination = iDestination;
            this.t.destinationName = iDestinationName;

            //if (debug) 
            Debug.write("SIP: callIncoming:", source);
            this.t.callIncoming.sendEvent(source, sourceName, destination,
destinationName);
        }

        this._nc.connected = function(publishName, playName){

            this.t.incomingNetStream = new NetStream(_nc);
            this.t.outgoingNetStream = new NetStream(_nc);

            this.t.outgoingNetStream.attachAudio(myMic);

            this.t.incomingNetStream.play(playName); 
            this.t.outgoingNetStream.publish(publishName, "live"); 

            //if (debug) 
            Debug.write("SIP: callConnected:", publishName + "->" + playName);
            this.t.callConnected.sendEvent(publishName, playName);
        }

        _nc.callState = function(msg){

            //if (debug) 
            Debug.write("SIP: callState:", msg);

            if (msg == "onUaCallClosed") {

                if (this.t.incomingNetStream != null) {
                    this.t.incomingNetStream.play(false); 
                    this.t.outgoingNetStream.attachAudio(null);
                    this.t.outgoingNetStream.publish(false);

                    this.t.incomingNetStream = null;
                    this.t.outgoingNetStream = null;
                }
            }           

            this.t.callState.sendEvent(msg);
        }
    ]]>     
    </handler>

Original issue reported on code.google.com by Marcin.B...@gmail.com on 9 Oct 2009 at 2:49

GoogleCodeExporter commented 9 years ago
Sorry for typo "sollution" -> solution.

Original comment by Marcin.B...@gmail.com on 9 Oct 2009 at 2:52