Using Nomorobo to block calls in Asterisk

Nomorobo is a fantastic service. It’s not perfect; plenty of illegal phone spammers are using throwaway numbers and/or illegally spoofing caller ID numbers to make calls that appear to be from random numbers — usually in your own area code. Short of using a strict whitelist, I don’t see a real way to get rid of those. Using Nomorobo, though, will dramatically cut down on the number of junk calls you will receive.

There’s a little problem, though… while many phone providers offer the service (we’ve been using Ooma), they don’t appear to offer the service to individuals or small businesses who run their own phones.

I ran my own Asterisk PBX for several years, supporting our home phones as well as a separate line I used for work, and even a toll-free number for my side business. Life was good for quite a while, but eventually it got to be quite a hassle trying to keep up with all the junk calls. Then my VOIP carrier changed their pricing to make them much less attractive from a cost standpoint. Eventually we switched to Ooma. They’ve been good, but not without issues. The Telo Air occasionally loses communication with the mothership, and if you don’t see the red light you won’t know that your phones aren’t working. The cost has gone up, now running over $20 per month for the Ooma Premier, which includes what I consider to be some pretty basic features — like call blocking, for example.

Now we have some family members who need a home phone, but I just can’t bear to see them get roped into paying really stupid monthly costs for a simple phone line. That, and our Ooma service is getting more expensive and (it seems) less reliable by the year. Time to switch back. But how can I keep Nomorobo? It would be a tough sell to do without that!

Well, Twilio to the rescue! They offer a Nomorobo lookup API that costs a tiny amount per lookup — $.003, or 0.3 cents per incoming call lookup. Conversely, that’s 333 lookups per dollar. Not bad, I’ll gladly pay that to avoid taking telemarketing or scam robocalls. Now, if only we could get Nomorobo to list all of the numbers used by political “push polls”, recorded messages, and other political campaign silliness!

Twilio’s call rates are not outrageously high either, and their monthly costs for DIDs (phone numbers) are pretty reasonable. The only thing I’ll fault them on is too much hassle to set up CNAM for your outbound calls, so unless you go through that process everything shows up as the number only with no CID name. Flowroute is MUCH better for this, so I route most of my outbound calls through them.

So — how to get Asterisk to do the lookup? After several hours of playing around with this, I found that it’s pretty easy to do. While it wouldn’t be terribly helpful (or smart) for me to post my entire dialplan here, I’ll include enough to get you going. I put this very near the top of the context I use for incoming calls from PSTN trunks. There’s no sense in burning CPU cycles on a call if you’re just going to drop it anyway.

First, you’ll need a Twilio account. They’re even nice enough to give you some credit on your account if you’re new, and it’s enough for quite a bit of learning and development work. I funded my account so I can use them for international calls — they’re ridiculously cheap for most destinations. They’re also a good solution if you want to get DIDs in countries outside the US.

Once you have a Twilio account established, use your account SID and auth token to set CURLOPT() with your username and password. This will be used in the next line to make the curl call to the API:

same = n,Set(CURLOPT(userpwd)=username:password)

Now, make the call to Twilio’s API to get the spam score. The result is a block of JSON that gets saved as TWILIO_RESULT:

same = n,Set(TWILIO_RESULT=${CURL("https://lookups.twilio.com/v1/PhoneNumbers/${CALLERID(num)}?AddOns=nomorobo_spamscore")})

Since we’ve got a block of JSON, we’ll need to extract the one wee bit we need. Fortunately Asterisk has a solution for that as well, so we don’t need to resort to anything drastic like a shell command:

same = n,Set(SPAMSCORE=${JSON_DECODE(TWILIO_RESULT,add_ons.results.nomorobo_spamscore.result.score)})

Now we use that result to drop the call if it’s spam. A simple Hangup(2) tells the caller that their call was rejected:

same = n,GotoIf($[ ${SPAMSCORE} = 1]?dropcall)

Later in the dialplan, after we’ve done the whole “call the user, drop to voicemail if they don’t answer, yadda yadda yadda” we have this:

same = n(dropcall),Hangup(21)

The Hangup(21) tells that their call was rejected. There are other, even more creative codes to use… like these (list courtesy of voip-info.org):

  • 1 – Unallocated number
  • 22 – Number changed
  • 27 – Destination out of order
  • 38 – Network out of order

Kramer’s Father Dempsey

I’ve tried a number of English and Balkan blends over the past several months. For those who don’t know, different types of tobacco each have their own unique flavor profile. Virginia is quite different from Burley; Latakia is quite distinct, and Turkish or Oriental leaves are different still. There are differences in the leaves themselves, then there are differences in how the leaves are dried, cured, and so on.

An English blend is typically Virginia tobacco blended with Latakia, which is a smoke cured leaf that comes from Cyprus. It was at one time produced mainly in Syria, but due to decades of war and other factors Syrian Latakia hasn’t been available in quite a while, and quite likely never will be again. The tobacco leaves are cured by hanging them in a shed with a fire pit burning various types of resinous, fragrant wood native to the region where the tobacco is grown. This produces a very distinct, rich, smoky aroma that carries over to the flavor of the tobacco when smoked. If you’re a fan of Islay Scotch (or even Johnny Walker Black Label), you’ll like Latakia.

If you add some Oriental or Turkish to it, you’ve got a Balkan blend. Orientals are small leaf, sun cured tobaccos and are quite fragrant. They tend to have a slight note of what I can only describe as an “incense” like flavor. That flavor is present to varying degrees in different blends, and when it’s there’ it’s quite distinct. My favorites have a hint of it, not an overpowering amount.

I ordered an ounce* of Father Dempsey to try just based on having seen quite a few favorable reviews in various places. Based on the descriptions I was reading, it seemed like it might be a blend I’d enjoy. It’s typically described as a full bodied English blend. One of the more raved about English blends is called Squadron Leader, which I’ve tried. It’s nice, but honestly I find it a bit too mild. I’m not a fan of overly strong tobacco, especially those blends with high nicotine content, but I do smoke English blends for the flavor. Father Dempsey is a notch or two more full bodied, and I find that it really holds its own.

I do love my Balkan blends; there are times when I really want that unique, slightly incense-y flavor of the Oriental leaf. Then there are times when I’m just in the mood for something with a little different character. That’s when Father Dempsey, or Squadron Leader, or some Navy flake or even an aromatic like 1-Q is nice to have on hand. I have to say, though, that I may end up keeping a good stock of Father Dempsey on hand. I could see it being something I’d reach for pretty regularly. I really enjoy an assertive Balkan like White Knight when I’ve got the time to relax and enjoy it. There are times, however, when something a little less “forward” is called for, and Father Dempsey seems to be a blend that just fits in perfectly. I can see why people tend to rave about it.

* If you’re not a pipe smoker, the idea of ordering an ounce may not mean much to you. Pipe tobacco is generally available in either tins or pouches, or in bulk. Tins and pouches are generally 50 grams (1.75 oz), with some exceptions. 100g and larger tins and tubs are not uncommon. Bulk tobacco can be ordered by the ounce, or even by the pound. An ounce is pretty much a sample size. At a bit over 28 grams, and roughly 3-5 grams per bowl, an ounce bag will give you enough tobacco for roughly six to maybe ten or twelve average sized pipe bowls.

Hearth & Home Black House

I tried this tobacco based on some reviews and suggestions from r/PipeTobacco Reddit users. It’s supposed to be a close match for the original Balkan Sobranie, though most people think White Knight (also from Hearth & Home) is better. From what I’ve read, H&H developed two different blends to try to match the old Sobranie blend. One was wildly popular with pipe smokers, the other won an award from other tobacco blenders. Or so the story goes.

It’s a ribbon cut mixture, with a good smoky tin note. I’ve smoked about half the tin now. I like it fine, but I really do like White Knight better. This seems to me to be more of a straight English blend; it’s got more “substance” to it than, say, Squadron Leader, but lacks that little hint of incense (for lack of a better word) that I get from a more Oriental forward blend like White Knight or Sutliff’s Sobranie match. I’m not sorry I tried it; it’s a good solid blend and I do enjoy it. That said, it’s not high on my re-order list. Tinned tobaccos are generally more expensive than bulk blends – usually double the cost or more. This one is no exception, and there are bulk blends I like as much or better.

Lessons learned: Maple syrup

Here’s a quick recap of the lessons I learned during our first year of maple tree tapping and maple syrup production. It’s my to-do list for next January.

  • Be prepared. I need to make sure I have everything I’ll need lined up ahead of time, cleaned, sanitized, and ready to go early. I’m pretty sure we missed a week, possibly two, of the sap run this year. Better to be ready in January.
  • I need to have two or three dedicated maple sap buckets, with airtight lids and at least 1/2 gallon markings, to hold at least a couple days worth of sap.
  • A hydrometer is a must. Trying to accurately measure the temperature of a small quantity of maple syrup is hard. The temperatures also seem to be a terrible way to estimate sugar content. I bought a hydrometer this year, and for next year I’ll have a testing cup on hand as well.
  • For the sap, a refractometer would be helpful to know the sugar content so I know what to expect when boiling it. Not essential, but they’re cheap so I’ll probably buy one.
  • Have plenty of propane; make sure there are at least two full tanks on hand.
  • Have bottles and labels on hand for the finished product.
  • More spiles and bags, unless I switch to plastic drip lines and containers on the ground (which would probably be better anyway).
  • A boiling pan with more surface area would be better. I’ve got a year to explore better evaporating options. I don’t want to go overboard, but maybe there’s a better option.
  • I may set up a small RO system. It would cost some to set up, but would greatly reduce the boiling time and save on propane. I’ve got time to investigate and decide whether I want to set one up. Next year I’ll have at least 6 taps going in 6 trees — four here, two at a rental house we own.

Consummate Gentleman revisited

As I stand here in the garage enjoying a pipe full of what was the first English blend I ever tried, I thought I’d follow up on my first post about this fine tobacco.

Since that summer evening when I first cracked open that tin – it was also the first vacuum sealed tin I had ever bought – I’ve come nearly to the end of that 50 g. I’ve explored a number of other English and several Balkan blends. I’ve enjoyed them all, but Consummate Gentleman never disappoints. It’s always smooth, not overpowering. The Latakia plays more of a supporting role, never trying to take the spotlight. I can appreciate the sweeter, slightly grassy Virginia while still getting that wonderful smoky undertone. Since it’s mostly Virginias, it will reward a slow, leisurely smoke and remind you somewhat harshly if you rush it.

So, with all that said… will I buy more? It’s hard to say. Right now I’ve got over a dozen tobaccos on hand, all in small quantities while I sort out what I like and what I don’t (I’m looking at you, Bayou Morning, and your buddy Haunted Bookshop too). I’d like to narrow it down to a few blends that I particularly like and can stock up on. This is one I like, but I’m not sure I’m in love with it. Time will tell. I will say, if you’re thinking about dipping your toes into English blends you could do worse than this one.

Our first batch of maple syrup!

After all the “learning curve” experiences over the past couple of weeks, we’ve finally got our first batch ready to bottle.

Using the turkey fryer to boil down the sap was a big step. There are faster and better ways, but this is what is practical right now. Ideally I’d like to have a 2′ square or 2 x 3 syrup pan, but that’s a purpose-specific item that would cost a lot and take up a lot of room for eleven-plus months of the year. The fryer does a passable job, and I’ve learned to just let it go until the sap is very nearly syrup before finishing it on the stove. The first time I emptied the stock pot there was still too much water; it took a couple of hours to boil down on the stove. Last night I brought in the second run; it was very close to being “done” when I poured it into the pan.

After sorting through our thermometers, I found one digital kitchen thermometer that reads in half-degree increments well past the point where our maple sugar would turn into maple candy. That has made the process so much easier and better. I can reliably get the temperature right where it needs to be. Unfortunately, I’m still not sure whether I’ve got it right. The resulting syrup seemed a bit thin to me. I ordered a maple syrup hydrometer from Amazon (they’re not expensive). Once it arrived, it confirmed my suspicion that the sugar content was a little low. I had to boil it a few more minutes, bringing the temperature up to 221 F. The next step will be to bottle the 2 quarts we have finished.

We have far more syrup than I ever imagined we’d get. Remember, when I started this I figured maybe I’d get enough maple syrup to anoint a stack or two of pancakes. Well, we’ve got about half a gallon now and there will be more. We’ve got nothing to store it in long term, and I’d like to share some with friends and family. Half a gallon is way more syrup than we’d use in a year. I ordered some maple syrup bottles and am working on ideas for a label to stick on them. Until then… yeah, I got impatient and bottled the first batch in these flask-shaped 375 ml bottles. As I write this they’re sitting in a pan pasteurizing before I put the caps on.

Pasteurizing the bottles before capping
Cooling down while I ponder how to label the bottles

More Maple Madness

Wow, what a journey this has been.

When I started this my goal was just to try it out and see if it would even be possible to get a little bit of syrup from our two larger trees. I was not prepared for what’s happened, even on this tiny, tiny scale. Not to give away the ending, but If I had known what would happen, I’d have prepared better. I’d have had multiple buckets marked in 1 gallon or maybe even 1 quart increments. I’d have filled both of my propane cylinders. I’d have picked up the propane turkey fryer from my son and had it scrubbed out. I’d have probably done the tapping a little differently.

When the weather is warm, I’ve been getting an average of 5-6 gallons of sap per day from the two trees. I can’t say exasperated much, because I’ve been emptying the sap collection bags at varying levels of fullness. My buckets aren’t marked, and sometimes I just empty them directly into the stock pot. The message here is that I’ve gotten a LOT of sap, relative to the amount I thought I’d see, and it’s gone on for days longer that I expected. As I write this it’s 27 degrees F (that’s 2.78 C for my friends outside the US), well below freezing, and it’s overcast. The collection bags were emptied late yesterday; I’ll still have to go empty them again this afternoon. That will be another five gallons or so. But I’m getting ahead of myself; let’s back up to this past weekend.

In my last post, I described my efforts to boil the sap down to make syrup. I can tell you a few things that simply won’t work. Boiling sap on your stove — no, don’t bother trying. Sure, it will work. Eventually. Your house will be a rainforest. We’ve got a good sized place and you could tell the humidity was getting higher, even with the vent hood turned on. And that electric roaster pan? Nope. It heats from the sides, not the bottom, so you can pour in 4-1/2 gallons… and it will steam, but not boil.

I bought a turkey fryer a couple of years back. I’ve never used it myself; it’s lived over at my son’s house where it’s been used to fry a few turkeys. It’s got a stock pot that will hold about 7 gallons (call it 26 liters) and a propane burner. Pete dropped it off for me. That took a little scrubbing to get completely clean and ready for sap duty. As I now had about 8 or 9 gallons of sap, I filled it and fired it up. As the level dropped during the day I’d add in more sap. Seven hours later I’d reduced the first batch down to less than a gallon and brought it inside to finish — it was late and dark, and I’d been having to run out every 13 minutes all day and reset the 15 minute automatic shut-off timer. This was way, way too labor intensive. And how much sap was that? I have no idea. If I were to guess I’d say maybe 9 gallons or so. Maybe more, maybe less, I have no way to keep track.

The turkey fryer, full of fresh sap and some partially boiled sap

Once inside on the stove, it took another couple hours to get to the point where the candy thermometer indicated (to the best of its very limited ability) that we might have maple syrup. Unfortunately it’s got nowhere near the resolution I need to see when the boiling temperature reaches 217 degrees. Why 217? Well, at our elevation, water boils at 209.5 F, give or take half a degree based on barometric pressure, so I add 7.5 to that to hit 66% or a little better sugar concentration. It’s an approximation (more on that later).

It’s getting closer to being syrup, and starting to take on that beautiful color!
The first batch… chapter one.

I finally called it quits when things were looking and feeling like syrup. It bugged me, though, that I didn’t really know for sure how close I was. After cooling it was apparent that the “syrup” was a little thin, and a little light in the rich flavor you’d expect. The next morning Lisa turned the burner on low heat and, not knowing any better, told me about it several minutes later. By the time I got it shut off, it was about to boil over. What we ended up with completely crystallized into a solid tan block of maple sugar once it cooled off. I didn’t take a picture of that, but it was a touch over half a liter of solid maple sugar.

Fortunately all was not lost… more to come.

Tapping maple trees for syrup

This year I decided to try something I’d been half-jokingly threatening to do for several years. Namely, tap the two big maple trees in my back yard and gather sap to make maple syrup.

I wasn’t expecting this to work well. They’re not sugar maples, for starters; they’re silver maples. Not even the second or third choice for syrup production. They’re big enough, though, and I finally decided to spend a few bucks on some equipment to give it a try. I figured, best case, maybe it would be a little bit of fun and maybe we’d end up with enough maple syrup for a stack of pancakes.

To do this you need a few items. First, you need spiles. These are the taps that get tapped into shallow holes drilled in the tree trunk. Not wanting to spend a big chunk of money on specialized buckets and other stuff that would be of limited or no use and would need to be stored 11 months of the year, I went with some plastic spiles and a bag collection system. The kit came with the proper size drill bit, three spiles, three PVC bag hangers, and three 4-gallon plastic bags. I thought the bags were pretty ambitious.

You’re supposed to start this as soon as the weather starts getting above freezing during the day, and drops below freezing at night. I didn’t anticipate things getting as warm as soon as they did, so I was a week or two late getting the supplies ordered. I honestly figured I’d probably missed the window to do this, but decided to give it a shot anyway. Once I had everything together I headed out to the back yard with my cordless drill, the spiles, a small mallet, and the collection bags. I picked the larger of the two trees to start with.

I’d already marked the drill bit with some tape at the proper depth, about 2”. I drilled the first hole on the south side of the tree (happily facing the house) and gently tapped the first of the spiles in place. I noticed that it immediately started dripping clear, watery sap. That surprised me. I hung the bag on it, and saw it was dripping regularly – about once per second or so.

A tree with spile and collection bag attached. The liquid in the bag is about 15 minutes worth of sap.

Moving to the other tree, I repeated the process there. This time the tap started dripping even faster, nearly twice a second. This was looking much better than I ever thought it would. Since I had a third collection setup and the first tree is actually large enough (according to my online research) to support as many as three taps, I started a second one about a quarter of the way around the trunk from the first one. All three were happily dripping away, much to my surprise.

I went back in, but couldn’t help look out the window often to check on the progress of our little maple syrup production line. I saw the bags show a little collected liquid in the bottom. Then it looked like there was about a cup in each bag, with the tree on the left (west) side outpacing the other one. Then it looked like maybe a pint. I checked often throughout the afternoon, amazed at the rate at which the sap was running out of those trees. By 5 PM, I decided I’d empty the bags. Much to my delight and amazement, I got about three gallons of sap total. Before we went to bed I’d collected another gallon or more.

Both trees tapped. The tree nearest the camera has a second tap on the other side of the trunk.

Maple sap is clear and looks like plain water. The sugar concentration, depending on several factors, can range from 1 to 3 percent sugar. I tried a little sip; it’s very, very slightly sweet. Maple syrup is, by definition, 66% sugar. To get from sap to syrup takes a lot of evaporation by boiling. You’ve got to boil 5 gallons of sap down to about a pint of syrup… or even less. Everyone will tell you this needs to be done outside. Needless to say, I tried it in the kitchen. A couple of hours of boiling sap down in a stock pot got me maybe 1/10 of the way there or less, but at least the sap – reduced by about half – actually tasted a little sweet. The humidity, however, was rising in the house to the point that I decided enough was enough and shut off the burner.

Maple sap boiling on the cooktop

That was yesterday. Today was overcast, colder, and raining. We probably got another gallon or so from the collection bags, maybe a bit more. Combined with yesterday’s collection and after the boiling, there was about 4-1/2 gallons or so. Not bad for the first try, started late in a suburban back yard. Being struck with what seemed like a good idea, I brought the 18 quart roaster oven up from the basement and filled it with sap, then turned it on and let it cook for a few hours. Unfortunately it’s just not up to the task of boiling that much liquid with the lid off. I can’t see the point to trying it with the lid on, since the whole point is to reduce the sap by evaporation. On the bright side, I figure half an hour at 180 degrees will kill off any bacteria and hopefully render the sap good for a couple more days until I can set up the propane turkey fryer for some serious boiling. I’m also hopeful tater can get another few gallons of sap before it’s time to call it quits until next February.

More to come…

A Balkan love affair

As I’ve worked my way through a dozen or so new pipe tobacco blends, I’ve developed a real affection for Balkans. The English tobaccos I’ve tried – Consummate Gentleman and Early Morning Pipe – are fine, and I do enjoy a bit of Latakia in the blend. That said, mixing in some Oriental just adds a little kick that I really enjoy.

I think the first one I tried was Sutliff’s Balkan Sobranie Original Mix Match. That was an eye opener! It had that smoky English note to it, which I like. Along with it, though, is a very noticeable undertone of something wonderful. It almost reminds me of Sen-Sen, though just a little hint. Somewhere between anise and an aromatic resin, like frankincense. It sounds horrible, but it’s actually quite nice. I’m assuming that’s the Oriental coming through.

Since then I’ve tried White Knight and Arango Balkan Supreme, and I’m ordering a tin of Black House to try out. They’re all similar to some degree, but so far the Sutliff has been my favorite. It and White Night are almost identical, which is no surprise considering I think they’re the same thing in tinned and bulk form.

It’s possible I may tire of the taste, so I’m not loading up with pounds of this stuff, but so far I’m loving it. I’m still keeping the English and 1-Q and the rest in my rotation, but it’s a rare day that I don’t smoke at least one pipe of a Balkan mixture.

Rob Roy made with Johnny Walker Double Black

I like a Manhattan on occasion, but once in a while I like to branch out a little. Tonight I tried a Rob Roy, made with Johnny Walker Double Black and Cinzano. I used a nice bourbon barrel cherry and a couple dashes of Angostura bitters.

The first sip was not great. Too bitter, too much bitter finish. I decided to add a little squirt of simple syrup, which helped quite a bit.

I think a smoky, Islay- heavy blended Scotch like this is not the best choice. I could see it being a good use for some crappy blended Scotch. It would probably be decent with a Highland Scotch like Macallan or something. Obviously this merits more research and experimentation.