ADL User's Guide

Caller Name

See Also

 

In addition to the caller's phone number, it might be useful to know the caller's line subscription name. You can see if this name is available for the current phone call with TrunkIsCallerNameAvailable and you can retrieve that name with TrunkGetCallerName.

To Retrieve the Caller's Name

1. Since the caller name might not be supported by every system on which you run your application, and it might not be available for every call, you first need to check for caller name support. TrunkIsCallerNameSupported tells if caller names are supported on the current Trunk Resource:

 

   Support = TrunkIsCallerNameSupported();

 

   When the function returns, Support is True if CallerName is supported or False if it is not.

 

2. See if the caller name is available for the current phone call with TrunkIsCallerNameAvailable:

 

   IsAvailable = TrunkIsCallerNameAvailable();

 

3. Get the caller name with TrunkGetCallerName:

 

   CallerName = TrunkGetCallerName();

 

Note
Although caller name information is often helpful in determining how to process an incoming call, you don't have to get the caller name before answering a phone call. The caller name is available throughout the duration of the call.

Example

# Once you’ve opened the Trunk Resource, see if it 
# supports caller names.

CallerNameSupport = TrunkIsCallerNameSupported();

      ... 

# Later, when an incoming call arrives, check for the caller name 
# and get it if it’s available.
if (CallerNameSupport) 
   CallerNameAvailable = TrunkIsCallerNameAvailable();
   if (CallerNameAvailable)
      CallerName = TrunkGetCallerName();
   endif
endif