On Wed, Sep 17, 2008 at 11:33 AM, cedric leveque <levequecedric at 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@xxxxxxxxxxx > To: pjsip at lists.pjsip.org > Date: Wed, 17 Sep 2008 12:04:30 +0200 > Subject: 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?o<http://www.microsoft.com/france/windows/bts/default.mspx> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080922/92210d76/attachment-0001.html