Skype only announce if known caller

Questions, problems, and other issues for Ascendis Caller ID that aren't covered by the other forums.
Post Reply
stevenospam
Posts: 3
Joined: Sat Feb 11, 2012 4:22 pm

Skype only announce if known caller

Post by stevenospam »

Hello,
I have a problem with Ascendis announcing incoming Skype callers who are not known in my Skype contacts or Ascendis. Example
+12246996000 1 (224) 699-6000 6/29/2012 5:06:48 PM

This call will be processed by the default script which will speak the name 12,246,996,000. I would like to only announce character names and not announce numeric names. How do I do that?

Thanks!
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: Skype only announce if known caller

Post by Bill Root »

Hi Steve,

That's an interesting problem. The solution is to check whether the "name" is numeric before speaking it. Assuming you're using the Default action in version 3.0, the solution is to replace the advanced script with something like this:

Code: Select all

//LANGUAGE=DWS


function IsNumeric(const s: String): Boolean;
var
  i: Integer;
begin
  const
    NUMBER_CHARS = '0123456789+-.';

  Result := False;
  for i := 1 to Length(s) do
  begin
    if not Contains(NUMBER_CHARS, s[i]) then
      Exit;
  end;

  Result := True;
end;


if IsNumeric(CallInfo.SpeakName) then
  Speak('Call from ' + CallInfo.Number)
else if CallInfo.FoundCaller or 
  AnsiSameText(Trim(CallInfo.SpeakName), Trim(CallInfo.Number)) then
  Speak('Call from ' + CallInfo.SpeakName)
else
  Speak('Call from ' + CallInfo.SpeakName + ' at ' + CallInfo.Number);
If you have a different action, you'll need to to modify it to include the "IsNumeric" function above and the "IsNumeric" call:

Code: Select all

if IsNumeric(CallInfo.SpeakName) then
  Speak('Call from ' + CallInfo.Number)
If you need help modifying a different action, please post (or email to support) the action script.


Finest regards,
Bill Root
Ascendis Software LLC
stevenospam
Posts: 3
Joined: Sat Feb 11, 2012 4:22 pm

Solved!

Post by stevenospam »

The script works like a charm. Thanks!
Post Reply