Question

Yat-il un module Perl disponible pour envoyer des messages à Office Communicator? Je cherchai dans CPAN mais sans aucune chance. Puis-je utiliser Python ou Ruby pour envoyer des messages à Office Communicator. Je veux le faire à partir d'une boîte Linux.

Était-ce utile?

La solution

"Office Communicator" utilise une version modifiée du SIP, vous pouvez essayer d'utiliser les clients SIP comme net :: SIP (ou net :: SIP :: simple du même paquet).

Autres conseils

Je suppose que vous avez trouvé une solution après plus d'un an, mais néanmoins, si vous voulez juste d'envoyer un message SIP écrire un programme Perl, vous pouvez jeter un oeil à cette approche: http://archive.cert.uni-stuttgart.de/bugtraq/2005/07/msg00276 .html

Une personnalisation possible:

#!/usr/bin/perl
use strict;
use warnings;
use Socket;

sub SendSIPTo {
    my ($from, $to, $text, $ProxyIP) = @_;

    my $contentLength = length($text);

    my $AT = '@';
    my $domain = 'example.com';
    my $ToURI = 'sip:' . $to . $AT . $domain;
    my $FromURI = 'sip:' . $from . $AT . $domain;

    my $MESG = "MESSAGE $ToURI SIP\/2.0\r
Via: SIP/2.0/UDP 10.10.10.10;branch=z9hG4bK8fe6.db5fade4.0\r
To: $ToURI\r
From: <$FromURI>;tag=578c0e59d7504cca4dc4a96522981b0a-0c8b\r
CSeq: 1 MESSAGE\r
Call-ID: 609ded3a79a9cbd5\r
Content-Length: $contentLength\r
User-Agent: perl\r
\r
" . $text;

    my $proto = getprotobyname('udp');
    socket(SOCKET, PF_INET, SOCK_DGRAM, $proto) ;
    my $iaddr = inet_aton("0.0.0.0");
    my $paddr = sockaddr_in(5060, $iaddr);
    bind(SOCKET, $paddr) ;

    my $port = 5060;
    my $hisiaddr = inet_aton($ProxyIP) ;
    my $hispaddr = sockaddr_in($port, $hisiaddr);
    send(SOCKET, $MESG, 0, $hispaddr ) || warn "send $!\n";

    return 'OK';
}

1;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top