如何在 kannel opensmppbox 中定义自定义供应商特定的错误代码

How to define custom vendor specific err code in kannel opensmppbox

我在 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);

如何添加自定义错误代码?

添加一个新案例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;