Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

telephony 3

ricosuavericosuave Member Posts: 33
can someone send me a c or c++ program involving telephony.

Comments

  • mfeikmfeik Member Posts: 24
    : can someone send me a c or c++ program involving telephony.
    :

    what are you trying to do?



  • brycebryce Member Posts: 25
    : can someone send me a c or c++ program involving telephony.
    :
    What are trying to do? Have you studied per se PPP along with
    Unix shell? These studies may help to answer your question.

    Bryce

  • ricosuavericosuave Member Posts: 33
    I want to be able to send and receive information.
    but i would accept any program that involves telephony
  • ricosuavericosuave Member Posts: 33
    i have not studied ppp,is that (public protection program).
    and unix shell. I am taking a class next semester that involves the study of unix.Are those 2 things necessary for the ability to do telephony? I thought you needed some knowledge of the software and hardware of any system that allowed you to operate telephone capibilities with a computer
  • mfeikmfeik Member Posts: 24
    : can someone send me a c or c++ program involving telephony.
    :
    Okay... I have to admit that I have no idea what 'telephony' is. I guess I thought you wanted to see some code on how to access communcation resources, like the serial port, etc... is this the case?

    -------------------------------------------

    Of all the things I've lost, I miss my mind the most!

  • ricosuavericosuave Member Posts: 33
    Telephony involves usings modems which allow you to send and receive information involving phone lines.
    I now that and that there is a huge field out their but i don't know anything else about it.
    But if you can send me any code on accesing anything dealing with communication i would love it .
    I am thinking that if I have more knowledge of communications programs telephony might occur outside of it.
    thank you
    : : can someone send me a c or c++ program involving telephony.
    : :
    : Okay... I have to admit that I have no idea what 'telephony' is. I guess I thought you wanted to see some code on how to access communcation resources, like the serial port, etc... is this the case?
    :
    : -------------------------------------------
    :
    : Of all the things I've lost, I miss my mind the most!
    :
    :

  • mfeikmfeik Member Posts: 24
    This is a simple interface with the a com port. I should think that you could easily modify this to work with a phone modem... also, I would be surprised if there wasn't some libraries out there (free at that) that you could download specifically for the phone modems (I use several types of modems but NONE for phone line connections).

    //setup of variables to be used...
    BOOL bPort;
    HANDLE hCom;
    CString sComPort; // you would choose the modem port here
    DCB dcb; // device comm. block
    COMMTIMEOUTS CommTimeouts; // see MSDN
    BOOL bWrite, bRead;
    DWORD dwBytesTx, dwBytesRx;
    char szBuf[256];

    sComPort = "COM1";
    hCom = CreatFile(mComport, // see MSDN for more
    GENERIC_READ | GENERIC_WRITE,
    0, //exclusive access
    NULL, // no security
    OPEN_EXISTING, // likely has to be this for phone too
    0, // no overlapping I/O
    NULL); // null template
    bPort = SetupComm(m_hCom, sizeof(szBuf),sizeof(szBuf));
    // error code here

    bPort = GetCommState(hCom, &dcb);
    // error code here
    dcb.BaudeRate = 9600;
    dcb.ByteSize = 8;
    dcb.Parity = NOPARITY;
    dcb.StopBits = ONESTOPBIT;
    dcb.fAbortOnError = TRUE;
    bPort = SetCommState(hCom, &dcb);
    // error code here

    //if you want/need to set timeouts its similar to the above block
    //bPort = GetCommTimeouts(hCom, &CommTimeouts);
    //CommTimeouts.ReadIntervalTimout = 50; // see MSND for more on these
    // ...
    //bPort = SetCommTimouts(hCom, &CommTimeouts);

    // if no errors from above you are ready to read and write
    bWrite = WriteFile(hCom, your_output, sizeof(your_output), &dwBytesTx, NULL);

    bRead = ReadFile(hCom, &szBuf, ***bytesToRead*** , &dwBytesRx, NULL);
    // ***bytesToRead*** if you don't know how many bytes are going to be
    // recieved you would need to set up the ReadFile inside some form of
    // control, such as break from read on some event char or max chars in
    // see WaitEvent, CreateEvent, etc in MSDN

    CloseHandle(hCom); // don't want to forget this

    I use VS6 and mostly write MFC apps so this might not be of much help to you. For the most part, I use libraries to handle my com port activities but it should give you some insight as to what all is involved.
    Peace
    -Mel

    -------------------------------------------

    Of all the things I've lost, I miss my mind the most!

  • ricosuavericosuave Member Posts: 33
    thank you mel .I will research this.

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    __ ( http://forcoder.org ) free ebooks and video tutorials about < Assembly, Objective-C, Go, Scratch, Visual Basic, PL/SQL, JavaScript, Java, Python, C, Delphi, Visual Basic .NET, Ruby, PHP, MATLAB, C#, C++, R, Perl, Swift VBScript, Awk, Crystal, LabVIEW, ABAP, Julia, Clojure, SAS, Rust, Lua, Prolog, Lisp, Transact-SQL, D, Scheme, Kotlin, Dart, FoxPro, Scala, Alice, Fortran, F#, Logo, Bash, Ada, ML, Apex, Erlang, COBOL, Hack /> ________

Sign In or Register to comment.