Results 1 to 4 of 4

Thread: perl/aim

  1. #1
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    11,686

    perl/aim

    Ok, bear with me, I'm not that fluent with perl, but unfortunately I need this to work a bit more than it does (it misfires about 3/4 the time currently).
    Code:
    #!/usr/bin/perl -w
    
    sub handler {
    my $type = shift @_;
    }
    
    use Net::AOLIM;
    $aim = Net::AOLIM->new('username' => "myuserhere",
    'password' => "mypasshere",
    'callback' => \&handler,
    'aim_agent'=> "AIM:\$Version 5.1.3036\$",
    'allow_srv_settings' => 1);
    
    $aim->signon;
    $aim->ui_dataget();
    print $Net::AOLIM::ERROR_MSGS{$IM_ERR};
    $aim->toc_send_im('myalertuserhere', 'There seems to be a problem with a server. Please check the network status immediately');
    sleep 4;

    Two things.
    A> as I mentioned it works about 1/4 of the time, which isn't acceptable. However, it's something that at least works somewhat . When it doesn't work, it says something about timing out reaching the AOL server or something.

    B> Aside from getting this to work, I'd LIKE it to work using variables. For example, currently, it's called through dnotify. What I'd like it to do is use something like this:
    dnotify $username $message
    so dnotify twhiting9275 'your server is down' would message me that the server is down, etc.

    Any thoughts ideas on how I could actually improve this and get it working like it should?


    <edit>
    Here's the exact error message I'm getting when it DOESN'T work:
    Couldn't connect to server: Connection timed out at /usr/lib/perl5/site_perl/5.8.1/Net/AOLIM.pm line 347.
    </edit>
    Last edited by whmcsguru; 03-18-2004 at 08:49 PM.
    WHMCS Guru - WHMCS addons, management, support and more.
    WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
    Always looking for Linux, WHMCS, Support Desk work. PM for details

  2. #2
    Join Date
    Feb 2004
    Location
    Boston
    Posts
    15
    ok, to specify your arguments as in:

    <script_name> <user> "<message>"

    Code:
    my $username = $ARGV[0];
    my $message  = $ARGV[1];
    as for your timeouts, are you sure that you can connect to the
    AIM server all the time? use a sniffer to verify that you are
    talking to the server first.

    Jeff

  3. #3
    Join Date
    Sep 2002
    Location
    Top Secret
    Posts
    11,686
    Is there a specific server that this protocol tries to use? OR a list of them somewhere?
    WHMCS Guru - WHMCS addons, management, support and more.
    WHMCS Notifications Extended - Add slack, hipchat, SMS, pushover to WHMCS !!
    Always looking for Linux, WHMCS, Support Desk work. PM for details

  4. #4
    Join Date
    Feb 2004
    Location
    Boston
    Posts
    15
    just to let you know, I'm not really an expert with AOLIM so I
    dont know where you can find a list of aol im servers.

    So, I just took a look at Net::AOLIM.

    The default server is toc.oscar.aol.com.
    The default port is 1234

    The login server is login.oscar.aol.com.
    The login port is 5198

Posting Permissions

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