Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. lineCallbackFunc not returning message..... [modified]

lineCallbackFunc not returning message..... [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
delphijsonquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AmbiguousName
    wrote on last edited by
    #1

    hello guys...everything seems to be fine here but when I call at my landline number it does't show me the number. TapiInitialize()

    void WINAPI TapiInitialize() {

    LPLINEDEVCAPS lineDevCaps = NULL;
    lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096);
    
    //create the event first..
    EventReply = CreateEvent(NULL,FALSE,FALSE,NULL);
    
    //clear the structure before the usage
    memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS));
    
    //populate the options
    LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS);
    LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION\_USEEVENT;
    
    //call the LineInitializeEx function
    result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)&lineCallbackFunc,NULL,&numDevs,&tapiVersion,&LineInitializeExParams);
    if (result!=0)	
    	printf("TAPI could't be Initialized"); 
    else printf("\\n\\nTAPI Initialized..");
    
    num = numDevs;
    printf("\\nNumber of lines available to this app:  %d",(LPWSTR)num);
    
    result = lineNegotiateAPIVersion(lineApp,0,API\_EARLY\_VERSION,API\_CURRENT\_VERSION,&tapiVersion,0);
    result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps);
    //opening a line
    result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE\_MONITOR,LINEMEDIAMODE\_DATAMODEM,NULL);
    if(result!=0)
    	printf("\\nLINE could't be Opened...");
    else
    	printf("\\nLINE Opened...");
    

    TapiShutDown()

    void WINAPI TapiShutdown() {
    result = lineShutdown(lineApp);
    if (result==0)
    printf("Line closed successfuly");
    else
    printf("something went wrong");
    }

    and lineCallbackFunc().

    VOID FAR PASCAL lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
    if (dwMsg == LINE_REQUEST)
    printf("incomg line...");
    }

    In the main(), I just call these functions.

    int _tmain(int argc, _TCHAR* argv[])
    {
    TapiInitialize();
    Sleep(180000);
    printf("\n\nPress any key to close line....");
    getche();
    TapiShutdown();
    return 0;
    }

    Where am I doing something wrong??:confused:

    modified on Tuesday, September 21, 2010 1:21 PM

    K O D 3 Replies Last reply
    0
    • A AmbiguousName

      hello guys...everything seems to be fine here but when I call at my landline number it does't show me the number. TapiInitialize()

      void WINAPI TapiInitialize() {

      LPLINEDEVCAPS lineDevCaps = NULL;
      lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096);
      
      //create the event first..
      EventReply = CreateEvent(NULL,FALSE,FALSE,NULL);
      
      //clear the structure before the usage
      memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS));
      
      //populate the options
      LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS);
      LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION\_USEEVENT;
      
      //call the LineInitializeEx function
      result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)&lineCallbackFunc,NULL,&numDevs,&tapiVersion,&LineInitializeExParams);
      if (result!=0)	
      	printf("TAPI could't be Initialized"); 
      else printf("\\n\\nTAPI Initialized..");
      
      num = numDevs;
      printf("\\nNumber of lines available to this app:  %d",(LPWSTR)num);
      
      result = lineNegotiateAPIVersion(lineApp,0,API\_EARLY\_VERSION,API\_CURRENT\_VERSION,&tapiVersion,0);
      result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps);
      //opening a line
      result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE\_MONITOR,LINEMEDIAMODE\_DATAMODEM,NULL);
      if(result!=0)
      	printf("\\nLINE could't be Opened...");
      else
      	printf("\\nLINE Opened...");
      

      TapiShutDown()

      void WINAPI TapiShutdown() {
      result = lineShutdown(lineApp);
      if (result==0)
      printf("Line closed successfuly");
      else
      printf("something went wrong");
      }

      and lineCallbackFunc().

      VOID FAR PASCAL lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
      if (dwMsg == LINE_REQUEST)
      printf("incomg line...");
      }

      In the main(), I just call these functions.

      int _tmain(int argc, _TCHAR* argv[])
      {
      TapiInitialize();
      Sleep(180000);
      printf("\n\nPress any key to close line....");
      getche();
      TapiShutdown();
      return 0;
      }

      Where am I doing something wrong??:confused:

      modified on Tuesday, September 21, 2010 1:21 PM

      K Offline
      K Offline
      Kushagra Tiwari
      wrote on last edited by
      #2

      You can look at these : [^] http://tapifaq.pennypacker.org/tapifaq3.html[^] Answering machine(TAPI 2.1)[^] Though the answer doesn't address your issue directly .. they might give u a proper direction. -Kushagra

      1 Reply Last reply
      0
      • A AmbiguousName

        hello guys...everything seems to be fine here but when I call at my landline number it does't show me the number. TapiInitialize()

        void WINAPI TapiInitialize() {

        LPLINEDEVCAPS lineDevCaps = NULL;
        lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096);
        
        //create the event first..
        EventReply = CreateEvent(NULL,FALSE,FALSE,NULL);
        
        //clear the structure before the usage
        memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS));
        
        //populate the options
        LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS);
        LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION\_USEEVENT;
        
        //call the LineInitializeEx function
        result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)&lineCallbackFunc,NULL,&numDevs,&tapiVersion,&LineInitializeExParams);
        if (result!=0)	
        	printf("TAPI could't be Initialized"); 
        else printf("\\n\\nTAPI Initialized..");
        
        num = numDevs;
        printf("\\nNumber of lines available to this app:  %d",(LPWSTR)num);
        
        result = lineNegotiateAPIVersion(lineApp,0,API\_EARLY\_VERSION,API\_CURRENT\_VERSION,&tapiVersion,0);
        result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps);
        //opening a line
        result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE\_MONITOR,LINEMEDIAMODE\_DATAMODEM,NULL);
        if(result!=0)
        	printf("\\nLINE could't be Opened...");
        else
        	printf("\\nLINE Opened...");
        

        TapiShutDown()

        void WINAPI TapiShutdown() {
        result = lineShutdown(lineApp);
        if (result==0)
        printf("Line closed successfuly");
        else
        printf("something went wrong");
        }

        and lineCallbackFunc().

        VOID FAR PASCAL lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
        if (dwMsg == LINE_REQUEST)
        printf("incomg line...");
        }

        In the main(), I just call these functions.

        int _tmain(int argc, _TCHAR* argv[])
        {
        TapiInitialize();
        Sleep(180000);
        printf("\n\nPress any key to close line....");
        getche();
        TapiShutdown();
        return 0;
        }

        Where am I doing something wrong??:confused:

        modified on Tuesday, September 21, 2010 1:21 PM

        O Offline
        O Offline
        oggenok64
        wrote on last edited by
        #3

        You need to open a TAPI-device before you can receive any events - use lineOpen. Most likely you will wan't to preceede that with lineNegotiateAPIVersion and lineGetDevCaps.

        A 1 Reply Last reply
        0
        • A AmbiguousName

          hello guys...everything seems to be fine here but when I call at my landline number it does't show me the number. TapiInitialize()

          void WINAPI TapiInitialize() {

          LPLINEDEVCAPS lineDevCaps = NULL;
          lineDevCaps = (LPLINEDEVCAPS)LocalAlloc(LPTR, 4096);
          
          //create the event first..
          EventReply = CreateEvent(NULL,FALSE,FALSE,NULL);
          
          //clear the structure before the usage
          memset(&LineInitializeExParams,0,sizeof(LINEINITIALIZEEXPARAMS));
          
          //populate the options
          LineInitializeExParams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS);
          LineInitializeExParams.dwOptions = LINEINITIALIZEEXOPTION\_USEEVENT;
          
          //call the LineInitializeEx function
          result = lineInitializeEx(&lineApp,NULL,(LINECALLBACK)&lineCallbackFunc,NULL,&numDevs,&tapiVersion,&LineInitializeExParams);
          if (result!=0)	
          	printf("TAPI could't be Initialized"); 
          else printf("\\n\\nTAPI Initialized..");
          
          num = numDevs;
          printf("\\nNumber of lines available to this app:  %d",(LPWSTR)num);
          
          result = lineNegotiateAPIVersion(lineApp,0,API\_EARLY\_VERSION,API\_CURRENT\_VERSION,&tapiVersion,0);
          result = lineGetDevCaps(lineApp,0,tapiVersion,0,lineDevCaps);
          //opening a line
          result = lineOpen(lineApp,0,&hLine,tapiVersion,0,0,LINECALLPRIVILEGE\_MONITOR,LINEMEDIAMODE\_DATAMODEM,NULL);
          if(result!=0)
          	printf("\\nLINE could't be Opened...");
          else
          	printf("\\nLINE Opened...");
          

          TapiShutDown()

          void WINAPI TapiShutdown() {
          result = lineShutdown(lineApp);
          if (result==0)
          printf("Line closed successfuly");
          else
          printf("something went wrong");
          }

          and lineCallbackFunc().

          VOID FAR PASCAL lineCallbackFunc(DWORD hDevice,DWORD dwMsg, DWORD Param1, DWORD Param2, DWORD Param3) {
          if (dwMsg == LINE_REQUEST)
          printf("incomg line...");
          }

          In the main(), I just call these functions.

          int _tmain(int argc, _TCHAR* argv[])
          {
          TapiInitialize();
          Sleep(180000);
          printf("\n\nPress any key to close line....");
          getche();
          TapiShutdown();
          return 0;
          }

          Where am I doing something wrong??:confused:

          modified on Tuesday, September 21, 2010 1:21 PM

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Do any of the printf() statements work?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          1 Reply Last reply
          0
          • O oggenok64

            You need to open a TAPI-device before you can receive any events - use lineOpen. Most likely you will wan't to preceede that with lineNegotiateAPIVersion and lineGetDevCaps.

            A Offline
            A Offline
            AmbiguousName
            wrote on last edited by
            #5

            thanx...that really was the problem though it is still not solved but im working.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups