info.setContent(content.getBytes(), ct);
}
catch (ParseException ex)
{
logger.error("Failed to construct the INFO request", ex);
throw new OperationFailedException(
"Failed to construct a client the INFO request"
, OperationFailedException.INTERNAL_ERROR
, ex);
}
//body ended
ClientTransaction clientTransaction = null;
try
{
clientTransaction = callPeer.getJainSipProvider()
.getNewClientTransaction(info);
}
catch (TransactionUnavailableException ex)
{
logger.error(
"Failed to construct a client transaction from the INFO request"
, ex);
throw new OperationFailedException(
"Failed to construct a client transaction from the INFO request"
, OperationFailedException.INTERNAL_ERROR
, ex);
}
try
{
if (callPeer.getDialog().getState()
== DialogState.TERMINATED)
{
//this is probably because the call has just ended, so don't
//throw an exception. simply log and get lost.
logger.warn("Trying to send a dtmf tone inside a "
+"TERMINATED dialog.");
return;
}
callPeer.getDialog().sendRequest(clientTransaction);
if (logger.isDebugEnabled())
logger.debug("sent request:\n" + info);
}
catch (SipException ex)
{
throw new OperationFailedException(
"Failed to send the INFO request"
, OperationFailedException.NETWORK_FAILURE
, ex);
}
}