[Asterisk-Dev] Using an additional modem to get CallerID information

Nicholas Hart nic at gttelegraph.net
Sun Feb 1 09:13:30 MST 2004


Lawrence - Presuming you are referring to BT services
(for non-UK readers: BT = British Telecom :))
 - I certainly get Caller-ID over my BT analogue line, and if you check
the BT technical documentation (http://www.sinet.bt.com/227v3p3.pdf) it
sounds very much as if it IS based on Bellcore standards (CLASS?).

Though of course BT have managed to improve on the original, so perhaps
the technique described below may not work.....

However, it might be helpful to have some more detail on the modem
configuration needed to make this all work - I presume this is some
'Hayes' AT command set extension....

nic

> SOre point; I have one, but Caller-ID doesn't work in the UK (we don't
> DO bellcore over here), so it's no f*ing use.
> Not all of us live in the U.S of A - hard to believe, but true.
> atb,
>    Lawrence
>
> On 31 Jan 2004, at 5:41 pm, Brian West wrote:
>
>> Now thats an ugly hack.  Why not just get an X100P :P
>>
>> bkw
>>
>>
>> On Sat, 31 Jan 2004, Jonathan McHarg wrote:
>>
>>> There are two stages in the process of getting callerID information
>>> from a
>>> standard modem, to be used in Asterisk. The first stage is actually
>>> capturing the information from the modem, the second stage is
>>> importing the
>>> captured data into Asterisk.
>>>
>>> Capturing the caller ID details from the modem
>>>
>>> I will presume at this stage, that you have a modem that supports
>>> caller ID
>>> and it is installed and configured to work with your Linux box.
>>>
>>> Here is my first script that reads the details in...
>>>
>>> #!/usr/bin/perl
>>> $PortName = "/dev/ttyn00";
>>> $PortObj =  open(MODEM,$PortName) || die "Can't open $PortName: $!\n";
>>> while (1==1) {
>>>   local $/ = "\n";
>>>   while ($line=<MODEM>) {
>>>     chomp;
>>>     if ($line =~ s/NMBR = //) {
>>>       open(OUTFILE, ">/usr/src/myperl/callerid.txt") or die "Can't
>>> open
>>> callerid.txt: $!";
>>>       print OUTFILE "$line";
>>>       close OUTFILE;
>>>     };
>>>   }
>>> }
>>>
>>> depending on your setup, you'll need to amend the $portName variable
>>> to
>>> point to the port that you've installed the modem on. You also may
>>> want to
>>> change the path that the callerid.txt file is written to.
>>>
>>> Once the script is written, used the chmod A+X callerid.pl to change
>>> the
>>> mode so that the program can be executed.
>>>
>>> Finally run the program with & parameter, to spawn the program as a
>>> new
>>> process.
>>>
>>>
>>> Using the callerid.txt file in Asterisk
>>>
>>> Once the callerid.pl file has captured the callerid data, the number
>>> needs
>>> to be loaded into asterisk. This is done using AGI functions within
>>> asterisk.
>>>
>>> Firstly create a perl script as follows.
>>>
>>> #!/usr/bin/perl
>>> open(INFILE, "/usr/src/myperl/callerid.txt") or die "cannot open
>>> file";
>>> if ($callerID=<INFILE>) {
>>>   print "SET CALLERID $callerID"};
>>> close INFILE;
>>>
>>> once created, this script should be placed in the AGI directory.
>>>
>>> Finally add a line to your extensions.conf file to call this script,
>>> an
>>> example line would be.
>>>
>>> Exten=>_.,1,agi,getcallerid.pl
>>>
>>> Hopefully, this should now leave you with CID working !!
>>>
>> _______________________________________________
>> Asterisk-Dev mailing list
>> Asterisk-Dev at lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
>
> --
> Registered Office: Roke Manor Research Ltd, Siemens House, Oldbury,
> Bracknell,
> Berkshire. RG12 8FZ
>
> The information contained in this e-mail and any attachments is
> confidential to
> Roke Manor Research Ltd and must not be passed to any third party without
> permission. This communication is for information only and shall not
> create or
> change any contractual relationship.
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>


------------------------------
Nicholas Hart
GTTelegraph
www.gttelegraph.net
------------------------------



More information about the asterisk-dev mailing list