Monks, 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_ma +xparts); 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_multi(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 M Chekuri

In reply to Failed to send multipart messages to multiple recipients using submit multi by manojmchekuri

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.