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 2011-08-17 02:55:25.300124-07 by manojmchekuri
Failed to send multipart messages to multiple recipients using submit multi
Hi All, I'm trying to use the sample script of sendmessage.pl to send a multipart message to multiple recipients by replacing "submit_sm" with "submit_multi". I could only see one part i.e the first part being delivered and then the server gives an error "error_status_code must be supplied at smsc.pl line 96". And it fails after that. Following is the code I'm using please go through and guide me through.
____________________________________________________________________ use Net::SMPP; use Data::Dumper; $trace = 1; $Net::SMPP::trace = 1; $sysid = ""; $pw = ""; $host = $host; $port = 2775; $facil = 0x00010003; # NF_PDC | GF_PVCY my $mymsg = join (" ", @ARGV); my $multimsg = 0; if (length ($mymsg) > 128) { $multimsg = 1; } $vers = 0x40; #4 $if_vers = 0x00; ### Connect and bind ($smpp, $resp) = Net::SMPP->new_transmitter($host, smpp_version => $vers, interface_version => $if_vers, system_id => $sysid, password => $pw, addr_ton => 0x09, addr_npi => 0x00, source_addr_ton => 0x09, source_addr_npi => 0x00, dest_addr_ton => 0x09, dest_addr_npi => 0x00, system_type => '_001', facilities_mask => $facil, port => $port, ) or die "Can't contact server: $!"; ### ### Typical session in synchronous mode ### warn "Sending submit_sm"; $sent_no = 0; $origref = $ref = 160; $textptr = 0; $finished = 0; #print "FELIX: Now checking length of string: ".length ($mymsg)."\n"; 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)) { ### See V4, p. 77 if ($multimsg_curpart) { $multimsg = pack ("nCC", $origref, $multimsg_curpart, $multimsg_maxparts); printf STDERR "\nI AM SETTING MULTIPART: len=%d\n", multimsg; } else { $multimsg = undef; } printf "Now sending: (multimsg = %.8x) (len: %d) %s\n", $multimsg, length ($msgtext), $msgtext; $msgref = sprintf "%.8d", $ref; print "MESSAGE REFERENCE: $msgref REF= $ref\n"; $resp = $smpp->submit_sm(message_class=>0, # source_addr => '0077719011234777' destination_addr => ['077714107777','+919652222415'], msg_reference => $msgref, priority_level => 3, short_message=>$msgtext, PDC_MultiPartMessage => $multimsg, ); $multimsg_curpart++; $msgtext = substr ($mymsg, 0, 120, ""); $ref++; } # warn Dumper $resp; $resp = $smpp->unbind(); # warn Dumper $resp; warn "Done."; #EOF ____________________________________________________________________
Thank You Manoj
Direct Responses: 13459 | Write a response
Posted on 2011-08-17 02:58:28.917882-07 by manojmchekuri in response to 13458
Re: Failed to send multipart messages to multiple recipients using submit multi
I've changed the line
" $resp = $smpp->submit_sm(message_class=>0," to " $resp = $smpp->submit_multi(message_class=>0,"
which resulted in error.
Direct Responses: Write a response