default next hop for proxy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Brocha Strous wrote:
> I was able to gather some more information:
> 
> The message is sent out. However, my proxy is listening on multiple
> ports and the request is forwarded using a different port then it came
> in on. How do I force the request to go out (to the next hop) using the
> same transport as the one it came in on?

I think you can do this:

  {
   pjsip_tpselector tpsel;

   pj_bzero(&tpsel, sizeof(tpsel));
   tpsel.type = PJSIP_TPSELECTOR_TRANSPORT;
   tpsel.u.transport = rdata->tp_info.transport;

   pjsip_tx_data_set_transport(tdata, &tpsel);
  }

I have not tried this myself, but I think it should work (for UDP, 
at least).

cheers,
  -benny


> Thanks,
> Brocha 
> 
> -----Original Message-----
> From: pjsip-bounces@xxxxxxxxxxxxxxx
> [mailto:pjsip-bounces at lists.pjsip.org] On Behalf Of Brocha Strous
> Sent: Tuesday, December 25, 2007 11:40 AM
> To: pjsip at pjsip.org
> Subject: default next hop for proxy
> 
> Hi,
> I tried modifying the proxy.h proxy_calculate_target function instead of
> rejecting messages that are sent to me with no other routing information
> forward them to a static next hop so at the end of the function I added
> instead of the 404 not found code:
> 
>     if (is_uri_local(target)) 
> 	{
> 		// pjsip_host_port	 global.defNextHop is
> intitialized 
> 		// somewhere else
> 
> 		target->host = global.defNextHop.host;
> 		target->port = global.defNextHop.port;
> 		proxy_postprocess(tdata);
>     }
> 
> This does not seem to work. The message is logged as going to the right
> place with the right transport but it does not actually get sent. What
> am I missing?
> 
> Thanks,
> Brocha




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux