Re: Dialing Telephone Numbers

From: Chris Willig (chris_nospam__at_5thelephant.com)
Date: 12/11/03

  • Next message: Vincent Langard: "Use an object in a DLL returned by a interface's method ?"
    Date: Thu, 11 Dec 2003 08:07:17 -0600
    
    

    Kursat wrote:

    > Hi,
    > I want to add phone dialing feature to my existing project. As I know, two
    > possible solutions exist;
    > 1- Sending AT commands to Modem
    > 2- Using TAPI
    >
    > Which one should I use and how to dial a number?
    >
    > Thanks for help
    >
    >

    unit TAPI;

    interface

    uses
       Windows, Messages, SysUtils, Variants, Classes;

    function tapiRequestMakeCall(lpszDestAddress,
                                  lpszAppName,
                                  lpszCalledParty,
                                  lpszComment:LPCSTR): Longint; stdcall;
    external 'tapi32.dll';

    function tapiGetLocationInfo(lpszCountryCode,
                                  lpszCityCode:LPCSTR): Longint; stdcall;
    external 'tapi32.dll';

    const
      TAPIERR_CONNECTED =0;
      TAPIERR_DROPPED =-1;
      TAPIERR_NOREQUESTRECIPIENT =-2;
      TAPIERR_REQUESTQUEUEFULL =-3;
      TAPIERR_INVALDESTADDRESS =-4;
      TAPIERR_INVALWINDOWHANDLE =-5;
      TAPIERR_INVALDEVICECLASS =-6;
      TAPIERR_INVALDEVICEID =-7;
      TAPIERR_DEVICECLASSUNAVAIL =-8;
      TAPIERR_DEVICEIDUNAVAIL =-9;
      TAPIERR_DEVICEINUSE =-10;
      TAPIERR_DESTBUSY =-11;
      TAPIERR_DESTNOANSWER =-12;
      TAPIERR_DESTUNAVAIL =-13;
      TAPIERR_UNKNOWNWINHANDLE =-14;
      TAPIERR_UNKNOWNREQUESTID =-15;
      TAPIERR_REQUESTFAILED =-16;
      TAPIERR_REQUESTCANCELLED =-17;
      TAPIERR_INVALPOINTER =-18;
      TAPIMAXDESTADDRESSSIZE =80;
      TAPIMAXAPPNAMESIZE =40;
      TAPIMAXCALLEDPARTYSIZE =40;
      TAPIMAXCOMMENTSIZE =80;
      TAPIMAXDEVICECLASSSIZE =40;
      TAPIMAXDEVICEIDSIZE =40;

    function TapiDialNumber(const PhoneNumber: string; var ErrMsg: string):
    longint;

    implementation

    function TapiDialNumber(const PhoneNumber: string; var ErrMsg: string):
    longint;
    begin
       result := tapiRequestMakeCall( PChar(PhoneNumber), nil, nil, nil);
       if result < 0 then begin
         case result of
           TAPIERR_NOREQUESTRECIPIENT : ErrMsg := 'TAPI: No request recipient.';
           TAPIERR_INVALDESTADDRESS : ErrMsg := 'TAPI: Invalid number.';
           TAPIERR_REQUESTQUEUEFULL : ErrMsg := 'TAPI: Request queue full.';
           TAPIERR_INVALPOINTER : ErrMsg := 'TAPI: Invalid pointer.';
           else
             ErrMsg := '';
         end;
       end;

       {
       Return Values

       Returns zero if the request succeeds or a negative error number if an
       error occurs. Possible error return value are:

       TAPIERR_NOREQUESTRECIPIENT, TAPIERR_INVALDESTADDRESS,
       TAPIERR_REQUESTQUEUEFULL, TAPIERR_INVALPOINTER.

       Remarks

       A telephony-enabled application can request that a call be placed on its
       behalf by invoking tapiRequestMakeCall, providing only the destination
       address for the call. This request is forwarded to the user's
    call-control
       application, which places the call on behalf of the original application.
       A default call-control application is provided as part of Telephony.
       Users can replace this with a call-control application of their choice.

       Invoking tapiRequestMakeCall when no call control application is running
       returns the TAPIERR_NOREQUESTRECIPIENT error indication. If the call
       control application is not running, TAPI attempts to launch the
       highest-priority call control application (which is listed for
       RequestMakeCall in the registry). Invoking this function when the
       Assisted TAPI request queue is full returns the TAPIERR_REQUESTQUEUEFULL
       error.

       }
    end;

    end.


  • Next message: Vincent Langard: "Use an object in a DLL returned by a interface's method ?"

    Relevant Pages

    • Re: Call Center application in Visual Basic
      ... I don't know of any other except its ancestor "Hicom CTI TAPI". ... Please note that you need additional hardware (optiset E data or control ... No it doesn't support lineGet/SetAgentXxx functions. ... > of statistics on a queue, such the number of calls currently queued. ...
      (microsoft.public.win32.programmer.tapi)
    • Re: NadaNet for the //c - just an idea
      ... chip/etc before/after each packet to be sent/received? ... control over write protect with the drive still running, ... properly *throughout* a whole request. ... able to write to the net to assert its lock). ...
      (comp.sys.apple2)
    • RE: Security Exception in TslStream.EndRead
      ... Microsoft Online Support ... | WebRequest component to request a SSL protected remote services. ... | machine (or grant the control assembly full trust) and run the page again ... | | Thread-Topic: Security Exception in TslStream.EndRead ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • RE: Security Exception in TslStream.EndRead
      ... WebRequest component to request a SSL protected remote services. ... machine (or grant the control assembly full trust) and run the page again ... Also, for IE hosted winform control developing, you can turn on the IE host ... | CertificateStore store = new CertificateStore; ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • Re: [patch 0/4] [RFC] Another proportional weight IO controller
      ... I thought that probably we can make this control per request ... I agree with you that 2 layer scheduler *might* invalidate some ... request queue partitioning per cgroup. ...
      (Linux-Kernel)