Hi,
I'm trying to add some header on Transmit Data thanks to the callback call_on_tsx_state_changed from a module session invite, but when I see the trace of my SIP message, there aren't any modification : No Subject Header.
static void call_on_tsx_state_changed( pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e ){ /*pjsip_tx_data tdata; pjsip_generic_string_hdr hsubject; pj_str_t name; pj_str_t value;
name = pj_str("Subject"); value = pj_str("PJSIP_UA");
puts("Subject"); puts("PJSIP_UA");
if(e->type == PJSIP_EVENT_TX_MSG) { tdata = e->body.tx_msg.tdata; hsubject = pjsip_generic_string_hdr_create(tdata->pool, &name, &value); pjsip_msg_insert_first_hdr(tdata->msg, (pjsip_hdr) hsubject); }/}
I have tried pjsip_msg_add_hdr too.
I use simpleUA example and the following page to do my code.
http://trac.pjsip.org/repos/wiki/SIP_Message_Buffer_Event#GettingtheSIPMessagefrompjsip_event
May be there is a bug ?
Thanks by advance for responses.
Cédric.
Installez gratuitement les 20 émôticones Windows Live Messenger les plus fous ! Cliquez ici !
http://www.emoticones-messenger.fr/
By some test I see that PJSIP_EVENT_TX_MSG was not the good event.
With PJSIP_EVENT_TSX_STATE I enter in the condition, but I have the same error.
From: levequecedric@hotmail.comTo: pjsip@lists.pjsip.orgDate: Wed, 17 Sep 2008 12:04:30 +0200Subject: [pjsip] on_tsx_state_changed - Adding header.
Hi, I'm trying to add some header on Transmit Data thanks to the callback call_on_tsx_state_changed from a module session invite, but when I see the trace of my SIP message, there aren't any modification : No Subject Header. static void call_on_tsx_state_changed( pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e ){ /*pjsip_tx_data tdata; pjsip_generic_string_hdr hsubject; pj_str_t name; pj_str_t value; name = pj_str("Subject"); value = pj_str("PJSIP_UA"); puts("Subject"); puts("PJSIP_UA"); if(e->type == PJSIP_EVENT_TX_MSG) { tdata = e->body.tx_msg.tdata; hsubject = pjsip_generic_string_hdr_create(tdata->pool, &name, &value); pjsip_msg_insert_first_hdr(tdata->msg, (pjsip_hdr) hsubject); }/}I have tried pjsip_msg_add_hdr too. I use simpleUA example and the following page to do my code.http://trac.pjsip.org/repos/wiki/SIP_Message_Buffer_Event#GettingtheSIPMessagefrompjsip_event May be there is a bug ? Thanks by advance for responses. Cédric.
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant !
Email envoyé avec Windows Live Hotmail. Dites adieux aux spam et virus, passez à Hotmail ! C'est gratuit !
http://www.windowslive.fr/hotmail/default.asp
On Wed, Sep 17, 2008 at 11:33 AM, cedric leveque
levequecedric@hotmail.comwrote:
By some test I see that PJSIP_EVENT_TX_MSG was not the good event.
With PJSIP_EVENT_TSX_STATE I enter in the condition, but I have the same
error.
You probably need to invalidate the transmit data so that the message is
re-printed to the message buffer. This can be done by using
pjsip_tx_data_invalidate_msg(tdata).
I don't normally use this callback to modify the message so I'm not sure if
this is the case, but you can try it yourself.
-benny
From: levequecedric@hotmail.com
To: pjsip@lists.pjsip.org
Date: Wed, 17 Sep 2008 12:04:30 +0200
Subject: [pjsip] on_tsx_state_changed - Adding header.
Hi,
I'm trying to add some header on Transmit Data thanks to the callback
call_on_tsx_state_changed from a module session invite, but when I see the
trace of my SIP message, there aren't any modification : No Subject Header.
static void call_on_tsx_state_changed( pjsip_inv_session *inv,
pjsip_transaction *tsx,
pjsip_event *e )
{
/*pjsip_tx_data tdata;
pjsip_generic_string_hdr hsubject;
pj_str_t name;
pj_str_t value;
name = pj_str("Subject");
value = pj_str("PJSIP_UA");
puts("Subject");
puts("PJSIP_UA");
if(e->type == PJSIP_EVENT_TX_MSG)
{
tdata = e->body.tx_msg.tdata;
hsubject = pjsip_generic_string_hdr_create(tdata->pool, &name,
&value);
pjsip_msg_insert_first_hdr(tdata->msg, (pjsip_hdr) hsubject);
}/
}
I have tried pjsip_msg_add_hdr too.
I use simpleUA example and the following page to do my code.
http://trac.pjsip.org/repos/wiki/SIP_Message_Buffer_Event#GettingtheSIPMessagefrompjsip_event
May be there is a bug ?
Thanks by advance for responses.
Cédric.
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le
maintenant ! http://www.windowslive.fr/messenger/1.asp
Qui vous permet d'enregistrer la TV sur votre PC et lire vos emails sur
votre mobile ? la réponse en vidéo la réponse en vidéohttp://www.microsoft.com/france/windows/bts/default.mspx
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Thanks for all your solution,
I tried these all things to managed PRACK after this creation by Invite session.
I think use the solution of the module to do it.
I'm reading again the developpers guide, and I understand more thing that at my first reading.
Cédric.
Date: Mon, 22 Sep 2008 00:02:59 +0100From: bennylp@pjsip.orgTo: pjsip@lists.pjsip.orgSubject: Re: [pjsip] on_tsx_state_changed - Adding header.
On Wed, Sep 17, 2008 at 11:33 AM, cedric leveque levequecedric@hotmail.com wrote:
By some test I see that PJSIP_EVENT_TX_MSG was not the good event.With PJSIP_EVENT_TSX_STATE I enter in the condition, but I have the same error.
You probably need to invalidate the transmit data so that the message is re-printed to the message buffer. This can be done by using pjsip_tx_data_invalidate_msg(tdata).I don't normally use this callback to modify the message so I'm not sure if this is the case, but you can try it yourself. -benny
From: levequecedric@hotmail.comTo: pjsip@lists.pjsip.orgDate: Wed, 17 Sep 2008 12:04:30 +0200Subject: [pjsip] on_tsx_state_changed - Adding header.
Hi, I'm trying to add some header on Transmit Data thanks to the callback call_on_tsx_state_changed from a module session invite, but when I see the trace of my SIP message, there aren't any modification : No Subject Header. static void call_on_tsx_state_changed( pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e ){ /*pjsip_tx_data tdata; pjsip_generic_string_hdr hsubject; pj_str_t name; pj_str_t value; name = pj_str("Subject"); value = pj_str("PJSIP_UA"); puts("Subject"); puts("PJSIP_UA"); if(e->type == PJSIP_EVENT_TX_MSG) { tdata = e->body.tx_msg.tdata; hsubject = pjsip_generic_string_hdr_create(tdata->pool, &name, &value); pjsip_msg_insert_first_hdr(tdata->msg, (pjsip_hdr) hsubject); }/}I have tried pjsip_msg_add_hdr too. I use simpleUA example and the following page to do my code.http://trac.pjsip.org/repos/wiki/SIP_Message_Buffer_Event#GettingtheSIPMessagefrompjsip_event May be there is a bug ? Thanks by advance for responses. Cédric.
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant !
Qui vous permet d'enregistrer la TV sur votre PC et lire vos emails sur votre mobile ? la réponse en vidéo la réponse en vidéo_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Installez gratuitement les 20 émôticones Windows Live Messenger les plus fous ! Cliquez ici !
http://www.emoticones-messenger.fr/