提交 1a181f05 authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #202 in FS/freeswitch from…

Merge pull request #202 in FS/freeswitch from ~SJTHOMASON/freeswitch:feature/FS-7309-allow-removal-of-user-agent-header to master

* commit '74e8db73':
  FS-7309: [mod_sofia] Allow removal of User-Agent header
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<profile name="internal-ipv6"> <profile name="internal-ipv6">
<!--aliases are other names that will work as a valid profile name for this profile--> <!--aliases are other names that will work as a valid profile name for this profile-->
<settings> <settings>
<!-- Can be set to "_undef_" to remove the User-Agent header -->
<!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> --> <!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> -->
<param name="debug" value="0"/> <param name="debug" value="0"/>
<param name="sip-trace" value="no"/> <param name="sip-trace" value="no"/>
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
bypass media after an attended transfer. bypass media after an attended transfer.
--> -->
<!--<param name="media-option" value="bypass-media-after-att-xfer"/>--> <!--<param name="media-option" value="bypass-media-after-att-xfer"/>-->
<!-- Can be set to "_undef_" to remove the User-Agent header -->
<!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> --> <!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> -->
<param name="debug" value="0"/> <param name="debug" value="0"/>
<param name="sip-trace" value="no"/> <param name="sip-trace" value="no"/>
......
...@@ -129,6 +129,8 @@ ...@@ -129,6 +129,8 @@
</gateways> </gateways>
<settings> <settings>
<!--<param name="media-option" value="bypass-media-after-att-xfer"/>--> <!--<param name="media-option" value="bypass-media-after-att-xfer"/>-->
<!-- Can be set to "_undef_" to remove the User-Agent header -->
<param name="user-agent-string" value="FreeSWITCH/SoftPhone"/> <param name="user-agent-string" value="FreeSWITCH/SoftPhone"/>
<!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> --> <!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> -->
<param name="debug" value="0"/> <param name="debug" value="0"/>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<!-- http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files --> <!-- http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files -->
<!--aliases are other names that will work as a valid profile name for this profile--> <!--aliases are other names that will work as a valid profile name for this profile-->
<settings> <settings>
<!-- Can be set to "_undef_" to remove the User-Agent header -->
<!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> --> <!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> -->
<param name="debug" value="0"/> <param name="debug" value="0"/>
<param name="sip-trace" value="no"/> <param name="sip-trace" value="no"/>
......
...@@ -42,7 +42,10 @@ ...@@ -42,7 +42,10 @@
bypass media after an attended transfer. bypass media after an attended transfer.
--> -->
<!--<param name="media-option" value="bypass-media-after-att-xfer"/>--> <!--<param name="media-option" value="bypass-media-after-att-xfer"/>-->
<!-- Can be set to "_undef_" to remove the User-Agent header -->
<!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> --> <!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> -->
<param name="debug" value="0"/> <param name="debug" value="0"/>
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. --> <!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<!-- <param name="shutdown-on-fail" value="true"/> --> <!-- <param name="shutdown-on-fail" value="true"/> -->
......
...@@ -80,7 +80,10 @@ ...@@ -80,7 +80,10 @@
<!-- <param name="media-option" value="bypass-media-after-att-xfer"/> --> <!-- <param name="media-option" value="bypass-media-after-att-xfer"/> -->
<!-- bypass again when hold is complete --> <!-- bypass again when hold is complete -->
<!-- <param name="media-option" value="bypass-media-after-hold"/> --> <!-- <param name="media-option" value="bypass-media-after-hold"/> -->
<!-- Can be set to "_undef_" to remove the User-Agent header -->
<!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> --> <!-- <param name="user-agent-string" value="FreeSWITCH Rocks!"/> -->
<param name="debug" value="0"/> <param name="debug" value="0"/>
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, <!-- If you want FreeSWITCH to shutdown if this profile fails to load,
uncomment the next line. --> uncomment the next line. -->
......
...@@ -2872,6 +2872,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void ...@@ -2872,6 +2872,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
nua_set_params(profile->nua, nua_set_params(profile->nua,
SIPTAG_ALLOW_STR("INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO"), SIPTAG_ALLOW_STR("INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO"),
SIPTAG_USER_AGENT(SIP_NONE),
NUTAG_AUTOANSWER(0), NUTAG_AUTOANSWER(0),
NUTAG_AUTOACK(0), NUTAG_AUTOACK(0),
NUTAG_AUTOALERT(0), NUTAG_AUTOALERT(0),
...@@ -2911,7 +2912,9 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void ...@@ -2911,7 +2912,9 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
TAG_IF(profile->pres_type, NUTAG_ALLOW_EVENTS("presence.winfo")), TAG_IF(profile->pres_type, NUTAG_ALLOW_EVENTS("presence.winfo")),
TAG_IF(profile->pres_type, NUTAG_ALLOW_EVENTS("message-summary")), TAG_IF(profile->pres_type, NUTAG_ALLOW_EVENTS("message-summary")),
TAG_IF(profile->pres_type == PRES_TYPE_PNP, NUTAG_ALLOW_EVENTS("ua-profile")), TAG_IF(profile->pres_type == PRES_TYPE_PNP, NUTAG_ALLOW_EVENTS("ua-profile")),
NUTAG_ALLOW_EVENTS("refer"), SIPTAG_SUPPORTED_STR(supported), SIPTAG_USER_AGENT_STR(profile->user_agent), TAG_END()); NUTAG_ALLOW_EVENTS("refer"), SIPTAG_SUPPORTED_STR(supported),
TAG_IF(strcasecmp(profile->user_agent, "_undef_"), SIPTAG_USER_AGENT_STR(profile->user_agent)),
TAG_END());
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set params for %s\n", profile->name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set params for %s\n", profile->name);
...@@ -2943,6 +2946,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void ...@@ -2943,6 +2946,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
NTATAG_SERVER_RPORT(profile->server_rport_level), NUTAG_URL(node->url), TAG_END()); /* Last tag should always finish the sequence */ NTATAG_SERVER_RPORT(profile->server_rport_level), NUTAG_URL(node->url), TAG_END()); /* Last tag should always finish the sequence */
nua_set_params(node->nua, nua_set_params(node->nua,
SIPTAG_USER_AGENT(SIP_NONE),
NUTAG_APPL_METHOD("OPTIONS"), NUTAG_APPL_METHOD("OPTIONS"),
NUTAG_APPL_METHOD("REFER"), NUTAG_APPL_METHOD("REFER"),
NUTAG_APPL_METHOD("SUBSCRIBE"), NUTAG_APPL_METHOD("SUBSCRIBE"),
...@@ -2954,7 +2958,9 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void ...@@ -2954,7 +2958,9 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
NUTAG_ALLOW("INFO"), NUTAG_ALLOW("INFO"),
TAG_IF(profile->pres_type, NUTAG_ALLOW("PUBLISH")), TAG_IF(profile->pres_type, NUTAG_ALLOW("PUBLISH")),
TAG_IF(profile->pres_type, NUTAG_ENABLEMESSAGE(1)), TAG_IF(profile->pres_type, NUTAG_ENABLEMESSAGE(1)),
SIPTAG_SUPPORTED_STR(supported), SIPTAG_USER_AGENT_STR(profile->user_agent), TAG_END()); SIPTAG_SUPPORTED_STR(supported),
TAG_IF(strcasecmp(profile->user_agent, "_undef_"), SIPTAG_USER_AGENT_STR(profile->user_agent)),
TAG_END());
} }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activated db for %s\n", profile->name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activated db for %s\n", profile->name);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论