I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2012-08-23 05:09:25.479266-07 by ahmadz
MULTIPART or concatenate message
I have tried the below code to send concatenated message however, it is not working and each message is sent separately... any idea please.
#!/usr/bin/perl use Net::SMPP; use Data::Dumper; $trace = 1; $Net::SMPP::trace = 0; $sysid = "#####"; $pw = "#######"; $host = 'Host'; $port = someport; $facil = 0x00010003; # NF_PDC | GF_PVCY $dest_number = @ARGV[0]; my $mymsg = join (" ", @ARGV); $mymsg = substr($mymsg,length($dest_number)+1,length($mymsg)); my $multimsg = 0; if (length ($mymsg) > 128) { $multimsg = 1; } $vers = 0x34; # versionsof SMPP server $if_vers = 0x34; ### Connect and bind ($smpp, $resp) = Net::SMPP->new_transmitter($host, smpp_version => $vers, interface_version => $if_vers, system_id => $sysid, password => $pw, source_addr_ton => 0x0, source_addr_npi => 0x0, dest_addr_ton => 0x0, dest_addr_npi => 0x0, system_type => '', facilities_mask => $facil, port => $port, ) or die "Can't contact server: $!"; $sent_no = 0; $origref = $ref = 0xa; $textptr = 0; $finished = 0; if (length ($mymsg) > 128) { $multimsg_maxparts = int (length ($mymsg) / 128); if (length ($mymsg) % 128) { $multimsg_maxparts++; } $multimsg_curpart = 1; print "multimsgsparts: $multimsg_maxparts\n"; } $msgtext = substr ($mymsg, 0, 128, ""); while (length ($msgtext)) { if($multimsg_maxparts) { @udh_ar = map { sprintf "%x", $_ } $origref, $multimsg_maxparts, $multimsg_curpart; $udh = pack("hhhhhh",0x05, 0x00, 0x03 , @udh_ar); } $resp = $smpp->submit_sm( source_addr_ton =>0x05, source_addr_npi => 0x01, source_addr => 'SenderName', dest_addr_ton => 0x01, dest_addr_npi => 0x01, destination_addr => $dest_number, short_message => $udh . $msgtext, ); $multimsg_curpart++; $msgtext = substr ($mymsg, 0, 128, ""); } ### warn Dumper $resp; $resp = $smpp->unbind(); # warn Dumper $resp; # warn "Done.";
Direct Responses: 13781 | Write a response