Giuseppina Senzatela wrote: > Hi! > I'm working on a simple statefull proxy that should work in this way: > when it receives the INVITE, after the proxy-authentication process (that it works properly), I have to fwd the INVITE directly to the called UA. > > UA1 PROXY UA2 > > --INVITE-----> | --->INVITE--> > > I started from the statefull_proxy.c, and I'm working on it. > I'm trying to use the function pjsip_endpt_create_request_fwd() with a URI not NULL (it should be the URI of the called UA, I suppose). > > How can I get the URI of the called UA, in order to pass it to the function? You only get this information if you implement a registrar function in your proxy. As a registrar, you know exactly where the UA is currently reachable from. > P.S. I'm trying to print the calling URI on screen in this way, but it doesn't work ... I' m sure I'm missing something, am I? > > pjsip_uri *address; > > address = rdata->msg_info.msg->line.req.uri; > printf("ADDRESS: %s \n ", &address); pjsip_uri is not a string so that wouldn't work. Try this instead: char buf[PJSIP_MAX_URL_SIZE]; int len; len = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, address, buf, sizeof(buf)); if (len > 0) printf("ADDRESS: %s\n", buf); else puts("Buffer over flow"); cheers, -benny