|
SMS is sent fine(wireless modem),
but sms_send() always returns: Quantifier follows nothing in regex; marked by <-- HERE in m/+ <-- HERE CMGS/ at /usr/local/share/perl/5.10.1/Device/Modem.pm line 676.
Manufacture: Sierra Wireless, Incorporated
# cat /proc/version
Linux version 2.6.35-22-server (buildd@yellow) (gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) ) #35-Ubuntu SMP Sat Oct 16 22:02:33 UTC 2010
# uname -a
Linux ns3 2.6.35-22-server #35-Ubuntu SMP Sat Oct 16 22:02:33 UTC 2010 x86_64 GNU/Linux
root@ns3:~# perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
use strict;
use Device::Gsm;
print "I hope I can send an SMS on your GSM phone attached to...\n";
my $myport = '/dev/ttyUSB2';
my $gsm = new Device::Gsm(
port => $myport,
log => 'file,send.log',
assume_registered => 0,
loglevel => 'debug',
pin => '0000'
);
die "cannot create Device::Gsm object!" unless $gsm;
$gsm->connect( baudrate => 9600 ) or die "cannot connect to GSM device on [$myport]\n";
$gsm->register() or die "cannot register on GSM network: check pin and/or network signal!";
my $level = $gsm->signal_quality();
print "signal quality: $level\n";
print "\nok! connected and registered to network\n";
my $number = '+16479906864';
my $content = 'Test Hello World';
$content = substr( $content, 0, 140 ); # text SMS
print "\nSending SMS ...\n";
my $res = $gsm->send_sms(
content => $content,
recipient => $number,
class => 'normal',
mode => 'text'
);
if ($res) {
print "SMS sent!\n" ;
} else {
print "Error in sending\n";
}
|