PJSIP pjsua_call_reinvite添加自定义字段

在调用pjsua_call_reinvite添加自定义字段时可以使用以下代码
pj_caching_pool cp;
pj_pool_t* pool;
pj_caching_pool_init(&cp, &pj_pool_factory_default_policy, 0);
pool = pj_pool_create(&cp.factory, “header”, 1000, 1000, NULL);

pj_str_t hname = pj_str(“Test”);
pj_str_t hvalue = pj_str(“111”);
pjsip_generic_string_hdr* add_hdr = pjsip_generic_string_hdr_create(pool, &hname, &hvalue);
pj_list_push_back(&msg_data.hdr_list, add_hdr);

case CMSIP_REQUEST_SIP_CALL: { pjsua_call_id call_id; pjsua_acc_id accId = -1; char contactArray[1][MAX_URI_LEN] = {{0}}; pj_status_t status = PJ_SUCCESS; pjsua_call_other other; CMSIP_SIP_CALL* pCall = (CMSIP_SIP_CALL*)pPacket->body; CMSIP_PRINT("================SIP CALL================================"); CMSIP_PRINT("type[%d] acc[%d],seq[%d],dst[%s]", pCall->type, pCall->accId, pCall->seq, pCall->destUri); #if defined(INCLUDE_SIP_INVITE_PRIORITY) CMSIP_PRINT("isWarmCall[%d]", pCall->isWarmCall); #endif /* INCLUDE_SIP_INVITE_PRIORITY */ CMSIP_PRINT("========================================================"); # if defined(SUPPORT_IPCALL_NO_ACCOUNT) && SUPPORT_IPCALL_NO_ACCOUNT==0 CMSIP_ASSERT(pCall->accId >= 0); # endif # if defined(SUPPORT_IPCALL_NO_ACCOUNT) && SUPPORT_IPCALL_NO_ACCOUNT!=0 if (pCall->accId >= 0) # endif accId = pjsua_acctIndexMap_cmToSip(pCall->accId); memset(&other, 0, sizeof(pjsua_call_other)); #if defined(INCLUDE_SIP_INVITE_PRIORITY) other.isWarmCall = pCall->isWarmCall; #endif /* INCLUDE_SIP_INVITE_PRIORITY */ pjsua_msg_data_init(&msg_data); pj_str_t tmp; tmp = pj_str(pCall->destUri); if (CMSIP_CALL_GENERIC == pCall->type) { status = pjsua_call_make_call(accId, &tmp, pCall->seq, 0, NULL, &msg_data, &other, &call_id); } else if (CMSIP_CALL_ANONYMOUS == pCall->type) { status = pjsua_call_make_call(accId, &tmp, pCall->seq, pj_call_anonymous, NULL, &msg_data, &other, &call_id); } else if (CMSIP_CALL_PSTN == pCall->type) { status = pjsua_call_make_call(accId, &tmp, pCall->seq, pj_call_pstn, NULL, &msg_data, &other, &call_id); } else if (CMSIP_CALL_T38 == pCall->type) { status = pjsua_call_make_call(accId, &tmp, pCall->seq, pj_call_t38, NULL, &msg_data, &other, &call_id); } #ifdef INCLUDE_VOICEAPP else if (CMSIP_CALL_VOICEAPP == pCall->type) { status = pjsua_call_make_call(accId, &tmp, pCall->seq, pj_call_voiceapp, NULL, &msg_data, &other, &call_id); } else if (CMSIP_CALL_VOICEAPP_ANONYMOUS == pCall->type) { status = pjsua_call_make_call(accId, &tmp, pCall->seq, pj_call_voiceapp_anonymous, NULL, &msg_data, &other, &call_id); } #endif /* INCLUDE_VOICEAPP */ if (PJ_SUCCESS == status) { cmsip_send_callStatus(CMSIP_CALL_GENERIC, call_id, pCall->seq, 100, contactArray, 1); } }在哪构造sip报文的
10-21
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

小加藤

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

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

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

打赏作者

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

抵扣说明:

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

余额充值