日期:2014-05-16 浏览次数:20907 次
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace dllTest
{
class Program
{
///
/// 初始化
///
///
[DllImport("pjsipDll.dll", CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int dll_init();
///
/// 主函数
///
///
[DllImport("pjsipDll.dll", CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int dll_main();
/// <summary>
///
/// </summary>
/// <returns></returns>
[DllImport("pjsipDll.dll", CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int dll_getNumOfCodecs();
/// <summary>
/// 打电话
/// </summary>
/// <param name="accountId">用户名</param>
/// <param name="uri">地址</param>
/// <returns></returns>
[DllImport("pjsipDll.dll", EntryPoint = "dll_makeCall")]
private static extern int dll_makeCall(int accountId, string uri);
/// <summary>
/// 回电话
/// </summary>
/// <param name="callId"></param>
/// <param name="code"></param>
/// <returns></returns>
[DllImport("pjsipDll.dll", CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int dll_answerCall(int callId, int code);
/// <summary>
///
/// </summary>
/// <param name="callId"></param>
/// <returns></returns>
[DllImport("pjsipDll.dll", EntryPoint = "dll_releaseCall", CharSet = CharSet.Ansi, SetLastError = true)]
private static extern int dll_releaseCall(int callId);
static void Main(string[] args)
{