1、/etc/freeswitch/autoload_configs/switch.conf.xml

 

如下:"[email protected]"不再显示操作系统主机名,同时"Host:"显示名称也不再显示主机名

[email protected]> sofia status profile internal reg
Registrations:
=================================================================================================
Call-ID:        [email protected]
User:           [email protected]
Contact:        "8001" 
Agent:          Fanvil X5 1.3.256.1566
Status:         Registered(UDP)(unknown) EXP(2017-07-17 21:37:03) EXPSECS(2739)
Ping-Status:    Reachable
Ping-Time:      0.00
Host:           Root.Lee.Sofia
IP:             172.16.100.232
Port:           6060
Auth-User:      8001
Auth-Realm:     172.16.100.229
MWI-Account:    [email protected]
Total items returned: 1
=================================================================================================


2、/etc/freeswitch/sip_profiles/external.xml internal.xml

 

如下:发送出去的INVITE消息里面包含的User-Agent: 名称改变

   ------------------------------------------------------------------------
   SIP/2.0 200 OK
   Via: SIP/2.0/UDP 172.16.100.232:6060;branch=z9hG4bK1532632258519713600;rport=6060
   From: 8001 ;tag=815319820
   To: "9910000" ;tag=evapmZN4Z6jjH
   Call-ID: [email protected]
   CSeq: 2 INVITE
   Contact: 
   User-Agent: Root.Lee.Sofia
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
   Content-Type: application/sdp
   Content-Disposition: session
   Content-Length: 176
   Remote-Party-ID: "Outbound Call" ;party=calling;privacy=off;screen=no


3、源码./src/mod/endpoints/mod_sofia/sofia.c

if (!profile->sdp_username) {
profile->sdp_username = switch_core_strdup(profile->pool, "FreeSWITCH");
}  
#修改此处"FreeSWITCH"可修改SIP消息SDP的FreeSWITCH标识,这个文件有几处"FreeSWITCH",均是显示,名称的,可以一并修改
#修改后需要重新编译sofia模块,并将编译出来的"mod_sofia.so"复制到FreeSWITCH相应的库文件位置


如下:SIP消息SDP中”o=******      s=******“不再显示"FreeSWITCH"

   o=Root.Lee.Sofia 1500262855 1500262856 IN IP4 172.16.100.229

   s=Root.Lee.Sofia

 

 ------------------------------------------------------------------------
   SIP/2.0 200 OK
   Via: SIP/2.0/UDP 172.16.100.232:6060;branch=z9hG4bK1532632258519713600;rport=6060
   From: 8001 ;tag=815319820
   To: "9910000" ;tag=evapmZN4Z6jjH
   Call-ID: [email protected]
   CSeq: 2 INVITE
   Contact: 
   User-Agent: Root.Lee.Sofia
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
   Content-Type: application/sdp
   Content-Disposition: session
   Content-Length: 176
   Remote-Party-ID: "Outbound Call" ;party=calling;privacy=off;screen=no
   v=0
   o=Root.Lee.Sofia 1500262855 1500262856 IN IP4 172.16.100.229
   s=Root.Lee.Sofia
   c=IN IP4 172.16.100.229
   t=0 0
   m=audio 32756 RTP/AVP 0
   a=rtpmap:0 PCMU/8000
   a=ptime:20

4、SIP消息头中不带号码而是显示FreeSwitch问题,如下:

INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.100.247:5080;rport;branch=z9hG4bKNvrZg7ZS0393e
Max-Forwards: 69
From: "ligen" ;tag=66Sm8SUjvc4pp
To: 

当送出的INVITE中From字段显示的是“FreeSWITCH@ip:端口”时,需要在网关中添加

<param name="caller-id-in-from" value="true"/>

否则,可能对端显示号码是88888888(华为呼叫中心就是这样子的)。