Skip to content

Example Process phone data

ggodart edited this page Jan 11, 2021 · 1 revision

Example of how to process phone data

WARNING: This example has not been verified

$callerid            = new  Serial_Item('I'); # Incoming callerid
$phonetone           = new  Serial_Item('O'); # Outgoing calls

if ($caller_id_data = state_now $callerid) {
    speak("rooms=all " . &Caller_ID::make_speakable($caller_id_data));
    my ($cid_date, $cid_number, $cid_name) = unpack("A13A13A15", $caller_id_data);
    logit("//house/c/mh/data/callerid.$Year_Month_Now.log",  "$cid_number $cid_name");
    logit_dbm("//house/c/mh/data/callerid.dbm", $cid_number, "$Time_Now $Date_Now $Year name=$cid_name");
}

logit("//house/c/mh/data/phone.$Year_Month_Now.log", $phonetone_data)
    if $phonetone_data = state_now $phonetone;

runit("min", "display_callers.bat") if state_now $display_calls;
Clone this wiki locally