pjsip - 如何确保 SDP 在 INVITE 的多部分消息正文中排在首位
问题描述
使用 pjsua2 拨打电话时,我想在邀请中包含其他信息。为此,我使用了 pjsip/pjsua2 的多部分功能。
但是,希望我的应用程序可以与不支持多部分的其他应用程序一起使用。因此,我希望 SDP 部分成为第一部分。
示例代码:
void MyAccount::makeCall(const std::string& dst_uri)
{
auto call = std::make_shared<MyCall>(*this);
pj::CallOpParam prm(true); // Use default call settings
prm.opt.audioCount = 1;
prm.opt.videoCount = 0;
pj::SipMultipartPart xmlDocMcptt;
xmlDocMcptt.contentType.type = "application";
xmlDocMcptt.contentType.subType = "whatever+xml";
xmlDocMcptt.body = "<?xml version=\"1.0\"?>\
<sample-xml>\
<sample-params type=\"Test\"/>\
<sample-sub>\
<tt>Test</tt>\
</sample-sub>\
</sample-xml>";
prm.txOption.multipartContentType.type = "multipart";
prm.txOption.multipartContentType.subType = "mixed";
prm.txOption.msgBody.clear();
prm.txOption.multipartParts.emplace_back(xmlDocMcptt);
pj::Endpoint::instance().utilLogWrite(1, "MyAccount", std::string("*** makeCall: headers.size()=") + std::to_string(prm.txOption.headers.size()) + ", multiparts=" + std::to_string(prm.txOption.multipartParts.size()));
call->makeCall(dst_uri, prm);
calls_[call->getInfo().id] = call;
}
解决方案
推荐阅读
- bash - 重命名文件保留基本名称添加额外的单词和更改扩展名
- c++ - 无法在 SFML 中加载字体
- c# - Microsoft Graph 客户端 - 检索超过 15 个用户?
- material-ui - 材质 ui DataDrid 分页样式
- git - 将 tar.gz 上传到 github 发布资产时出现 curl 错误
- amazon-web-services - 授予对组织中所有委托人的 S3 存储桶访问权限
- php - 通过 Vonage(tokbox)广播视频面临的问题
- react-native - 我的 OnPress 没有链接到我制作的屏幕 - React Native
- php - Wordpress:服务器迁移后/wp-admin 权限被拒绝
- javascript - 页面刷新时如何保持状态?