sipster icon indicating copy to clipboard operation
sipster copied to clipboard

How can I get the call Event such as "media" in nodejs if I'm the caller?

Open chengzi201412 opened this issue 10 years ago • 4 comments

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 .

chengzi201412 avatar Jan 14 '15 03:01 chengzi201412

after "acct.makeCall('');" can't get the call state in nodejs.

chengzi201412 avatar Jan 14 '15 03:01 chengzi201412

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.

mscdex avatar Jan 14 '15 04:01 mscdex

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.

chengzi201412 avatar Jan 16 '15 07:01 chengzi201412

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)

valenti1234 avatar Sep 21 '15 03:09 valenti1234