问题描述
我正在 pjsip sdk 顶部的ios项目和虹吸类中使用Sip.
I am using Sip in my ios projects and siphon classes on top of pjsip sdk .
我对基本配置没问题,因此,每当我进行Sip呼叫时,都需要向Sip标头中添加一些自定义数据.
I have no problem with basic configuration and therefore I need to add some custom data to my sip header whenever I make a sip call.
我具有以下标头格式
邀请sip:xxx9 @ xxxxxx SIP/2.0
INVITE sip:xxx9@xxxxxx SIP/2.0
通过:SIP/2.0/UDP xxxxx:xxx; rport; branch = z9hG4bKPjt.fUN05fzpwxbm5zJvjoGSA.bnLvoAHl
Via: SIP/2.0/UDP xxxxx:xxx;rport;branch=z9hG4bKPjt.fUN05fzpwxbm5zJvjoGSA.bnLvoAHl
最大前进次数:70
发件人:sip:xxxx @ xxxxx; tag = d1Ww0T4iQNqygphKlqLQ.iNcYx-Cdsb2
From: sip:xxxx@xxxxx;tag=d1Ww0T4iQNqygphKlqLQ.iNcYx-Cdsb2
收件人:sip:xxxx @ xxxxxxxx
To: sip:xxxx@xxxxxxxx
联系人:
呼叫ID:a3zCaQtWPsnKrlbyYtLwwhUQgxnLs8hv
Call-ID: a3zCaQtWPsnKrlbyYtLwwhUQgxnLs8hv
CSeq:31730邀请
CSeq: 31730 INVITE
允许:PRACK,INVITE,ACK,BYE,取消,更新,订阅,通知,引用,消息,选项
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
支持:替换,100rel,计时器,norefersub
Supported: replaces, 100rel, timer, norefersub
会话过期:1800
最低SE:90
用户代理:Siphon PjSip v2.0.1svn/arm-apple-darwin9
User-Agent: Siphon PjSip v2.0.1svn/arm-apple-darwin9
; sdsd:BLABLABLA
;sdsd: BLABLABLA
内容类型:application/sdp
Content-Type: application/sdp
内容长度:448
v = 0
o =-3563345387 3563345387输入IP4 192.168.1.3
o=- 3563345387 3563345387 IN IP4 192.168.1.3
s = pjmedia
s=pjmedia
b = AS:84
b=AS:84
t = 0 0
a = X-nat:0
a=X-nat:0
m =音频40000 RTP/AVP 98 97 99 104 3 0 8 96
m=audio 40000 RTP/AVP 98 97 99 104 3 0 8 96
c = IN IP4 192.168.1.3
c=IN IP4 192.168.1.3
b = TIAS:64000
b=TIAS:64000
a = rtcp:40001输入IP4 192.168.1.3
a=rtcp:40001 IN IP4 192.168.1.3
a = sendrecv
a=sendrecv
a = rtpmap:98 speex/16000
a=rtpmap:98 speex/16000
a = rtpmap:97 speex/8000
a=rtpmap:97 speex/8000
a = rtpmap:99 speex/32000
a=rtpmap:99 speex/32000
a = rtpmap:104 iLBC/8000
a=rtpmap:104 iLBC/8000
a = fmtp:104模式= 30
a=fmtp:104 mode=30
a = rtpmap:3 GSM/8000
a=rtpmap:3 GSM/8000
a = rtpmap:0 PCMU/8000
a=rtpmap:0 PCMU/8000
a = rtpmap:8 PCMA/8000
a=rtpmap:8 PCMA/8000
a = rtpmap:96电话事件/8000
a=rtpmap:96 telephone-event/8000
a = fmtp:96 0-15
a=fmtp:96 0-15
-结束msg-
我想更改以下两行
收件人:sip:xxxx @ xxxxxxxx
To: sip:xxxx@xxxxxxxx
看起来像这样
收件人:sip:xxxx @ xxxxxxxx
To: sip:xxxx@xxxxxxxx
就是这样.
请提供一些清晰度.
推荐答案
pjsip使用pjsua_call_make_call
API进行呼叫.在其中,它会创建一个对话框,其中包含对pjsip_dlg_create_uac
的调用.您可以将自定义标头传递给此API.详细信息此处
pjsip uses pjsua_call_make_call
API to make a call. Inside this it creates a dialog with a call to pjsip_dlg_create_uac
. You can pass your custom headers to this API. More information here
这篇关于pjsip sip标头配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!