I am now responsible for the Voice over IP project in our company, and one of the things that I will be doing is updating the outbound phonebooks for the VoIP equipment at all 58 of our remote sites. The equipment in question automatically reboots itself upon receipt of the new phonebook, so the ftp connection will not be closing out cleanly. Also, it is sending some information back when I use a manual client (WS_FTP) to connect to it. An example from the log is shown below:
connecting to 128.1.198.22...
Connected to 128.1.198.22 port 21
220 Service ready
USER mvpadmin
331 User name ok, need password
PASS (hidden)
230 User logged in
PWD
257 "/"
Host type (I): UNIX (standard)
PORT 128,1,208,162,19,38
200 Command OK
LIST
150 Here it comes...
Received 52 bytes in 1.0 secs, (51.90 Bps), transfer succeeded
226 Transfer Ok, Closing connection
Now I know that the last two lines are what is being displayed to my FTP program from the remote directory on the VoIP equipment. How would I deal with the line "150 Here it comes..."? my current test script receives the following error: "getsockname() on closed socket GEN0 at D:/Perl/lib/IO/Socket.pm line 192"
As always, here is the test code:
#!perl -w use strict; use Net::FTP; my $user="mvpadmin"; my $pass="mypassword"; my $opb="D:\\MVP\\OutPhBk.tmr"; my $mvp="128.1.198.22"; my $FTP=Net::FTP->new($mvp,Timeout=>20); my $login=$FTP->login($user,$pass); if(!defined $login){ die"Unable to connect: $!\n"; }else{ print"Connected to $mvp\n"; } $FTP->binary; $FTP->put($opb); $FTP->close;

TStanley
--------

In reply to FTP automation by TStanley

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.