获取函数内收到呼叫的分机号码 - 星号
我有一个星号服务器设置为电话交换机。我在上面有 100 个分机,从 00 到 99。我在每个分机上运行特定的功能。其中一些功能可能需要接收呼叫的分机才可用。我怎样才能访问相同的内容?例如,
假设分机 55 接到呼叫。
55具有与其相关的功能。该函数必须接受 55 作为输入参数。我该怎么做?
我已尝试以下操作:
exten => 0,n,Verbose(1, "Call on ${EXTEN}-${CHANNEL}")
输出为:调用 0-DAHDI/20-1
谢谢,
斯里拉姆·香卡。
I have an asterisk server set up as a telephone exchange. I have, on it, a 100 extensions, from 00 - 99. I am running specific functions on each of those extensions. Some of these functions may need the extension on which the call was received to be available. How can I access the same? For example,
Say a call comes in on extension 55.
55 has a function associated with it. That function must take in 55 as an input parameter. How do I do this?
I have tried the following:
exten => 0,n,Verbose(1, "Call on ${EXTEN}-${CHANNEL}")
Output is : Call on 0-DAHDI/20-1
Thanks,
Sriram Shankar.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找的答案取决于呼叫通过您的系统的路径。确定问题答案的最简单方法是拨打电话,然后从 Asterisk CLI 中运行以下命令:
这将显示哪些通道处于活动状态。找到您通话的频道名称。
这将输出一系列通道详细信息,包括设置的不同变量及其相应的值。在值字段中查找您要获取的分机号码,然后查看相应的变量名称是什么。它可以是 ${CALLERID(num)}、${CALLERID(dnid)}、${CDR} 变量下的内容,甚至其他地方。
如果您在“core show channel [channel-name]”生成的输出中没有找到它,您可能必须跟踪呼叫所采用的拨号方案路径,并在 DID 信息仍然可用时尝试尽早设置该变量。
The answer you are looking for is dependent upon the path that the call is taking through your system. The easiest way to determine the answer to your question is to place the call and then run the following commands from within the Asterisk CLI:
This will show you what channels are active. Find the channel name of your call.
This will output an array of channel details, including different variables that are set and their corresponding values. Look for the extension number you are trying to grab in the value fields and then look to see what the corresponding variable name is. It could be ${CALLERID(num)}, ${CALLERID(dnid)}, something under the ${CDR} variable, or even elsewhere.
If you don't find it in the output produced by "core show channel [channel-name]", you may have to trace the dialplan path that the call is taking and try setting the variable early on when the DID information is still available.