我在我的 ios 项目中使用 Sip,并在 pjsip sdk 之上使用 siphon 类。
我对基本配置没有问题,因此每当我进行 sip 调用时,我都需要向我的 sip header 添加一些自定义数据。
我有以下标题格式
pjsua_core.c . TX 1123 bytes Request msg INVITE/cseq=31730 (tdta0x92aa400) to UDP xxxxx: 5060:
INVITE sip:xxx9@xxxxxx SIP/2.0
Via: SIP/2.0/UDP xxxxx:xxx;rport;branch=z9hG4bKPjt.fUN05fzpwxbm5zJvjoGSA.bnLvoAHl
Max-Forwards: 70
From: sip:xxxx@xxxxx;tag=d1Ww0T4iQNqygphKlqLQ.iNcYx-Cdsb2
To: sip:xxxx@xxxxxxxx
Contact:
Call-ID: a3zCaQtWPsnKrlbyYtLwwhUQgxnLs8hv
CSeq: 31730 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: Siphon PjSip v2.0.1svn/arm-apple-darwin9
;sdsd: BLABLABLA
Content-Type: application/sdp
Content-Length: 448
v=0
o=- 3563345387 3563345387 IN IP4 192.168.1.3
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 40000 RTP/AVP 98 97 99 104 3 0 8 96
c=IN IP4 192.168.1.3
b=TIAS:64000
a=rtcp:40001 IN IP4 192.168.1.3
a=sendrecv
a=rtpmap:98 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:99 speex/32000
a=rtpmap:104 iLBC/8000
a=fmtp:104 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
--结束消息--
我想改下面两行
From: sip:xxxx@xxxxx;tag=d1Ww0T4iQNqygphKlqLQ.iNcYx-Cdsb2
To: sip:xxxx@xxxxxxxx
看起来像这样
From: sip:xxxx@xxxxx;tag=d1Ww0T4iQNqygphKlqLQ.iNcYx-Cdsb2;textid=1 ;texfrom=2;textto=4
To: sip:xxxx@xxxxxxxx
就是这样。
请提供一些清晰度。
最佳答案
pjsip 使用 pjsua_call_make_call
API 进行调用。在此内部,它创建了一个调用 pjsip_dlg_create_uac
的对话框。您可以将自定义 header 传递给此 API。更多信息 here
关于iphone - pjsip sip header 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13658076/