Results 1 to 2 of 2

Thread: Using Net::SMPP

  1. #1
    Join Date
    Jan 2005
    Posts
    2

    Unanswered: Using Net::SMPP

    Hi All,

    I am using NEtMPP modile of CPAN, I can send message (sms) to mobile phone but when I executed my ESME RECIVED, this break, the message is:

    premature eof reading from socket at /usr/lib/perl5/site_perl/5.8.0/Net/SMPP.pm line 2347.
    Not a HASH reference at /usr/lib/perl5/site_perl/5.8.0/Net/SMPP.pm line 2348.

    Ineed urgent help, I need suggestions

    My code is:

    use Net:MPP;
    use Data:umper;
    $smpp = Net:MPP->new_receiver($host1,

    smpp_version => $smpp_version1,
    interface_version => $interface_version1,
    system_id => $sysid1,
    password => $password1,
    addr_ton => $addr_ton1,
    addr_npi => $addr_npi1,
    source_addr_ton => $source_addr_ton1,
    source_addr_npi => $source_addr_npi1,
    dest_addr_ton => $dest_addr_ton1,
    dest_addr_npi => $dest_addr_npi1,
    system_type => $system_type1,
    facilities_mask => 0x00010003,
    port => $port1,
    #timeout => 10,
    );



    while(1){

    ################ Proses Receiving ################################################## #####
    warn "####################################\n";
    warn "# SMPP ESME Receive #\n";
    warn "####################################\n";
    warn "Waiting For message ....\n";


    $pdu = $smpp->read_pdu();

    print "Received #$pdu->{seq} $pdu->{cmd}:". Net:MPP:du_tab->{$pdu->{cmd}}{cmd} ."\n";
    #print "Received #$pdu->{seq} $pdu->{cmd}:". Net:MPP::PDU->{$pdu->{message_id}} ."\n";
    warn Dumper($pdu) if $trace;
    $smpp->bind_receiver_resp(system_id => $sysid,
    seq => $pdu->{seq}
    );
    $smpp->deliver_sm_resp(message_id => $pdu->{sm_default_msg_id},
    seq => $pdu->{seq}
    );
    $smpp->generic_nack(seq => $pdu->{seq});

    .
    My lines to process
    .....


    The problem is that there is a socket timeout, how can I to correct this problem.

    Thanks in Advanced,

    Regards.

  2. #2
    Join Date
    Sep 2004
    Posts
    7
    hello,
    do u get the error message immediately just when u connect it or after few seconds or minutes?
    if second condition, i guess it is because u havent sent the enquire_link_resp to continue the rx.
    i havent tried on the code so i just guess on it only
    besides, to do the deliver_sm_resp, that suppose is the message_id you received from the deliver_sm to continue receive the next DR.
    Last edited by volant; 01-20-05 at 05:32.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •