开启关闭操作

    1. # 生成环境后台运行 推荐
    2. freeswitch -rp -nc -nonat
    3. #直接启动 不输入nonat会有警告
    4. freeswitch -nonat
    5. # 可以查看到详细的日志信息
    6. freeswitch -c -nonat -rp
    7. # 默认后台运行
    8. freeswitch -nc
    9. #进入fs控制台
    10. fs_cli
    11. #两种方式退出fs控制台
    12. /exit
    13. ctrl+d
    14. #关闭
    15. shutdown
    16. #重载配置文件
    17. reloadxml
    18. #看端口是否被占用
    19. netstat -an | grep 5060

    内部操作

    1. #显示多少用户已注册
    2. sofia status profile internal reg
    3. #相当于在软电话1000 上拨打9999
    4. originate user/1000 9999
    5. #echo echo程序是一个很简单的程序(App),它只是将你说话的内容原样再放给你听,在测试时很有用,在本书中我们会经常用它来0测试
    6. originate user/1000 &echo
    7. #freeswitch作为一个B2BUA桥接两个UA通话
    8. originate user/1000 &bridge(user/1234)
    9. #方法二
    10. originate user/1000 &park
    11. originate user/1234 &park
    12. show channels
    13. uuid_bridge <1000_uuid> <1234_uuid>
    14. #订阅事件
    15. /event plain ALL
    16. #自动呼入
    17. originate sofia/external/8888#192.168.2.161:5080 &echo
    18. #获取SIP消息
    19. sofia global siptrace on
    20. #关闭trace
    21. sofia global siptrace off
    22. #列出某个Profile状态
    23. sofia profile internal
    24. #列出某个Profile上所有已注册用户
    25. sofia status profile internal reg
    26. #过滤某些符合条件的用户
    27. sofia status profile internal reg 1000
    28. #列出某个特定用户
    29. sofia status profile internal user 1000
    30. #列出网关状态
    31. sofia status gateway gw1
    32. #status可以用xmlstatus替代
    33. #启动,停止,重启Profile命令
    34. sofia profile internal start/stop/restart
    35. #重读sofia配置
    36. sofia profile internal rescan
    37. #修改网关
    38. sofia profile external killgw gw1
    39. 先删除
    40. sofia profile external rescan
    41. 重读参数
    42. #z注册或注销
    43. sofia profile external register/unregister gw1
    44. #开启Profile抓包
    45. sofia profile internal siptrace on
    46. #打开关闭全局SIP消息跟踪
    47. sofia global siptrace on/off
    48. #打开关闭SIP捕获
    49. sofia global capture on/off
    50. #找到当前通话的channel的uuid
    51. show channel
    52. #通过呼叫回声,gw1是Bob使用网关名称
    53. originate sofia/gateway/gw1/Bob &echo

    在fs_cli中可以单独订阅某类事件,如:

    1. #channel 频道 sofia::registerSIP注册)、sofia::unregisterSIP注销)
    2. fs_cli> /event plain CHANNEL_ANSWER
    3. fs_cli> /event plain CUSTOM sofia::register