AMI Asterisk Manager Interface Originate Action

有些话、适合烂在心里 提交于 2019-12-06 19:33:30

What exactly are you trying to do? You can't use a non-existent channel to bridge into a conference room. If you're looking to create a conference, then have people called on their extensions (or on any number, really) and placed into the conference room, that's simple.

I assume you're using Asterisk.NET. The originate command expects a number to dial (this is the channel), a context, and an extension to connect the call to within the dialplan (this can be hard-coded or can presumably be created through the AMI).

Say you set up a conference room on extension 300. Your originate command would look something like this:

OriginateAction oc = new OriginateAction();
oc.Context = "YourDialPlanContext";
oc.Priority = 1;

// Channel is however you're dialing (extensions, SIP, DAHDI, etc.)
oc.Channel = "SIP/12125551212@Your-Sip-Prover-Peer-Name"; 
// or in the alternative
// oc.Channel = "ZAP/ZapChannelName/12125551212";

oc.CallerId = "9998887777";

// This is the extension you want dialed once the call is connected
// 300 in our example
oc.Exten = "300";
oc.Timeout = 60000;               // Our timeout in ms
oc.Variable = "VAR1=ABC|VAR2=25"; // If you need to pass variables to the dialplan

// Async should be set to true, unless you want your code to wait until the call
// is complete
oc.Async = true;         

// Go ahead and place the call
ManagerResponse originateResponse = AsteriskManager.SendAction(oc, oc.Timeout);

Voila! You have now originated a call to your intended conference participant, and upon answering they will be directed into your conference room.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!