in reply to Re: (OT) SMPP Submit Multi Response
in thread (OT) SMPP Submit Multi Response
#-------------------------------------- #!/usr/bin/perl use Net::FTP; use File::Copy; use Net::Ping; use Net::SMPP; use Data::Dumper; $trace=1; $default_smsc="smsc-ip-address"; $smsc_port = port; $smsc_sysid = "username"; $smsc_pwd = "password"; #### Initialiazation of Varibales ############### my $bind_status=&bindeq; if($bind_status==0) { print "Binding OK\n"; #&sendmsg("440829285","TESTING"); &submit_multi; &unbindeq }else{ print("Failed to Bind to SMSC\n"); } sub bindeq() { $Net::SMPP::trace = 0; ### Connect and bind ($smpp,$resp) = Net::SMPP->new_transceiver ( $default_smsc, interface_version => 0x34, system_id => $smsc_sysid, password => $smsc_pwd, addr_ton => 0x01, addr_npi => 0x01, source_addr_ton =>0x01, source_addr_npi =>0x01, dest_addr_ton => 0x01, dest_addr_npi => 0x01, system_type => '', port => $smsc_port, async=>0, timeout => 10, ); $resp->explain_status(); my $bind_stat=$resp->{'status'}; return($bind_stat); } #-------------------------------------------------------------# sub sendmsg() { $Net::SMPP::trace = 1; my $number=@_[0]; my $message=@_[1]; my $msg_stat=0; $resp = $smpp->submit_sm( protocol_id=>'', validity_period=>'', source_addr_ton =>0x01, source_addr_npi =>0x01, source_addr => '50023', esm_class=>0x00, priority_flag=>0, schedule_delivery_time=>'', validity_period=>'', registered_delivery=>0x00, replace_if_present_flag=>0x00, data_coding => 0x00, sm_default_msg_id=>'', dest_addr_ton => 0x01, dest_addr_npi => 0x01, destination_addr => "$number", short_message=>"$message", ); $msgid=$resp->message_id(); print "MessageId=$msgid\n"; print $resp->explain_status(); } #-------------------------------------------------------------# sub submit_multi(){ $Net::SMPP::trace = 1; my $resp=$smpp->submit_multi( service_type => '', # default ok source_addr_ton => 0x01, # default ok source_addr_npi => 0x01, # default ok source_addr => '50023', # default ok dest_flag => [1,1], dest_addr_ton =>[0x01, 0x01], dest_addr_npi =>[0x01, 0x01], destination_addr =>[919440829285,440829285], ## 440 +829285 is Invalid Dest Number esm_class => 0x00, protocol_id => '', priority_flag => 0, schedule_delivery_time => '', validity_period => '', registered_delivery => 0x00, replace_if_present_flag => 0x00, data_coding => 0x00, sm_default_msg_id =>'', short_message => 'TEST-MULTI', ); $msgid=$resp->{message_id}; print "Messagid=$msgid\n"; print $resp->explain_status(); #Dumper $resp; } #-------------------------------------------------------------- sub unbindeq() { $Net::SMPP::trace = 1; my $resp = $smpp->unbind(); print $resp->explain_status(); }
And this is my output:
Binding OK req Header: 0000: 00 00 00 4b 00 00 00 21 00 00 00 00 00 00 00 02 req Body: 0000: 00 01 01 35 30 30 32 33 00 02 01 01 01 39 31 39 0010: 34 34 30 38 32 39 32 38 35 00 01 01 01 34 34 30 0020: 38 32 39 32 38 35 00 00 00 00 00 00 00 00 00 00 0030: 54 45 53 54 2d 4d 55 4c 54 49 req sent, waiting response at C:/Perl/site/lib/Net/SMPP.pm line 604. read Header: 0000: 00 00 00 34 80 00 00 21 00 00 00 00 00 00 00 02 read Body: 0000: 30 30 33 31 33 34 33 31 33 32 37 35 30 37 39 38 0010: 36 30 30 30 31 4f 4d 43 52 48 59 44 5f 6d 75 6c 0020: 74 69 00 00 Messagid=003134313275079860001OMCRHYD_multi req Header: 0000: 00 00 00 10 00 00 00 06 00 00 00 00 00 00 00 03 req Body: req sent, waiting response at C:/Perl/site/lib/Net/SMPP.pm line 604. read Header: 0000: 00 00 00 12 80 00 00 04 00 00 00 0b 00 00 00 02 read Body: 0000: 30 00 looking for 2147483654 seq=3, skipping cmd=2147483652 seq=2 at C:/Perl +/site/lib/ Net/SMPP.pm line 2489. read Header: 0000: 00 00 00 10 80 00 00 06 00 00 00 00 00 00 00 03 read Body: No error (ESME_ROK=0x00000000)No error (ESME_ROK=0x00000000)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: (OT) SMPP Submit Multi Response
by roboticus (Chancellor) on Jan 25, 2012 at 13:28 UTC |