• Anthony Minessale's avatar
    Add state change i/o hook to the core and change some spidermonkey behaviour. · d9de1807
    Anthony Minessale 提交于
    The most important thing to check is you now must create a new session with a blank constructor:
    s = new Session();
    then call s.originate() with all the former args that were documented to be for the constructor
    this will will return true or false to indicate if the call worked.
    
    See below this sample code demonstrates all of the changes:
    
    ////////////////////////////////////////////////////////////////////////////////
    function on_hangup(hup_session)
    {
        console_log("debug", "HANGUP!!!! name: " + hup_session.name + " cause: " + hup_session.cause + "\n");
    	//exit here would end the script so you could cleanup and just be done
    	//exit();
    }
    
    //set the on_hangup function to be called when this session is hungup
    session.setHangupHook(on_hangup);
    
    //allocate a new b_session
    var b_session = new Session();
    
    //make a call with b_session.  If this fails, all we will be able to access is the b_session.cause attr
    if (b_session.originate(session, "sofia/mydomain.com/888@conference.freeswitch.org")) {
    	//Inform the scripting engine to automaticly hang this session up when the script ends
        b_session.setAutoHangup(true);
    	//set the on_hangup function to be called when this session is hungup
        b_session.setHangupHook(on_hangup);	
    	//bridge session with b_session
        bridge(session, b_session);
    } else {
        console_log("debug", "Originate Failed.. cause: " + b_session.cause + "\n");
    }
    ////////////////////////////////////////////////////////////////////////////////
    
    
    
    
    
    
    git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4773 d0543943-73ff-0310-b7d9-9358b9ac24b2
    d9de1807
名称
最后提交
最后更新
build 正在载入提交数据...
conf 正在载入提交数据...
docs 正在载入提交数据...
libs 正在载入提交数据...
scripts 正在载入提交数据...
src 正在载入提交数据...
support 正在载入提交数据...
w32 正在载入提交数据...
Freeswitch.sln 正在载入提交数据...
INSTALL 正在载入提交数据...
Makefile.am 正在载入提交数据...
acinclude.m4 正在载入提交数据...
bootstrap.sh 正在载入提交数据...
configure.in 正在载入提交数据...