<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Cristian Livadaru on Medium]]></title>
        <description><![CDATA[Stories by Cristian Livadaru on Medium]]></description>
        <link>https://medium.com/@lcx_at?source=rss-7b23d38ec10------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BLmFQMbiFfJfN0kPBpNX3Q.jpeg</url>
            <title>Stories by Cristian Livadaru on Medium</title>
            <link>https://medium.com/@lcx_at?source=rss-7b23d38ec10------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 19:39:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lcx_at/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When you go with your future ex-wife to plan the kitchen for your new apartment, because you went…]]></title>
            <link>https://medium.com/@lcx_at/when-you-go-with-your-future-ex-wife-to-plan-the-kitchen-for-your-new-apartment-because-you-went-ddf572c9e3fa?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddf572c9e3fa</guid>
            <category><![CDATA[divorce]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Fri, 29 May 2020 17:38:28 GMT</pubDate>
            <atom:updated>2020-05-29T17:38:28.556Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpaE_zYlYzQj89wlHmSRtQ@2x.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5t94ueBhVe5oZnfLd0vZpw@2x.jpeg" /></figure><p>When you go with your future ex-wife to plan the kitchen for your new apartment, because you went through all those <strong>beautiful times</strong> and all that crap together, but you will remain friends forever.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddf572c9e3fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing Emergency Bypass on iOS 12]]></title>
            <link>https://medium.com/@lcx_at/fixing-emergency-bypass-on-ios-12-96e85b2006a7?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/96e85b2006a7</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[iphone]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Sun, 27 Jan 2019 09:42:37 GMT</pubDate>
            <atom:updated>2019-01-27T09:42:37.901Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever since upgrading to iOS 12 I had an issue with DND mode and Emergency bypass not working. I usually keep my phone on vibrate all the time and when with clients or trying to get some work done and focusing I turn my phone on DND mode. Since I have all important people in my favorites as well as my 24/7 Emergency Hotline where I also enabled a custom ringtone for calls coming from my emergency hotline, I know that if it’s something urgent I can be reached.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t2cnmcTONvuSKdhR2moK9A.jpeg" /></figure><p>All this was gone since iOS 12 since the same issue occurred with my wife’s phone after the upgrade, this had to be an iOS issue. I reached out to apple but the first request from Apple was to reset my Phone, something I don’t like doing and it makes no sense since the issue occurred on two phones already. Before doing something stupid I reached out to some friends to test this with me after they upgraded to iOS 12 and the issue was reproduced on all phones where iOS 12 was running. Nonetheless, I did reset my phone, set it up as a brand new phone, added one single phone number and retested the issue with the same results. Restored my backup and constantly kept bugging apple Support.</p><p>After the upgrade to iOS 12.1.3, the issue still persisted which drove me insane!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*dMjEk0drEL83zlGyyVU6Jw.gif" /></figure><p>After ranting again I got a call from Apple support, actually quite fast, 5 Minutes after I sent my rant Mail to apple and he gave me an idea to save the number without the country code in the address book.</p><h4>The solution</h4><p>Ok, so here I was with a test phone and a +43123123123 number in my address book, DND enabled, added the contact to favourites and called, as expected the call was blocked due to DND, changed the contact to 123123123 which is totally invalid, also didn’t work, continued with 0123123123 which would be valid, but again doesn’t work … 23123123 still no luck. Almost about to give up when changing the number to 43123123123 and finally, the call goes through DND mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*TKgC8So_i5WugjjuLisD5g.gif" /></figure><p>But there still remains an Issue, the call goes through DND but the contact won’t be found which means the emergency bypass settings like custom caller ID won’t work.</p><p>To solve this, just add the Phone number with + and without + to the address book under one single contact. The one without + solves the DND issue and the one with + is that one that will be found in the contacts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*X4keCtyIffv2NnDa6IMJeA.gif" /></figure><p>come on apple, this is really embarrassing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96e85b2006a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Doing FusionPBX Provisioning the right way]]></title>
            <link>https://medium.com/@lcx_at/doing-fusionpbx-provisioning-the-right-way-82556abcc91b?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/82556abcc91b</guid>
            <category><![CDATA[voip]]></category>
            <category><![CDATA[fusionpbx]]></category>
            <category><![CDATA[freeswitch]]></category>
            <category><![CDATA[pbx]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Sat, 24 Nov 2018 12:01:15 GMT</pubDate>
            <atom:updated>2018-11-24T12:01:15.215Z</atom:updated>
            <content:encoded><![CDATA[<p>Reusing passwords is never a good idea and by default the fusionpbx setup would use the same user and password for all domains when provisioning.</p><p>All things are not bad though, then by default also FusionPBX checks that the domain matches the device domain, nonetheless if one customer knows other customers domains and also has the user/password for provisioning, it could try to enumerate MAC addresses and get a hold of other customers credentials.<br>Yes I know there are a lot of if’s here but it is very simple to solve so why not solve it the proper way?</p><p>I will assume you already have provisioning enabled, if not got to the default settings and set the enabled setting under provisioning to true and also to enabled, otherwise the whole provisioning thing will not work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*BUW4kJHKF42wDv0N.png" /></figure><p>You might not know that you can override default settings for every domain, fusionpbx first uses the domain settings and if they are missing it will fail over to the default settings! It’s awesome for what you need to set up separate provisioning settings for each client.<br>To accomplish this, go to advanced -&gt; domain and click on the domain, not the edit pencil on the right, you have to click on the domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*xHvcif5YsOOXEOrD.png" /></figure><p>After you click on the domain, you click on the plus sign on the right side, this will allow you to create settings valid for this domain only!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_6xA0YDy7GS1byJs.png" /></figure><p>Create settings for http_auth_password and http_auth_user if you want separate users for HTTP provisioning auth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*PesCpAx9uAg9VMoV.png" /></figure><p>after you have done this, it should look something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/0*_F0B1l1EFGVbtArT.png" /></figure><p>that’s it, you have now created a custom http auth user + password that will be used for provisioning only for this domain.</p><p>Well, almost. You still need to tell fusionpbx which domain to use for provisioning, for this to work you will have to tell fusionpbx to use the current domain of each customer. You can do this by adding a separate setting for each domain, but this is duplicated work and nobody likes duplication.</p><p>This of course requires the provisioning template to not use hardcoded values in the provisioning settings but to use the variables. For a SNOM 7xx it would look like this:</p><pre><strong>&lt;</strong>setting_server perm<strong>=</strong>&quot;RW&quot;<strong>&gt;</strong>https://{$http_auth_username}:{$http_auth_password}@{$domain_name}:443{$project_path}/app/provision/index.php?mac={$mac}&lt;/setting_server&gt;</pre><p>It has to be {$domain_name} in order to fill the current domain in the provisioning URL.</p><h3>Enforcing domain filters</h3><p>At first, I wanted to recommend to enable the http_domain_filter in the default settings but here is why this will actually screw you over quite bad and why you don&#39;t need it if you have set up separate passwords for each client.</p><ol><li>NAPTR + A Records don’t go well together. If you set an A record the NAPTR will stop working! Not sure if this is supposed to be that way or I did something wrong while testing.</li><li>You might either need SSL Certs for each client or a wildcard cert.</li></ol><p>So, just set the http_domain_filter to false, use the main domain with valid CERT and DNS A records for provisioning.<br>If you set up domain level http_user + pass for provisioning, fusionpbx will check the values from the domain where the device is attached to. Even if a client knows a second domain and mac address of a device, they won&#39;t be able to use the password from their domain to fetch the provisioning data.<br>I think an example would help here but I did spend half a day testing and reading PHP code, who know me better knows that I don&#39;t do well with PHP.</p><h3>I’ve got a 404 error</h3><p>If by any chance you encounter a 404 error with nginx version 1.12.1, don’t freak out. Fusionpbx returns this by default when something is wrong during provisioning.</p><pre><strong>if</strong> ($error <strong>===</strong> &quot;404&quot;) {<br>  header(&quot;HTTP/1.0 404 Not Found&quot;);<br>  <strong>echo</strong> &quot;&lt;html&gt;\n&quot;;<br>  <strong>echo</strong> &quot;&lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;\n&quot;;<br>  <strong>echo</strong> &quot;&lt;body bgcolor=\&quot;white\&quot;&gt;\n&quot;;<br>  <strong>echo</strong> &quot;&lt;center&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;&lt;/center&gt;\n&quot;;<br>  <strong>echo</strong> &quot;&lt;hr&gt;&lt;center&gt;nginx/1.12.1&lt;/center&gt;\n&quot;;<br>  <strong>echo</strong> &quot;&lt;/body&gt;\n&quot;;<br>  <strong>echo</strong> &quot;&lt;/html&gt;\n&quot;;<br>}</pre><p>A good hint is to check syslog where you might find more useful information.<br>If you have a 404 error and no syslog then you have reached resources/classes/provision.php which returns 404 either if the device is not enabled if($row[&#39;device_enabled&#39;] != &#39;true&#39;) or //if $file is not provided then look for a default file that exists not quite sure when this happens.</p><h3>How to test this?</h3><ol><li>Use curl or wget to request the provisioning file, prevent using your browser since it might work if you are login even if the http auth credentials are wrong.</li><li>Check the output if the URL settings are correct<br>Domains transfers normally cause no downtime and no issues but if some registrar want’s to play rough it can definitely cause some headache</li></ol><h3>Thanks</h3><p>Thanks go out to Aleksa Markovic for helping with this and setting up the test system and of course to Mark for creating fusionpbx.</p><p>This is a cross post from my blog: <a href="https://cristian.livadaru.net/fusionpbx-provisioning/">https://cristian.livadaru.net/fusionpbx-provisioning/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82556abcc91b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fusionpbx: 404 during provisioning]]></title>
            <link>https://medium.com/@lcx_at/fusionpbx-404-during-provisioning-adaccbaa7bfd?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/adaccbaa7bfd</guid>
            <category><![CDATA[voip]]></category>
            <category><![CDATA[fusionpbx]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Sat, 02 Jun 2018 11:59:22 GMT</pubDate>
            <atom:updated>2018-06-02T11:59:22.323Z</atom:updated>
            <content:encoded><![CDATA[<p>After updating fusionpbx to 4.4.1 phone provisioning stopped working and all requests resulted in a 404.</p><p>After looking in to the provisioning code there was this line which checks a new fusionpbx variable.</p><pre>if($provision[&#39;http_domain_filter&#39;] == &quot;true&quot;)</pre><p>If this setting is enabled, the domain the phone requests must match the domain to which the device was assigned. So if your provisioning goes to the main domain of fusionpbx, this will result in a mismatch in the domain uuid, hence the 404 error.</p><p>Updating this value to false will solve the issue.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adaccbaa7bfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Importing masses of IMAP accounts to Zimbra]]></title>
            <link>https://medium.com/@lcx_at/importing-masses-of-imap-accounts-to-zimbra-dd2a21530b65?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd2a21530b65</guid>
            <category><![CDATA[zimbra]]></category>
            <category><![CDATA[imapsync]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Fri, 22 Dec 2017 14:09:18 GMT</pubDate>
            <atom:updated>2017-12-22T14:09:18.057Z</atom:updated>
            <content:encoded><![CDATA[<p>Ok, I won’t double post this and it’s shameless self promotion of my blog entry … how to migrate from Cyrus IMAP to Zimbra with the help of the awesome imapsync tool.</p><p>If you’re just looking for the imapsync parameters, well here you go:</p><pre>./imapsync \<br>  <strong>--</strong>buffersize 8192000 \<br>  <strong>--</strong>nosyncacls <strong>--</strong>subscribe <strong>--</strong>syncinternaldates \<br>  <strong>--</strong>exclude &#39;(?i)\b(Junk|Spam|Trash)\b&#39; \<br>  <strong>--</strong>regexflag &#39;s/\\\\(?!Answered|Flagged|Deleted|Seen|Recent|Draft)[^\s]*\s*//ig&#39; \<br>  <strong>--</strong>regexflag &#39;tr,:&quot;/,_,&#39;<br>  <strong>--</strong>regextrans2 &#39;s,:,-,g&#39; \<br>  <strong>--</strong>regextrans2 &#39;s,\*,,g&#39; \<br>  <strong>--</strong>regextrans2 &#39;s,\&quot;,&#39;\&#39;&#39;,g&#39; \<br>  <strong>--</strong>regextrans2 &#39;s,\s+(?=/|$),,g&#39; \<br>  <strong>--</strong>regextrans2 &#39;s,^(Briefcase|Calendar|Contacts|Emailed Contacts|Notebook|Tasks)(?=/|$), $1 Folder,ig&#39; \<br>  <strong>--</strong>host1 &quot;192.168.0.1&quot; <strong>--</strong>host2 &quot;localhost&quot; <strong>--</strong>port2 7143 \<br>  <strong>--</strong>user1 &quot;$1&quot; <strong>--</strong>user2 &quot;$1&quot; \<br>  <strong>--</strong>password1 &quot;$2&quot; <strong>--</strong>password2 &quot;$2&quot; \<br>  <strong>--</strong>regextrans2 &#39;s,\&quot;,-,g&#39; \<br>  <strong>--</strong>regextrans2 &#39;s,&amp;AAo-|&amp;AA0ACg-|&amp;AA0ACgANAAo-(?=/|$),,g&#39; \<br>  <strong>--</strong>delete2 \<br>  <strong>--</strong>logfile $3</pre><p>Full details and some skripts to help with the migration are on my blog.</p><p><a href="https://cristian.livadaru.net/migrating-imap-accounts-to-zimbra/">https://cristian.livadaru.net/migrating-imap-accounts-to-zimbra/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd2a21530b65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dealing with Spamy phone marketers]]></title>
            <link>https://medium.com/@lcx_at/dealing-with-spamy-phone-marketers-28cd6751984c?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/28cd6751984c</guid>
            <category><![CDATA[freeswitch]]></category>
            <category><![CDATA[cold-calling]]></category>
            <category><![CDATA[pbx]]></category>
            <category><![CDATA[fusionpbx]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Thu, 30 Nov 2017 13:37:00 GMT</pubDate>
            <atom:updated>2017-11-30T13:37:00.552Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s December, that time of year then the spam cold calls start increasing. Be it some scam stating that my “google premium maps listing” will expire and I need to pay 180 Euro for another year or the usual donation for things you never heard about and of course the usual suspects wanting to sell the greatest stock tips ever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1yp2c0XoPfrHZyhqvWxihA.jpeg" /><figcaption>Please please call me again :) Photo by <a href="https://unsplash.com/photos/cAQfkfLSA80?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jesse Darland</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Block them?</h3><p>Thanks to the Call Block feature of FusioPBX I usually added them to the blacklist and sent them to music on hold, not just drop the call but put them on hold and waste their time like they waste my time. But somehow there’s no real fun in that is there?</p><h3>Play them some nice tune!</h3><p>My colleague suggested I should play them some ear worm that they can’t get out of their head the whole day, yeah but … still no fun in that.</p><p>After a few seconds of thought … how a bout a nice energising death metal track? of we go to audio junge, search for a nice, phone marketer worthy death metal track and found this lovely tune: <a href="https://audiojungle.net/item/death-metal/19536693?s_rank=1">https://audiojungle.net/item/death-metal/19536693?s_rank=1</a></p><p>Now each time someone on my blacklist calls me, they get to listen to this great death metal track.</p><h3>How to set it up in fusionPBX</h3><p>I will skip the part about adding the number to Apps -&gt; Call Block and also the upload of the recording. It’s important to set the option “Hold” for the blocked caller for this to work.</p><p>Calls on the blacklist that are set to “Hold” will be transferred to *9664 by default as we can see in the call_block lua script</p><pre>elseif (found_action ==”Hold”) then<br> session:setAutoHangup(false)<br> session:execute(“transfer”, “*9664”)</pre><p>All we need to do now is create a new *9664 dialplan with a higher priority then the old one. Do not delete the old one as you might still want music on hold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*u1Mg8rySO1kbEBbMFd5FFg.png" /><figcaption>*9664 — music on hold setup for blacklist</figcaption></figure><p>Note the extra condition checking the call_blocked setting, you really really want to add that if you don’t want non blacklisted callers which are on hold to listen to the same death metal track.</p><p>All done, rock on baby and keep calling me :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28cd6751984c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NeoVim with vim-airline in iTerm2]]></title>
            <link>https://medium.com/@lcx_at/neovim-with-vim-airline-in-iterm2-7901c0ec98a9?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/7901c0ec98a9</guid>
            <category><![CDATA[iterm2]]></category>
            <category><![CDATA[vim]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Mon, 25 Sep 2017 14:24:25 GMT</pubDate>
            <atom:updated>2017-09-25T14:24:25.262Z</atom:updated>
            <content:encoded><![CDATA[<p>So, you set up nvim with vim-airline and are using iTerm2, fire up your cool newly configured nvim and wtf is this?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0PakxOzGF8-oEqsSx0pgg.png" /><figcaption>screwed up airline settings</figcaption></figure><p>First of all RTFM, you need a <a href="https://github.com/powerline/fonts">powerline font</a> for vim-airline to work, that’s already mentioned in the docs.</p><blockquote>But I installed the fonts changed the font in iTerm2 and it’s still broken.</blockquote><p>Yeah … I know that feeling, just spent what feels like hours in searching for a solution and it’s so simple. Ever noticed the “Non-ASCII Font” setting in iTerm2?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*ND9KadYU_m7td46SLG_x_w.png" /><figcaption>Non-ASCII Font</figcaption></figure><p>Change that font to the patched powerline font and all will be good :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7M03TG1EC7TKqw8sjaW7Q.png" /><figcaption>That’s more like it</figcaption></figure><p>A huge thank you to <a href="https://github.com/gkb">gkb on Github</a> for this <a href="https://github.com/vim-airline/vim-airline/issues/142#issuecomment-29936302">comment in an Github issue</a> which opened my eyes!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7901c0ec98a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Call limit freeswitch (FusionPBX) on outbound calls]]></title>
            <link>https://medium.com/@lcx_at/call-limit-freeswitch-fusionpbx-on-outbound-calls-ccc601934db0?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccc601934db0</guid>
            <category><![CDATA[pbx]]></category>
            <category><![CDATA[voip]]></category>
            <category><![CDATA[freeswitch]]></category>
            <category><![CDATA[fusionpbx]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Fri, 28 Jul 2017 10:35:26 GMT</pubDate>
            <atom:updated>2017-07-28T10:35:26.381Z</atom:updated>
            <content:encoded><![CDATA[<p>I had a special request to send two inbound calls to a phone number (PSTN), if that phone number already had two active calls it should send the next two callers to a second phone number and if that one received two calls any other caller would just receive a sound file saying all lines are busy. Sounds simple and sounds like something <a href="https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools%3A+Limit">freeswitch limit </a>would handle.</p><p>Well, my first problem was that I didn’t see this important note at the beginning:</p><blockquote>Note that a limit is active within a given context — if you transfer an inbound call from the public dialplan to an extension in the default dialplan — any limit you just set in the public dialplan will be reset.</blockquote><p>Well… what that means is that as soon as you transfer the call, the limit is set back to zero and you have no clue on how many calls you actually already sent out. This is when I came across this <a href="https://txlab.wordpress.com/2013/06/29/freeswitch-limiting-the-number-of-concurrent-calls-on-multiple-sip-accounts/">blog post regarding execute_on_answer</a></p><p>Another request was to play some audio file while it was ringing, I could have done it with ring groups in fusionpbx but that caused some other issues so I went with a custom dialplan which looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WS9vjdCyeBvPtwHnHVwlZw.png" /><figcaption>Dialplan with caller limitation</figcaption></figure><p>first we export the limit and execute it on answer</p><pre>action export nolocal:execute_on_answer=limit db ${domain_name} studio1</pre><p>Then in a second condition we check if the limit counter is &gt; 1</p><pre>${cond(${limit_usage(db foo.example.net studio1)} &gt; 1 ? true:false)}</pre><p>if this is true, we transfer the call to our second dial plan 602.</p><p>For the audio playback while ringing to work, this does the trick</p><pre>ignore_early_media=true<br>instant_ringback=true<br>ringback=/var/lib/freeswitch/recordings/foo.examle.net/somefile.wav<br>transfer_ringback=/var/lib/freeswitch/recordings/foo.examle.net/somefile.wav</pre><p>Now to our second dialplan which looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5XaThNL01KYApjPGZ6cb0g.png" /></figure><p>Here we basically do the same, only that if the limit on studio2 &gt; 1 we just play the desired audio file and hang up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccc601934db0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SIP ALG is not your friend, especially with NAPTR + SRV]]></title>
            <link>https://medium.com/@lcx_at/sip-alg-is-not-your-friend-especially-with-naptr-srv-9afd88e5c5a1?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/9afd88e5c5a1</guid>
            <category><![CDATA[freeswitch]]></category>
            <category><![CDATA[voip]]></category>
            <category><![CDATA[mikrotik]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Mon, 24 Jul 2017 14:20:14 GMT</pubDate>
            <atom:updated>2017-07-24T14:20:14.889Z</atom:updated>
            <content:encoded><![CDATA[<p>So, I finally had my two <a href="https://www.fusionpbx.com/">FusionPBX</a> (freeswitch) setup in two data centers, solved the problem regarding how to register to the freeswitch with NAPTR + SRV Records which is quite awesome. I won’t get into the topic of NAPTR, if that’s what you’re looking for you should probably <a href="https://anders.com/cms/264/">read this</a></p><h4>The first tests</h4><p>Setup an old Yealink I had laying around, registering via NAPTR DNS works, calls work, failover to the other data center if one goes down, all works great. So it’s time to switch my phones over to the new setup so I can do more detailed tests. I didn’t think that the fact that I use SNOM instead of yealink could yield any other results but here the first surprise, once I hang up the call keeps on ringing which didn’t happen in the first tests with the Yealink. I retried with my favorite Mac OS soft phone (<a href="http://icanblink.com/">Blink</a>) as I wasn’t in the office and couldn’t test with the Yealink and the issue persisted which leads me to my first false conclusion.</p><h4>It’s a freeswitch issue</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlkOw1TIyw3X-eXs4ygguw.jpeg" /><figcaption>Photo by Jakob Owens on Unsplash</figcaption></figure><p>Next day in the office retested with Yealink and the issue is gone, retest with SNOM and the Issue is Back. Well, this sucks … Let’s try this with my Smartphone VoIP App, oh wait … media5fone doesn’t handle NAPTR which was a great moment to search for something new and I ended up with Bria for iOS (awesome softphone!) It handles NAPTR and guess what, same as with yealink, no issue. Back to SNOM and issue once again occurs.</p><p>So what’s the SIP Trace saying?</p><pre>SIP/2.0 481 Call/Transaction Does Not Exist</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vySmN7ayaiWkkdRQniYwCA.png" /></figure><p>What the ????</p><p>A lot of google searches later I came across this older <a href="http://lists.freeswitch.org/pipermail/freeswitch-users/2011-December/078247.html">Mailinglist entry</a>. This was describing my issue exactly, after the Proxy Authentication response my phone as well changed to the internal IP addresses.</p><h4>is this a SNOM issue?</h4><p>That was my first thought and I opened a support ticket with SNOM but I couldn’t wait until I got a response so I tested further.</p><p>On the FusionPBX IRC channel, someone with the same setup gave me an account where I could test with my phone and guess what, everything is working. So wait, is it freeswitch again?</p><p>Let’s confirm by connecting the phone directly to one datacenter without NAPTR and SRV so we now have the same phone, the same server, the same everything, except the NAPTR setup and guess what, once again it’s working.</p><p>So back to pointing the finger at SNOM but still made no sense. Then thanks to some input from the IRC channel regarding SIP ALG the issue was found.</p><h4>SIP ALG you nasty piece of ….</h4><p>I always disable SIP ALG, <strong>never</strong> liked it, <strong>never</strong> trusted it, it <strong>never</strong> helped me but <strong>always</strong> fucked me over … so I thought … <br>For some reason, I always though Mikrotik doesn’t have SIP ALG, but guess what? turns out they do, it’s just called SIP helper. Which also means, I was using it all these years and it did even work without issues until now.</p><pre>/ip firewall service-port disable sip</pre><p>This one little line solved my issue instantly! Everything works as expected with SNOM and other phones as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9afd88e5c5a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving a xen geust (domU) from a debian jessie host (dom0) to a debian stretch dom0]]></title>
            <link>https://medium.com/@lcx_at/moving-a-xen-geust-domu-from-a-debian-jessie-host-dom0-to-a-debian-stretch-dom0-c10b4b1d461b?source=rss-7b23d38ec10------2</link>
            <guid isPermaLink="false">https://medium.com/p/c10b4b1d461b</guid>
            <category><![CDATA[ext4]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[xen]]></category>
            <dc:creator><![CDATA[Cristian Livadaru]]></dc:creator>
            <pubDate>Thu, 13 Jul 2017 13:21:06 GMT</pubDate>
            <atom:updated>2017-07-13T15:07:56.755Z</atom:updated>
            <content:encoded><![CDATA[<p>Nice new freshly installed debian stretch server with Xen on it so I went ahead to move a guest from a different xen host, this dom0 was however still running on debian wheezy. Once I tried to boot up the guest via pvgrub I was greeted by this a error message while trying to mount /</p><pre>[   47.768360] EXT4-fs (xvda2): couldn&#39;t mount RDWR because of unsupported optional features (400)</pre><p>wait what?</p><p>Comapring features with tune2fs shows two features that the ext4 filesystem created on the jessie host doesn’t have, which the stretch server does.</p><ul><li>metadata_csum</li><li>64bit</li></ul><p>so, let’s get rid of these features so that the older kernel can mount the ext4 FS.</p><p>First FSCK, you need to pass the -f argument to force fsck to run</p><pre>e2fsck -f /dev/vg1/...<br>tune2fs -O ^metadata_csum /dev/vg1/...<br>tune2fs -O ^64bit /dev/vg1/...</pre><p>After the last tune2fs you will be prompted to run resize2fs so let’s do that as well.</p><pre>resize2fs -s /dev/vg1/...</pre><p>Now when booting the guest it might happen that you will see a new error message</p><pre>Journal superblock has an unknown incompatible feature flag set.<br>/dev/xvda2: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.<br>        (i.e., without -a or -p options)</pre><p>so, let’s do that as well, run fsck manually without the -a option.</p><pre>(initramfs) fsck.ext4 /dev/xvda2<br>e2fsck 1.42.12 (29-Aug-2014)<br>Journal superblock has an unknown incompatible feature flag set.<br>Abort&lt;y&gt;? no<br>Journal superblock is corrupt.<br>Fix&lt;y&gt;? yes<br>Pass 1: Checking inodes, blocks, and sizes<br>Pass 2: Checking directory structure<br>Pass 3: Checking directory connectivity<br>Pass 4: Checking reference counts<br>Pass 5: Checking group summary information</pre><p>after exiting initram the system will boot up without any issues.</p><h4>What about debian wheezy?</h4><p>Apparently this solved the issue only for my debian jessie guest. The wheezy guest still complained during boot</p><pre>[ 1.683594] JBD2: Unrecognised features on journal<br>[ 1.683601] EXT4-fs (xvda2): error loading journal</pre><p>I expected this but didn’t expect initramfs to not contain fsck. So the solution was to boot up a jessie guest which has the LVM from the wheezy system, then run e2fsck, shut down jessie and boot up with wheezy again.</p><pre>root@jessie:~# e2fsck /dev/xvda3<br>e2fsck 1.42.12 (29-Aug-2014)<br>Journal superblock has an unknown incompatible feature flag set.<br>Abort&lt;y&gt;? no<br>Journal superblock is corrupt.<br>Fix&lt;y&gt;? yes<br>Pass 1: Checking inodes, blocks, and sizes<br>Pass 2: Checking directory structure<br>Pass 3: Checking directory connectivity<br>Pass 4: Checking reference counts<br>Pass 5: Checking group summary information</pre><pre>/dev/xvda3: ***** FILE SYSTEM WAS MODIFIED *****<br>/dev/xvda3: 56968/3932160 files (0.2% non-contiguous), 1141635/15728640 blocks</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c10b4b1d461b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>