Hello, the NTA page show an example of a stateless proxy using 302 REDIRECT stuffs. Instead i want to write a statefull proxy that will stay into the message path using "Record-Route" header and "lr=" param.
How do i do this for example for an INVITE? Its not clear with API i should use to route a request that reached my sofia-test-proxy from the contact A to contact B. I mean: 1. A register on me and i answer 200 OK 2. B register on me and i answer 200 OK 3. A INVITE B thru me a. i reply 100 Trying to A b. i forward the INVITE to B and wait for 200 OK 4. if B answer me 200 OK i forward it to A and wait for ACK Actually this is my main function: su_root_t *registrar_root = NULL; nta_agent_t *registrar_agent = NULL; nta_leg_t *registrar_leg = NULL; registrar_root = su_root_create(NULL); if (!registrar_root) { printf( CONSOLE_ERROR "registar_root = su_root_create(NULL) FAILED\n" ); exit(1); } registrar_agent = nta_agent_create( registrar_root, NULL, NULL, NULL, NTATAG_CLIENT_RPORT(1), NTATAG_EXTRA_100(1), NTATAG_MAX_FORWARDS(10), NTATAG_REL100(1), NTATAG_SIPFLAGS(MSG_FLG_COMPACT), TAG_END() ); if (!registrar_agent) { printf( CONSOLE_ERROR "registrar_agent = nta_agent_create(...) FAILED\n" ); exit(1); } registrar_leg = nta_leg_tcreate( registrar_agent, leg_process, NULL, NTATAG_NO_DIALOG(1), TAG_END() ); su_root_run(registrar_root); nta_agent_destroy(registrar_agent); su_root_destroy(registrar_root); And this is where i'm proccessing requests at the moment: int leg_process( nta_leg_magic_t *lmagic, nta_leg_t *leg, nta_incoming_t *irq, sip_t const *sip) { printf( CONSOLE_TODO "got a message in leg_process ...\n" ); switch (sip->sip_request->rq_method) { case sip_method_register: return 200; case sip_method_subscribe: return 200; default: printf( CONSOLE_TODO "i dunno how to handle this...\n" ); } return 0; } Ok now i need to forward INVITE and its not clean to me wich API does this job. Regards, Antonio Gallo ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel