1

我正在尝试从 Asterisk.Net 的旧副本升级到最新版本的 AsterNet。我们曾经使用 AsteriskManager.OriginateCall() 发起调用,它返回一个 Call 对象。该调用对象有一个 UniqueId 和 ChannelName。

现在我使用 SendAction() 发起呼叫并向其发送 OriginateAction。所以我的第一个问题是:这是正确的做法吗?因为在我得到的结果中,UniqueId 为空并且它没有 ChannelName。我认为频道名称可能在一个属性中,但 Attributes 也是空的。

那么如何获取我刚刚发起的呼叫的频道名称和唯一 ID?

4

2 回答 2

3

我是这样做的:我创建了一个 OriginateAction。在 OriginateAction 中,我将异步设置为 true。然后我用 SendEventGeneratingAction() 发送它并超时。我检查我返回的 ResponseEvents 不为空,responseEvents.Events.Count > 0,并且 responseEvents.Events[0] 是 OriginateResponseEvent。responseEvents.Events[0] 然后拥有我需要的所有信息。

于 2014-03-21T15:46:35.883 回答
-1

Please consult Action Originate page. Also check source code of you library.

After triggering originate, you get event OriginateResponse which have actoion id info. After that it will spawn more events(depend of version) which give your more info based on actionid.

Other solution is send to originate some variables, after that use in dialplay UserEvent command to return all info you need.

PS. Create dialling core without experience in asterisk is very bad idea, becuase it WILL have issues under load. Use already writed cores or hire expert.

于 2014-03-07T12:42:25.650 回答