telnet 192.168.1.139 5038
Action: login
Username: phpagi
Secret: phpagi
Events: off //这行可有(显示事件),可无(不显示事件)
Action: Command
Command: pri show spans
//查看可用的命令
Action: ListCommands
//列出可用的命令
WaitEvent: Wait for an event to occur 等待一个事件出现
QueueReset: Reset queue statistics
QueueReload: Reload a queue,queues,or any sub-section of a queue 0
QueueRule: Queue Rules
QueuePenalty: Set the penalty for a queue member
QueueLog: Add custom entry in queue_log
QueuePause: Makes a queue member temporarily
//停止/开启队列中某个成员的使用
Action: QueuePause
Queue: //队列名
Interface: //成员名
Paused: 停止或开启(true or false)
QueueRemove: Remove interface from queue
//移除队列成员
Action: QueueRemove
Queue: 200 //移除成员的队列名
Interface: sip/3001 //成员名(分机名)
QueueAdd: Add interface to queue
//添加队列成员
Action: QueueAdd
Queue: 200 //添加成员的队列名
Interface: sip/3001 //成员名
Penalty: 1 //数值,值越高越靠后
Paused: true //暂停(true)或不暂停(false)
(ActionID:可选的匹配参数)
QueueSummary: Show queue summary
//队列概要
QueueStatus: Show queue status
//返回全部队列的电话数据信息
Action: QueueStatus
Queues: Queues
//返回全部队列的配置以及电话数据信息
Action: Queues
MuteAudio: Mute an audio stream
MixMonitorMute: Mute/unMute a Mixmonitor recording
VoicemailUsersList: List All Voicemail user information
//所有语音信箱用户的信息
PlayDTMF: Play DTMF signal on a specific channel.
//在指定的通道上发送双音多频信号数字
Action: PlayDTMF
Channel: SIP/123-e2b2
Digit:1 //双间多频信号数字
MeetmeList:
MeetmeUnmute:
MeetmeMute:
LocalOptimizeAway: Optimize away a local channel when possible
SKINNYshowline: Show SKINNY line(text format)
SKINNYlines: List SKINNY lines(text format)
SKINNYshowdevice: Show SKINNY device(text format)
SKINNYdevices: List SKINNY devices(text format)
IAXregistry: Show IAX registrations
IAXnetstats; Show IAX Netstats
IAXpeerlist: List IAX Peers
IAXpeers: List IAX peers
//显示iax信息列表
Action: IAXPeers
SIPnotify: Send a SIP notify
SIPshowregistry: Show SIP registrations(text format)
SIPqualifypeer: Qualify SIP peers
SIPshowpeer: show SIP peer(text format)
//显示指定peer信息
Action: SIPshowpeer
peer: //指定的分机
SIPpeers: List SIP peers(text format)
//显示sip用户列表
Action: SIPpeers
AgentLogoff: Sets an agent as no longer logged in
Agents: Lists agents and their status
DAHDIRestart:
DAHAIShowChannels:
DAHDIDNDoff:
DAHDIDNDon:
DAHDIDialOffhook:
DADHIHangup:
DAHDITransfer:
UnpauseMonitor: Unpause monitoring of a channel
PauseMonitor: Pause monitoring of a channel
ChangeMonitor: Change monitoring filename of a channel
//更改记录某通道信息文件名
Action: ChangeMonitor
Channel: SIP/x7065558529-1c20
File:20050103-140105_cc51
StopMonitor: Stop monitoring a channel
//停止检测某通道
Action: StopMonitor
Channel:Zap/1-1
Monitor: Monitor a channel
//监听某个通道
Action: Monitor
Channel: SIP/x7062618529-643d
File: channelsavefile
Mix: 1
DBDelTree: Delete DB Tree
DBDel: Delete DB entry
DBPut: Put DB entry
//更新数据库信息
Action: DBPut
Family:
Key:
Value: (note,as of Asterisk 1.4 The Manager API wants Val:)
DBGet: Get DB Entry
//查询数据库信息
Action: DBGet
Family:
Key:
Bridge: Bridge two channels already in the PBX
Park: Park a channel
ParkedCalls: List parked calls
//设置显示保持的呼叫列表
Action: ParkedCalls
(ActionID:可选参数)
ShowDialPlan: Show dialplan contexts and extensions
AOCMessage: Generate an Advice of Charge message on a channel
ModuleCheck: Check if module is loaded
ModuleLoad: Module management
CoreShowChannels: List currently active channels
Reload: Send a reload event
CoreStatus: Show PBX core status variables
CoreSettings: Show PBX core settings(version etc)
UserEvent: Send an arbitrary event
UpdateConfig: Update basic configuration
//更新配置文件
Action: UpdateConfig
reload: yes //是否重新加载
srcfilename: manager.conf //要读取的配置文件
dstfilename: manager.conf //要更新的配置文件
action-000000: append //采取的动作
cat-000000: newuser //操作对象
var-000000: secret //采用的变量
value-000000: nottelling //变量的值
(Match-xxxxxx: //其它匹配信息)
SendText: Send text message to channel
ListCommands: List available manager commands
//显示命令列表
Action: ListCommands
MailboxCount: Check Mailbox Message Count
//检查语音信箱是否有新信息
Action: MailboxCount
Mailbox:2001@device
(actionID:可选参数)
MailboxStatus: Check mailbox
//检查语音信箱状态
Action: MailboxStatus
Mailbox: 2001@device
(actionID:可选参数)
AbsoluteTimeout: Set absolute timeout(设置指定秒数)
//要求Asterisk在指定秒数后挂断特定的通道,从而有效地结束通话
Action: AbsoluteTimeout
Chaael: SIP/123-1c20
Timeout:20
ExtensionState: Check Extension Status
//检查分机的状态
Action: ExtensionState
Context: default //检查内容
Exten: 2001 //分机
ActionID: 1
(Status状态代码:
-1=扩展找不到
0=空闲
1=在使用
2=忙
4=不可用
8=振铃
16=正等待
Command: Execute Asterisk CLI Command
//发送Asterisk CLI命令
Action:COMMAND
command:Show Channels
Originate: Originate a call
//产生一个呼叫
//这个参数比较复杂
//只列两个例子
Action: Originate
Channel: SIP/101test //呼叫连接产生的通道
Context: default //呼叫连接所使用的Context
Exten: 8135551212 //呼叫连接使用的分机
Priority: 1 //呼叫连接的优先级
Callerid: 3125551212 //呼叫连接的来电显示
Timeout:30000 //呼叫连接超时,单位为毫秒,默认为30000
Variable: var1=23|var2=24|var3=25 //通道变量设置,本地通道和连接通道都将被设置
ActionID: ABC45678901234567890 //请求标识符
Account: 呼叫所用密码
Application: 使用此次呼叫的应用程序(使用参数和数据)
Data:应用程序参数所使用的数据
Async:呼叫是否为异步(允许多次调用不等待响应生成)
Atxfer: Attended transfer
Redirect: Redirect(transfer) a call
//重定向一个呼叫
Action: Redirect
Channel: Zap/73-1 //重定向的通道
ExtraChannel: SIP/199testphone-1f3c //重定向的第二通道(可选)
Exten:8600029 重定向的分机
Context:default //重定向的上下文
priority: 1 //重定向的优先级
(ActionID: 可选)
ListCategories: List categories in configuration file
CreateConfig: Creates an empty file in the configuration directory
Status: List channel status
//返回所有开放通道或指定通道的状态
Action: Status
(Channel:可选)
(ActionID:可选)
GetConfigJSON: a Retrieve configuration(JSON format)
GetConfig: a Retrieve configuration
Getvar: Gets a channel variable
//获取一个通道变量
Action: GetVar
Channel: SIP/5060-44d225d0
Variable:extension
(ActionID:一个可选的参数匹配信息)
Setvar: Set a channel variable
//设置通道变量
Action: Setvar
Channel: Zap/1-1 //要设置的通道
Variable: AtestVariable //要设置的变量
Value: This is now set //新值
Ping: Keepalive command
//
Action: ping
Hangup: Hangup channel
//挂断指定通道
Action: Hangup
Channel: SIP/x7065558529-99a0
Challenge: Generate Challenge for MD5 Auth
Login: Login Manager
Logoff: Logoff Manager
//注销管理客户端
Action: Logoff
Events: Control Event Flow
//事件控制流,用于启用/禁用发送给管理客户端的事件
Action: Events
EventMask: ON
(EventMask:OFF)
DataGet: Retrieve the data api tree
AGI: Add an AGI command to execute by Async AGI
SetCDRUserField:
//设置用户的呼叫详细记录
//参数:UserField,Channel,Append
//保持、恢复
Action: Park
Channel: SIP/620-000002de
Channel2: SIP/614-000002dd
Timeout: 60000
Action: Originate
Channel: SIP/604
Application: Bridge
Data: SIP/620-000002de,Tx
Callerid: 620
Priority: 1
Action: Command
Command: pbx reload
Action: Command
Command: dialplan reload
//PRI中继
Action: Command
Command: dahdi show status
//模拟中继信息
Action: DAHDIShowChannels
//分区播放中的一种
Action: Originate
Channel: LOCAL/000@broadcastfiles
Application: Page
Data: SIP/623&SIP/604&SIP/628&SIP/607&SIP/619,sr
Callerid: 000
Variable: ID=93 //ID 插入后的数据库记录
Priority: 1
//E1线路使用情况
Event: CoreShowChannel
Channel: DAHDI/1/500-1
UniqueID: 1382585437.16
Context: macro-sip-exten
Extension: 611
Priority: 4
ChannelState: 6
ChannelStateDesc: Up
Application: Dial
ApplicationData: SIP/611,50,tTkKm(default)
CallerIDnum: 500
CallerIDname: ��遍�? 500
ConnectedLineNum: 611
ConnectedLineName:
Duration: 00:00:20
AccountCode:
BridgedChannel: SIP/611-00000007
BridgedUniqueID: 1382585440.17
Event: CoreShowChannel
Channel: SIP/611-00000007
UniqueID: 1382585440.17
Context: 国内长途
Extension:
Priority: 1
ChannelState: 6
ChannelStateDesc: Up
Application: AppDial
ApplicationData: (Outgoing Line)
CallerIDnum: 611
CallerIDname:
ConnectedLineNum: 500
ConnectedLineName: ��遍�? 500
Duration: 00:00:16
AccountCode:
BridgedChannel: DAHDI/1/500-1
BridgedUniqueID: 1382585437.16
E1对接,在162上注册500,139上注册605,500拨打9605,
即可在AMI中用CoreShowChannels查看E1通道状态
//测试,一秒发一次,500个分机
action: sippeers
action: coreshowchannels
本文出自 “日知其所无” 博客,谢绝转载!