我在opensmppbox中添加了一个函数,但我需要为ESME用户生成特定于供应商的自定义错误代码
octstr_destroy(smpp_queued_response_pdu->pdu->u.data_sm_resp.message_id);
smpp_queued_response_pdu->pdu->u.data_sm_resp.message_id = NULL;
smpp_queued_response_pdu->pdu->u.data_sm_resp.command_status = **CUSTOM STATUS HERE**;
msg_destroy(smpp_queued_response_pdu->msg);
smpp_queued_response_pdu->msg = NULL;
smpp_queues_add_outbound(smpp_queued_response_pdu);如何添加自定义错误代码?
发布于 2016-08-18 20:20:03
添加一个新的案例SMPP_ESME_RXXXXXXXXX:和您的状态消息
const char *smpp_error_to_string(enum SMPP_ERROR_MESSAGES error)
{
switch (error) {
case SMPP_ESME_ROK:
.........
...............
case SMPP_ESME_RXXXXXXXXX:
return "Your return status message";
default:
/* tell the user that we have a vendor-specific beast here */
if (error >= 0x0400 && error <= 0x04FF)
return "Vendor-specific error, please refer to your SMPP provider";
else
return "Unknown/Reserved";
}您已经在gw/smsc/smpp_pdu.h中定义了SMPP_ESME_RXXXXXXXXX及其错误代码
/*
* Some SMPP error messages we come across
*/
enum SMPP_ERROR_MESSAGES {
SMPP_ESME_ROK = 0x00000000,
............
.............
SMPP_ESME_RXXXXXXXXX = 0x00000432,
};在代码中,
smpp_queued_response_pdu->pdu->u.data_sm_resp.command_status = SMPP_ESME_RXXXXXXXXX;https://stackoverflow.com/questions/39017885
复制相似问题