{"id":5975,"date":"2023-12-27T12:26:26","date_gmt":"2023-12-27T19:26:26","guid":{"rendered":"https:\/\/jasonsblog.ddns.net\/?p=5975"},"modified":"2023-12-27T13:15:06","modified_gmt":"2023-12-27T20:15:06","slug":"pushover-allstarlink-connection-messages","status":"publish","type":"post","link":"https:\/\/jasonsblog.ddns.net\/index.php\/2023\/12\/27\/pushover-allstarlink-connection-messages\/","title":{"rendered":"Pushover for Allstarlink Connection Messages"},"content":{"rendered":"\n<p>Having installed <a href=\"https:\/\/jasonsblog.ddns.net\/index.php\/2023\/12\/26\/skywarn-plus-for-allstarlink\/\" target=\"_blank\" rel=\"noreferrer noopener\">Skywarn Plus<\/a> on my <a href=\"https:\/\/www.allstarlink.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Allstarlink<\/a> node yesterday, it used <a href=\"https:\/\/pushover.net\/\" target=\"_blank\" rel=\"noreferrer noopener\">Pushover<\/a> for the weather alert text messages to your phone as opposed to cellular SMS messages. The app is so nice for receiving messages because it&#8217;s clean and you can easily delete them as they come in as opposed to using an SMS client. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pushover.net\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"437\" src=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-32-1024x437.png\" alt=\"\" class=\"wp-image-5976\" srcset=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-32-1024x437.png 1024w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-32-300x128.png 300w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-32-768x328.png 768w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-32.png 1073w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>So I thought it would be nice to setup a script to send new connection alerts through Pushover, and I had a previously operating SMS script from Doug Crompton that just needed some tweaking to convert over to Pushover. Consequently, Hamvoip has a <a href=\"https:\/\/hamvoip.org\/howto\/Allstar_email_howto.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">guide<\/a> on how to setup your Gmail account to allow for e-mail messages from your node, and once that&#8217;s setup and working you can utilize it to send e-mails to Pushover. And then use the e-mail address from your Pushover account to receive the alerts only when someone connects to your node via the smsconnectlog bash script below which I include in my \/etc\/asterisk\/local directory, and don&#8217;t forget to make it executable (chmod +x).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n#\n# Bash Script to Text\/email new connects\/disconnects\n# filtered by callsign ignoreing your nodes,iaxrpt...\n# Logging must be enabled for your nodes\n#\n# Destination SMS number and address or email\nRECEIVER=\"Pushoveraddress@pomail.net\"\n# How often to check connection log \nALERT_INTERVAL=\"15\"\n# Log file to monitor\nLOGFILE=\"\/var\/log\/asterisk\/connectlog\"\n# Callsign to ignore\nCALL=\"CALLSIGN\"\n\nlength=$(find \"$LOGFILE\" -printf \"%s\")\nCALL=\"$CALL*\"\nwhile sleep $ALERT_INTERVAL  \ndo\n  new_length=$(find \"$LOGFILE\" -printf \"%s\")\n  if &#91;&#91; $length &lt; $new_length ]]\n  then\n    newconnect=$(tail --bytes=$&#91;new_length-length] \"$LOGFILE\"|cut -d' ' -f13)\n    newconnect2=$(tail --bytes=$&#91;new_length-length] \"$LOGFILE\"|cut -d' ' -f11)\n    newconnect3=$(tail --bytes=$&#91;new_length-length] \"$LOGFILE\"|cut -d' ' -f12)\n    if &#91;&#91; $newconnect != $CALL &amp;&amp; $newconnect2 != $CALL ]]\n    then\n      if &#91; \"$newconnect3\" = \"&lt;=IN==\" ]\n        then\n        newlogentries=$(tail --bytes=$&#91;new_length-length] \"$LOGFILE\" |cut -c 11-16,29-)\n        echo -e \"Subject: Allstar ConnectLog\\n\\r$newlogentries\" | sendmail -v $RECEIVER\n      fi\n    fi\n  fi\n  length=$new_length\n  newlogentries=\"\"\ndone\n<\/code><\/pre>\n\n\n\n<p>Then you&#8217;ll want to add the file once tested to your \/etc\/rc.local file to be loaded on boot, and reboot after everything is configured.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Script to sms new external log entries\n\/etc\/asterisk\/local\/smsconnectlog &gt; null &amp;<\/code><\/pre>\n\n\n\n<p>Once setup, you&#8217;ll only get messages when someone connects to your node, and the messages are very easy to check and delete. Worth pointing out that Pushover can be used for a lot of other automation messages as well and is a very good product. And I&#8217;ll include their Android privacy information below as you should always check this before installing any applications on your phone, especially since many are recording your location information, apps used&#8230; and sharing this with third parties like our government which purchases it to skirt around legal requirements.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/play.google.com\/store\/apps\/datasafety?id=net.superblock.pushover\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"263\" src=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-33.png\" alt=\"\" class=\"wp-image-5982\" srcset=\"https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-33.png 780w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-33-300x101.png 300w, https:\/\/jasonsblog.ddns.net\/wp-content\/uploads\/2023\/12\/image-33-768x259.png 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Having installed Skywarn Plus on my Allstarlink node yesterday, it used Pushover for the weather alert text messages to your phone as opposed to cellular SMS messages. The app is so nice for receiving messages because it&#8217;s clean and you can easily delete them as they come in as opposed to using an SMS client. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-5975","post","type-post","status-publish","format-standard","hentry","category-ham"],"blocksy_meta":[],"featured_image_src":null,"author_info":{"display_name":"Jason","author_link":"https:\/\/jasonsblog.ddns.net\/index.php\/author\/jturning\/"},"_links":{"self":[{"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/posts\/5975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/comments?post=5975"}],"version-history":[{"count":6,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/posts\/5975\/revisions"}],"predecessor-version":[{"id":5986,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/posts\/5975\/revisions\/5986"}],"wp:attachment":[{"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/media?parent=5975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/categories?post=5975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jasonsblog.ddns.net\/index.php\/wp-json\/wp\/v2\/tags?post=5975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}