基于resip协议栈的b2bua代理服务器设计

博客提到GB28181要求中心信令服务器以b2bua模式设计。通过学习resip协议栈,可知其中AppDialog可指定端到端对话关系,能借此实现b2bua的左右两个呼叫,还提及继承自AppDialog的CDniuAppDialog类用于加入自定义变量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我们知道GB28181中要求中心信令服务器以b2bua模式进行设计。

通过对resip协议栈的学习,我们可以了解到,在resip协议栈中AppDialog是用来指定端到端的一段对话关系的,所以我们可以通过AppDialog来实现b2bua的左右两个呼叫。

参考:

/**
*   description:
*       implement b2bua call core class.
*
*
*   author:     YangDong
*   date:       2019-05-12
*   email:      heibao111728@126.com
*   home_page:  https://blog.youkuaiyun.com/heibao111728
*/

#ifndef __DNIUB2BUACALL_H__
#define __DNIUB2BUACALL_H__

#include "resip/stack/Uri.hxx"
#include "resip/dum/DialogUsageManager.hxx"
#include "resip/dum/AppDialogSetFactory.hxx"
#include "resip/dum/RegistrationPersistenceManager.hxx"
#include "resip/dum/DialogSetId.hxx"
#include "resip/dum/AppDialog.hxx"
#include "resip/dum/Handles.hxx"
//#include "DniuAppDialogSet.h"

using namespace resip;

typedef enum _DniuB2buaCallStatus
{
    _NONE = 0,
    _LEFTCALL_INVITE,
    _LEFTCALL_200OK,
    _LEFTCALL_ACK,
    _LEFTCALL_BYE,
    _RIGHTCALL_INVITE,
    _RIGHTCALL_200OK,
    _RIGHTCALL_ACK,
    _RIGHTCALL_BYE,
    _TERMINATE
} DniuB2buaCallStatus;

class CDniuAppDialog;
class CDniuAppDialogSet;
class CDniuAppDialogSetFactory;

class CDniuB2buaCall
{
public:
    CDniuB2buaCall(RegistrationPersistenceManager* RegistrationPersistenceManager, NameAddr target, DialogUsageManager& dum, CDniuAppDialog* appDialog);
    virtual ~CDniuB2buaCall();

    DniuB2buaCallStatus getCallState();
    void SetCallState(DniuB2buaCallStatus state);
    bool isComplete();

    void process();

    void doRightInviteWithSdp();
    void doResponse200OKWithSdpToLeftCall();
    void doAckToRightCall();
    void doByeToRightCall();
    Data generateSsrc();

    CDniuAppDialog* getLeftAppDialog();
    CDniuAppDialog* getRightAppDialog();

    void setRightAppDialog(CDniuAppDialog* appDialog);


private:
    DniuB2buaCallStatus m_state;

    NameAddr        m_target;

    CDniuAppDialog*      m_leftAppDialog;
    CDniuAppDialog*      m_rightAppDialog;
    CDniuAppDialogSet*   m_rightAppDialogSet;

    DialogUsageManager& m_dum;
    RegistrationPersistenceManager* m_RegistrationPersistenceManager; //used to implement 28181 dns

public:
    Data m_leftCallSdp;
    Data m_rightCallSdp;
};


#endif

上述代码中CDniuAppDialog是继承自AppDialog的类,目的是加入自定义的变量。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

heibao111728

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值