server/serverMethods.js
// A web client that initiated a SIP call is requesting that we hang up
A web client that initiated a SIP call is requesting that we hang up
A web client that initiated a SIP call is requesting that we hang up
function postHangUp(aReq, aRes) {
    var body = aReq.body;
    var phoneNumber = body.phoneNumber;
    var googleIdToken = body.googleIdToken;
    var tbConfig = aReq.tbConfig;
    serverPersistence.getKey(redisPhonePrefix + phoneNumber, true)
      .then((dialedNumberInfo) => {
        if (!dialedNumberInfo || dialedNumberInfo.googleIdToken !== googleIdToken) {
          return aRes.status(400).send(new ErrorInfo(400, 'Unknown phone number.'));
        }
        return tbConfig.otInstance.forceDisconnect_P(dialedNumberInfo.sessionId,
          dialedNumberInfo.connectionId).then(() => {
            serverPersistence.delKey(redisPhonePrefix + phoneNumber);
            return aRes.send({});
          });
      });
  }
function postHangUp ( aReq , aRes ) { var body = aReq . body ; var phoneNumber = body . phoneNumber ; var googleIdToken = body . googleIdToken ; var tbConfig = aReq . tbConfig ; serverPersistence . getKey ( redisPhonePrefix + phoneNumber , true ) . then ( ( dialedNumberInfo ) => { if ( ! dialedNumberInfo || dialedNumberInfo . googleIdToken !== googleIdToken ) { return aRes . status ( 400 ) . send ( new ErrorInfo ( 400 , 'Unknown phone number.' ) ) ; } return tbConfig . otInstance . forceDisconnect_P ( dialedNumberInfo . sessionId , dialedNumberInfo . connectionId ) . then ( ( ) => { serverPersistence . delKey ( redisPhonePrefix + phoneNumber ) ; return aRes . send ( { } ) ; } ) ; } ) ; }
A web client that initiated a SIP call is requesting that we hang up
A web client that initiated a SIP call is requesting that we hang up