sipster
sipster copied to clipboard
How can I get the call Event such as "media" in nodejs if I'm the caller?
How can I get the call Event such as "media" in nodejs if I'm the caller?
just as
acct.on('call', function(info, call) {
console.log('=== Incoming call from ' + info.remoteContact);});
..etc
but it just happen when some one else call me.
so I don't know how to get the call Event just as "acct.on('call',function)".
sincerely,ask for you help .
after "acct.makeCall('');" can't get the call state in nodejs.
I haven't done testing for UAC scenarios. I merely added the makeCall() because it was simple to do and a small step towards a more complete addon that supports both UAC and UAS scenarios.
very thanks for explain ,because I was just learning node.js ,so don't familiar with the callback function in nodejs addon.Also please forgive me.
chengzi you need to assign a variable for makeCall and than use emit event on it
var _out = acct.makeCall('sip:[email protected]') console.log('OUT CALL >>>>>>>>>>>>>>>>>>>>>>>>>', _out); _out.on('state', function(state) { console.log('>>>>>>>>>>>>>>>>> STATE ' ,state)); });
setTimeout(function() {
_out.hangup();
}, 8000)