Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
23f3ad6b
提交
23f3ad6b
authored
1月 14, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@378
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
784ea716
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
348 行增加
和
0 行删除
+348
-0
Makefile
src/mod/dialplans/mod_pcre/Makefile
+17
-0
mod_pcre.c
src/mod/dialplans/mod_pcre/mod_pcre.c
+124
-0
mod_pcre.vcproj
src/mod/dialplans/mod_pcre/mod_pcre.vcproj
+207
-0
没有找到文件。
src/mod/dialplans/mod_pcre/Makefile
0 → 100644
浏览文件 @
23f3ad6b
LDFLAGS
+=
-lpcre
-L
/usr/local/lib
all
:
depends $(MODNAME).so
depends
:
$(BASE)
/buildlib.sh
$(BASE)
install
pcre-6.4.tar.gz
--prefix
=
$(PREFIX)
$(MODNAME).so
:
$(MODNAME).c
$(CC)
$(CFLAGS)
-fPIC
-c
$(MODNAME)
.c
-o
$(MODNAME)
.o
$(CC)
$(SOLINK)
-o
$(MODNAME)
.so
$(MODNAME)
.o
$(LDFLAGS)
clean
:
rm
-fr
*
.so
*
.o
*
~
install
:
cp
-f
$(MODNAME)
.so
$(PREFIX)
/mod
src/mod/dialplans/mod_pcre/mod_pcre.c
0 → 100644
浏览文件 @
23f3ad6b
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthmct@yahoo.com>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Anthony Minessale II <anthmct@yahoo.com>
*
*
* mod_pcre.c -- Regex Dialplan Module
*
*/
#include <switch.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
static
const
char
modname
[]
=
"mod_pcre"
;
switch_caller_extension
*
dialplan_hunt
(
switch_core_session
*
session
)
{
switch_caller_profile
*
caller_profile
;
switch_caller_extension
*
extension
=
NULL
;
switch_channel
*
channel
;
char
*
cf
=
"extensions.conf"
;
switch_config
cfg
;
char
*
var
,
*
val
;
char
app
[
1024
];
channel
=
switch_core_session_get_channel
(
session
);
caller_profile
=
switch_channel_get_caller_profile
(
channel
);
//switch_channel_set_variable(channel, "pleasework", "yay");
switch_console_printf
(
SWITCH_CHANNEL_CONSOLE
,
"Hello %s You Dialed %s!
\n
"
,
caller_profile
->
caller_id_name
,
caller_profile
->
destination_number
);
if
(
!
switch_config_open_file
(
&
cfg
,
cf
))
{
switch_console_printf
(
SWITCH_CHANNEL_CONSOLE
,
"open of %s failed
\n
"
,
cf
);
switch_channel_hangup
(
channel
);
return
NULL
;
}
while
(
switch_config_next_pair
(
&
cfg
,
&
var
,
&
val
))
{
if
(
!
strcasecmp
(
cfg
.
category
,
"extensions"
))
{
if
(
!
strcmp
(
var
,
caller_profile
->
destination_number
)
&&
val
)
{
char
*
data
;
memset
(
app
,
0
,
sizeof
(
app
));
strncpy
(
app
,
val
,
sizeof
(
app
));
if
((
data
=
strchr
(
app
,
' '
)))
{
*
data
=
'\0'
;
data
++
;
}
else
{
switch_console_printf
(
SWITCH_CHANNEL_CONSOLE
,
"invalid extension on line %d
\n
"
,
cfg
.
lineno
);
continue
;
}
if
(
!
extension
)
{
if
(
!
(
extension
=
switch_caller_extension_new
(
session
,
caller_profile
->
destination_number
,
caller_profile
->
destination_number
)))
{
switch_console_printf
(
SWITCH_CHANNEL_CONSOLE
,
"memory error!
\n
"
);
break
;
}
}
switch_caller_extension_add_application
(
session
,
extension
,
app
,
data
);
}
}
}
switch_config_close_file
(
&
cfg
);
if
(
extension
)
{
switch_channel_set_state
(
channel
,
CS_EXECUTE
);
}
else
{
switch_channel_hangup
(
channel
);
}
return
extension
;
}
static
const
switch_dialplan_interface
dialplan_interface
=
{
/*.interface_name =*/
"demo"
,
/*.hunt_function = */
dialplan_hunt
/*.next = NULL */
};
static
const
switch_loadable_module_interface
dialplan_module_interface
=
{
/*.module_name = */
modname
,
/*.endpoint_interface = */
NULL
,
/*.timer_interface = */
NULL
,
/*.dialplan_interface = */
&
dialplan_interface
,
/*.codec_interface = */
NULL
,
/*.application_interface =*/
NULL
};
SWITCH_MOD_DECLARE
(
switch_status
)
switch_module_load
(
const
switch_loadable_module_interface
**
interface
,
char
*
filename
)
{
/* connect my internal structure to the blank pointer passed to me */
*
interface
=
&
dialplan_module_interface
;
/* indicate that the module should continue to be loaded */
return
SWITCH_STATUS_SUCCESS
;
}
src/mod/dialplans/mod_pcre/mod_pcre.vcproj
0 → 100644
浏览文件 @
23f3ad6b
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"8.00"
Name=
"mod_pcre"
ProjectGUID=
"{2988EB83-785F-45D4-8731-8E1E4345177E}"
RootNamespace=
"mod_pcre"
Keyword=
"Win32Proj"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"Debug"
IntermediateDirectory=
"Debug"
ConfigurationType=
"2"
InheritedPropertySheets=
"$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet=
"2"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
AdditionalIncludeDirectories=
""$(InputDir)..\..\..\include";"$(InputDir)include";"$(InputDir)..\..\..\..\libs\include""
PreprocessorDefinitions=
"WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
MinimalRebuild=
"true"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"1"
UsePrecompiledHeader=
"0"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"true"
DebugInformationFormat=
"4"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"..\..\..\..\w32\vsnet\$(OutDir)/mod/mod_pcre.dll"
LinkIncremental=
"2"
AdditionalLibraryDirectories=
"$(InputDir)..\..\..\libs\apr\Debug"
GenerateDebugInformation=
"true"
ProgramDatabaseFile=
"$(OutDir)/mod_pcre.pdb"
SubSystem=
"2"
ImportLibrary=
"$(OutDir)/mod_pcre.lib"
TargetMachine=
"1"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"Release"
IntermediateDirectory=
"Release"
ConfigurationType=
"2"
InheritedPropertySheets=
"$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet=
"2"
>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""$(InputDir)..\..\..\include";"$(InputDir)include";"$(InputDir)..\..\..\..\libs\include""
PreprocessorDefinitions=
"WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS"
RuntimeLibrary=
"0"
UsePrecompiledHeader=
"0"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"true"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCManagedResourceCompilerTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"..\..\..\..\w32\vsnet\$(OutDir)/mod/mod_pcre.dll"
LinkIncremental=
"1"
AdditionalLibraryDirectories=
""$(InputDir)..\..\..\libs\apr\Release""
GenerateDebugInformation=
"true"
SubSystem=
"2"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
ImportLibrary=
"$(OutDir)/mod_pcre.lib"
TargetMachine=
"1"
/>
<Tool
Name=
"VCALinkTool"
/>
<Tool
Name=
"VCManifestTool"
/>
<Tool
Name=
"VCXDCMakeTool"
/>
<Tool
Name=
"VCBscMakeTool"
/>
<Tool
Name=
"VCFxCopTool"
/>
<Tool
Name=
"VCAppVerifierTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
".\mod_pcre.c"
>
</File>
</Filter>
<Filter
Name=
"Header Files"
Filter=
"h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier=
"{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name=
"Resource Files"
Filter=
"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier=
"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论