freeswitch之fs_cli常用指令

  fs_cli是FreeSWITCH的一个客户端连接程序,可以通过其连接freeswitch服务,查看运行情况并对其进行控制。

一、fs_cli登录与退出

1.1 登录

root@pc:/usr/local/freeswitch/bin# ./fs_cli

freeswitch之fs_cli常用指令_第1张图片

1.2 退出

freeswitch@pc> /exit
root@pc:/usr/local/freeswitch/bin#

二、常用指令

2.1 查看信令报文

开启/关闭internal报文追踪:
freeswitch> sofia profile internal siptrace on
开启/关闭external报文追踪:
freeswitch> sofia profile external siptrace on
开启/关闭全部报文追踪:
freeswitch> sofia global siptrace on/off

2.2 查看sofia状态

freeswitch@pc> sofia status

				Name	   Type	                                      Data	State
=================================================================================================
            external-ipv6	profile	  sip:mod_sofia@[2008:93ab:1:9999:a145:2ebb:775c:e93c]:5080	RUNNING (0)
            192.168.1.200	  alias	                                  internal	ALIASED
                 external	profile	         sip:[email protected]:5080	RUNNING (0)
    external::example.com	gateway	                   sip:[email protected]	NOREG
            internal-ipv6	profile	  sip:mod_sofia@[2008:93ab:1:9999:a145:2ebb:775c:e93c]:5060	RUNNING (0)
                 internal	profile	          sip:[email protected]:5060	RUNNING (0)
=================================================================================================

2.3 查看profile状态

freeswitch@pc> sofia status profile internal

Name             	internal
Domain Name      	N/A
Auto-NAT         	false
DBName           	sofia_reg_internal
Pres Hosts       	192.168.1.200,192.168.1.200
Dialplan         	XML
Context          	public
Challenge Realm  	auto_from
RTP-IP           	192.168.1.200
Ext-RTP-IP       	50.155.141.178
SIP-IP           	192.168.1.200
Ext-SIP-IP       	192.168.1.200
URL              	sip:[email protected]:5060
BIND-URL         	sip:[email protected]:5060;maddr=192.168.1.200;transport=udp,tcp
WS-BIND-URL     	sip:[email protected]:5066;transport=ws
WSS-BIND-URL     	sips:[email protected]:7443;transport=wss
HOLD-MUSIC       	local_stream://moh
OUTBOUND-PROXY   	N/A
CODECS IN        	OPUS,G722,PCMU,PCMA,H264,VP8
CODECS OUT       	OPUS,G722,PCMU,PCMA,H264,VP8
TEL-EVENT        	101
DTMF-MODE        	rfc2833
CNG              	13
SESSION-TO       	0
MAX-DIALOG       	0
MAX-RECV-RPS     	1000
NOMEDIA          	false
LATE-NEG         	true
PROXY-MEDIA      	false
AGGRESSIVENAT    	false
CALLS-IN         	26
FAILED-CALLS-IN  	4
CALLS-OUT        	13
FAILED-CALLS-OUT 	4
REGISTRATIONS    	2

freeswitch@pc> sofia status profile external

Name             	external
Domain Name      	N/A
Auto-NAT         	false
DBName           	sofia_reg_external
Pres Hosts       	
Dialplan         	XML
Context          	public
Challenge Realm  	auto_to
RTP-IP           	192.168.1.200
Ext-RTP-IP       	39.155.140.178
SIP-IP           	192.168.1.200
Ext-SIP-IP       	39.155.140.178
URL              	sip:[email protected]:5080
BIND-URL         	sip:[email protected]:5080;maddr=192.168.1.200;transport=udp,tcp
HOLD-MUSIC       	local_stream://moh
OUTBOUND-PROXY   	N/A
CODECS IN        	OPUS,G722,PCMU,PCMA,H264,VP8
CODECS OUT       	OPUS,G722,PCMU,PCMA,H264,VP8
TEL-EVENT        	101
DTMF-MODE        	rfc2833
CNG              	13
SESSION-TO       	0
MAX-DIALOG       	0
MAX-RECV-RPS     	1000
NOMEDIA          	false
LATE-NEG         	true
PROXY-MEDIA      	false
AGGRESSIVENAT    	false
CALLS-IN         	0
FAILED-CALLS-IN  	0
CALLS-OUT        	0
FAILED-CALLS-OUT 	0
REGISTRATIONS    	0

2.4 查看注册状态

freeswitch@pc> sofia status profile internal reg

Registrations:
=================================================================================================
Call-ID:    	2[email protected]
User:       	1006@192.168.1.200
Contact:    	"1006" <sip:[email protected]:5060>
Agent:      	IpPhone
Status:     	Registered(UDP)(unknown) EXP(2024-02-04 11:30:00) EXPSECS(2198)
Ping-Status:	Reachable
Ping-Time:	0.00
Host:       	pc
IP:         	192.168.1.150
Port:       	5060
Auth-User:  	1006
Auth-Realm: 	192.168.1.200
MWI-Account:	1006@192.168.1.200

Call-ID:    	[email protected]
User:       	1005@192.168.1.200
Contact:    	"1005" <sip:[email protected]:5060>
Agent:      	IpPhone
Status:     	Registered(UDP)(unknown) EXP(2024-02-04 11:30:30) EXPSECS(2228)
Ping-Status:	Reachable
Ping-Time:	0.00
Host:       	pc
IP:         	192.168.1.16
Port:       	5060
Auth-User:  	1005
Auth-Realm: 	192.168.1.200
MWI-Account:	1005@192.168.1.200

Total items returned: 2

2.5 查看注册用户信息

freeswitch@pc> sofia status profile internal user [email protected]

Call-ID:    	[email protected]
User:       	1005@192.168.1.200
Contact:    	"1005" <sip:[email protected]:5060>
Agent:      	IpPhone
Status:     	Registered(UDP)(unknown) EXP(2024-02-04 12:00:30) EXPSECS(3356)
Ping-Status:	Reachable
Ping-Time:	0.00
Host:       	pc
IP:         	192.168.1.16
Port:       	5060
Auth-User:  	1005
Auth-Realm: 	192.168.1.200

2.6 打电话

呼叫1005分机

originate sofia/internal/[email protected] &echo

你可能感兴趣的:(freeSwitch,freeswitch,fs_cli,sofia,sofia,status,internal)