亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tapicode.c

?? 一份有用的TAPI編程源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
    if (!(lpLineDevCaps->dwLineFeatures & LINEFEATURE_MAKECALL))
    {
        HangupCall();
        MessageBox(g_hDlgParentWindow,
            "Error on Requested line",
            "The selected line doesn't support MAKECALL capabilities",
            MB_OK);
        goto DeleteBuffers;
    }

    // Open the Line for an outgoing DATAMODEM call.
    do
    {
        lReturn = lineOpen(g_hLineApp, g_dwDeviceID, &g_hLine,
            g_dwAPIVersion, 0, 0,
            LINECALLPRIVILEGE_NONE, LINEMEDIAMODE_DATAMODEM,
            0);

        if(lReturn == LINEERR_ALLOCATED)
        {
            HangupCall();
            MessageBox(g_hDlgParentWindow,
                "Line is already in use by a non-TAPI application "
                "or by another TAPI Service Provider.",
                "Unable to Use Line",MB_OK);
            goto DeleteBuffers;
        }

        if (HandleLineErr(lReturn))
            continue;
        else
        {
            OutputDebugLineError(lReturn, "lineOpen unhandled error: ");
            MessageBox(g_hDlgParentWindow,
                "Error on Requested line",
                "Unable to Use Line",MB_OK);
            HangupCall();
            goto DeleteBuffers;
        }
    }
    while(lReturn != SUCCESS);

    // Tell the service provider that we want all notifications that
    // have anything to do with this line.
    do
    {
        // Set the messages we are interested in.

        // Note that while most applications aren't really interested
        // in dealing with all of the possible messages, its interesting
        // to see which come through the callback for testing purposes.

        lReturn = lineSetStatusMessages(g_hLine, 
            LINEDEVSTATE_OTHER          |
            LINEDEVSTATE_RINGING        |
            LINEDEVSTATE_CONNECTED      |  // Important state!
            LINEDEVSTATE_DISCONNECTED   |  // Important state!
            LINEDEVSTATE_MSGWAITON      |
            LINEDEVSTATE_MSGWAITOFF     |
            LINEDEVSTATE_INSERVICE      |
            LINEDEVSTATE_OUTOFSERVICE   |  // Important state!
            LINEDEVSTATE_MAINTENANCE    |  // Important state!
            LINEDEVSTATE_OPEN           |
            LINEDEVSTATE_CLOSE          |
            LINEDEVSTATE_NUMCALLS       |
            LINEDEVSTATE_NUMCOMPLETIONS |
            LINEDEVSTATE_TERMINALS      |
            LINEDEVSTATE_ROAMMODE       |
            LINEDEVSTATE_BATTERY        |
            LINEDEVSTATE_SIGNAL         |
            LINEDEVSTATE_DEVSPECIFIC    |
            LINEDEVSTATE_REINIT         |  // Not allowed to disable this.
            LINEDEVSTATE_LOCK           |
            LINEDEVSTATE_CAPSCHANGE     |
            LINEDEVSTATE_CONFIGCHANGE   |
            LINEDEVSTATE_COMPLCANCEL    ,

            LINEADDRESSSTATE_OTHER      |
            LINEADDRESSSTATE_DEVSPECIFIC|
            LINEADDRESSSTATE_INUSEZERO  |
            LINEADDRESSSTATE_INUSEONE   |
            LINEADDRESSSTATE_INUSEMANY  |
            LINEADDRESSSTATE_NUMCALLS   |
            LINEADDRESSSTATE_FORWARD    |
            LINEADDRESSSTATE_TERMINALS  |
            LINEADDRESSSTATE_CAPSCHANGE);


        if (HandleLineErr(lReturn))
            continue;
        else
        {
            // If we do get an unhandled problem, we don't care.
            // We just won't get notifications.
            OutputDebugLineError(lReturn,
                "lineSetStatusMessages unhandled error: ");
            break;
        }
    }
    while(lReturn != SUCCESS);


    // Get LineAddressStatus so we can make sure the line
    // isn't already in use by a TAPI application.
    lpLineAddressStatus = 
        I_lineGetAddressStatus(lpLineAddressStatus, g_hLine, 0);
        
    if (lpLineAddressStatus == NULL)
    {
        HangupCall();
        MessageBox(g_hDlgParentWindow,
            "Error on Requested line",
            "Unable to Use Line",MB_OK);
        goto DeleteBuffers;
    }

    // MAKECALL will be set if there are any available call appearances
    if ( ! ((lpLineAddressStatus -> dwAddressFeatures) &
            LINEADDRFEATURE_MAKECALL) )
    {
        OutputDebugString("This line is not available to place a call.\n");
        HangupCall();
        MessageBox(g_hDlgParentWindow,
            "Requested line is already in use",
            "Unable to Use Line",MB_OK);
        goto DeleteBuffers;
    }

    // If the line was configured in the 'Dial' dialog, then
    // we need to actually complete the configuration.
    if (g_lpDeviceConfig)
        lineSetDevConfig(g_dwDeviceID, g_lpDeviceConfig,
            g_dwSizeDeviceConfig, "comm/datamodem");

    // Start dialing the number
    if (DialCallInParts(lpLineDevCaps, g_szDialableAddress,
            g_szDisplayableAddress))
    {
        OutputDebugString("DialCallInParts succeeded.\n");
    }
    else
    {
        OutputDebugString("DialCallInParts failed.\n");
        HangupCall();
        goto DeleteBuffers;
    }

DeleteBuffers:

    if (lpLineAddressStatus)
        LocalFree(lpLineAddressStatus);
    if (lpLineDevCaps)
        LocalFree(lpLineDevCaps);
    if (g_bTapiInUse)
        EnableHangupCall(g_hWndMainWindow, TRUE);

    return g_bTapiInUse;
}


//**************************************************
// These APIs are specific to this module 
//**************************************************



//
//  FUNCTION: DialCallInParts(LPLINEDEVCAPS, LPCSTR, LPCSTR)
//
//  PURPOSE: Dials the call, handling special characters.
//
//  PARAMETERS:
//    lpLineDevCaps - LINEDEVCAPS for the line to be used.
//    lpszAddress   - Address to Dial.
//    lpszDisplayableAddress - Displayable Address.
//
//  RETURN VALUE:
//    Returns TRUE if we successfully Dial.
//
//  COMMENTS:
//
//    This function dials the Address and handles any
//    special characters in the address that the service provider
//    can't handle.  It requires input from the user to handle
//    these characters; this can cause problems for fully automated
//    dialing.
//
//    Note that we can return TRUE, even if we don't reach a
//    CONNECTED state.  DIalCallInParts returns as soon as the
//    Address is fully dialed or when an error occurs.
//
//

BOOL DialCallInParts(LPLINEDEVCAPS lpLineDevCaps,
    LPCSTR lpszAddress, LPCSTR lpszDisplayableAddress)
{
    LPLINECALLPARAMS  lpCallParams = NULL;
    LPLINEADDRESSCAPS lpAddressCaps = NULL;
    LPLINECALLSTATUS  lpLineCallStatus = NULL;

    long lReturn;
    int i;
    DWORD dwDevCapFlags;
    char szFilter[1+sizeof(g_sNonDialable)] = "";
    BOOL bFirstDial = TRUE;
                               
    // Variables to handle Dialable Substring dialing.
    LPSTR lpDS; // This is just so we can free lpszDialableSubstring later.
    LPSTR lpszDialableSubstring;
    int nAddressLength = 0;
    int nCurrentAddress = 0;
    char chUnhandledCharacter;

    // Get the capabilities for the line device we're going to use.
    lpAddressCaps = I_lineGetAddressCaps(lpAddressCaps,
        g_dwDeviceID, 0, g_dwAPIVersion, 0);
    if (lpAddressCaps == NULL)
        return FALSE;

    // Setup our CallParams for DATAMODEM settings.
    lpCallParams = CreateCallParams (lpCallParams, lpszDisplayableAddress);
    if (lpCallParams == NULL)
        return FALSE;

    // Determine which special characters the service provider
    // does *not* handle so we can handle them manually.
    // Keep list of unhandled characters in szFilter.
    
    dwDevCapFlags = lpLineDevCaps -> dwDevCapFlags;  // SP handled characters.
    for (i = 0; i < g_sizeofNonDialable ; i++)
    {
        if ((dwDevCapFlags & g_sNonDialable[i].dwDevCapFlag) == 0)
        {
            strcat(szFilter, g_sNonDialable[i].szToken);
        }
    }

    // szFilter now contains the set of tokens which delimit dialable substrings
    
    // Setup the strings for substring dialing.
                           
    nAddressLength = strlen(lpszAddress);
    lpDS = lpszDialableSubstring = (LPSTR) LocalAlloc(LPTR, nAddressLength + 1);
    if (lpszDialableSubstring == NULL)
    {
        OutputDebugLastError(GetLastError(), "LocalAlloc failed: ");
        HandleNoMem();
        goto errExit;
    }

    // Lets start dialing substrings!
    while (nCurrentAddress < nAddressLength)
    {
  retryAfterError:

        // Find the next undialable character
        i = strcspn(&lpszAddress[nCurrentAddress], szFilter);

        // Was there one before the end of the Address string?
        if (i + nCurrentAddress < nAddressLength)
        {
            // Make sure this device can handle partial dial.
            if (! (lpAddressCaps -> dwAddrCapFlags & 
                   LINEADDRCAPFLAGS_PARTIALDIAL))
            {
                MessageBox(g_hDlgParentWindow,
                    "This line doesn't support partial dialing.\n",
                    "Warning",MB_OK);
                goto errExit;
            }
            // Remember what the unhandled character is so we can handle it.
            chUnhandledCharacter = lpszAddress[nCurrentAddress+i];
            
            // Copy the dialable string to the Substring.
            memcpy(lpszDialableSubstring, &lpszAddress[nCurrentAddress], i);

            // Terminate the substring with a ';' to signify the partial dial.
            lpszDialableSubstring[i] = ';';
            lpszDialableSubstring[i+1] = '\0';
            
            // Increment the address for next iteration.
            nCurrentAddress += i + 1;
        }
        else // No more partial dials.  Dial the rest of the Address.
        {
            lpszDialableSubstring = (LPSTR) &lpszAddress[nCurrentAddress];
            chUnhandledCharacter = 0;
            nCurrentAddress = nAddressLength;
        }
        
        do
        {                   
            if (bFirstDial)
                lReturn = WaitForReply( 
                    lineMakeCall(g_hLine, &g_hCall, lpszDialableSubstring,
                        0, lpCallParams) );
            else
                lReturn = WaitForReply( 
                    lineDial(g_hCall, lpszDialableSubstring, 0) );

            switch(lReturn)
            {
                // We should not have received these errors because of the
                // prefiltering strategy, but there may be some ill-behaved
                // service providers which do not correctly set their
                // devcapflags.  Add the character corresponding to the error
                // to the filter set and retry dialing.
                //
                case LINEERR_DIALBILLING:
                case LINEERR_DIALDIALTONE:
                case LINEERR_DIALQUIET:
                case LINEERR_DIALPROMPT:
                {
                    OutputDebugString("Service Provider incorrectly sets dwDevCapFlags\n");

                    for (i = 0; i < g_sizeofNonDialable; i++)
                        if (lReturn == g_sNonDialable[i].lError)
                        {
                            strcat(szFilter, g_sNonDialable[i].szToken);
                        }

                    goto retryAfterError;
                }

                case WAITERR_WAITABORTED:
                    OutputDebugString("While Dialing, WaitForReply aborted.\n");
                    goto errExit;
            
            }

            if (HandleLineErr(lReturn))
                continue;
            else
            {
                if (bFirstDial)
                    OutputDebugLineError(lReturn, "lineMakeCall unhandled error: ");
                else
                    OutputDebugLineError(lReturn, "lineDial unhandled error: ");

                goto errExit;
            }

        }
        while (lReturn != SUCCESS);
        
        bFirstDial = FALSE;
                                
        // The dial was successful; now handle characters the service
        // provider didn't (if any).
        if (chUnhandledCharacter)
        {
            LPSTR lpMsg = "";

            // First, wait until we know we can continue dialing.  While the
            // last string is still pending to be dialed, we can't dial another.

            while(TRUE)
            {

                lpLineCallStatus = I_lineGetCallStatus(lpLineCallStatus, g_hCall);
                if (lpLineCallStatus == NULL)
                    goto errExit;

                // Does CallStatus say we can dial now?
                if ((lpLineCallStatus->dwCallFeatures) & LINECALLFEATURE_DIAL)
                {
                    OutputDebugString("Ok to continue dialing.\n");
                    break;
                }
                
                // We can't dial yet, so wait for a CALLSTATE message
                OutputDebugString("Waiting for dialing to be enabled.\n");

                if (WaitForCallState(I_LINECALLSTATE_ANY) != SUCCESS)
                    goto errExit;
            }

            for (i = 0; i < g_sizeofNonDialable; i++)
                if (chUnhandledCharacter == g_sNonDialable[i].szToken[0])
                    lpMsg = g_sNonDialable[i].szMsg;
                    
            MessageBox(g_hDlgParentWindow, lpMsg, "Dialing Paused", MB_OK);
        }
        
    } // continue dialing until we dial all Dialable Substrings.

    LocalFree(lpCallParams);
    LocalFree(lpDS);
    LocalFree(lpAddressCaps);
    if (lpLineCallStatus)
        LocalFree(lpLineCallStatus);
    
    return TRUE;
    
  errExit:
        // if lineMakeCall has already been successfully called, there's a call in progress. 
        // let the invoking routine shut down the call.
        // if the invoker did not clean up the call, it should be done here.

    if (lpLineCallStatus)
        LocalFree(lpLineCallStatus);
    if (lpDS)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲成年网址在线观看| 不卡一区在线观看| 国产精品一卡二卡在线观看| 97se亚洲国产综合自在线观| 在线观看www91| 国产精品天美传媒沈樵| 美洲天堂一区二卡三卡四卡视频| 色成年激情久久综合| 中文字幕欧美一区| 成人免费毛片a| 中文字幕一区二区视频| 91麻豆精品国产综合久久久久久| 专区另类欧美日韩| 欧美片网站yy| 免费看日韩精品| 精品久久久三级丝袜| 蜜桃视频免费观看一区| 亚洲一区免费观看| 粗大黑人巨茎大战欧美成人| 麻豆精品新av中文字幕| 亚洲成人激情综合网| 欧美一区二区三区免费在线看| 五月天激情综合网| 精品欧美乱码久久久久久| 欧美妇女性影城| 国产精品一级片| 国产精品中文字幕日韩精品| 九九**精品视频免费播放| 久久众筹精品私拍模特| 91香蕉视频污| 麻豆国产一区二区| www.66久久| 亚洲精品成人精品456| 黄网站免费久久| 中文字幕在线观看一区二区| 久久免费看少妇高潮| 91激情在线视频| 欧美喷潮久久久xxxxx| 91麻豆精品国产91久久久久久久久| 精品污污网站免费看| 成人av影院在线| 欧美在线一区二区| 欧美成人免费网站| 中文字幕亚洲在| 首页国产欧美日韩丝袜| 一区二区成人在线| 国产精品国产自产拍高清av | 亚洲三级久久久| 视频在线观看一区| 成人午夜视频在线| 欧美挠脚心视频网站| 中文天堂在线一区| 天天操天天综合网| 91日韩精品一区| 久久久久久免费毛片精品| 一区二区成人在线观看| 从欧美一区二区三区| 日韩亚洲欧美综合| 欧美日韩激情一区二区三区| 欧美不卡一二三| 亚洲一区二区三区四区在线| 成人午夜私人影院| 久久综合久久99| 亚洲黄色尤物视频| 国产 欧美在线| 99久久久国产精品免费蜜臀| 2024国产精品| 免费成人av在线| 久久一夜天堂av一区二区三区| 亚洲免费观看高清完整版在线观看熊| 中文字幕一区二区三区乱码在线| 国产自产v一区二区三区c| 欧美在线视频全部完| 亚洲亚洲精品在线观看| 美女视频黄久久| 制服丝袜在线91| 久久av资源网| 99re热视频精品| 亚洲视频小说图片| 国产精品一区二区三区四区| 日韩一级大片在线观看| 国产在线一区观看| 国产亚洲欧美一区在线观看| 国产福利视频一区二区三区| 91蜜桃网址入口| 亚洲精品久久久蜜桃| 在线视频亚洲一区| 日韩成人精品视频| av在线一区二区| 一区二区三区欧美日| 欧美精品久久久久久久久老牛影院 | 午夜成人在线视频| 欧美成人精品1314www| 国产精品亚洲专一区二区三区| 欧美国产精品专区| 免费在线观看一区| 国产欧美一二三区| 国产又粗又猛又爽又黄91精品| 91免费精品国自产拍在线不卡| 亚洲黄色小视频| 久久人人爽人人爽| 欧美亚洲禁片免费| 亚洲综合在线五月| 久久夜色精品国产噜噜av | 91麻豆精品国产91久久久使用方法 | 日韩精品成人一区二区在线| 欧美精品一区二区不卡| 天堂一区二区在线免费观看| 91精品国产综合久久精品麻豆 | 日韩码欧中文字| 精品欧美一区二区久久| 欧美性色黄大片手机版| 国v精品久久久网| 精品一区二区三区久久久| 有坂深雪av一区二区精品| 久久久久久久久伊人| 日韩精品一区二区在线| 日韩高清中文字幕一区| 中文字幕在线不卡一区二区三区| 日韩欧美一卡二卡| 欧美一级高清片在线观看| 在线观看成人免费视频| 色婷婷一区二区三区四区| 综合久久久久综合| 国产精品久久精品日日| 精品人伦一区二区色婷婷| 欧美日韩在线播放一区| 日本韩国精品在线| 欧美主播一区二区三区美女| 一本到不卡免费一区二区| 99久久精品国产精品久久| 91丝袜美女网| 欧美三级视频在线| 欧美二区三区91| 日韩写真欧美这视频| 亚洲精品一区二区在线观看| 精品国内二区三区| 国产日韩精品一区二区浪潮av| 中文字幕欧美日韩一区| 亚洲日本电影在线| 亚洲第一精品在线| 极品少妇xxxx精品少妇偷拍| 成人黄色小视频| 欧美男男青年gay1069videost| 日韩精品一区二区三区视频| 欧美三区在线观看| 免费成人av资源网| 国产成人午夜精品影院观看视频| 国产裸体歌舞团一区二区| 亚洲国产aⅴ成人精品无吗| 久久精品国产秦先生| 欧美精品18+| 欧美mv日韩mv亚洲| 亚洲人一二三区| 天堂av在线一区| 久久精品国产亚洲a| 国产精品一级片| 欧美日韩国产高清一区| 久久久欧美精品sm网站 | 色婷婷久久一区二区三区麻豆| 欧美精品在线观看播放| 久久久精品天堂| 视频一区二区不卡| 国产激情一区二区三区| 制服丝袜国产精品| 精品国产3级a| 亚洲综合精品自拍| 日本高清不卡aⅴ免费网站| 日韩视频在线永久播放| 一区二区欧美在线观看| 成人av电影在线观看| 日韩欧美一区二区三区在线| 亚洲综合男人的天堂| 看电视剧不卡顿的网站| 色999日韩国产欧美一区二区| 国产婷婷色一区二区三区| 秋霞午夜鲁丝一区二区老狼| 成人精品免费网站| 国产精品视频免费| 国产成人综合网| 久久综合色婷婷| 久久成人av少妇免费| 欧美男同性恋视频网站| 麻豆一区二区99久久久久| 欧美性感一区二区三区| 亚洲综合视频在线观看| www.欧美色图| 日韩欧美的一区二区| 亚洲免费在线视频| 97久久精品人人做人人爽50路| 亚洲色图在线看| 色婷婷精品久久二区二区蜜臂av| 久久久午夜电影| 91社区在线播放| 亚洲国产综合91精品麻豆| 欧美视频在线观看一区| 久久精品国产秦先生| 久久精品欧美一区二区三区不卡 | 国产女同互慰高潮91漫画| 欧美中文字幕一区|