Display Raw Name if no name in Contacts

Questions, problems, and other issues for Ascendis Caller ID that aren't covered by the other forums.
Post Reply
deb7890
Posts: 19
Joined: Fri Jun 20, 2008 9:04 am

Display Raw Name if no name in Contacts

Post by deb7890 »

Hi Bill,
Thank you for the awesome software. I'm using Ascendis 2.1.0.10, with a Whozz Calling 2.

The question: Can I make the display panel show Raw Name if the Contact has no name assigned?

That probably sounds funny--why would I have a Contact with no name assigned? Well, it occurs when I call out to a new phone number, then take the outgoing call entry in the Call List and put it into Contacts but I don't add name info yet--which suits my work style sometimes. Understandably, if that caller calls back before I've gotten around to adding name info, then of course no name is displayed in the display panel, just a number.

Instead of no name it would be helpful to see the Raw Name that the incoming call has. It would be scripted something like this, in effect:

If CallInfo.Display Name = '' [i.e. blank] Send CallInfo.RawName

which is probably wrong as I'm not too up on the scripting yet, but would like to learn. Looking at "Display.dwshtml" for the display panel I got confused right off the bat! There is no scripting for Callinfo.DisplayName or Callinfo.RawName--is that because those two objects are assumed and are already written into the underlying code? I'm guessing this must be the case...

Any help you can give to write this, would be very instructive! Thanks.
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: Display Raw Name if no name in Contacts

Post by Bill Root »

Hi deb7890,
Thank you for the awesome software. I'm using Ascendis 2.1.0.10, with a Whozz Calling 2.
Thank you for using it, and for your kind words!
The question: Can I make the display panel show Raw Name if the Contact has no name assigned?
Yes, you can. And although there might not be many people using Ascendis Caller ID in the same way, I think the change is a good idea in general.

I changed the standard Display.dwshtml as you requested. The change will be included in the next beta release. You can replace your Display.dwshtml immediately with the following:

Code: Select all

<html>
 <head>
  <title>Ascendis Caller ID Display Template</title>
  <style>
    body &#123;###FONT_STYLE###&#125;
  </style>
 </head>

 <body style="margin&#58; 0px;">
  <table width = "100%" Xborder="1">
   <tr>
    <td valign="top">
     <table xborder="1" xwidth="30%" style="font-size&#58; 75%">
      <tr>
       <td>
        <%
          if &#40;CallCount > 0&#41; then 
            Send&#40;CallInfo.CallBeganDateStr&#41;
          Else
            Send&#40;'&nbsp;'&#41;;
        %>
       </td>
      </tr>
      <tr>
       <td>
        <% 
          if &#40;CallCount > 0&#41; then 
            Send&#40;StringReplace&#40;CallInfo.CallBeganTimeStr, ' ', '&nbsp;', True, False&#41;&#41;
          Else
            Send&#40;'&nbsp;'&#41;;
        %>
       </td>
      </tr>
      <tr>
       <td style="font-size&#58; 60%">&nbsp;</td>
      </tr>
      <tr>
       <td VALIGN="BOTTOM"><% Send&#40;IntToStr&#40;NewCallCount&#41; + '&nbsp;New&nbsp;Calls'&#41;; %></td>
      </tr>
     </table>
    </td>

    <td width="100%" valign="top">
     <table xborder="1" width="100%" valign="top" style="font-size&#58; 100%; text-align&#58; center">
      <tr>
       <td><% 
        if CallInfo.Name = '' then
        begin
          if CallInfo.Company <> '' then
            Send&#40;CallInfo.Company&#41;
          else
            Send&#40;CallInfo.RawName&#41;
        end
        else if CallInfo.Company = '' then
          Send&#40;CallInfo.Name&#41;
        else
          Send&#40;CallInfo.Name + ' from ' + CallInfo.Company&#41;;
        %></td>
      </tr>
      <tr>
       <td><% Send&#40;CallInfo.Number&#41;; %></td>
      </tr>
      <tr style="font-size&#58; 75%">
       <td><% 
        var s&#58; String;

        s &#58;= CallInfo.City;

        if CallInfo.State <> '' then
        begin
          if s <> '' then
            s &#58;= s + ', ';
          s &#58;= s + CallInfo.State;
        end;

        if CallInfo.PostalCode <> '' then
        begin
          if s <> '' then
            s &#58;= s + '  ';
          s &#58;= s + CallInfo.PostalCode;
        end;

        Send&#40;s&#41;;
       %></td>
      </tr>
     </table>
    </td>

     <%
      if CallInfo.PicturePathname <> '' then
      begin
        Send&#40;'<td style="align&#58; center">' + #13#10&#41;;
        Send&#40;'<img ALIGN="RIGHT" src="' + CallInfo.PicturePathname + '">' + #13#10&#41;;
        Send&#40;'</td>' + #13#10&#41;;
      end;
     %>
   </tr>
  </table>
 </body>
</html>
(For those following along, Display.dwshtml is in the Ascendis Caller ID program folder. You can open it with a text editor (like Notepad) and replace its contents with the above code. Once saved, Ascendis Caller ID will use it the next time a call is displayed.)

You were certainly on the right track. "CallInfo.RawName" did not occur in the standard Display.dwshtml because it was not used before now. "CallInfo.DisplayName" did not occur because in scripts, "CallInfo.Name" is used instead for historical reasons. (The Ascendis Caller ID help lists all available components of the CallInfo objects; the online version is at http://www.ascendis.com/callerid/help/c ... object.php.)

I should mention that the above change only affects the display panel in the main window of Ascendis Caller ID (the part with a blue background in new installations). None of the notification windows can take advantage of dwshtml files yet.

Finest regards,
Bill Root
Ascendis Software
deb7890
Posts: 19
Joined: Fri Jun 20, 2008 9:04 am

Post by deb7890 »

Thanks so much. This works just as I had in mind, and helps me to figure out some more about the scripting too. Much appreciated.
Post Reply