我使用Asterisk 16.5和sip中继。
如果已知的sip通道,我可以找到呼叫的唯一ID吗?
注意:我想通过Asterisk AMI的动作和事件来实现。 我想用Asterisk AMI的动作和事件来做.
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
如果你希望做事件,正确的方法是使用事件。即收集NewChannel事件,然后建立map(例如,在memcached中)。
https:/wiki.asterisk.orgwikidisplayASTAsterisk+13+ManagerEvent_Newchannel。
运行太多命令有时会导致ami连接的问题。
你可以查看FOP开源项目或FOP2项目(现在没有源码),作为这种代码的例子。https:/www.fop2.comabout.php