[HowTo] SMS with CID when a call is missed - chan_mobile

To get an SMS with CID# when someone is calling us but we are out of office.
The call is redirect to the voicemail in this example but you can choose any other destination you prefere.

You need chan_mobile installed and connected to a cellphone capable of sending SMS.

Edit /etc/asterisk/extensions_custom.conf:

exten => xx,1,Answer
exten => xx,2,MobileSendSMS(device,numbertosendsms,call received from:${CALLERID(all)} at ${STRFTIME(${EPOCH},%d:%m:%Y - %H:%M:%S)} from channel ${CHANNEL})
exten => xx,3,Voicemail(number)
exten => xx,4,Hangup

change ‘xx’, ‘device’, ‘numbertosendsms’ based on your configuration and numbers,
then save and restart asterisk (‘amportal restart’)

NOTE: you may want to create a misc destination ‘SMS’ (dial xx) and divert the incoming calls to it when out of office.


exten => 98,1,Answer
exten => 98,2,MobileSendSMS(MPx220,+393348702623,call received from:${CALLERID(all)} at ${STRFTIME(${EPOCH},%d:%m:%Y - %H:%M:%S)} from channel ${CHANNEL})
exten => 98,3,Voicemail(240)
exten => 98,4,Hangup

This will send ‘call received from: CID# @ date-time from Channel#’ via device ‘MPx220’ to ‘+393348702623’

the SMS is sent anyway, it doesn’t matter if a voicemail message is left or not.


Linux software: “hodge-podge assortments of files, & poor instructions to make something work. Usually many steps are required to get it working & if anything goes wrong you get nothing”.