pjsua_call_answer2 method

int pjsua_call_answer2(
  1. int call_id,
  2. Pointer<pjsua_call_setting> opt,
  3. int code,
  4. Pointer<pj_str_t> reason,
  5. Pointer<pjsua_msg_data> msg_data,
)

Send response to incoming INVITE request with call setting param. Depending on the status code specified as parameter, this function may send provisional response, establish the call, or terminate the call. Notes about call setting:

  • if call setting is changed in the subsequent call to this function, only the first call setting supplied will applied. So normally application will not supply call setting before getting confirmation from the user.
  • if no call setting is supplied when SDP has to be sent, i.e: answer with status code 183 or 2xx, the default call setting will be used, check #pjsua_call_setting for its default values.

@param call_id Incoming call identification. @param opt Optional call setting. @param code Status code, (100-699). @param reason Optional reason phrase. If NULL, default text will be used. @param msg_data Optional list of headers etc to be added to outgoing response message. Note that this message data will be persistent in all next answers/responses for this INVITE request.

@return PJ_SUCCESS on success, or the appropriate error code.

Implementation

int pjsua_call_answer2(
  int call_id,
  ffi.Pointer<pjsua_call_setting> opt,
  int code,
  ffi.Pointer<pj_str_t> reason,
  ffi.Pointer<pjsua_msg_data> msg_data,
) {
  return _pjsua_call_answer2(
    call_id,
    opt,
    code,
    reason,
    msg_data,
  );
}