Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

issue in SMS Connectivity

by rammoorthi (Novice)
on Dec 11, 2012 at 08:13 UTC ( #1008232=perlquestion: print w/replies, xml ) Need Help??
rammoorthi has asked for the wisdom of the Perl Monks concerning the following question:

Hi, This is ram. i am getting the error while sending a sms using smpp. the code is:
#!perl use strict; use warnings; use Net::SMPP; my $host = ''; my $port = 5001; my $system_id = 'r123'; my $password = 'r_123'; my ($smpp, $resp_pdu) = Net::SMPP->new_transmitter( $host, system_id => $system_id, password => $password, system_type => 'r123', port => $port ) or die "Cant connect to SMSC: $!"; print "PDU_resp ERROR: ".$resp_pdu->explain_status() if $resp_pdu->status; $smpp->enquire_link() or die "Unable to connect to SMSC"; $resp_pdu = $smpp->submit_sm( destination_addr => '9610985672', short_message => 'Hello World. via SMPP' ) or die; print "PDU_resp ERROR: " . $resp_pdu->explain_status() if $resp_pdu->status; my $msg_id = $resp_pdu->{message_id}; print "\nEOF\n"; ##sleep 30; #$resp_pdu = $smpp->query_sm(message_id => $msg_id) or die; #die "PDU_resp ERROR: ".$resp_pdu->explain_status() if $resp_pdu->stat +us; #print "\nMessage state is $resp_pdu->{message_state}\n";
i am getting the error as
D:\Perl>perl PDU_resp ERROR: Invalid source address (ESME_RINVSRCADR=0x0000000A) EOF
The sms heading should be A$-SMS Please help me to resolve this issue. Thanks Ram

Replies are listed 'Best First'.
Re: issue in SMS Connectivity
by davido (Archbishop) on Dec 11, 2012 at 08:52 UTC

    It's a message from the SMPP gateway, and I think it's coming from your new_transmitter() call. Why don't you change your error message "print" statements to "warn", so that a line number gets reported. That will help to disambiguate what point along the way the message is being generated.

    Out of curiosity, is it intentional that your "system_type" and "system_id" are being set to the same value?


      hi, i was getting error in the following code only
      $resp_pdu = $smpp->submit_sm( destination_addr => '9610985672', short_message => 'Hello World. via SMPP' ) or die; print "PDU_resp ERROR: " . $resp_pdu->explain_status()

      i tried with country code as well like +91 before the mobile number. still same error.

      There is no intention that system type and id is same. i got this from system admin.

      thanks in advance ram

        The error isn't about the destination address so why change that? It sounds like the server is expecting a non-null source address so pass one with source_addr in the call to submit_sm.

        $resp_pdu = $smpp->submit_sm( source_addr => '', # add your source address here destination_addr => '9610985672', short_message => 'Hello World. via SMPP' ) or die; print "PDU_resp ERROR: " . $resp_pdu->explain_status()

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1008232]
Approved by GrandFather
[Corion]: Gratulations! :-D

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2018-02-22 09:25 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (289 votes). Check out past polls.