首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在kannel opensmppbox中定义自定义供应商特定错误代码

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

Stack Overflow用户
提问于 2016-08-18 20:10:34
回答 1查看 444关注 0票数 0

我在opensmppbox中添加了一个函数,但我需要为ESME用户生成特定于供应商的自定义错误代码

代码语言:javascript
复制
            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);

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-18 20:20:03

添加一个新的案例SMPP_ESME_RXXXXXXXXX:和您的状态消息

代码语言:javascript
复制
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及其错误代码

代码语言:javascript
复制
    /*
 * Some SMPP error messages we come across
 */
enum SMPP_ERROR_MESSAGES {
    SMPP_ESME_ROK = 0x00000000,
............
.............
    SMPP_ESME_RXXXXXXXXX = 0x00000432,
};

在代码中,

代码语言:javascript
复制
smpp_queued_response_pdu->pdu->u.data_sm_resp.command_status = SMPP_ESME_RXXXXXXXXX;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39017885

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档