使用C#应用程序管理PABX并从端口读取信息! [英] manage a PABX with C # application and read information from a port!

查看:69
本文介绍了使用C#应用程序管理PABX并从端口读取信息!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好吧:)

我想解释一下:在一家公司有电话连接到标准电话打电话我想把这个PABX连接到一台电脑处理交易使用一个申请c#:



拨打电话:此应用程序保存来电号码i(属于公司并要求拨打电话)和被叫号码(请求由来电者i)和持续时间dt



问题是:o

*如何通过端口将集团电话连接到电脑!

*连接时,如何通过c#中的此端口读取上述数字(来电者i,被叫号码和持续时间dt)的交易信息和信息。 :D

thnx

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

推荐答案

你最好切换到基于软件的系统,比如Ozeki的PBX。使用其SDK,您可以使用C#开发呼叫记录器:



You'd better switch to a software-based system, like Ozeki's PBX. With its SDK you can develop call recorder in 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);
        }
    }
}





来源: http://www.ozekiphone.com/voip-part2-c-example-on- recording-voip-calls-call-routing-754.html [ ^ ]


所有这些都取决于您的PBX及其公开的接口。请参阅系统上的文档。
All of this depends on your PBX and the interfaces it exposes. Consult the documentation on your system.


ok thnx

如果我的PBX连接到计算机的COM端口通过

RS232电缆..我发现我可以读取端口的信息,但我怎么能知道电话号码(使用System.IO.Ports)!!任何想法

:)
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
:)


这篇关于使用C#应用程序管理PABX并从端口读取信息!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆