寻找呼叫通道的唯一ID

问题描述 投票:0回答:1

我使用Asterisk 16.5和sip中继。

如果已知的sip通道,我可以找到呼叫的唯一ID吗?

注意:我想通过Asterisk AMI的动作和事件来实现。 我想用Asterisk AMI的动作和事件来做.

asterisk sip pbx
1个回答
1
投票
Action: Command
Command: core show channels concise

给你一个列表:Channel:Context:Exten:Priority:Stats:Application:Data:CallerID:Accountcode:Amaflags:Duration:Bridged.

你必须在 "Channel "字段中选择正确的通道,并进行一个

Action: Command
Command: core show channel YOUR_CHANNEL

0
投票

如果你希望做事件,正确的方法是使用事件。即收集NewChannel事件,然后建立map(例如,在memcached中)。

https:/wiki.asterisk.orgwikidisplayASTAsterisk+13+ManagerEvent_Newchannel。

运行太多命令有时会导致ami连接的问题。

你可以查看FOP开源项目或FOP2项目(现在没有源码),作为这种代码的例子。https:/www.fop2.comabout.php

© www.soinside.com 2019 - 2024. All rights reserved.