Leser: 1
|< 1 2 >| | 20 Einträge, 2 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
use Device::Gsm::Sms; my $sms = Device::Gsm::Sms->new(); # example for SMS in PDU mode #07911356131313F351000B911326926556F800F6AD4E060504C032C032000014010F06050C2A363100835D0001F5F5FFFFFFFF0002000201FE0700080000000000119FBDC8000908001231653131313F09001153494D4B617274656E5465737465723031 $sms->decode("010F06050C2A363100835D0001F5F5FFFFFFFF0002000201FE0700080000000000119FBDC8000908001231653131313F09001153494D4B617274656E5465737465723031"); print "SMS content:\n " .$sms->decode(); sub decode { my( $self, $type ) = @_; $self->{'type'} = $type; # Get list of tokens for this message (from ::Sms::Structure) my $cPdu = $self->{'pdu'}; # Check that PDU is not empty return 0 unless $cPdu; # Backup copy for "backtracking" my $cPduCopy = $cPdu; my @token_names = $self->structure(); my $decoded = 1; while( @token_names ) { # Create new token object my $token = new Sms::Token( shift @token_names, {messageTokens => $self->{'tokens'}} ); if( ! defined $token ) { $decoded = 0; last; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use Device::Gsm::Sms; # Or you can instance a sms message from raw PDU data my $msg = new Device::Gsm::Sms( header => '+CMGL: 4', pdu => '[07916407080007F8240F9164170900013635F40000702101310024400141]', storage=> 'ME', # or 'SC' ); if( defined $msg ) { print $msg->recipient() , "\n"; print $msg->sender() , "\n"; print $msg->text() , "\n"; # or $msg->text() print $msg->time() , "\n"; print $msg->type() , "\n"; }
$opt{'header'} =~ /\+CMGL:\s*(\d+),\s*(\d+),\s*(\w*),\s*(\d+)/
|< 1 2 >| | 20 Einträge, 2 Seiten |