<div dir="ltr">Hello!<div><br><div>Sorry to bring the topic up, but so far I have no idea what the problem is. Or do I need to open an issue on github?<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 3 янв. 2023 г. в 13:58, Denys Pozniak <<a href="mailto:denys.pozniak@gmail.com">denys.pozniak@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello!</div><div> <br></div>I'm trying to build a classic anycast cluster topology with two OpenSIPS nodes, in which requests are processed by one proxy and responses by another.<div>The client and server are emulated via baresip.<br>But I ran into a problem in that the replicated responses have an extra 00 in the tail of the reply (the original reply from baresip UAS does not have it).<br><br><div><div>ngrep -x:</div><div>#<br>U <a href="http://192.168.100.100:5060" target="_blank">192.168.100.100:5060</a> -> <a href="http://192.168.56.103:37279" target="_blank">192.168.56.103:37279</a> #5<br> 53 49 50 2f 32 2e 30 20 31 38 30 20 52 69 6e 67 SIP/2.0 180 Ring<br> 69 6e 67 0d 0a 52 65 63 6f 72 64 2d 52 6f 75 74 ing..Record-Rout<br> 65 3a 20 3c 73 69 70 3a 31 39 32 2e 31 36 38 2e e: <sip:192.168.<br> 31 30 30 2e 31 30 30 3b 6c 72 3e 0d 0a 56 69 61 100.100;lr>..Via<br> 3a 20 53 49 50 2f 32 2e 30 2f 55 44 50 20 31 39 : SIP/2.0/UDP 19<br> 32 2e 31 36 38 2e 35 36 2e 31 30 33 3a 33 37 32 <a href="http://2.168.56.103:372" target="_blank">2.168.56.103:372</a><br> 37 39 3b 72 65 63 65 69 76 65 64 3d 31 39 32 2e 79;received=192.<br> 31 36 38 2e 35 36 2e 31 30 33 3b 62 72 61 6e 63 168.56.103;branc<br> 68 3d 7a 39 68 47 34 62 4b 62 65 63 38 65 38 66 h=z9hG4bKbec8e8f<br> 30 32 36 62 65 39 31 34 61 3b 72 70 6f 72 74 3d 026be914a;rport=<br> 33 37 32 37 39 0d 0a 54 6f 3a 20 3c 73 69 70 3a 37279..To: <sip:<br> 31 30 30 40 31 39 32 2e 31 36 38 2e 31 30 30 2e <a href="mailto:100@192.168.100." target="_blank">100@192.168.100.</a><br> 31 30 30 3b 74 72 61 6e 73 70 6f 72 74 3d 75 64 100;transport=ud<br> 70 3e 3b 74 61 67 3d 32 37 65 33 63 32 31 38 65 p>;tag=27e3c218e<br> 30 65 61 31 32 30 64 0d 0a 46 72 6f 6d 3a 20 3c 0ea120d..From: <<br> 73 69 70 3a 32 30 30 40 31 39 32 2e 31 36 38 2e sip:200@192.168.<br> 31 30 30 2e 31 30 30 3a 35 30 36 30 3e 3b 74 61 100.100:5060>;ta<br> 67 3d 35 36 38 35 66 33 38 39 61 39 37 66 65 31 g=5685f389a97fe1<br> 30 32 0d 0a 43 61 6c 6c 2d 49 44 3a 20 31 32 34 02..Call-ID: 124<br> 39 37 61 63 37 36 65 38 30 34 66 35 36 0d 0a 43 97ac76e804f56..C<br> 53 65 71 3a 20 36 33 37 30 37 20 49 4e 56 49 54 Seq: 63707 INVIT<br> 45 0d 0a 53 65 72 76 65 72 3a 20 62 61 72 65 73 E..Server: bares<br> 69 70 20 76 32 2e 31 30 2e 30 20 28 78 38 36 5f ip v2.10.0 (x86_<br> 36 34 2f 4c 69 6e 75 78 29 0d 0a 43 6f 6e 74 61 64/Linux)..Conta<br> 63 74 3a 20 3c 73 69 70 3a 31 30 30 2d 30 78 63 ct: <sip:100-0xc<br> 62 63 31 39 30 40 31 39 32 2e 31 36 38 2e 35 36 bc190@192.168.56<br> 2e 31 30 36 3a 35 30 38 30 3e 0d 0a 41 6c 6c 6f .106:5080>..Allo<br> 77 3a 20 49 4e 56 49 54 45 2c 41 43 4b 2c 42 59 w: INVITE,ACK,BY<br> 45 2c 43 41 4e 43 45 4c 2c 4f 50 54 49 4f 4e 53 E,CANCEL,OPTIONS<br> 2c 4e 4f 54 49 46 59 2c 53 55 42 53 43 52 49 42 ,NOTIFY,SUBSCRIB<br> 45 2c 49 4e 46 4f 2c 4d 45 53 53 41 47 45 2c 55 E,INFO,MESSAGE,U<br> 50 44 41 54 45 2c 52 45 46 45 52 0d 0a 43 6f 6e PDATE,REFER..Con<br> 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 30 0d 0a tent-Length: 0..<br> 0d 0a 00 ...<br>#<br></div><div><br></div><div>So it throws a Baresip error:<br></div><div><div>call: SIP Progress: 100 Trying-2 (/)<br>call: SIP Progress: 100 Giving it a try (/)<br>call: SIP Progress: 180 Ringing (/)<br>call: could not decode SDP answer: Bad message [74]<br></div><div><br></div><div><div><div>192.168.56.103 - baresip UAC<br></div><div>192.168.56.106 - baresip UAS<br></div><div>192.168.100.100 - anycast OpenSIPS<br></div></div><div><br></div></div><div>opensips.cfg (node2):<br></div><div>...</div><div>socket = udp:192.168.100.100 anycast<br>socket= bin:<a href="http://192.168.56.105:5566" target="_blank">192.168.56.105:5566</a><br>...<br>modparam ("tm", "tm_replication_cluster", 1)<br>modparam("clusterer", "db_mode", 0)<br>modparam("clusterer", "my_node_id", 2)<br>modparam("clusterer", "my_node_info", "cluster_id=1, url=bin:<a href="http://192.168.56.105:5566" target="_blank">192.168.56.105:5566</a>")<br>modparam("clusterer", "neighbor_node_info", "cluster_id=1,node_id=1,url=bin:<a href="http://192.168.56.104:5566" target="_blank">192.168.56.104:5566</a>")<br>modparam("clusterer", "sharing_tag", "vip1/2=active")<br>...<br>####### Routing Logic ########<br><br>route{<br><br> if ( !mf_process_maxfwd_header(10) ) {<br> send_reply(483,"Too Many Hops");<br> exit;<br> }<br><br> sl_send_reply(100, "Trying-2");<br><br> if (has_totag()) {<br><br> if ( !loose_route() && !t_check_trans() ) {<br> if ( is_method("ACK") ) {<br> t_anycast_replicate();<br> exit;<br> }<br> }<br><br> t_relay();<br> exit;<br> }<br><br> if (is_method("CANCEL")) {<br> if (t_check_trans()) {<br> t_relay();<br><br> } else {<br> t_anycast_replicate();<br> }<br><br> exit;<br> }<br><br> t_check_trans();<br><br> if (!is_method("REGISTER|MESSAGE")) {<br> record_route();<br> }<br><br> if ( is_method("INVITE") && $si!="5080" ) {<br> $du = "sip:<a href="http://192.168.56.106:5080" target="_blank">192.168.56.106:5080</a>";<br> }<br><br> t_relay();<br> exit;<br><br></div><div>}<br></div><div><br></div><div>[root@localhost opensips]# opensips -V<br>version: opensips 3.3.2 (x86_64/linux)<br>flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT<br>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535<br>poll method support: poll, epoll, sigio_rt, select.<br>main.c compiled on 16:12:02 Oct 19 2022 with gcc 4.8.5<br></div><div><br></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div>