[Asterisk][raspberry PI] Send SMS from Dongle to Mail Adress

Login as Root to your PI check Asterisk Dongles.
Open Asterisk Shell asterrisk -r
To get list of dongles type dongle show devices, looks like this…

ID           Group State      RSSI Mode Submode Provider Name  Model      Firmware          IMEI             IMSI             Number
dongle0      0     Free       20   5    4       aaaa          AAA0      1AAAAA00.00   SAAAASD  XXXXX XXXXXXXXXXX

Note that dongle0 name and leave the Console of asterisk with exit
Than open the Config File vim /etc/asterisk/extensions.conf

exten => sms,1,Noop(Incoming SMS from ${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})})
exten => sms,n,System(echo 'From: ${CALLERID(num)} <asterisk@mydomain.com>\nTo: Recipient Name <asterisk@mydomain.com>\nSubject:SMS - Received\nReceived from: ${CALLERID(num)}\n${BASE64_DECODE(${SMS_BASE64})}' >> /tmp/sms.txt)
exten => sms,n,System(ssmtp sms@mydomain.com < /tmp/sms.txt) 
exten => sms,n,System(rm -f /tmp/sms.txt;)
exten => sms,n,Hangup()

Save and close the Configuration file.:wq

If you get this error Message in asterisk:
at_response.c:1420 at_response_smmemfull: [dongle0] SMS storage is full
go to your Asterisk console asterrisk -r
Type in dongle cmd dongle0 AT+CMGD=1,4 to clear the SMS Cache.
Or If you wan’t to see the Messages type the following.
dongle cmd dongle0 AT+CMGL="ALL"

Now you can test the Service.

[Raspberry Pi] send Mail Konfiguration

How to Configure the Raspberry Pi with Debian image to Send Mails trouth an firewall.

# Login as Root
# Update Package List
apt-get update
# apt-get install ssmtp

# if Installation complete
# Configure the ssmtp.conf

vim /etc/ssmtp/ssmtp.conf

# Sender Server / Extern Mail Hoster Adress

# Senders Host must be Exist.


Now the Mail Configuration is ready to test.

# Login as Root
pstree | mail -s "PSTREE RESULT" mymail@addyy.com

If you plan to test this Projekt you need: