Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone :)
I would like to explain that: in a company there are telephones connected to a standard telephone to make calls I want to connect this PABX to a computer for processing transactions using a application c #:

For telephone calls: This application saves the caller's number i (which belongs to the company and asked to make a call) and the called numbers (requested by the caller i) and duration dt

The problem is: :o
* how to connect the PBX to the computer via a port!
* When connecting, how to read the information of transactions and information explained above numbers (caller i, numbers called and the duration dt) to record in a database via this port in c#. :D
thnx
Posted

You'd better switch to a software-based system, like Ozeki's PBX. With its SDK you can develop call recorder in C#:

C#
public class Program
{
    public void static void Main(string[] args)
    {
        OpsClient opsClient = new OpsClient();
        var result = opsClient.Login("ozekixepbx.ip", "admin", "abc12345");

        opsClient.SessionCreated += new EventHandler>(opsClient_SessionCreated);
        opsClient.SessionCompleted += new EventHandler>(opsClient_SessionCompleted);
    }

    static void client_SessionCreated(object sender, Ozeki.VoIP.VoIPEventArgs e)
    {
        try{
            var mp3Recorder = currentCalls.GetOrAdd(session, (s) => new MP3StreamRecorder(string.Format("{0}_{1}_{2}.mp3", session.CallerId, session.Destination, session.SessionID)));
            session.ConnectAudioReceiver(CallParty.All, mp3Recorder);
            
            //attach speaker to call
            //var speaker = Speaker.GetDefaultDevice();
            //session.ConnectAudioReceiver(CallParty.All, speaker);
            //speaker.Start();
            
            //attach microphone to call
            //var microphone = Microphone.GetDefaultDevice();
            //session.ConnectAudioSender(CallParty.All, microphone); // you can select which call party can hear your voice with the CallParty parameter
            //microphone.Start();
            
            mp3Recorder.StartStreaming();
        }catch(Exception ex)
        {
            Console.WrinteLine(ex.Message);
        }

    }

    static void client_SessionCompleted(object sender, Ozeki.VoIP.VoIPEventArgs e)
    {
        MP3StreamRecorder recorder;
        if(currentCalls.TryGetValue(session, out recorder))
        {
            recorder.Dispose();
            session.DisconnectAudioReceiver(CallParty.All, recorder);
        }
    }
}


Source: http://www.ozekiphone.com/voip-part2-c-example-on-recording-voip-calls-call-routing-754.html[^]
 
Share this answer
 
Comments
VICK 14-Mar-14 3:05am    
Great to see an answer posted and accepted for an old question.

MY 5+ for your effort.
Member 10667561 18-Mar-14 9:58am    
Thanks a lot. Happy to help :)
All of this depends on your PBX and the interfaces it exposes. Consult the documentation on your system.
 
Share this answer
 
ok thnx
if my PBX is connected to the COM port of the computer via
RS232 cable.. i found that i can read the informations of the port , but how can i know the phone numbers (using System.IO.Ports) !! any idea
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900