Caller ID on TV

Will Asterisk send Caller ID info via an IP UDP packet to a specific IP address/port?

Background info:
I am implementing a pure IP environment including VoIP & IPTV.
The middleware server will insert a Caller ID info into the video stream, showing up as a message on the television screen. I know there is specific hardware for a standard PSTN setup, but can it be done on an Asterisk server?

If Asterisk will not do it, are there any other hardware/software add-ons that can give is the capability?

you should be able to do this with a little coding.

have your incoming line call execute an AGI script. The agi script can read the callerid and send a UDP packet with the info to the server before dialing the phone/extension. You will have to do a little coding, but it would be pretty simple if you use say perl or some other high level language.

now that’s assuming you have some type of server that will take the data you send it and “splice” that into a video feed. I have friend that uses myth-tv heavily and I know he has his callerid spliced into his playback (not using asterisk… just his modem’s callerid features), so I"m sure there software to do the actual video transcoding, but as far as the asterisk side is concerned reading the callerid and sending a UDP packet to a specified server that would be pretty easy.

-brian

By the way here’s some (bad) AGI code, to do what you request.
Takes the callerid and sends a UDP packet with just that data to a
server (localhost, in this example), and port (10000) specfied then will dial the dialstring (Zap/4/5551112222) also specified… note this code is by no means good, and has NO error checking ect. just a proof of concept I wrote in a couple minutes. SO if you don’t like the code… write something better and post it :wink:

also part of this code is directly taken from the test-agi.agi in the asterisk distribution.


#!/usr/bin/perl

warning… this code is not necessarily good, and I believe

I put all of NO error checking into it

part of this code is taken directly from test-agi.cgi in the asterisk

distribution, please don’t yell at me for crappy code… it’s just

a 5 minute proof of concept. If you like what it does… make it better

add some error checking, clean it up and repost it

-brian

change servername and port for sending UDP caller id message

change the dialstring to dial your phone rather than Zap/4/5551112222

##############################################################
$servername=“localhost”; #hostname or IP
$port=10000;
$dialstring=“Zap/4/5551112222”; # should not be this… edit accordingly
##############################################################

$|=1;

Setup some variables

my %AGI; my $tests = 0; my $fail = 0; my $pass = 0;

while() {
chomp;
last unless length($);
if (/^agi
(\w+):\s+(.*)$/) {
$AGI{$1} = $2;
}
}

my $callerid=$AGI{‘callerid’};
print STDERR “callerid = $callerid\n”;

#print STDERR “1. Testing ‘sendfile’…”;
#print “STREAM FILE beep “”\n”;
#my $result = ;
#&checkresult($result);

sendCallerid sends the callerid to the server at $servername and

the port specified by $port

&sendCallerID("$callerid",$servername,$port);
print “EXEC Dial $dialstring\n”;
my $result = ;

sub sendCallerID {
use IO::Socket::INET;
my $callerid = shift(@);
my $servername = shift(@
);
my $port = shift(@_);
my $sock=undef;

unless($sock=IO::Socket::INET->new(PeerPort=>"$port",
                              Proto=>'udp',
                              PeerAddr=>"$servername")) {

    print STDERR "could not make socket - $!";
    return undef;
}

$sock->send("$callerid");
return 1;

}