关于Skype for Business云PBX对接全SIP能力IVR机器人的技术问询
Absolutely, your requirement is fully feasible—Skype for Business (SfB) Online Cloud PBX was built to integrate with third-party telephony systems, including custom IVR bots with full SIP capabilities. Let’s break down the details step by step:
1. Core Feasibility
SfB Online supports SIP Trunking (either via Microsoft-certified providers or direct SIP connections for qualified scenarios) and exposes programmatic APIs for call control, so building a custom SIP IVR bot to connect to it is totally doable. Even as Microsoft transitions users to Teams Phone, SfB Online’s core telephony integration capabilities remain intact for existing tenants.
2. Implementation Approaches
You have two primary paths to build this integration:
Option A: Direct SIP Trunk Integration
This is the most straightforward route for a SIP-native IVR bot:
- Configure a SIP Trunk in your SfB tenant: Register your IVR bot’s public SIP endpoint (IP address/domain) with Microsoft, define supported codecs (G.711 u-law/a-law is mandatory, G.722 is optional), and set up voice routing policies to direct incoming calls to your IVR, or route outgoing calls from your IVR to SfB’s PSTN network.
- Build the SIP IVR Logic: Your bot will handle SIP INVITE requests, send/receive DTMF tones, play audio prompts, and manage call transfers using standard SIP protocols (RFC 3261). Make sure your bot adheres to Microsoft’s SIP trunking requirements, like proper authentication, session timers, and media handling.
Option B: Microsoft Graph Cloud Communications API
If you prefer a more programmatic approach (instead of raw SIP), use the Graph API (which works with both SfB Online and Teams Phone):
- Use the Graph Calls API: This lets you initiate, manage, and terminate calls programmatically. Your IVR bot can act as a "service hosted media bot" to handle audio prompts, DTMF input, and call flow logic.
- Example: Initiate an Outbound Call with Graph SDK (C#)
using Microsoft.Graph; using Microsoft.Graph.Models; var graphClient = new GraphServiceClient(authProvider); var call = new Call { CallbackUri = "https://your-ivr-service.com/callbacks", Targets = new List<InvitationParticipantInfo> { new InvitationParticipantInfo { Identity = new IdentitySet { User = new Identity { Id = "user@contoso.com" } // For PSTN calls: replace User with Phone // Phone = new Identity { Id = "+1234567890" } } } }, RequestedModalities = new List<string> { "audio" }, MediaConfig = new ServiceHostedMediaConfig { PreFetchMedia = new List<MediaInfo> { new MediaInfo { Uri = "https://your-ivr-service.com/welcome-message.wav", ResourceId = "welcome_prompt" } } } }; var createdCall = await graphClient.Communications.Calls .Request() .AddAsync(call);
3. Multi-Call Handling
Yes, this is fully supported:
- If using SIP trunking: Build your IVR bot’s backend with scalable, asynchronous processing (e.g., containerization, serverless functions, or a distributed telephony platform) to handle concurrent calls. Microsoft’s SIP trunking lets you specify the number of concurrent calls in your agreement.
- If using Graph API: The API is designed to handle multiple concurrent call sessions, and your bot can manage each call via unique session IDs and callback endpoints.
4. Outbound Calling Capabilities
You can absolutely implement outbound calls:
- SIP Trunk Route: Configure your SfB tenant to route outbound calls from your IVR bot to the PSTN (requires your SfB tenant has PSTN connectivity enabled, either via Microsoft Calling Plans or a third-party SIP trunk).
- Graph API: Use the
Callsendpoint to initiate calls to SfB users, Teams users, or external PSTN numbers (as shown in the example above).
Key Considerations
- Tenant Configuration: Ensure your SfB Online tenant has SIP trunking enabled, and that your IVR bot’s IP/domain is whitelisted in Microsoft’s admin center.
- Compliance: Adhere to Microsoft’s telephony compliance requirements (e.g., call recording policies if applicable).
- Testing: Use Microsoft’s SfB Online test tools or a staging tenant to validate call flows before production.
内容的提问来源于stack exchange,提问作者James Hancock

