[asterisk-dev] Virtual IP Adresses and SIP requests failing...

Mr. James W. Laferriere babydr at baby-dragons.com
Thu Jul 5 00:23:07 CDT 2007


 	Hello Tilgham ,

On Wed, 4 Jul 2007, Tilghman Lesher wrote:
> On Wednesday 04 July 2007, King Ho wrote:
>> I think what Tilghman said is not exactly correct. That is, asterisk will
>> not be able to control how the packet is routed BUT asterisk DOES have
>> control of which IP address the response uses for the "source ip address"
>> of the packet. That is, if I send a sip register request to asterisk at
>> address x.x.x.x, I expect asterisk to response using the same x.x.x.x
>> address as the
>> source ip address in the response, even though asterisk won't be able to
>> control how the packet is routed.
>
> What I said was exactly how it is implemented TODAY.  I should know; I wrote
> the initial implementation.  It has since been supplanted by MUCH better code
> (and more portable, to boot).
>
>> After some googling, I found that you can use setsockopt and IP_PKTINFO to
>> get the destination address and set the source address. I found a web page
>> with a complete example for a recvfromto() which will provide the
>> destination address in addition to the regular stuff that recvfrom()
>> provides.
>
> As I said before, it isn't that we don't know how, it's that it hasn't been
> done yet.  I actually wrote sample code for Mark that does IP_PKTINFO way back
> in the pre-1.0 days (2002, specifically), and it was rejected, because at the
> time, he needed to know which address to send an original packet from (not
> just responses).  That sample code can still be found here:
> http://asterisk.drunkcoder.com/hacks/udpserver.c
>
> We ARE going to implement this, by having Asterisk bind to multiple addresses.
> That is coming, with Marc's IPv6 implementation, as discussed at AstriDevCon
> 2007.
 	Thank you ,  This is very good to know .
 	Now a further question .  Is the implementation coming 'with' or as an
 	'integral part' of the ipv6 implementation ?
 		Tia ,  JimL
-- 
+-----------------------------------------------------------------+
| James   W.   Laferriere | System   Techniques | Give me VMS     |
| Network        Engineer | 663  Beaumont  Blvd |  Give me Linux  |
| babydr at baby-dragons.com | Pacifica, CA. 94044 |   only  on  AXP |
+-----------------------------------------------------------------+



More information about the asterisk-dev mailing list