api

语法:

api <command> <arg>

作用:发送一个api命令(阻塞模式)

示例:

api originate sofia/mydomain.com/ext@yourvsp.com 1000   # connect sip:ext@yourvsp.com to extension 1000

api sleep 5000

 

bgapi

语法:

bgapi <command> <arg>

作用:向后台提交一个api命令(非阻塞模式)。返回的数据中将多出一个JOB-uuid

 

linger

语法:

linger

作用:告诉FreeSwitch当信道挂断时不要立刻关闭socket连接。这样做的目的是防止因为FreeSwitch的立刻关闭连接而导致一些信道数据丢失无法记录。

 

nolinger

语法:

nolinger

作用:关闭linger

 

event

语法:

event <type> <list of events to log or all for all>

作用:激活或者关闭部分或者所有的事件通知

参数说明:

1.      type的作用为显示格式,取值说明如下

plain

默认状态

xml

以xml格式显示

json

以json的格式显示

2.      第二个参数表示事件类型,ALL表示全部事件。

示例:

event plain ALL

  event plain CHANNEL_CREATE CHANNEL_DESTROY CUSTOM conference::maintenance sofia::register sofia::expire

  event xml ALL

  event json CHANNEL_ANSWER

 

myevents

语法1:

myevents : <uuid>

语法2:

myevents plain <uuid>

  myevents json <uuid>

  myevents xml <uuid>

作用:该语法可以让你的inbound模式下的套接字连接表现的像outbound模式下一样。它会锁定一个特定的uuid事件并忽略其他uuid的事件。当应用结束执行或者失去连接亦或是信道消失、信道关闭,该套接字连接都会被关闭。

一旦锁定了一个uuid,你将看不到任何与该uuid无关的信道信息。即使你发送了跟其他信道相关的命令。

 

divert_events

语法:

divert_events on|off

作用:捕获inputCallback产生的回调函数(默认情况下用户按键产生的inputcallback事件只能被嵌入式脚本的回调函数捕获)

 

filter

语法:

filter <EventHeader> <ValueToFilter>

作用:对输入进行过滤,而不是对输出进行过滤。在一个套接字连接上定义多个过滤器是允许的。

示例:

filter plain all

  filter plain CUSTOM conference::maintenance

  filter Unique-ID $participantB

  filter Unique-ID $participantA

  filter Unique-ID $participantC

filter call-direction Inbound

  filter Event-Calling-File mod_conference.c

  filter Conference-Unique-ID $ConfUUID

filter delete

语法:

filter delete <EventHeader> <ValueToFilter>

作用:删除一个过滤器

 

sendevent

语法:

sendevent <event-name>

作用:向事件系统发送一个事件(多行)

示例:

sendevent SOME_NAME

Event-Name: CUSTOM

Event-Subclass: albs::Section-Alarm

Section: 33

Alarm-Type: PIR

State: ACTIVE

 

sendmsg

语法:

sendmsg <uuid>

作用:向一个给定呼叫的uuid发送消息

示例:
执行操作:

sendmsg <uuid>

call-command: execute

execute-app-name: <one of the applications>

loops: <number of times to invoke the command, default: 1>

content-type: text/plain

content-length: <content length>



<application data>

挂断操作:

sendmsg <uuid>

call-command: hangup

hangup-cause: <one of the causes listed below>

 

exit

语法:

exit

作用:关闭套接字连接

 

auth

语法:

auth <password>

作用:在inbound模式下,auth为第一个要发送的命令,用于认证FreeSwitch服务器。

默认的FreeSwitch服务器的密码为:ClueCon,定义在conf/autoload_configs/event_socket.conf.xml中。

 

log

语法:

log <level>

作用:激活日志输出。level等级参考

 

nolog

语法:

nolog

作用:关闭日志输出

 

nixevent

语法:

nixevent <event types | ALL  | CUSTOM custom event sub-class>

作用:取消关注某些事件

 

noevents

语法:

noevents

作用:关闭所有事件。默认情况下为关闭所有事件。