吴伟贤のBlog

Feed Rss

Sofia ,FreeSWITCH的SIP 协议实现的模块

11.28.2012, freeswitch, by .

来自:http://hi.baidu.com/cococup/item/b7aa4917f38052a5ffded52d

 

Sofia 是FreeSWITCH使用的一个SIP 协议栈 。

在mod模块目录下是mod_sofia.dll。提供了UA客户端到freeswitch的连接功能。

这个模块应该是来源于诺基亚研究中心的一个开源项目 : http://opensource.nokia.com/projects/sofia-sip/

 

当FreeSWITCH 启动的时候,它读取 conf/autoload_configs/sofia.conf.xml 文件。 该文件包含的 “X-PRE-PROCESS” 指示FreeSWITCH 去读取conf/sip_profiles/*.xml 文件。 每个*.xml 文件包含一个或多个 SIP客户端的详细描述。 

 

在 FreeSWITCH 的术语里面, UA = User Agent = Sofia Profile = SIP Profile。

 

以下描述了 FreeSWITCH 的SIP/Sofia 配置与使用方法。

Sofia 配置文件是sofia.conf.xml,该文件的详细描述在:Sofia Configuration Files.

 

  • 查看可用的网关(一般在conf/sip_profiles/external/*.xml里面设置)

        freeswitch> sofia profile <profile_name> flush_inbound_reg [<call_id>|<user@host>] [reboot]

 

  • 查看当前注册的SIP终端

    freeswitch> sofia status profile <profile name>
    freeswitch> sofia status profile default
    freeswitch> sofia status profile outbound

  • 用flush_inbound_reg指令更新或重启一个端点的配置:

        freeswitch> sofia profile <profile_name> flush_inbound_reg [<call_id>|<user@host>] [reboot]
如果没有<call_id> 或 user@host参数,将会更新所有端点

 

  • 用[<rescan>|<restart>指令重新载入配置文件:

        freeswitch> sofia profile <profile_name> [<rescan>|<restart>] reloadxml

 

  • 删除网关

        freeswitch> sofia profile <profile_name> killgw <gateway_name>

 

  • 重启网关

        freeswitch> sofia profile <profile_name> killgw <gateway_name>
        freeswitch> sofia profile <profile_name> rescan

 

  • 添加或修改一个已存在的网关(不影响当前通话)
    freeswitch> sofia profile external rescan reloadxml

 

  • 查看调试信息:

        freeswitch> sofia loglevel <all|default|tport|iptsec|nea|nta|nth_client|nth_server|nua|soa|sresolv|stun> [0-9]

        “all” 将会改变所有的组件的调试记录信息

        以下是关闭所有调试输出

        freeswitch> sofia loglevel all 0

评论已关闭。