{"id":1271,"date":"2019-05-01T13:47:26","date_gmt":"2019-05-01T08:47:26","guid":{"rendered":"http:\/\/alexeyka.zantsev.com\/?p=1271"},"modified":"2021-03-17T16:52:06","modified_gmt":"2021-03-17T11:52:06","slug":"opensips-batch-dialogs-killer-one-liner","status":"publish","type":"post","link":"https:\/\/alexeyka.zantsev.com\/?p=1271","title":{"rendered":"OpenSIPS: batch dialogs killer one-liner"},"content":{"rendered":"\n<p>Situation: VoIP ISP server suddenly became unavailable and you have some thousands of dialogs like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dialog::  ID=17580696317398\n\tstate:: 3\n\tuser_flags:: 0\n\ttimestart:: 1556697836\n\tdatestart:: 2019-05-01 13:03:56\n\ttimeout:: 1556701436\n\tdateout:: 2019-05-01 14:03:56\n\tcallid:: 7EB7F3F9-6B1E11E9-90F3C2ED-81742C80@XX.YY.168.28\n\tfrom_uri:: sip:ZZZXXX7146@XX.YY.168.28\n\tto_uri:: sip:NNNN902290@XX.YY.169.130\n\tcaller_tag:: 8999291C-450\n\tcaller_contact:: sip:ZZZXXX7146@XX.YY.168.28:5060\n\tcallee_cseq:: 0\n\tcaller_route_set:: &lt;sip:XX.YY.169.130;lr=on;ftag=8999291C-450;did=dff3.a92b;nat=yes&gt;\n\tcaller_bind_addr:: udp:EE.FF.116.74:5060\n\tcaller_sdp:: \n\tCALLEES:: \n\t\tcallee:: \n\t\t\tcallee_tag:: as3d7dee61\n\t\t\tcallee_contact:: sip:abc@EE.FF.116.62:5060;transport=udp\n\t\t\tcaller_cseq:: 101\n\t\t\tcallee_route_set:: \n\t\t\tcallee_bind_addr:: udp:EE.FF.116.74:5060\n\t\t\tcallee_sdp:: \n<\/code><\/pre>\n\n\n\n<p>To kill them in some seconds (not to wait when OpenSIPS will terminate them according to SIP timers), do:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for i in `opensipsctl fifo dlg_list | grep callid | grep \\@XX.YY.168.28 | awk '{print $2}'` ; do opensipsctl fifo dlg_end_dlg $i ; done<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/alexeyka.zantsev.com\/wp-content\/uploads\/2019\/05\/sessions.png\" alt=\"\" class=\"wp-image-1272\" width=\"452\" height=\"195\"\/><\/figure>\n\n\n\n<p>In fact, the situation was as follows: VoIP software on the ISP side (we have a DID from it connected to our OpenSIPS cluster) had some problems and they suddenly started sending us a bunch of <em>unique<\/em> INVITES (with <em>different<\/em> Call-IDs) for any certain inbound call.<\/p>\n\n\n\n<p>Very soon the total number of dialogs dramatically increased up to enormous values. And this is a theme of <a href=\"http:\/\/alexeyka.zantsev.com\/?p=1275\">my next article<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Situation: VoIP ISP server suddenly became unavailable and you have some thousands of dialogs like this: To kill them in some seconds (not to wait when OpenSIPS will terminate them according to SIP timers), do: In fact, the situation was as follows: VoIP software on the ISP side (we have a DID from it connected [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[208],"class_list":["post-1271","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-opensips"],"_links":{"self":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/1271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1271"}],"version-history":[{"count":6,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/1271\/revisions"}],"predecessor-version":[{"id":5063,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=\/wp\/v2\/posts\/1271\/revisions\/5063"}],"wp:attachment":[{"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alexeyka.zantsev.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}