本文整理汇总了Java中com.csipsimple.api.SipMessage.MESSAGE_TYPE_FAILED属性的典型用法代码示例。如果您正苦于以下问题:Java SipMessage.MESSAGE_TYPE_FAILED属性的具体用法?Java SipMessage.MESSAGE_TYPE_FAILED怎么用?Java SipMessage.MESSAGE_TYPE_FAILED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.csipsimple.api.SipMessage
的用法示例。
在下文中一共展示了SipMessage.MESSAGE_TYPE_FAILED属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: on_pager_status
@Override
public void on_pager_status(int callId, pj_str_t to, pj_str_t body, pjsip_status_code status,
pj_str_t reason) {
lockCpu();
// TODO : treat error / acknowledge of messages
int messageType = (status.equals(pjsip_status_code.PJSIP_SC_OK)
|| status.equals(pjsip_status_code.PJSIP_SC_ACCEPTED)) ? SipMessage.MESSAGE_TYPE_SENT
: SipMessage.MESSAGE_TYPE_FAILED;
String toStr = SipUri.getCanonicalSipContact(PjSipService.pjStrToString(to));
String reasonStr = PjSipService.pjStrToString(reason);
String bodyStr = PjSipService.pjStrToString(body);
int statusInt = status.swigValue();
Log.d(THIS_FILE, "SipMessage in on pager status " + status.toString() + " / " + reasonStr);
// Update the db
ContentResolver cr = pjService.service.getContentResolver();
ContentValues args = new ContentValues();
args.put(SipMessage.FIELD_TYPE, messageType);
args.put(SipMessage.FIELD_STATUS, statusInt);
if (statusInt != StatusCode.OK
&& statusInt != StatusCode.ACCEPTED) {
args.put(SipMessage.FIELD_BODY, bodyStr + " // " + reasonStr);
}
cr.update(SipMessage.MESSAGE_URI, args,
SipMessage.FIELD_TO + "=? AND " +
SipMessage.FIELD_BODY + "=? AND " +
SipMessage.FIELD_TYPE + "=" + SipMessage.MESSAGE_TYPE_QUEUED,
new String[] {
toStr, bodyStr
});
// Broadcast the information
Intent intent = new Intent(SipManager.ACTION_SIP_MESSAGE_RECEIVED);
intent.putExtra(SipMessage.FIELD_FROM, toStr);
pjService.service.sendBroadcast(intent, SipManager.PERMISSION_USE_SIP);
unlockCpu();
}