You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于C#与CUCM通信:捕获来电并查询Dynamics CRM的.NET方案咨询

Capturing Cisco Call Events in .NET and Integrating with Dynamics CRM

Hey there! I’ve worked on similar integrations before, so let’s walk through the practical .NET-focused options you have to capture those caller events and tie them to Dynamics CRM.

1. Cisco TAPI + .NET Tapi3Lib

If your Cisco Unified Communications Manager (CUCM) is set up with the Cisco TAPI Service Provider (TSP) (standard for most Windows-based Cisco deployments), you can leverage Windows TAPI framework with .NET. Here’s how to get started:

  • Add a COM reference to Tapi3Lib in your C# project (look for it under COM components in Visual Studio’s Add Reference dialog).
  • Use the library to register for incoming call notifications, extract the Caller ID, then query Dynamics CRM.

A quick code snippet for the TAPI event listening part:

using Tapi3Lib;

public class CiscoCallListener
{
    private ITap3 _tapiSession;
    private ITAddress _ciscoLineAddress;

    public void InitializeCallListener()
    {
        _tapiSession = new TAPIClass();
        _tapiSession.Initialize();

        // Locate the Cisco TSP line address
        foreach (ITAddress addr in _tapiSession.Addresses)
        {
            if (addr.Name.Contains("Cisco"))
            {
                _ciscoLineAddress = addr;
                break;
            }
        }

        if (_ciscoLineAddress != null)
        {
            _ciscoLineAddress.EnableCallNotifications(Tapi3Constants.TAPIMEDIATYPE_AUDIO, true);
            _ciscoLineAddress.CallNotification += OnIncomingCall;
        }
    }

    private void OnIncomingCall(ITCallInfo call, Tapi3Constants.TAPICALLNOTIFICATION_EVENT eventType)
    {
        if (eventType == Tapi3Constants.TAPICALLNOTIFICATION_EVENT.TCNE_CALLINFOCHANGE)
        {
            var callerId = call.get_CallInfoString(Tapi3Constants.CALLINFO_STRING.CIS_CALLERIDNUMBER);
            if (!string.IsNullOrWhiteSpace(callerId))
            {
                // Pass caller ID to Dynamics CRM query
                _ = QueryDynamicsCRMForContact(callerId);
            }
        }
    }

    private async Task<Entity> QueryDynamicsCRMForContact(string callerId)
    {
        // Implementation using Dataverse client (see section 3)
        return null;
    }
}

2. SIP-Based Listening with .NET SIP Libraries

If your Cisco environment exposes SIP endpoints, you can listen for SIP INVITE messages (triggered on incoming calls) using a .NET SIP library. Popular choices include:

  • SIPSharp: An open-source .NET SIP stack that lets you build a lightweight listener to extract caller ID from SIP From headers.
  • Ozeki SIP SDK: A commercial library with pre-built call monitoring components that reduce low-level SIP handling work.

These libraries let you capture call events directly from the SIP stream, making them a great fit if you need cross-platform flexibility or don’t want to rely on TAPI.

3. Cisco Finesse/UCCE REST APIs (For Contact Center Environments)

If you’re using Cisco Unified Contact Center Enterprise (UCCE) or Finesse, these platforms offer REST APIs and WebSocket-based notification services for real-time call tracking:

  • Use the Finesse Notification Service to subscribe to incoming call events and retrieve caller ID.
  • For the Dynamics CRM integration, use the official Microsoft.PowerPlatform.Dataverse.Client NuGet package to query records matching the caller’s phone number.

Here’s a snippet for the CRM query logic:

using Microsoft.PowerPlatform.Dataverse.Client;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;

public async Task<Entity> FindMatchingContact(string callerId)
{
    var serviceClient = new ServiceClient("your-crm-connection-string");
    if (!serviceClient.IsReady) return null;

    var contactQuery = new QueryExpression("contact")
    {
        ColumnSet = new ColumnSet("fullname", "emailaddress1", "telephone1"),
        Criteria = new FilterExpression
        {
            Conditions = {
                new ConditionExpression("telephone1", ConditionOperator.Equal, callerId),
                new ConditionExpression("mobilephone", ConditionOperator.Equal, callerId)
            },
            FilterOperator = LogicalOperator.Or
        }
    };

    var results = await serviceClient.RetrieveMultipleAsync(contactQuery);
    return results.Entities.FirstOrDefault();
}

Final Recommendations

  • Start with the TAPI approach if you have a standard CUCM setup—it’s the most straightforward for Windows/.NET environments.
  • For cross-platform needs or more control over call data, go with a SIP library.
  • For contact center deployments, use the Finesse/UCCE APIs—they’re the official, supported way to access call events.

All these methods let you capture caller IDs and integrate seamlessly with Dynamics CRM using the official Dataverse client library.

内容的提问来源于stack exchange,提问作者Nader Vaghari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:26:41