#!/bin/sh #tmo.sh #T-mobile Get More with Signal #by Lucky225 # #This script allows you to receive a FREE inbound call to your t-mobile cellphone by sending a text over signal to your Asterisk #box. It regardless of what plan you are on, it even works #on a 2GB $10/mo "data only" sim that isn't supposed to have phone #calling at all. # #Pre-requisite is signal-cli on the asterisk box - install it at https://github.com/AsamK/signal-cli #Then just run a screen session with watch -n 1 ./tmo.sh that will be constantly looking for a text from you. # #To place a call send a text over signal to your asterisk box with $76073339966, replace 7607339969 with the number you want to #call. # #Replace 3035551212 below with your signal number and replace SIP/outbound/7205551212 with your outbound trunk #name and tmobile sim phone number. Replace tmo-out with your regular outbound context in asterisk. # #Original idea from 2006 text file T-mobile - Get More... Than you're supposed to! by Lucky225 & greyarea #http://web.textfiles.com/ezines/DIGZINE/dig4.txt signal-cli -u +13035551212 receive --ignore-attachments > data.txt cat data.txt | grep -e '^Body: \$' data.txt > output1.txt cut -d' ' -f2- output1.txt > output2.txt cat output2.txt | grep '\$' | cut -c 2- > output3.txt head -1 output3.txt > output4.txt if grep -q $ output4.txt; then number=$(< output4.txt) echo -e "Channel: SIP/outbound/7205551212\nCallerid: 18009378997\nContext: tmo-out\nExtension: $number\n" > new.call mv new.call /var/spool/asterisk/outgoing/ rm data.txt rm output1.txt rm output2.txt rm output3.txt rm output4.txt else break fi