how add header filed and what are the restrictions to add?

KU
kumar uppu
Sat, Jun 13, 2020 12:27 PM

Hi,
I am new to pjsip, I want to send some data with a new header field in
pjsip.
Like:

INVITE sip:123@XXX.XXX SIP/2.0
From: sip:123@XXX.XXX;tag=02509797-a5fd-4c94-8d66-92eb0df6bff5

To: sip:566@XXX.XXX

Contact: sip:123@XXX.XXX;ob

Call-ID: 74ec3d14-7734-46ea-9bf2-0ae92afdb8fc

CSeq: 1036 INVITE
My-own-header: <some data>

please give me example to add custom header in pjsip
what are the instructions to add header filed

Thanks,
Kumar

--
Kumar

Hi, I am new to pjsip, I want to send some data with a new header field in pjsip. Like: *INVITE sip:123@XXX.XXX SIP/2.0* *From: <sip:123@XXX.XXX>;tag=02509797-a5fd-4c94-8d66-92eb0df6bff5* *To: sip:566@XXX.XXX* *Contact: <sip:123@XXX.XXX;ob>* *Call-ID: 74ec3d14-7734-46ea-9bf2-0ae92afdb8fc* *CSeq: 1036 INVITE* *My-own-header: <some data>* please give me example to add custom header in pjsip what are the instructions to add header filed Thanks, Kumar -- Kumar
DA
Dirar Abu-Saymeh
Sat, Jun 13, 2020 12:56 PM

You have to be more specific about what part of pjsip you are using. Are you using PJSUA or PJSUA2 or some other platform. For PJSUA, the function  pjsua_call_make_call has the parameter msg_data which should contain the additional headers you want to add when starting the invite.

Sent from my iPhone

On Jun 13, 2020, at 8:27 AM, kumar uppu kumar94905@gmail.com wrote:


Hi,
I am new to pjsip, I want to send some data with a new header field in pjsip.
Like:
INVITE sip:123@XXX.XXX SIP/2.0
From: sip:123@XXX.XXX;tag=02509797-a5fd-4c94-8d66-92eb0df6bff5
To: sip:566@XXX.XXX
Contact: sip:123@XXX.XXX;ob
Call-ID: 74ec3d14-7734-46ea-9bf2-0ae92afdb8fc
CSeq: 1036 INVITE
My-own-header: <some data>

please give me example to add custom header in pjsip
what are the instructions to add header filed

Thanks,
Kumar

--
Kumar


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

You have to be more specific about what part of pjsip you are using. Are you using PJSUA or PJSUA2 or some other platform. For PJSUA, the function pjsua_call_make_call has the parameter msg_data which should contain the additional headers you want to add when starting the invite. Sent from my iPhone > On Jun 13, 2020, at 8:27 AM, kumar uppu <kumar94905@gmail.com> wrote: > >  > Hi, > I am new to pjsip, I want to send some data with a new header field in pjsip. > Like: > INVITE sip:123@XXX.XXX SIP/2.0 > From: <sip:123@XXX.XXX>;tag=02509797-a5fd-4c94-8d66-92eb0df6bff5 > To: sip:566@XXX.XXX > Contact: <sip:123@XXX.XXX;ob> > Call-ID: 74ec3d14-7734-46ea-9bf2-0ae92afdb8fc > CSeq: 1036 INVITE > My-own-header: <some data> > > please give me example to add custom header in pjsip > what are the instructions to add header filed > > Thanks, > Kumar > > -- > Kumar > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
GM
gabriel manea
Sat, Jun 13, 2020 2:14 PM

Hi,

a simple example for "P-Early-Media: inactive" :

{
const pj_str_t P_Early_Media_str = {(char*) "P-Early-Media", 13};
pj_str_t hdr_val;
pjsip_generic_string_hdr * hdr_name;
hdr_val = pj_str((char*) "inactive");
hdr_name = pjsip_generic_string_hdr_create(tdata->pool,
&P_Early_Media_str, &hdr_val);
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) hdr_name);
}

good luck!

On 13.06.2020 15:27, kumar uppu wrote:

Hi,
I am new to pjsip, I want to send some data with a new header field in
pjsip.
Like:

INVITE sip:123@XXX.XXX SIP/2.0

From: sip:123@XXX.XXX;tag=02509797-a5fd-4c94-8d66-92eb0df6bff5**

To: sip:566@XXX.XXX

**

Contact: sip:123@XXX.XXX;ob

**

Call-ID: 74ec3d14-7734-46ea-9bf2-0ae92afdb8fc

**

CSeq: 1036 INVITE

My-own-header: <some data>

please give me example to add custom header in pjsip
what are the instructions to add header filed

Thanks,
Kumar

--
Kumar


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi, a simple example for "P-Early-Media: inactive" : { const pj_str_t P_Early_Media_str = {(char*) "P-Early-Media", 13}; pj_str_t hdr_val; pjsip_generic_string_hdr * hdr_name; hdr_val = pj_str((char*) "inactive"); hdr_name = pjsip_generic_string_hdr_create(tdata->pool, &P_Early_Media_str, &hdr_val); pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) hdr_name); } good luck! On 13.06.2020 15:27, kumar uppu wrote: > Hi, > I am new to pjsip, I want to send some data with a new header field in > pjsip. > Like: > > *INVITE sip:123@XXX.XXX SIP/2.0* > > *From: <sip:123@XXX.XXX>;tag=02509797-a5fd-4c94-8d66-92eb0df6bff5*** > > *To: sip:566@XXX.XXX* > > ** > > *Contact: <sip:123@XXX.XXX;ob>* > > ** > > *Call-ID: 74ec3d14-7734-46ea-9bf2-0ae92afdb8fc* > > ** > > *CSeq: 1036 INVITE* > > *My-own-header: <some data>* > > please give me example to add custom header in pjsip > what are the instructions to add header filed > > Thanks, > Kumar > > -- > Kumar > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org