I'm very stupid. I send 183 before modify it :( Sorry for this stupid mail. C?dric. From: levequecedric@hotmail.comTo: pjsip at lists.pjsip.orgDate: Tue, 14 Oct 2008 12:17:41 +0200Subject: Adding Contact on 183 response. Hi everybody, Actually I modify the simpleua example to manage Early message. So when I received a message I construct a 183 response like a 180. It's works well but the method, used, does not generate a Contact header in message.So I trying to add it like this : /* * Initially send 183 response. * * The very first response to an INVITE must be created with * pjsip_inv_initial_answer(). Subsequent responses to the same * transaction MUST use pjsip_inv_answer(). */ status = pjsip_inv_initial_answer(g_inv, rdata, 183, NULL, NULL, &tdata); PJ_ASSERT_RETURN(status == PJ_SUCCESS, PJ_TRUE); hsubject = pjsip_generic_string_hdr_create(tdata->pool, &name, &value); pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) hsubject); /* Send the 183 response. */ status = pjsip_inv_send_msg(g_inv, tdata); PJ_ASSERT_RETURN(status == PJ_SUCCESS, PJ_TRUE); /* Local Contact. */ puts("get contact by pj_gethostip"); if (pj_gethostip(AF, &hostaddr2) != PJ_SUCCESS) { app_perror(THIS_FILE, "Unable to retrieve local host IP", status); } puts("Stock it in hostaddr2"); pj_sockaddr_print(&hostaddr2, hostip2, sizeof(hostip2), 2); puts("construct l_uri"); pj_ansi_sprintf(l_uri, "<sip:B2BUA@%s:%d>", hostip2, SIP_PORT); puts("l_uri"); puts(l_uri); puts("store to local_contact2"); local_contact2 = pj_str(l_uri); puts("Contactname"); puts(Contactname.ptr); puts("Generate hcontact2"); hcontact2 = pjsip_generic_string_hdr_create(tdata->pool, &Contactname, &local_contact2); puts("Add in Tdata"); pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*) hcontact2); puts("end"); /* * Managed Prack request after sending 183. */ status = pjsip_100rel_on_rx_prack( g_inv, rdata); if (status != PJ_SUCCESS) { app_perror(THIS_FILE, "Problems in managing PRACK", status); return 1; } There is not error message, but in result no header contact is added. I don't uderstand why. Thanks in advance for your help. C?dric. Souhaitez vous ? ?tre au bureau sans y ?tre ? ? Oui je le veux ! _________________________________________________________________ Installez gratuitement les 20 ?m?ticones Windows Live Messenger les plus fous ! Cliquez ici ! http://www.emoticones-messenger.fr/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20081014/e80a7ad7/attachment.html>