Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: CTI Meteor caller id

  1. #1

    Default CTI Meteor caller id

    Hi

    Heres another serial device that needs the experts to create the lua script for!

    http://www.caller-id-answers.info/meteordoc.doc

    Basically the caller id info arrives in a slight different format than the usual callerid modem with some numbers before the month/day/time sone more numbers and then the actual phone number and the name if it exists.

    Can someone please give me a pointer on how I can modify the existing caller id script to do this?

    1200 baud rate with 1 stop bit.

    Example message from the document :

    MESSAGE EXAMPLE

    Byte sent (decimal) Description

    128 Message Type
    34 Message Length
    17 Call Type Parameter
    1 Parameter length
    1 Call type = 1 (Voice Call)
    1 Date & Time Parameter
    8 Parameter length = 8
    49 1
    48 0 (Month = 10)
    49 1
    48 0 (Day = 10)
    48 0
    51 3 (Hour = 3)
    51 3
    48 0 (Minutes = 30)
    2 Calling Number Parameter
    10 Parameter length = 10
    49 1
    50 2
    51 3
    52 4
    53 5
    54 6
    55 7
    56 8
    57 9
    48 0 (Number = 1234567890)
    7 Calling Name Parameter
    7 Parameter length = 7
    80 P
    69 E
    84 T
    69 E
    82 R
    32 (Space)
    82 R
    161 Checksum

    Thanks for your help

    Dom

  2. #2

    Default

    I think I need something that does this :

    read message from com port into buffer

    read buffer one byte at a time .....

    if (byte == 128)
    {
    skip next byte

    loop:

    if (byte == 1) then
    Next byte is the length which should be 8 for the date/time
    Next 8 bytes is the DATE/TIME
    if (byte == 2) then
    Next byte is the length
    The next bytes (length) is the calling number
    else if (byte == 7) then
    Next byte is the length
    The next bytes (length) is the calling name
    else read a head by the value of the next byte (i.e in the example for parameter 17 we read that it has a length of 1 byte so we skip a head to parameter 2

    goto loop unless there is no next byte.

    }
    else ignore


    That should pull the date/time, number and name out of the message?

    Sorry thats about as far as I can get!

    Dom
    Last edited by domloff; October 25th, 2006 at 05:05 AM. Reason: Forgot to add that the code should loop

  3. #3
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    drop this in the serial try and show the output here.
    Attached Files Attached Files

  4. #4

    Default

    Thanks

    This is what I get what I call my home number (I've changed my cellphone number) :

    Serial: CTIMETEOR : Opened Device: CTIMETEOR Port: 4 Settings: 1200 N 0 8 0
    Serial: CTIMETEOR : Callback Installed 1
    80 1A 11 01 01 01 08 31 30 32 35 32 31 35 34 02 0B 38 37 38 38 31 35 36 31 31 39 39 6A 4F 46 46 2D 4C 49 4E 45 0D 0A 00 €......10252154..87881561199jOFF-LINE...
    Serial: CTIMETEOR : Simple Receive: Data 80 1A 11 01 01 01 08 31 30 32 35 32 31 35 34 02 0B 38 37 38 38 31 35 36 31 31 39 39 6A 4F 46 46 2D 4C 49 4E 45 0D 0A 00 €......10252154..87881561199jOFF-LINE... Code: 0
    4F 46 46 2D 4C 49 4E 45 0D 0A 00 OFF-LINE...
    Serial: CTIMETEOR : Simple Receive: Data 4F 46 46 2D 4C 49 4E 45 0D 0A 00 OFF-LINE... Code: 0
    4F 46 46 2D 4C 49 4E 45 0D 0A 00 OFF-LINE...
    Serial: CTIMETEOR : Simple Receive: Data 4F 46 46 2D 4C 49 4E 45 0D 0A 00 OFF-LINE... Code: 0

    Dom
    Last edited by domloff; October 26th, 2006 at 03:27 AM. Reason: changed the number ...

  5. #5
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    where is your number in that stream of data?

  6. #6

    Default

    The number is the 87881561199 part with 10252154 being the date time

    and the name is missing (I think it shows up only if its international or payphone)

    Thanks

    Dom

  7. #7

    Default

    I've sort of worked it out.

    I'm sure there are probably nicer ways of doing this but this works when I try it.

    The data is stored in the a variable :

    a = "\128\034\004\001P\017\001\001\01\00810100332\002\ 0101234567890\007\005\Dom L\161"

    function extract (data,offset)

    offset = offset+1
    length = string.byte (data,offset)
    offset = offset+1
    extracted = string.sub(a,offset,offset+length-1)
    offset = offset+length
    return extracted,offset
    end

    Call = {}
    Call.name = ""
    Call.type = ""
    Call.number = ""
    Call.date = ""
    Call.time = ""

    i = 1
    if (string.byte(a,i) == 128) then
    i = i+1
    loop = string.byte(a,i)
    while i < loop+2 do
    param = string.byte(a,i)
    if (param == 17 ) then
    Call.type,i = extract(a,i)
    elseif (param == 1) then
    datetime,i = extract(a,i)
    Call.date = string.sub(datetime,1,4)
    Call.time = string.sub(datetime,5,8)
    elseif (param == 2) then
    Call.number,i = extract(a,i)
    elseif (param == 7) then
    Call.name,i = extract(a,i)
    elseif (param == 4) then
    Call.reason,i = extract(a,i)
    else
    i = i+1
    end
    end
    end


    if ((Call.reason == "O") and (Call.name == "")) then
    Call.name = "Unavailable"
    elseif ((Call.reason == "P") and (Call.name == "")) then
    Call.name = "Withheld"
    elseif (Call.name == "") then
    Call.name = "Unknown"
    end


    print ("calltype ",string.byte(Call.type) or "")
    print ("date and time ",Call.date or "" ,Call.time or "")
    print ("number ",Call.number or "")
    print ("name ",Call.name or "")
    print ("reason ",Call.reason or "")

  8. #8

    Default

    It looks like I have to convert this to something that Girder will recognise!

    I'm getting :

    Serial Error (CallLua): ...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:8: bad argument #1 to `sub' (string expected, got nil)
    stack traceback:
    [C]: in function `sub'
    ...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:8: in function `extract'
    ...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:57: in function <...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:45>
    Serial Error (CallLua): ...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:85: attempt to concatenate field `number' (a nil value)
    stack traceback:
    ...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:85: in function <...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:45>
    Serial Error (CallLua): ...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:85: attempt to concatenate field `number' (a nil value)
    stack traceback:
    ...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:85: in function <...s\Promixis\Girder\/plugins/serial/MeteorCallerID.lua:45>

    Please help!

    Dom
    Attached Files Attached Files

  9. #9
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    In the extract function you should be using data rather than a since that's the parameter

    It would actually be better to use string.find() and a suitable pattern than all those calls to string.sub etc.
    --Rob

  10. #10

    Default

    Thanks to all!

    Had to learn lua to get this thing working, and it is now!

    BTW: In case you've never heard of it the CTI Meteor :

    http://www.crucible-technologies.co....d=MP&did=43864

    Though expensive is about the only guaranteed way of getting caller id in the UK.

    It supports US, UK and I think other countries caller id systems, but until now there was not an easy way to get the info out of it!

    It works out the box with no tweaking, and it works with a USB to serial converter perfectly (thatís what I'm using).

    This serial driver for Girder uses Girders pop up OSD to display the caller info not only on the PC that is receiving it but any other connected PC with girder running.

    I've also plugged in the yac2slim.exe so that it will send the info to my slimp3 (squeezebox)

    Let me know if anybody is interested in the working lua script and I'll post it here.

    Oh and I'm not connected to the company that makes it in anyway.

    Just happy that I've finally found a caller id solution that actually works as it should do!

    Dom

Page 1 of 3 123 LastLast

Posting Permissions

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