<div>I think I may have spotted the problem in the signalling.</div>
<div> </div>
<div>In this reply to the INVITE, the <u>first stage</u> is fine:</div>
<div> </div>
<div>Asterisk -> OpenSER (The signalling here is fine from Asterisk)</div>
<div> </div>
<div> </div>
<div>In the <u>second stage</u>, the reply from OpenSER to UAC</div>
<div><br>OpenSER -> Client</div>
<div> </div>
<div>this part</div>
<div> </div>
<div>Session Description Protocol<br> Session Description Protocol Version (v): 0<br> Owner/Creator, Session Id (o): root 20137 20138 IN IP4<br><strong>OOO.OOO.OOO.OOO</strong><br> Session Name (s): session
<br> Connection Information (c): IN IP4 Session Description Protocol<br> Session Description Protocol Version (v): 0<br> Owner/Creator, Session Id (o): root 20137 20138 IN IP4<br>OOO.OOO.OOO.OOO
<br> Session Name (s): session<br> Connection Information (c): IN IP4 OOO.OOO.OOO.OOO<br> Time Description, active time (t): 0 0<br> Media Description, name and address (m): audio 58508 Time Description, active time (t): 0 0
<br> Media Description, name and address (m): audio 58508</div>
<div><br> </div>
<div>you see where it says IN IP4, this should <u>still</u> have the IP of Asterisk if you want the RTP to go to the Asterisk server, but instead it has the IP of OpenSER so RTP is sent to OpenSER.</div>
<div> </div>
<div>This information is taken from somewhere (I forget - i think it's the <u>contact</u> of the REGISTER message), but it can be fixed.</div>
<div> </div>
<div>You will need to look at the entire call flow starting from when the UAC first registers with OpenSER. Then, in your NAT handling routine use I think <strong>fix_nated_register</strong> and <strong>fix_nated_contact
</strong>.</div>
<div> </div>
<div>Hope this helps.</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div><span class="gmail_quote">On 12/19/06, <b class="gmail_sendername">Edoardo Serra</b> <<a href="mailto:osdevel@webrainstorm.it">osdevel@webrainstorm.it</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">At 13.51 19/12/2006, Klaus Darilion wrote:<br>>You said that the 200 contains openser's IP in the SDP? Is it put in
<br>>there by openser or already by Asterisk?<br><br>Tnx very much for help<br><br>It's put in there by OpenSER.<br><br>I'm attaching the 2 SIP/SDP packets (1 from asterisk to openser and 1<br>from openser to client)
<br><br>AAA.AAA.AAA.AAA stands for IP of Asterisk<br>OOO.OOO.OOO.OOO stands for IP of OpenSER<br>CCC.CCC.CCC.CCC stands for IP of client<br>3333333333 is the called number<br><br><br>No. Time Source Destination Protocol Info
<br> 20 12.646925 AAA.AAA.AAA.AAA OOO.OOO.OOO.OOO SIP/SDP<br>Status: 200 OK, with session description<br><br>Session Initiation Protocol<br> Status-Line: SIP/2.0 200 OK<br> Message Header<br> Via: SIP/2.0/UDP
<br>OOO.OOO.OOO.OOO;branch=z9hG4bK5bbd.eaf4f093.0;received=OOO.OOO.OOO.OOO<br> Via: SIP/2.0/UDP<br>CCC.CCC.CCC.CCC:8952;branch=z9hG4bK-d87543-e15656230434101e-1--d87543-;rport=8952<br> Record-Route: <sip:OOO.OOO.OOO.OOO
;lr=on;ftag=9043ec70><br> From: "test"<<a href="mailto:sip:test@OOO.OOO.OOO.OOO">sip:test@OOO.OOO.OOO.OOO</a>>;tag=9043ec70<br> To: "3333333333"<<a href="mailto:sip:3333333333@OOO.OOO.OOO.OOO">
sip:3333333333@OOO.OOO.OOO.OOO</a>>;tag=as30a7528b<br> Call-ID: 98684a222a2eeb7aYmVlZTUzZDRhNjMzN2Y0MTZhYmNmOTc5MzQ4OGI3ZGU.<br> CSeq: 3 INVITE<br> User-Agent: Asterisk<br> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
<br> Contact: <sip:3333333333@AAA.AAA.AAA.AAA:5060><br> Content-Type: application/sdp<br> Content-Length: 291<br> Message body<br> Session Description Protocol<br> Session Description Protocol Version (v): 0
<br> Owner/Creator, Session Id (o): root 20137 20138 IN IP4<br>AAA.AAA.AAA.AAA<br> Session Name (s): session<br> Connection Information (c): IN IP4 AAA.AAA.AAA.AAA<br> Time Description, active time (t): 0 0
<br> Media Description, name and address (m): audio 58508<br>RTP/AVP 98 3 8 0 101<br> Media Attribute (a): rtpmap:98 iLBC/8000<br> Media Attribute (a): rtpmap:3 GSM/8000<br> Media Attribute (a): rtpmap:8 PCMA/8000
<br> Media Attribute (a): rtpmap:0 PCMU/8000<br> Media Attribute (a): rtpmap:101 telephone-event/8000<br> Media Attribute (a): fmtp:101 0-16<br> Media Attribute (a): silenceSupp:off - - - -
<br><br>No. Time Source Destination Protocol Info<br> 21 12.647437 OOO.OOO.OOO.OOO CCC.CCC.CCC.CCC SIP/SDP<br>Status: 200 OK, with session description<br><br>Session Initiation Protocol
<br> Status-Line: SIP/2.0 200 OK<br> Message Header<br> Via: SIP/2.0/UDP<br>OOO.OOO.OOO.OOO:5060;branch=z9hG4bK-d87543-e15656230434101e-1--d87543-;rport=8952<br> Record-Route: <sip:OOO.OOO.OOO.OOO;lr=on;ftag=9043ec70>
<br> From: "test"<<a href="mailto:sip:test@OOO.OOO.OOO.OOO">sip:test@OOO.OOO.OOO.OOO</a>>;tag=9043ec70<br> To: "3333333333"<<a href="mailto:sip:3333333333@OOO.OOO.OOO.OOO">sip:3333333333@OOO.OOO.OOO.OOO
</a>>;tag=as30a7528b<br> Call-ID: 98684a222a2eeb7aYmVlZTUzZDRhNjMzN2Y0MTZhYmNmOTc5MzQ4OGI3ZGU.<br> CSeq: 3 INVITE<br> User-Agent: Asterisk<br> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
<br> Contact: <sip:3333333333@AAA.AAA.AAA.AAA:5060><br> Content-Type: application/sdp<br> Content-Length: 291<br> Message body<br> Session Description Protocol<br> Session Description Protocol Version (v): 0
<br> Owner/Creator, Session Id (o): root 20137 20138 IN IP4<br>OOO.OOO.OOO.OOO<br> Session Name (s): session<br> Connection Information (c): IN IP4 OOO.OOO.OOO.OOO<br> Time Description, active time (t): 0 0
<br> Media Description, name and address (m): audio 58508<br>RTP/AVP 98 3 8 0 101<br> Media Attribute (a): rtpmap:98 iLBC/8000<br> Media Attribute (a): rtpmap:3 GSM/8000<br> Media Attribute (a): rtpmap:8 PCMA/8000
<br> Media Attribute (a): rtpmap:0 PCMU/8000<br> Media Attribute (a): rtpmap:101 telephone-event/8000<br> Media Attribute (a): fmtp:101 0-16<br> Media Attribute (a): silenceSupp:off - - - -
<br><br>Tnx very much for help again<br><br>Regards<br><br>Edoardo<br><br><br>>regards<br>>klaus<br>><br>><br>>regards<br>>klaus<br>><br>>Edoardo Serra wrote:<br>>>Hi guys,<br>>> I'm having a problem with an OpenSER acting as registrar
<br>>> server and load balancer for many Asterisk servers.<br>>>In a few words: "users are registering on openser and, when they<br>>>want to make a call, OpenSER proxies the request to an Asterisk<br>
>>server with the dispatcher module"<br>>>Here is the intended data flow (SIP goes through OpenSER and media<br>>>goes directly to Asterisk)<br>>>User <-- SIP --> OpenSER <-- SIP --> Asterisk
<br>>>User <-- RTP --> Asterisk<br>>>Both, OpenSER and Asterisks have public IPs<br>>>I already have a working setup of that and everything seems working<br>>>correctly.<br>>>I'm trying to replicate that setup on another site, same
<br>>>configurations of the boxes, same versions of OpenSER and Asterisk,<br>>>etc... but I'm having monodirectional Audio.<br>>>Having a look with tethereal I see that OpenSER, when the<br>>>communication is answered, sends a SIP packet (200 OK) to the user
<br>>>indicating itself as media endpoint instead of the Asterisks.<br>>> From that moment I see RTP packets flowing from the client to OpenSER<br>>>This seems really strange to me because I just copied the same
<br>>>configurations file from a working setup to the new installation.<br>>>Tnx in advance for help.<br>>>Regards<br>>>P.S.: Here is my openser.cfg<br>>>## $Id: ser.cfg,v <a href="http://1.21.4.1">
1.21.4.1</a> 2003/11/10 15:35:15 andrei Exp $<br>>>## simple quick-start config script<br>>>#<br>>># ----------- global configuration parameters ------------------------<br>>>#debug=3 # debug level (cmd line: -dddddddddd)
<br>>>fork=yes<br>>>#log_stderror=no # (cmd line: -E)<br>>>check_via=no # (cmd. line: -v)<br>>>dns=no # (cmd. line: -r)<br>>>rev_dns=no # (cmd. line: -R)<br>>>#children=4<br>>>#port=5060
<br>>>fifo="/tmp/ser_fifo"<br>>>#uid=nobody<br>>>#gid=nobody<br>>># ------------------ module loading ----------------------------------<br>>>loadmodule "/usr/lib/openser/modules/sl.so"
<br>>>loadmodule "/usr/lib/openser/modules/tm.so"<br>>>loadmodule "/usr/lib/openser/modules/rr.so"<br>>>loadmodule "/usr/lib/openser/modules/maxfwd.so"<br>>>loadmodule "/usr/lib/openser/modules/usrloc.so"
<br>>>loadmodule "/usr/lib/openser/modules/registrar.so"<br>>>loadmodule "/usr/lib/openser/modules/nathelper.so"<br>>>loadmodule "/usr/lib/openser/modules/textops.so"<br>>>loadmodule "/usr/lib/openser/modules/exec.so"
<br>>>loadmodule "/usr/lib/openser/modules/uri.so"<br>>>loadmodule "/usr/lib/openser/modules/uri_db.so"<br>>>loadmodule "/usr/lib/openser/modules/dispatcher.so"<br>>># Uncomment this if you want digest authentication
<br>>># mysql.so must be loaded !<br>>>loadmodule "/usr/lib/openser/modules/mysql.so"<br>>>loadmodule "/usr/lib/openser/modules/auth.so"<br>>>loadmodule "/usr/lib/openser/modules/auth_db.so"
<br>>>modparam("usrloc", "db_mode", 2)<br>>>modparam("usrloc", "db_url", "mysql://xxx:xxx@xxx.xxx.xxx.xxx/openser")<br>>>modparam("usrloc", "timer_interval", 120)
<br>>>modparam("auth_db", "calculate_ha1", 0)<br>>>modparam("auth_db", "db_url", "mysql://xxx:xxx@xxx.xxx.xxx.xxx/voip")<br>>>modparam("uri_db", "db_url", "
mysql://xxx:xxx@xxx.xxx.xxx.xxx/openser")<br>>>modparam("rr", "enable_full_lr", 1)<br>>>modparam("registrar", "nat_flag", 6)<br>>>modparam("registrar", "max_expires", 3600)
<br>>>modparam("registrar", "min_expires", 60)<br>>>modparam("registrar", "append_branches", 0)<br>>>modparam("registrar", "desc_time_order", 1)
<br>>>modparam("nathelper", "natping_interval", 20) # Ping interval 20 s<br>>>modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT<br>>>modparam("dispatcher", "force_dst", 1)
<br>>># ------------------------- request routing logic -------------------<br>>># main routing logic<br>>>route{<br>>># initial sanity checks -- messages with<br>>># max_forwards==0, or excessively long requests
<br>>>if (!mf_process_maxfwd_header("10")) {<br>>>sl_send_reply("483","Too Many Hops");<br>>>exit;<br>>>};<br>>>if ( msg:len > max_len ) {<br>>>sl_send_reply("513", "Message too big");
<br>>>exit;<br>>>};<br>>>if ( (method=="OPTIONS") || (method=="SUBSCRIBE") || (method=="NOTIFY") ) {<br>>>sl_send_reply("405", "Method Not Allowed");
<br>>>exit;<br>>>}<br>>>if (!method=="REGISTER") {<br>>>record_route();<br>>>};<br>>>if ((src_ip==xxx.xxx.xxx.xxx) || (src_ip==xxx.xxx.xxx.xxx)) { # IP<br>>>of Asterisks
<br>>>if (!lookup("location")) {<br>>>sl_send_reply("404", "Not Found");<br>>>exit;<br>>>};<br>>># forward to current uri now; use stateful forwarding; that<br>>># works reliably even if we forward from TCP to UDP
<br>>>if (!t_relay()) {<br>>>sl_reply_error();<br>>>};<br>>>exit;<br>>>};<br>>>if (nat_uac_test("3")) {<br>>>if ((method=="REGISTER") || (method=="INVITE") || (method=="OPTIONS")) {
<br>>>fix_nated_contact();<br>>>force_rport();<br>>>setflag(6); # Mark as NATed<br>>>}<br>>>}<br>>># if the request is for other domain use UsrLoc<br>>># (in case, it does not work, use the following command
<br>>># with proper names and addresses in it)<br>>>if (method=="REGISTER") {<br>>>if (!proxy_authorize("domain", "openser_view")) {<br>>>proxy_challenge("domain", "0");
<br>>>exit;<br>>>}<br>>>if (!check_to()) {<br>>>sl_send_reply("403", "Digest username and URI username do NOT<br>>>match! Stay away!");<br>>>exit;<br>>>}<br>>>save("location");
<br>>>exit;<br>>>};<br>>><br>>>if (method=="INVITE") {<br>>>if (!proxy_authorize("domain", "openser_view")) {<br>>>proxy_challenge("domain", "0");
<br>>>exit;<br>>>}<br>>>if (!check_from()) {<br>>>sl_send_reply("403", "Digest username and URI username do NOT<br>>>match! Stay away!");<br>>>exit;<br>>>}<br>
>>}<br>>># loose-route processing<br>>>if (loose_route()) {<br>>># mark routing logic in request<br>>>append_hf("P-hint: rr-enforced\r\n");<br>>>route(1);<br>>>exit;<br>
>>};<br>>>if (!uri==myself) {<br>>># mark routing logic in request<br>>>append_hf("P-hint: outbound\r\n");<br>>>route(1);<br>>>exit;<br>>>};<br>>>append_hf("P-hint: usrloc applied\r\n");
<br>>>route(1);<br>>>}<br>>>route[1]<br>>>{<br>>># ! Nathelper<br>>>if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&<br>>>!search("^Route:")){
<br>>>sl_send_reply("479", "We don't forward to private IP addresses");<br>>>exit;<br>>>};<br>>># NAT processing of replies; apply to all transactions (for example,<br>>># re-INVITEs from public to private UA are hard to identify as
<br>>># NATed at the moment of request processing); look at replies<br>>>t_on_reply("1");<br>>># send it out now; use stateful forwarding as it works reliably<br>>># even for UDP2TCP<br>>>if ((src_ip!=
xxx.xxx.xxx.xxx) && (src_ip!=xxx.xxx.xxx.xxx)) { # IP<br>>>of Asterisks<br>>>ds_select_dst("2", "0");<br>>>}<br>>>if (!t_relay()) {<br>>>sl_reply_error();<br>>>};
<br>>>}<br>>># ! Nathelper<br>>>onreply_route[1] {<br>>># NATed transaction ?<br>>>if (isflagset(6) && status =~ "(183)|2[0-9][0-9]") {<br>>>fix_nated_contact();<br>>># otherwise, is it a transaction behind a NAT and we did not
<br>>># know at time of request processing ? (RFC1918 contacts)<br>>>} else if (nat_uac_test("1")) {<br>>>fix_nated_contact();<br>>>};<br>>>}<br>>><br>>>_______________________________________________
<br>>>Users mailing list<br>>><a href="mailto:Users@openser.org">Users@openser.org</a><br>>><a href="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users</a>
<br>><br>><br>>--<br>>Klaus Darilion<br>><a href="http://nic.at">nic.at</a><br>><br><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openser.org">Users@openser.org
</a><br><a href="http://openser.org/cgi-bin/mailman/listinfo/users">http://openser.org/cgi-bin/mailman/listinfo/users</a><br></blockquote></div><br>