Пример #1
0
int uas_answer(sipua_uas_t* uas, sipua_call_t* call, int reply, char* reply_type, char* reply_body)
{
	if(reply_body)
	{

		if(eXosip_answer_call_with_body(call->did, reply, reply_type, reply_body) == 0)
			return UA_OK;
	}
	else
	{
		if(eXosip_answer_call(call->did, reply, NULL) == 0)
			return UA_OK;
	}

	return UA_FAIL;
}
Пример #2
0
/**
 * Answer an incoming call with the specified body
 *
 * @param hCall				The handle to the incoming call.
 * @param szContentType		The content type of the message
 * @param body				The body of the message 
 * @param BodySize			The size of the body of the message
 */
MY_DLLEXPORT OWPL_RESULT
owplCallAnswerWithBody (const OWPL_CALL hCall,
			const char* szContentType,
			const char* szBody,
			int BodySize) {
	int i;
	phcall_t *ca = ph_locate_call_by_cid(hCall);

	if(!ca) {
		return OWPL_RESULT_INVALID_ARGS;
	}

	eXosip_lock();
	i = eXosip_answer_call_with_body(ca->did, 200, szContentType, szBody); // returns 0 on success; -1 else
	eXosip_unlock();

	if(i != 0) {
		return OWPL_RESULT_FAILURE;
	}

	return OWPL_RESULT_SUCCESS;
}