respoke/respoke — pull request #2 by steely-glint (2014-11-21 15:23:16+00:00)
Title: Add a hook to allow extraction of extra data from SDP to suit business case.

The idea here is to allow the respoke developer (user?) to extract some extra data from the incoming SDP that may impact their business case. (for example if the fingerprint matches one this user 'trusts').
Respoke can't be expected to expose all possible SDP data, but the expert user may want to get at some specific info (e.g. dtmf support, or license paid codecs) before accepting the call.
Notice that the SDP isn't expected to be edited, so core functionality isn't changed.

This PR is used like this :
client = new respoke.Client({
appId: appid,
developmentMode: true
});
respoke.log.setLevel('trace');
respoke.sdpExtract = Ipseorama.getFinger;
....
client.listen('call', function(evt) {
call = evt.call;
if ((call.initiator !== true) && (call.remoteSdpExtract == oldFriend)){
call.answer(
...
} else {
call.reject(
... etc