<div>Hi Daniel,</div>
<div>I'll try to use the force_send_sock function, maybe this solve the issue;</div>
<div>btw I don't think it is a strictly Asterisk related problem,</div>
<div> </div>
<div>thank you for the hint,</div>
<div> </div>
<div>C.<br><br> </div>
<div><span class="gmail_quote">2008/11/5, Daniel-Constantin Mierla <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>>:</span>
<div><span class="e" id="q_11d7209a593bb753_1">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello,<span><br><br>On 11/05/08 16:36, Cosimo Fadda wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi everybody<br>I'd like to implement this scenario:<br><br>----------- ------------------- ---------------<br>
| GW/FW |<----LAN1---->|eth0|Openser|eth1|<----LAN2---->|eth0|asterisk| -->PSTN<br>----------- ------------------- | ---------------<br> |_______________________________________________| <br>
<br>Where:<br>- Openser is reachable from the outside with a public IP forwarded to eth0 private address;<br><br>- Asterisk is connected to Openser using another separated LAN<br>- Openser acts as proxy (for requests coming from the outside) and Asterisk act as registrar and gateway.<br>
<br><br>This is the description, now the questions:<br>-since opneser has two different nics, how can configure it to properly send register request to asterisk?<br> <br></blockquote></span>if you want to force an interface for outgoing sip requests, see force_send_sock() function:<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:1.4.x#force_send_socket_protoaddress_port" target="_blank">http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:1.4.x#force_send_socket_protoaddress_port</a>
<div><span><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">This is what currently happens:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.40.68:5060/" target="_blank">192.168.40.68:5060</a>: is eth0 Openser Address<br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.12.165/" target="_blank">192.168.12.165</a> is eth1 Openser Address<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.12.106/" target="_blank">192.168.12.106</a> is Asterisk address<br>
82.187.X.X is Openser public address<br>Network 192.168.40.X is not reachable from net 192.168.12.X<br><br><-- SIP read from <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.40.68:5060/" target="_blank">192.168.40.68:5060</a>: REGISTER sip:<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.12.106/" target="_blank">192.168.12.106</a> SIP/2.0 // 12.106 is Asterisk address<br>
Via: SIP/2.0/UDP 82.187.X.X;branch=z9hG4bKfe0f.21364c47.0 Via: SIP/2.0/UDP 192.168.40.254:2660;rport=2265;received=82.187.Y.Ybranch=z9hG4bK532058BAC7C544E0961E038CC29B2106 <br>From: Cfadda <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sip%3A225@82.187.90.68" target="_blank">sip:225@82.187.90.68</a>>;tag=3189722840<br>
To: Cfadda <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sip%3A225@82.187.90.68" target="_blank">sip:225@82.187.90.68</a>><br>Contact: "Cfadda" <<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://sip:225@192.168.40.254:2660/" target="_blank">sip:225@192.168.40.254:2660</a>><br>
Call-ID: 487DA353295C484FA58B2FB1464A2210@82.187.X.X<br>CSeq: 65140 REGISTER<br>Expires: 1800<br>Max-Forwards: 69<br>User-Agent: X-PRO release 1105x<br>Content-Length: 0<br><br><br>Nov 5 10:37:28 VERBOSE[23848] logger.c: --- (12 headers 0 lines) ---<br>
Nov 5 10:37:28 VERBOSE[23848] logger.c: Using latest REGISTER request as basis request<br>Nov 5 10:37:28 VERBOSE[23848] logger.c: Sending to 82.187.X.X : 5060 (non-NAT)<br>Nov 5 10:37:28 VERBOSE[23848] logger.c: Transmitting (NAT) to <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.40.68:5060/" target="_blank">192.168.40.68:5060</a>:<br>
SIP/2.0 100 Trying<br>Via: SIP/2.0/UDP 82.187.X.X ;branch=z9hG4bKfe0f.21364c47.0;received=<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.40.68/" target="_blank">192.168.40.68</a><br>Via: SIP/2.0/UDP 192.168.40.254:2660;rport=2265;received=82.187.Y.Y;branch=z9hG4bK532058BAC7C544E0961E038CC29B2106 <br>
From: Cfadda <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sip%3A225@82.187.90.68" target="_blank">sip:225@82.187.90.68</a>>;tag=3189722840<br>To: Cfadda <sip:225@82.187.X.X ><br>Call-ID: 487DA353295C484FA58B2FB1464A2210@82.187.X.X<br>
CSeq: 65140 REGISTER<br>User-Agent: Asterisk PBX<br>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY<br>Contact: <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sip%3A225@192.168.12.106" target="_blank">sip:225@192.168.12.106</a>><br>
Content-Length: 0<br><br><br>---<br>Nov 5 10:37:28 VERBOSE[23848] logger.c: Transmitting (NAT) to <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.40.68:5060/" target="_blank">192.168.40.68:5060</a>:<br>
SIP/2.0 401 Unauthorized<br>Via: SIP/2.0/UDP 82.187.X.X ;branch=z9hG4bKfe0f.21364c47.0;received=<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.40.68/" target="_blank">192.168.40.68</a><br>Via: SIP/2.0/UDP 192.168.40.254:2660;rport=2265;received=82.187.Y.Y;branch=z9hG4bK532058BAC7C544E0961E038CC29B2106 <br>
From: Cfadda <sip:225@82.187.X.X >;tag=3189722840<br>To: Cfadda <sip:225@82.187.X.X >;tag=as4c420a53<br>Call-ID: 487DA353295C484FA58B2FB1464A2210@82.187.X.X<br>CSeq: 65140 REGISTER<br>User-Agent: Asterisk PBX<br>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY<br>WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="05f14a3e"<br>Content-Length: 0<br><br>So asterisk sends response to the wrong interface.<br>
<br>How can I solve this?<br> <br></blockquote><br></span></div>Probably the right answer you will get on the asterisk mailing lists.<br><br>Cheers,<br>Daniel<br><span><br>-- <br>Daniel-Constantin Mierla<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.asipto.com/" target="_blank">http://www.asipto.com</a><br>
<br></span></blockquote></span></div></div><br>