Posted on 2008-09-26 11:20:57-07 by robiwan
Net::UCP Problem with timeout
Dear all, I try to send SMS over a german SMS service-center from t-mobile, but there is a Problem with the Net::UCP Module: When i run the following Skript, it is quite similar to the documentation on the CPAN-Site, i got an error. The modules Net::UCP::IntTimeout and Time::Hires are installed.

Maybe someone can help me, to fix the problem. Many thanks in advance...

Best regards, Robert

this is the error message:

Can't locate object method "timeout" via package "Net::UCP::IntTimeout" at /usr/local/share/perl/5.8.8/Net/UCP.pm line 91.

this is my script:
#!/usr/bin/perl -w use Encode; use Net::UCP; $recipient = "+49171712345"; $text = "Hello World"; $sender = "sender"; my ($acknowledge, $error_number, $error_text); $emi = Net::UCP->new(SMSC_HOST => '10.10.1.2', SMSC_PORT => 9099, SENDER_TEXT => 'MyApp', WARN => 1, FAKE => 0 ) or die("Failed to create SMSC object"); $emi->open_link() or die($!); ($acknowledge,$error_number,$error_text) = $emi->login( SMSC_ID => '12345', SMSC_PW => 'secret', SHORT_CODE => '12345', ); die ("Login to SMSC failed. Error nbr: $error_number, Error txt: $error_text\n") unless($acknowledge); ($acknowledge,$error_number,$error_text) = $emi->send_sms( RECIPIENT => $recipient, #mand. MESSAGE_TEXT => $text, #opt SENDER_TEXT => $sender, #opt ); die("Sending SMS failed. Error nbr: $error_number, Error txt: $error_text\n") unless($acknowledge); $emi->close_link();
Direct Responses: 9054 | Write a response
Posted on 2008-10-14 15:38:33-07 by robiwan in response to 8873
Re: Net::UCP Problem with timeout
Net::UCP Module Version: 0.38

Watch out UCP.pm line 91and line 150: Replace in both lines:
$timeout = $self->{TIMEOUT_OBJ}->timeout(); # false
to
$timeout = $self->{TIMEOUT_OBJ}->get(); # correct
Direct Responses: 9430 | Write a response
Posted on 2008-11-26 08:05:57-08 by nemux in response to 9054
Re: Net::UCP Problem with timeout
thanks robiwan. i'm glad to see in this forum your post with the workaround which i wrote you via email. Anyway i released a bug fixed version.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.