[Asterisk-Users] SMS - how to send one
Gary Ruddock (Swift Drinks)
garyruddock at hotmail.com
Thu Dec 30 04:48:38 MST 2004
In extensions.conf
[smsdial]
exten = _X.,1,SMS(${CALLERIDNUM},,${EXTEN},${CALLERIDNAME})
exten = _X.,2,SMS(${CALLERIDNUM})
exten = _X.,3,Hangup
[local]
exten => 077777,1,wait(1)
exten => 077777,2,Answer
exten => 077777,3,GotoIf($[foo${CALLERIDNUM} = foo]?12:4)
exten => 077777,4,GotoIf($[${CALLERIDNUM:0:10} = 8005875290]?9:5) //this is
the number sms text messages come from
exten => 077777,5,system(play /var/lib/asterisk/sounds/ring3.wav -v3 &)
exten => 077777,6,Playback(welcome)
exten => 077777,7,musiconhold
exten => 077777,8,Hangup
exten => 077777,9,SMS(${EXTEN:3},a)
exten => 077777,10,System(/usr/lib/asterisk/smsin ${EXTEN:3})
exten => 077777,11,Hangup
exten => 077777,12,system(play /var/lib/asterisk/sounds/uh-uhhh.wav -v1 &)
exten => 077777,13,Wait(1)
exten => 077777,14,Playback(withheld)
exten => 077777,15,Hangup
I have a PHP program to send the messages
$timeout = 7500;
$socket = fsockopen("10.0.0.99","5038", $errno, $errstr,
$timeout);
if ($socket)
{
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: manageruser\r\n"); // must be defined
in manager.conf
fputs($socket, "Secret: mysecretpassword\r\n\r\n");
fputs($socket, "Action: Originate\r\n");
fputs($socket, "callerid: " . $your_text_message .
"<$your_sending_number>\r\n"); // your sending number
fputs($socket, "exten: " . $mobile_number . "\r\n");
fputs($socket, "Channel: Zap/g1/147017094009\r\n"); //this is
the bt message center
fputs($socket, "Context: smsdial\r\n");
fputs($socket, "Priority: 1\r\n\r\n");
}
incoming messages go into /var/spool/asterisk/sms/sc-me.777
i had to register with BT first by sending a blank message to telephone
number 00000
----- Original Message -----
From: "Wilson Pickett" <spamsucks2005 at gmail.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion"
<asterisk-users at lists.digium.com>
Sent: Sunday, December 19, 2004 7:41 PM
Subject: [Asterisk-Users] SMS - how to send one
> I've read quite a bit in the older mailing list posts and the wiki but
> I'm missing some simple point.
>
> 1) What is required to send an SMS to a mobile outside the office given:
>
> Channel: ZAP/1
> send it to $SMS_RECIPIENT (which includes the final "extra" digit)
> via
> $SMS_CENTER=the national message center server for sending messages
>
> $MESSAGE= the message text
>
> How is the .call file organized?
>
>
> 2) When an SMS is received from $SMS_CENTER2, how to get the $MESSAGE from
> it?
>
> using
>
> exten => s/${SMS_CENTER2},NoOp(${CALLERID})
> exten => wait, answer
>
> then?
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
More information about the asterisk-users
mailing list