pjsip sip header configuration

人走茶凉 提交于 2019-12-23 14:56:07

问题


I am using Sip in my ios projects and siphon classes on top of pjsip sdk .

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.

I have the following header format

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

--end msg--

I want to change the following two lines

From: sip:xxxx@xxxxx;tag=d1Ww0T4iQNqygphKlqLQ.iNcYx-Cdsb2

To: sip:xxxx@xxxxxxxx

to look like this

From: sip:xxxx@xxxxx;tag=d1Ww0T4iQNqygphKlqLQ.iNcYx-Cdsb2;textid=1 ;texfrom=2;textto=4

To: sip:xxxx@xxxxxxxx

just like that.

Kindly, provide some clarity.


回答1:


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



来源:https://stackoverflow.com/questions/13658076/pjsip-sip-header-configuration

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!