Freeswitch fs cli commands: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
Line 3: Line 3:


== Basic ==
== Basic ==
<pre>
$ ./fs_cli -h
Usage: ./fs_cli [-H <host>] [-P <port>] [-p <secret>] [-d <level>] [-x command] [-t <timeout_ms>] [profile]
  -?,-h --help                    Usage Information
  -H, --host=hostname            Host to connect
  -P, --port=port                Port to connect (1 - 65535)
  -u, --user=user@domain          user@domain
  -p, --password=password        Password
  -i, --interrupt                Allow Control-c to interrupt
  -x, --execute=command          Execute Command and Exit
  -l, --loglevel=command          Log Level
  -U, --log-uuid                  Include UUID in log output
  -S, --log-uuid-short            Include shortened UUID in log output
  -q, --quiet                    Disable logging
  -r, --retry                    Retry connection on failure
  -R, --reconnect                Reconnect if disconnected
  -d, --debug=level              Debug Level (0 - 7)
  -b, --batchmode                Batch mode
  -t, --timeout                  Timeout for API commands (in milliseconds)
  -T, --connect-timeout          Timeout for socket connection (in milliseconds)
  -n, --no-color                  Disable color
</pre>
=== Commands(part) ===
<pre>
<pre>
[                ...] [                acl] [              alias] [              banner]
[                ...] [                acl] [              alias] [              banner]

Revision as of 07:59, 14 December 2020

Overview

Freeswitch fs_cli command 내용 정리

Basic

$ ./fs_cli -h

Usage: ./fs_cli [-H <host>] [-P <port>] [-p <secret>] [-d <level>] [-x command] [-t <timeout_ms>] [profile]

  -?,-h --help                    Usage Information
  -H, --host=hostname             Host to connect
  -P, --port=port                 Port to connect (1 - 65535)
  -u, --user=user@domain          user@domain
  -p, --password=password         Password
  -i, --interrupt                 Allow Control-c to interrupt
  -x, --execute=command           Execute Command and Exit
  -l, --loglevel=command          Log Level
  -U, --log-uuid                  Include UUID in log output
  -S, --log-uuid-short            Include shortened UUID in log output
  -q, --quiet                     Disable logging
  -r, --retry                     Retry connection on failure
  -R, --reconnect                 Reconnect if disconnected
  -d, --debug=level               Debug Level (0 - 7)
  -b, --batchmode                 Batch mode
  -t, --timeout                   Timeout for API commands (in milliseconds)
  -T, --connect-timeout           Timeout for socket connection (in milliseconds)
  -n, --no-color                  Disable color

Commands(part)

[                 ...]	[                 acl]	[               alias]	[              banner]	
[           bg_system]	[               bgapi]	[               break]	[                chat]	
[            coalesce]	[            complete]	[                cond]	[             console]	
[    console_complete]	[console_complete_xml]	[         create_uuid]	[            db_cache]	
[       domain_exists]	[                echo]	[              escape]	[                eval]	
[          event_sink]	[              expand]	[         file_exists]	[       find_user_xml]	
[               fsctl]	[             gethost]	[       global_getvar]	[       global_setvar]	
[          group_call]	[                help]	[         host_lookup]	[            hostname]	
[              hupall]	[            in_group]	[        interface_ip]	[         is_lan_addr]	
[                json]	[    limit_hash_usage]	[limit_interval_reset]	[         limit_reset]	
[        limit_status]	[         limit_usage]	[          list_users]	[                load]	
[                 log]	[                 md5]	[       module_exists]	[              msleep]	
[             nat_map]	[           originate]	[                page]	[               pause]	
[            presence]	[               pyrun]	[              python]	[     quote_shell_arg]	
[             reg_url]	[               regex]	[              reload]	[           reloadacl]	
[           reloadxml]	[             replace]	[          say_string]	[           sched_api]	
[     sched_broadcast]	[           sched_del]	[        sched_hangup]	[      sched_transfer]	
[                show]	[            shutdown]	[               sofia]	[       sofia_contact]	
[     sofia_count_reg]	[           sofia_dig]	[  sofia_gateway_data]	[ sofia_presence_data]	
[   sofia_username_of]	[          sql_escape]	[              status]	[            strepoch]	
[            strftime]	[         strftime_tz]	[       strmicroepoch]	[                stun]	
[          switchname]	[              system]	[           time_test]	[          timer_test]	
[         tone_detect]	[              unload]	[         unsched_api]	[          url_decode]	
[          url_encode]	[           user_data]	[         user_exists]	[         uuid_answer]	
[          uuid_audio]	[          uuid_break]	[         uuid_bridge]	[      uuid_broadcast]	
[        uuid_buglist]	[           uuid_chat]	[    uuid_debug_media]	[        uuid_deflect]	
[       uuid_displace]	[        uuid_display]	[  uuid_dual_transfer]	[           uuid_dump]	
[       uuid_early_ok]	[         uuid_exists]	[        uuid_fileman]	[     uuid_flush_dtmf]	
[         uuid_getvar]	[           uuid_hold]	[   uuid_jitterbuffer]	[           uuid_kill]	
[          uuid_limit]	[  uuid_limit_release]	[       uuid_loglevel]	[          uuid_media]	
[    uuid_media_reneg]	[uuid_outgoing_answer]	[           uuid_park]	[          uuid_pause]	
[    uuid_phone_event]	[     uuid_pre_answer]	[     uuid_preprocess]	[         uuid_record]	
[uuid_recovery_refresh]	[      uuid_recv_dtmf]	[     uuid_ring_ready]	[      uuid_send_dtmf]	
[      uuid_send_info]	[   uuid_send_message]	[uuid_session_heartbeat]	[uuid_set_media_stats]	
[         uuid_setvar]	[   uuid_setvar_multi]	[       uuid_simplify]	[       uuid_transfer]	
[  uuid_video_refresh]	[    uuid_zombie_exec]	[             version]	[     xml_flush_cache]	
[          xml_locate]	[            xml_wrap]	[        uuid_warning]	

Localhost 접속시, 다음과 같이 입력하면 된다. <source lang=bash> $ fs_cli -H localhost </source>

acl

Usage: acl <ip> <list_name>

acl,<ip> <list_name>,Compare an ip to an acl list,mod_commands

배너를 보여준다.

banner,,Return the system banner,mod_commands

Example

freeswitch@internal> banner 

.=============================================================.
|   _____              ______        _____ _____ ____ _   _   |
|  |  ___| __ ___  ___/ ___\ \      / /_ _|_   _/ ___| | | |  |
|  | |_ | '__/ _ \/ _ \___ \\ \ /\ / / | |  | || |   | |_| |  |
|  |  _|| | |  __/  __/___) |\ V  V /  | |  | || |___|  _  |  |
|  |_|  |_|  \___|\___|____/  \_/\_/  |___| |_| \____|_| |_|  |
|                                                             |
.=============================================================.
|   Anthony Minessale II, Michael Jerris, Brian West, Others  |
|   FreeSWITCH (http://www.freeswitch.org)                    |
|   Paypal Donations Appreciated: paypal@freeswitch.org       |
|   Brought to you by ClueCon http://www.cluecon.com/         |
.=============================================================.

fsctl

fsctl 은 Freeswitch 에 control 메시지를 전송하는 명령어이다.

freeswitch@internal> fsctl 

[     calibrate_clock]	[               crash]	[         debug_level]	[          debug_pool]	
[           debug_sql]	[default_dtmf_duration]	[    flush_db_handles]	[              hupall]	
[            last_sps]	[            loglevel]	[   max_dtmf_duration]	[        max_sessions]	
[   min_dtmf_duration]	[        min_idle_cpu]	[               pause]	[         pause_check]	
[         ready_check]	[         reclaim_mem]	[             recover]	[              resume]	
[        save_history]	[         send_sighup]	[            shutdown]	[      shutdown_check]	
[                 sps]	[          sync_clock]	[      verbose_events]	

freeswitch@internal> fsctl 
-USAGE: [recover|send_sighup|hupall|pause [inbound|outbound]|resume [inbound|outbound]|shutdown\
 [cancel|elegant|asap|now|restart]|sps|sps_peak_reset|sync_clock|sync_clock_when_idle|reclaim_mem|max_sessions|\
min_dtmf_duration [num]|max_dtmf_duration [num]|default_dtmf_duration [num]|min_idle_cpu|loglevel [level]|debug_level [level]]

shutdown

Freeswitch 를 종료 및 재시작한다. 뒤에 따르는 옵션 값으로 현재 active 상태인 콜들에 대한 처리를 지정할 수 있다.

Usage: fsctl shutdown [cancel|elegant|asap|restart|now]
  • cancel : Discontinue a previous shutdown request. 이미 진행되고 있는 shutdown request 를 취소한다.
  • elegant : Wait for all traffic to stop; do not prevent new traffic. 모든 콜 들이 종료될 때 까지 기다린다. 새로 인입되는 콜을 허용한다.
  • asap : Wait for all traffic to stop; do not allow new traffic. 모든 콜 들이 종료될 때 까지 기다린다. 새로 인인되는 콜을 허용하지 않는다.
  • restart : Restart freeswitch immediately following the shutdown. Freeswitch 종료 후 곧바로 다시 시작한다.
  • now : Shutdown freeswitch immediately. Freeswitch 를 즉시 종료한다.

"elegant", "asap", "now" 옵션의 경우, "restart" 명령과 같이 사용될 수 있다.

Usage: fsctl shutdown [elegant|asap|now] restart

Example

$ fs_cli -x "fsctl shutdown asap restart"

See also

See also

uuid_kill

지정된 session 을 종료(hangup)한다.

freeswitch@internal> uuid_kill 
-USAGE: <uuid> [cause]

Example

freeswitch@internal> uuid_kill 6af16dae-d71a-4e3f-ac67-642bc60a5300 2017-07-31 11:36:41.072989 [DEBUG] switch_ivr_play_say.c:1714 done playing file /usr/share/freeswitch/sounds/en/en/voicemailprompts/ForConfiguration.wav

+OK

2017-07-31 11:36:41.532993 [NOTICE] switch_ivr.c:3705 Hangup sofia/internal/501@127.0.0.1 [CS_EXECUTE] [NORMAL_CLEARING]

See also

version

Version 정보를 보여준다.

Example

freeswitch@debian-10> version

FreeSWITCH Version 1.10.6-dev+git~20201120T142952Z~8045c96458~64bit (git 8045c96 2020-11-20 14:29:52Z 64bit)

See also