Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
3e1ae21d
提交
3e1ae21d
authored
9月 03, 2010
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove stuff that should be only on smg repo
上级
a70192f2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
1 行增加
和
104 行删除
+1
-104
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+0
-89
switch_core.c
src/switch_core.c
+1
-15
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
3e1ae21d
...
@@ -3300,7 +3300,6 @@ SWITCH_STANDARD_API(sofia_contact_function)
...
@@ -3300,7 +3300,6 @@ SWITCH_STANDARD_API(sofia_contact_function)
char
*
p
;
char
*
p
;
sofia_profile_t
*
profile
=
NULL
;
sofia_profile_t
*
profile
=
NULL
;
const
char
*
exclude_contact
=
NULL
;
const
char
*
exclude_contact
=
NULL
;
const
char
*
user_replacement
=
NULL
;
char
*
reply
=
"error/facility_not_subscribed"
;
char
*
reply
=
"error/facility_not_subscribed"
;
if
(
!
cmd
)
{
if
(
!
cmd
)
{
...
@@ -3311,7 +3310,6 @@ SWITCH_STANDARD_API(sofia_contact_function)
...
@@ -3311,7 +3310,6 @@ SWITCH_STANDARD_API(sofia_contact_function)
if
(
session
)
{
if
(
session
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
session
);
exclude_contact
=
switch_channel_get_variable
(
channel
,
"sip_exclude_contact"
);
exclude_contact
=
switch_channel_get_variable
(
channel
,
"sip_exclude_contact"
);
user_replacement
=
switch_channel_get_variable
(
channel
,
"sip_contact_user_replacement"
);
}
}
...
@@ -3390,93 +3388,6 @@ SWITCH_STANDARD_API(sofia_contact_function)
...
@@ -3390,93 +3388,6 @@ SWITCH_STANDARD_API(sofia_contact_function)
reply
=
"error/user_not_registered"
;
reply
=
"error/user_not_registered"
;
}
}
if
(
user_replacement
)
{
int
urlcount
=
0
;
int
copyerr
=
0
;
char
*
newreply
=
NULL
;
char
*
urlstart
=
NULL
;
char
*
newptr
=
NULL
;
char
*
bufend
=
NULL
;
char
*
str
=
reply
;
switch_size_t
copysize
=
0
;
switch_size_t
replacesize
=
strlen
(
user_replacement
);
switch_size_t
allocsize
=
0
;
/* first pass to count how many URLs we have */
while
((
urlstart
=
strcasestr
(
str
,
"sip:"
))
||
(
urlstart
=
strcasestr
(
str
,
"sips:"
)))
{
urlcount
++
;
str
=
urlstart
+
4
;
}
if
(
!
urlcount
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"sofia_contact(): no sip URLs found to replace the user
\n
"
);
copyerr
++
;
goto
copydone
;
}
/* this allocates a bit more than needed but better safe than sorry doing more funky math */
allocsize
=
strlen
(
reply
)
+
(
urlcount
*
replacesize
);
newreply
=
switch_core_session_alloc
(
session
,
allocsize
);
if
(
!
newreply
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"sofia_contact(): no buffer space available for replacement
\n
"
);
copyerr
++
;
goto
copydone
;
}
/* get a working pointer to the new reply */
newptr
=
newreply
;
/* pointer to the end of the allocated buffer for safety checks */
bufend
=
newreply
+
allocsize
-
1
;
*
bufend
=
0
;
/* go thru all the urls and replace the user part */
str
=
reply
;
while
((
urlstart
=
strcasestr
(
str
,
"sip:"
))
||
(
urlstart
=
strcasestr
(
str
,
"sips:"
)))
{
/* found an URL, copy up to the start of the url */
copysize
=
(
urlstart
-
str
)
+
4
;
/* double check boundaries before copying anything at all (this should not happen) */
if
((
newptr
+
copysize
+
replacesize
)
>=
bufend
)
{
copyerr
++
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"sofia_contact(): wow buffer was not big enough!
\n
"
);
break
;
}
/* copy the original contact string except for the user */
memcpy
(
newptr
,
str
,
copysize
);
newptr
+=
copysize
;
/* copy the user replacement */
memcpy
(
newptr
,
user_replacement
,
replacesize
);
newptr
+=
replacesize
;
/* skip the original user part */
str
=
strchr
(
urlstart
,
'@'
);
if
(
!
str
)
{
copyerr
++
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"sofia_contact(): not host part found for contact
\n
"
);
break
;
}
/* continue searching for the next sip: URL */
}
copydone
:
if
(
!
copyerr
)
{
/* copy the remaining reply string */
copysize
=
strlen
(
str
);
if
((
newptr
+
copysize
)
>=
bufend
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"sofia_contact(): wow buffer was not big enough, close, but not enough!
\n
"
);
}
else
{
strcpy
(
newptr
,
str
);
reply
=
newreply
;
}
}
else
{
reply
=
"error/replacement error"
;
}
}
stream
->
write_function
(
stream
,
"%s"
,
reply
);
stream
->
write_function
(
stream
,
"%s"
,
reply
);
reply
=
NULL
;
reply
=
NULL
;
...
...
src/switch_core.c
浏览文件 @
3e1ae21d
...
@@ -1539,7 +1539,7 @@ static void switch_load_core_config(const char *file)
...
@@ -1539,7 +1539,7 @@ static void switch_load_core_config(const char *file)
SWITCH_DECLARE
(
const
char
*
)
switch_core_banner
(
void
)
SWITCH_DECLARE
(
const
char
*
)
switch_core_banner
(
void
)
{
{
#if 0
return
(
"
\n
"
return
(
"
\n
"
" _____ ______ _____ _____ ____ _ _
\n
"
" _____ ______ _____ _____ ____ _ _
\n
"
" | ___| __ ___ ___/ ___
\\
\\
/ /_ _|_ _/ ___| | | |
\n
"
" | ___| __ ___ ___/ ___
\\
\\
/ /_ _|_ _/ ___| | | |
\n
"
...
@@ -1552,20 +1552,6 @@ SWITCH_DECLARE(const char *) switch_core_banner(void)
...
@@ -1552,20 +1552,6 @@ SWITCH_DECLARE(const char *) switch_core_banner(void)
"* FreeSWITCH (http://www.freeswitch.org) *
\n
"
"* FreeSWITCH (http://www.freeswitch.org) *
\n
"
"* Paypal Donations Appreciated: paypal@freeswitch.org *
\n
"
"* Paypal Donations Appreciated: paypal@freeswitch.org *
\n
"
"* Brought to you by ClueCon http://www.cluecon.com/ *
\n
"
"************************************************************
\n
"
"
\n
"
);
"* Brought to you by ClueCon http://www.cluecon.com/ *
\n
"
"************************************************************
\n
"
"
\n
"
);
#else
return
(
"
\n
_____ ___ ___ _ _ _____ _
\n
"
"/ ___| |
\\
/ | | (_) | __
\\
| |
\n
"
"
\\
`--. __ _ _ __ __ _ ___ _ __ ___ __ _ | . . | ___ __| |_ __ _ | |
\\
/ __ _| |_ _____ ____ _ _ _
\n
"
" `--.
\\
/ _` | '_
\\
/ _` |/ _
\\
| '_ ` _
\\
/ _` | | |
\\
/| |/ _
\\
/ _` | |/ _` | | | __ / _` | __|/ _
\\
\\
/
\\
/ / _` | | | |
\n
"
"/
\\
__/ / (_| | | | | (_| | (_) | | | | | | (_| | | | | | __/ (_| | | (_| | | |_
\\
\\
(_| | |_| __/
\\
V V / (_| | |_| |
\n
"
"
\\
____/
\\
__,_|_| |_|
\\
__, |
\\
___/|_| |_| |_|
\\
__,_|
\\
_| |_/
\\
___|
\\
__,_|_|
\\
__,_|
\\
____/
\\
__,_|
\\
__|
\\
___|
\\
_/
\\
_/
\\
__,_|
\\
__, |
\n
"
" __/ | __/ |
\n
"
" |___/ |___/
\n
"
"************************************************************
\n
"
"* Powered by: FreeSWITCH (http://www.freeswitch.org) *
\n
"
"************************************************************
\n
"
"
\n
"
);
#endif
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论