Merge remote-tracking branch 'fsorig/master'

This commit is contained in:
Moises Silva committed 2012-01-31 15:57:07 -05:00
commit 1ad0bc250c
488 files changed
+108347 -4416

No files matched your search

@@ -42,7 +42,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv&quot;"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt&quot;"
PreprocessorDefinitions="LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4201"
@@ -109,7 +109,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv&quot;"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt&quot;"
PreprocessorDefinitions="LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4201"
@@ -177,7 +177,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv&quot;"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt&quot;"
PreprocessorDefinitions="LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4201"
@@ -244,7 +244,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv&quot;"
AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\win32&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv&quot;;&quot;$(InputDir)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt&quot;"
PreprocessorDefinitions="LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC"
UsePrecompiledHeader="0"
DisableSpecificWarnings="4201"
@@ -66,7 +66,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -85,7 +85,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -102,7 +102,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -121,7 +121,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>
</PrecompiledHeader>
+59 -35
View File
@@ -454,7 +454,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
}
if (!((use_my_cause = switch_channel_get_variable(channel, "sip_ignore_remote_cause")) && switch_true(use_my_cause))) {
ps_cause = switch_channel_get_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE);
ps_cause = switch_channel_get_variable(channel, "last_bridge_" SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE);
}
if (!zstr(ps_cause) && (!strncasecmp(ps_cause, "sip:", 4) || !strncasecmp(ps_cause, "sips:", 5))) {
@@ -494,7 +494,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
val = switch_channel_get_variable(tech_pvt->channel, "disable_q850_reason");
if (switch_false(val)) {
if (!val || switch_false(val)) {
if (switch_channel_test_flag(channel, CF_INTERCEPT) || cause == SWITCH_CAUSE_PICKED_OFF || cause == SWITCH_CAUSE_LOSE_RACE) {
switch_snprintf(reason, sizeof(reason), "SIP;cause=200;text=\"Call completed elsewhere\"");
} else if (cause > 0 && cause < 128) {
@@ -811,7 +811,8 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SIPTAG_CALL_INFO_STR(switch_channel_get_variable(tech_pvt->channel, SOFIA_SIP_HEADER_PREFIX "call_info")),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1),
SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"),
TAG_IF(sofia_test_pflag(tech_pvt->profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)),
TAG_IF(is_proxy, SOATAG_RTP_SELECT(1)),
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
TAG_IF(switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote),
@@ -1984,7 +1985,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,
"Operation not permitted on an inbound non-answered call leg!\n");
} else {
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR(event), TAG_END());
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_SUBSCRIPTION_STATE_STR("active"),
SIPTAG_EVENT_STR(event), TAG_END());
}
}
@@ -2100,10 +2102,12 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if (zstr(number)) {
number = tech_pvt->caller_profile->destination_number;
}
if (sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR,
"Cannot send display update to %s Did not receive reply to last update\n", switch_channel_get_name(tech_pvt->channel));
if (sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY) || !switch_channel_test_flag(channel, CF_ANSWERED)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_WARNING,
"Cannot send display update to %s "
"Did not receive reply to last update or channel has not been answered yet.\n",
switch_channel_get_name(tech_pvt->channel));
} else {
if (zstr(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) ||
zstr(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) {
@@ -2151,6 +2155,15 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} else if ((ua && (switch_stristr("cisco/spa50", ua) || switch_stristr("cisco/spa525", ua)))) {
snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <sip:%s@%s>", name, number, tech_pvt->profile->sipip);
sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
nua_update(tech_pvt->nh,
NUTAG_SESSION_TIMER(tech_pvt->session_timeout),
NUTAG_SESSION_REFRESHER(tech_pvt->session_refresher),
TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_END());
} else if ((ua && (switch_stristr("Yealink", ua)))) {
snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <sip:%s@%s>", name, number, tech_pvt->profile->sipip);
sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
nua_update(tech_pvt->nh,
NUTAG_SESSION_TIMER(tech_pvt->session_timeout),
@@ -2230,10 +2243,11 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if (!zstr(msg->string_arg)) {
if (!switch_channel_test_flag(channel, CF_ANSWERED) && !sofia_test_flag(tech_pvt, TFLAG_BYE)) {
char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_RESPONSE_HEADER_PREFIX);
char *added_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_HEADER_PREFIX);
char *dest = (char *) msg->string_arg;
char *argv[128] = { 0 };
char *mydata = NULL, *newdest = NULL;
int argc = 0, i;
int argc = 0, ok = 0, i;
switch_size_t len = 0;
if (strchr(dest, ',')) {
@@ -2268,13 +2282,17 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Redirecting to %s\n", dest);
ok = sofia_test_pflag(tech_pvt->profile, PFLAG_MANUAL_REDIRECT);
if (argc > 1) {
nua_respond(tech_pvt->nh, SIP_300_MULTIPLE_CHOICES, SIPTAG_CONTACT_STR(dest),
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
TAG_IF((!zstr(added_headers) && !ok), SIPTAG_HEADER_STR(added_headers)), TAG_END());
} else {
nua_respond(tech_pvt->nh, SIP_302_MOVED_TEMPORARILY, SIPTAG_CONTACT_STR(dest),
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
TAG_IF((!zstr(added_headers) && !ok), SIPTAG_HEADER_STR(added_headers)), TAG_END());
}
@@ -2460,14 +2478,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
{
switch_ring_ready_t ring_ready_val = msg->numeric_arg;
if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
switch_channel_mark_ring_ready(channel);
status = SWITCH_STATUS_SUCCESS;
switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO,
"Pretending to send ringing. Not available for 3pcc calls\n");
goto end_lock;
}
if (!switch_channel_test_flag(channel, CF_RING_READY) && !sofia_test_flag(tech_pvt, TFLAG_BYE) &&
!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED)) {
char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
@@ -2516,14 +2526,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
const char *val = NULL;
const char *call_info = switch_channel_get_variable(channel, "presence_call_info_full");
if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
sofia_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
switch_channel_mark_pre_answered(channel);
status = SWITCH_STATUS_SUCCESS;
switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO,
"Pretending to send early media. Not available for 3pcc calls\n");
goto end_lock;
}
if (!sofia_test_flag(tech_pvt, TFLAG_ANS) && !sofia_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
@@ -2935,8 +2937,10 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
if (profile->extsipip) {
stream->write_function(stream, "Ext-SIP-IP \t%s\n", profile->extsipip);
}
stream->write_function(stream, "URL \t%s\n", switch_str_nil(profile->url));
stream->write_function(stream, "BIND-URL \t%s\n", switch_str_nil(profile->bindurl));
if (! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only) {
stream->write_function(stream, "URL \t%s\n", switch_str_nil(profile->url));
stream->write_function(stream, "BIND-URL \t%s\n", switch_str_nil(profile->bindurl));
}
if (sofia_test_pflag(profile, PFLAG_TLS)) {
stream->write_function(stream, "TLS-URL \t%s\n", switch_str_nil(profile->tls_url));
stream->write_function(stream, "TLS-BIND-URL \t%s\n", switch_str_nil(profile->tls_bindurl));
@@ -3061,8 +3065,10 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
ac++;
stream->write_function(stream, "%25s\t%s\t %40s\t%s\n", vvar, " alias", profile->name, "ALIASED");
} else {
stream->write_function(stream, "%25s\t%s\t %40s\t%s (%u)\n", profile->name, "profile", profile->url,
if (! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only) {
stream->write_function(stream, "%25s\t%s\t %40s\t%s (%u)\n", profile->name, "profile", profile->url,
sofia_test_pflag(profile, PFLAG_RUNNING) ? "RUNNING" : "DOWN", profile->inuse);
}
if (sofia_test_pflag(profile, PFLAG_TLS)) {
stream->write_function(stream, "%25s\t%s\t %40s\t%s (%u) (TLS)\n", profile->name, "profile", profile->tls_url,
@@ -3336,9 +3342,11 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
stream->write_function(stream, "<alias>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s</state>\n</alias>\n", vvar, "alias",
profile->name, "ALIASED");
} else {
stream->write_function(stream, "<profile>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s (%u)</state>\n</profile>\n",
if (! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only){
stream->write_function(stream, "<profile>\n<name>%s</name>\n<type>%s</type>\n<data>%s</data>\n<state>%s (%u)</state>\n</profile>\n",
profile->name, "profile", profile->url, sofia_test_pflag(profile, PFLAG_RUNNING) ? "RUNNING" : "DOWN",
profile->inuse);
}
if (sofia_test_pflag(profile, PFLAG_TLS)) {
stream->write_function(stream,
@@ -3509,6 +3517,22 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
goto done;
}
if (!strcasecmp(argv[1], "recover")) {
if (argv[2] && !strcasecmp(argv[2], "flush")) {
sofia_glue_profile_recover(profile, SWITCH_TRUE);
stream->write_function(stream, "Flushing recovery database.\n");
} else {
int x = sofia_glue_profile_recover(profile, SWITCH_FALSE);
if (x) {
stream->write_function(stream, "Recovered %d call(s)\n", x);
} else {
stream->write_function(stream, "No calls to recover.\n");
}
}
goto done;
}
if (!strcasecmp(argv[1], "register")) {
char *gname = argv[2];
@@ -4156,7 +4180,7 @@ SWITCH_STANDARD_API(sofia_function)
}
if (strstr(argv[2], "sla")) {
mod_sofia_globals.debug_sla = 1;
mod_sofia_globals.debug_sla = 10;
stream->write_function(stream, "+OK Debugging sla\n");
}
@@ -4808,7 +4832,7 @@ static int notify_callback(void *pArg, int argc, char **argv, char **columnNames
nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
nua_notify(nh, NUTAG_NEWSUB(1),
nua_notify(nh, NUTAG_NEWSUB(1), SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
TAG_IF(dst->route_uri, NUTAG_PROXY(route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)),
SIPTAG_EVENT_STR(es), SIPTAG_CONTENT_TYPE_STR(ct), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END());
@@ -4897,7 +4921,7 @@ static void general_event_handler(switch_event_t *event)
nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
nua_notify(nh,
NUTAG_NEWSUB(1),
NUTAG_NEWSUB(1), SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
TAG_IF(dst->route_uri, NUTAG_PROXY(dst->route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)),
SIPTAG_EVENT_STR(es), TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END());
@@ -4918,7 +4942,7 @@ static void general_event_handler(switch_event_t *event)
if ((session = switch_core_session_locate(uuid))) {
if ((tech_pvt = switch_core_session_get_private(session))) {
nua_notify(tech_pvt->nh,
NUTAG_NEWSUB(1),
NUTAG_NEWSUB(1), SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
SIPTAG_EVENT_STR(es), SIPTAG_CONTENT_TYPE_STR(ct), TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)), TAG_END());
}
switch_core_session_rwunlock(session);
+19 -6
View File
@@ -122,6 +122,7 @@ typedef struct private_object private_object_t;
#include <sofia-sip/auth_module.h>
#include <sofia-sip/su_md5.h>
#include <sofia-sip/su_log.h>
#include <sofia-sip/su_strlst.h>
#include <sofia-sip/nea.h>
#include <sofia-sip/msg_addr.h>
#include <sofia-sip/tport_tag.h>
@@ -131,9 +132,7 @@ typedef struct private_object private_object_t;
#include "sofia-sip/sip_parser.h"
#include "sofia-sip/tport_tag.h"
#include <sofia-sip/msg.h>
#ifndef WIN32
#include <sofia-sip/uniqueid.h>
#endif
typedef enum {
DTMF_2833,
@@ -248,7 +247,7 @@ typedef enum {
PFLAG_T38_PASSTHRU,
PFLAG_CID_IN_1XX,
PFLAG_IN_DIALOG_CHAT,
PFLAG_DEL_SUBS_ON_REG,
PFLAG_DEL_SUBS_ON_REG_REUSE,
PFLAG_IGNORE_183NOSDP,
PFLAG_PRESENCE_PROBE_ON_REGISTER,
PFLAG_PRESENCE_ON_REGISTER,
@@ -455,6 +454,9 @@ struct sofia_gateway {
char *auth_username;
char *register_password;
char *register_from;
char *options_from_uri;
char *options_to_uri;
char *options_user_agent;
char *register_contact;
char *extension;
char *real_extension;
@@ -639,6 +641,16 @@ struct sofia_profile {
switch_mutex_t *gw_mutex;
uint32_t queued_events;
uint32_t cseq_base;
int tls_only;
int tls_verify_date;
enum tport_tls_verify_policy tls_verify_policy;
int tls_verify_depth;
char *tls_passphrase;
char *tls_verify_in_subjects_str;
su_strlst_t *tls_verify_in_subjects;
uint32_t sip_force_expires;
uint32_t sip_expires_max_deviation;
int ireg_seconds;
};
struct private_object {
@@ -819,6 +831,7 @@ typedef struct {
int network_port;
const char *is_nat;
int is_auto_nat;
int fs_path;
} sofia_nat_parse_t;
@@ -865,8 +878,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session);
uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_sdp);
void sofia_presence_establish_presence(sofia_profile_t *profile);
void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip,
sofia_dispatch_event_t *de, tagi_t tags[]);
@@ -1038,6 +1049,7 @@ void sofia_reg_release_gateway__(const char *file, const char *func, int line, s
sofia_transport_t sofia_glue_via2transport(const sip_via_t * via);
sofia_transport_t sofia_glue_url2transport(const url_t *url);
sofia_transport_t sofia_glue_str2transport(const char *str);
enum tport_tls_verify_policy sofia_glue_str2tls_verify_policy(const char * str);
const char *sofia_glue_transport2str(const sofia_transport_t tp);
char *sofia_glue_find_parameter(const char *str, const char *param);
@@ -1111,6 +1123,7 @@ int sofia_sla_supported(sip_t const *sip);
void sofia_glue_tech_untrack(sofia_profile_t *profile, switch_core_session_t *session, switch_bool_t force);
void sofia_glue_tech_track(sofia_profile_t *profile, switch_core_session_t *session);
int sofia_glue_recover(switch_bool_t flush);
int sofia_glue_profile_recover(sofia_profile_t *profile, switch_bool_t flush);
void sofia_profile_destroy(sofia_profile_t *profile);
switch_status_t sip_dig_function(_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream);
const char *sofia_gateway_status_name(sofia_gateway_status_t status);
@@ -1131,7 +1144,7 @@ switch_status_t sofia_glue_sdp_map(const char *r_sdp, switch_event_t **fmtp, swi
void sofia_glue_build_vid_refresh_message(switch_core_session_t *session, const char *pl);
void sofia_glue_check_dtmf_type(private_object_t *tech_pvt);
void sofia_glue_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str);
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sofia_dispatch_event_t *de, sofia_nat_parse_t *np);
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua_handle_t *nh, sofia_dispatch_event_t *de, sofia_nat_parse_t *np);
void sofia_glue_pause_jitterbuffer(switch_core_session_t *session, switch_bool_t on);
void sofia_process_dispatch_event(sofia_dispatch_event_t **dep);
char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool);
+169 -67
View File
@@ -91,7 +91,7 @@ void sofia_handle_sip_r_notify(switch_core_session_t *session, int status,
if (status >= 300 && sip && sip->sip_call_id && (!sofia_private || !sofia_private->is_call)) {
char *sql;
sql = switch_mprintf("update sip_subscriptions set expires=%ld where call_id='%q'", (long) switch_epoch_time_now(NULL), sip->sip_call_id->i_id);
sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", sip->sip_call_id->i_id);
switch_assert(sql != NULL);
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
nua_handle_destroy(nh);
@@ -563,8 +563,9 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
char st[80] = "";
#endif
if (!session)
if (!session) {
return;
}
channel = switch_core_session_get_channel(session);
tech_pvt = switch_core_session_get_private(session);
@@ -1570,7 +1571,7 @@ void watchdog_triggered_abort(void) {
void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread, void *obj)
{
sofia_profile_t *profile = (sofia_profile_t *) obj;
uint32_t ireg_loops = IREG_SECONDS; /* Number of loop iterations done when we haven't checked for registrations */
uint32_t ireg_loops = profile->ireg_seconds; /* Number of loop iterations done when we haven't checked for registrations */
uint32_t gateway_loops = GATEWAY_SECONDS; /* Number of loop iterations done when we haven't checked for gateways */
void *pop = NULL; /* queue_pop placeholder */
switch_size_t sql_len = 1024 * 32; /* length of sqlbuf */
@@ -1845,7 +1846,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
supported = switch_core_sprintf(profile->pool, "%s%s%sprecondition, path, replaces", use_100rel ? "100rel, " : "", use_timer ? "timer, " : "", use_rfc_5626 ? "outbound, " : "");
if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {
if (switch_nat_add_mapping(profile->sip_port, SWITCH_NAT_UDP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
if ( (! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only) && switch_nat_add_mapping(profile->sip_port, SWITCH_NAT_UDP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
}
if (switch_nat_add_mapping(profile->sip_port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
@@ -1857,10 +1858,15 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
}
}
/* We have to init the verify_subjects here as during config stage profile->home isn't setup, it should be freed when profile->home is freed */
if ( (profile->tls_verify_policy & TPTLS_VERIFY_SUBJECTS_IN) && profile->tls_verify_in_subjects_str && ! profile->tls_verify_in_subjects) {
profile->tls_verify_in_subjects = su_strlst_dup_split((su_home_t *)profile->nua, profile->tls_verify_in_subjects_str, "|");
}
profile->nua = nua_create(profile->s_root, /* Event loop */
sofia_event_callback, /* Callback for processing events */
profile, /* Additional data to pass to callback */
NUTAG_URL(profile->bindurl),
TAG_IF( ! sofia_test_pflag(profile, PFLAG_TLS) || ! profile->tls_only, NUTAG_URL(profile->bindurl)),
NTATAG_USER_VIA(1),
TAG_IF(!strchr(profile->sipip, ':'),
SOATAG_AF(SOA_AF_IP4_ONLY)),
@@ -1870,8 +1876,16 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
NUTAG_SIPS_URL(profile->tls_bindurl)),
TAG_IF(sofia_test_pflag(profile, PFLAG_TLS),
NUTAG_CERTIFICATE_DIR(profile->tls_cert_dir)),
TAG_IF(sofia_test_pflag(profile, PFLAG_TLS) && profile->tls_passphrase,
TPTAG_TLS_PASSPHRASE(profile->tls_passphrase)),
TAG_IF(sofia_test_pflag(profile, PFLAG_TLS),
TPTAG_TLS_VERIFY_POLICY(0)),
TPTAG_TLS_VERIFY_POLICY(profile->tls_verify_policy)),
TAG_IF(sofia_test_pflag(profile, PFLAG_TLS),
TPTAG_TLS_VERIFY_DEPTH(profile->tls_verify_depth)),
TAG_IF(sofia_test_pflag(profile, PFLAG_TLS),
TPTAG_TLS_VERIFY_DATE(profile->tls_verify_date)),
TAG_IF(sofia_test_pflag(profile, PFLAG_TLS) && profile->tls_verify_in_subjects,
TPTAG_TLS_VERIFY_SUBJECTS(profile->tls_verify_in_subjects)),
TAG_IF(sofia_test_pflag(profile, PFLAG_TLS),
TPTAG_TLS_VERSION(profile->tls_version)),
TAG_IF(!strchr(profile->sipip, ':'),
@@ -2008,10 +2022,6 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
sofia_glue_add_profile(profile->name, profile);
if (profile->pres_type) {
sofia_presence_establish_presence(profile);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Starting thread for %s\n", profile->name);
profile->started = switch_epoch_time_now(NULL);
@@ -2041,8 +2051,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write lock %s\n", profile->name);
switch_thread_rwlock_wrlock(profile->rwlock);
sofia_reg_unregister(profile);
nua_shutdown(profile->nua);
@@ -2105,6 +2114,9 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write lock %s\n", profile->name);
switch_thread_rwlock_wrlock(profile->rwlock);
//su_home_unref(profile->home);
su_root_destroy(profile->s_root);
//pool = profile->pool;
@@ -2317,13 +2329,14 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
*caller_id_in_from = "false",
*extension = NULL,
*proxy = NULL,
*options_user_agent = NULL,
*context = profile->context,
*expire_seconds = "3600",
*retry_seconds = "30",
*timeout_seconds = "60",
*from_user = "", *from_domain = NULL, *outbound_proxy = NULL, *register_proxy = NULL, *contact_host = NULL,
*contact_params = NULL, *params = NULL, *register_transport = NULL,
*reg_id = NULL, *str_rfc_5626 = NULL;
*contact_params = "", *params = NULL, *register_transport = NULL,
*reg_id = NULL, *str_rfc_5626 = "";
if (!context) {
context = "default";
@@ -2422,6 +2435,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
ping_max = atoi(val);
} else if (!strcmp(var, "ping-min")) {
ping_min = atoi(val);
} else if (!strcmp(var, "ping-user-agent")) {
options_user_agent = val;
} else if (!strcmp(var, "proxy")) {
proxy = val;
} else if (!strcmp(var, "context")) {
@@ -2463,8 +2478,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
gateway->register_transport = transport;
}
}
#ifndef WIN32
/* Windows todo figure this out! */
/* RFC 5626 enable in the GW profile and the UA profile */
if (rfc_5626 && sofia_test_pflag(profile, PFLAG_ENABLE_RFC5626)) {
char str_guid[su_guid_strlen + 1];
@@ -2473,18 +2487,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
su_guid_sprintf(str_guid, su_guid_strlen + 1, guid);
str_rfc_5626 = switch_core_sprintf(gateway->pool, ";reg-id=%s;+sip.instance=\"<urn:uuid:%s>\"",reg_id,str_guid);
}
#endif
if (ping_freq) {
if (ping_freq >= 5) {
gateway->ping_freq = ping_freq;
gateway->ping_max = ping_max;
gateway->ping_min = ping_min;
gateway->ping = switch_epoch_time_now(NULL) + ping_freq;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: invalid ping!\n");
}
}
if ((gw_subs_tag = switch_xml_child(gateway_tag, "subscriptions"))) {
parse_gateway_subscriptions(profile, gateway, gw_subs_tag);
@@ -2508,6 +2511,14 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: password param is REQUIRED!\n");
goto skip;
}
} else {
if (zstr(username)) {
username = "FreeSWITCH";
}
if (zstr(password)) {
password = "";
}
}
if (zstr(from_user)) {
@@ -2567,6 +2578,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
gateway->auth_username = switch_core_strdup(gateway->pool, auth_username);
gateway->register_password = switch_core_strdup(gateway->pool, password);
gateway->distinct_to = distinct_to;
gateway->options_user_agent = options_user_agent;
if (switch_true(caller_id_in_from)) {
sofia_set_flag(gateway, REG_FLAG_CALLERID);
@@ -2598,6 +2610,21 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
from_user, !zstr(from_domain) ? from_domain : proxy, register_transport);
if (ping_freq) {
if (ping_freq >= 5) {
gateway->ping_freq = ping_freq;
gateway->ping_max = ping_max;
gateway->ping_min = ping_min;
gateway->ping = switch_epoch_time_now(NULL) + ping_freq;
gateway->options_to_uri = switch_core_sprintf(gateway->pool, "<sip:%s;transport=%s>",
!zstr(from_domain) ? from_domain : proxy, register_transport);
gateway->options_from_uri = switch_core_sprintf(gateway->pool, "<sip:%s;transport=%s>",
profile->extrtpip ? profile->extrtpip : profile->sipip, register_transport);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: invalid ping!\n");
}
}
if (contact_host) {
if (!strcmp(contact_host, "sip-ip")) {
sipip = profile->sipip;
@@ -2648,11 +2675,11 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
profile->tls_sip_port : profile->sip_port, params, str_rfc_5626);
} else {
format = strchr(sipip, ':') ? "<sip:%s@[%s]:%d%s>" : "<sip:%s@%s:%d%s%s>";
format = strchr(sipip, ':') ? "<sip:%s@[%s]:%d%s>" : "<sip:%s@%s:%d%s>";
gateway->register_contact = switch_core_sprintf(gateway->pool, format, extension,
sipip,
sofia_glue_transport_has_tls(gateway->register_transport) ?
profile->tls_sip_port : profile->sip_port, params,contact_params);
profile->tls_sip_port : profile->sip_port, params);
}
} else {
if (rfc_5626) {
@@ -2908,12 +2935,6 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
} else {
sofia_clear_pflag(profile, PFLAG_PASS_CALLEE_ID);
}
} else if (!strcasecmp(var, "delete-subs-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
} else {
sofia_clear_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
}
} else if (!strcasecmp(var, "watchdog-enabled")) {
profile->watchdog_enabled = switch_true(val);
} else if (!strcasecmp(var, "watchdog-step-timeout")) {
@@ -2965,6 +2986,11 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
sofia_glue_parse_rtp_bugs(&profile->auto_rtp_bugs, val);
} else if (!strcasecmp(var, "manual-rtp-bugs")) {
sofia_glue_parse_rtp_bugs(&profile->manual_rtp_bugs, val);
} else if (!strcasecmp(var, "registration-thread-frequency")) {
profile->ireg_seconds = atoi(val);
if (profile->ireg_seconds < 0) {
profile->ireg_seconds = IREG_SECONDS;
}
} else if (!strcasecmp(var, "user-agent-string")) {
profile->user_agent = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "auto-restart")) {
@@ -3426,6 +3452,20 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
} else {
sofia_clear_pflag(profile, PFLAG_OPTIONS_RESPOND_503_ON_BUSY);
}
} else if (!strcasecmp(var, "sip-force-expires")) {
int32_t sip_force_expires = atoi(val);
if (sip_force_expires >= 0) {
profile->sip_force_expires = sip_force_expires;
} else {
profile->sip_force_expires = 0;
}
} else if (!strcasecmp(var, "sip-expires-max-deviation")) {
int32_t sip_expires_max_deviation = atoi(val);
if (sip_expires_max_deviation >= 0) {
profile->sip_expires_max_deviation = sip_expires_max_deviation;
} else {
profile->sip_expires_max_deviation = 0;
}
}
}
}
@@ -3623,6 +3663,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
sofia_profile_start_failure(NULL, xprofilename);
goto done;
}
profile->tls_verify_policy = TPTLS_VERIFY_NONE;
/* lib default */
profile->tls_verify_depth = 2;
switch_mutex_init(&profile->gw_mutex, SWITCH_MUTEX_NESTED, pool);
@@ -3646,6 +3689,8 @@ switch_status_t config_sofia(int reload, char *profile_name)
switch_thread_rwlock_create(&profile->rwlock, profile->pool);
switch_mutex_init(&profile->flag_mutex, SWITCH_MUTEX_NESTED, profile->pool);
profile->dtmf_duration = 100;
profile->sip_force_expires = 0;
profile->sip_expires_max_deviation = 0;
profile->tls_version = 0;
profile->mflags = MFLAG_REFER | MFLAG_REGISTER;
profile->server_rport_level = 1;
@@ -3658,7 +3703,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
profile->contact_user = SOFIA_DEFAULT_CONTACT_USER;
sofia_set_pflag(profile, PFLAG_PASS_CALLEE_ID);
sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER);
sofia_set_pflag(profile, PFLAG_PRESENCE_ON_FIRST_REGISTER);
//sofia_set_pflag(profile, PFLAG_PRESENCE_ON_FIRST_REGISTER);
sofia_set_pflag(profile, PFLAG_SQL_IN_TRANS);
profile->shutdown_type = "false";
@@ -3667,6 +3712,13 @@ switch_status_t config_sofia(int reload, char *profile_name)
sofia_set_pflag(profile, PFLAG_CID_IN_1XX);
profile->ndlb |= PFLAG_NDLB_ALLOW_NONDUP_SDP;
profile->te = 101;
profile->ireg_seconds = IREG_SECONDS;
profile->tls_verify_policy = TPTLS_VERIFY_NONE;
/* lib default */
profile->tls_verify_depth = 2;
profile->tls_verify_date = SWITCH_TRUE;
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
char *var = (char *) switch_xml_attr_soft(param, "name");
@@ -3701,6 +3753,11 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
}
} else if (!strcasecmp(var, "registration-thread-frequency")) {
profile->ireg_seconds = atoi(val);
if (profile->ireg_seconds < 0) {
profile->ireg_seconds = IREG_SECONDS;
}
} else if (!strcasecmp(var, "user-agent-string")) {
profile->user_agent = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "auto-restart")) {
@@ -3742,12 +3799,6 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
sofia_clear_pflag(profile, PFLAG_IN_DIALOG_CHAT);
}
} else if (!strcasecmp(var, "delete-subs-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
} else {
sofia_clear_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
}
} else if (!strcasecmp(var, "t38-passthru")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_T38_PASSTHRU);
@@ -4401,6 +4452,14 @@ switch_status_t config_sofia(int reload, char *profile_name)
}
} else if (!strcasecmp(var, "tls-bind-params")) {
profile->tls_bind_params = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "tls-only")) {
profile->tls_only = switch_true(val);
} else if (!strcasecmp(var, "tls-verify-date")) {
profile->tls_verify_date = switch_true(val);
} else if (!strcasecmp(var, "tls-verify-depth")) {
profile->tls_verify_depth = atoi(val);
} else if (!strcasecmp(var, "tls-verify-policy")) {
profile->tls_verify_policy = sofia_glue_str2tls_verify_policy(val);
} else if (!strcasecmp(var, "tls-sip-port")) {
if (!strcasecmp(val, "auto")) {
sofia_set_pflag(profile, PFLAG_AUTO_ASSIGN_TLS_PORT);
@@ -4409,6 +4468,10 @@ switch_status_t config_sofia(int reload, char *profile_name)
}
} else if (!strcasecmp(var, "tls-cert-dir")) {
profile->tls_cert_dir = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "tls-passphrase")) {
profile->tls_passphrase = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "tls-verify-in-subjects")) {
profile->tls_verify_in_subjects_str = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "tls-version")) {
if (!strcasecmp(val, "tlsv1")) {
@@ -4450,6 +4513,20 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
sofia_clear_pflag(profile, PFLAG_OPTIONS_RESPOND_503_ON_BUSY);
}
} else if (!strcasecmp(var, "sip-force-expires")) {
int32_t sip_force_expires = atoi(val);
if (sip_force_expires >= 0) {
profile->sip_force_expires = sip_force_expires;
} else {
profile->sip_force_expires = 0;
}
} else if (!strcasecmp(var, "sip-expires-max-deviation")) {
int32_t sip_expires_max_deviation = atoi(val);
if (sip_expires_max_deviation >= 0) {
profile->sip_expires_max_deviation = sip_expires_max_deviation;
} else {
profile->sip_expires_max_deviation = 0;
}
} else if (!strcasecmp(var, "reuse-connections")) {
switch_bool_t value = switch_true(val);
if (!value) {
@@ -5119,8 +5196,8 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
astate = "confirmed";
}
if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED) &&
!switch_channel_test_flag(channel, CF_RING_READY)) {
if ((!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED) &&
!switch_channel_test_flag(channel, CF_RING_READY)) || sofia_test_flag(tech_pvt, TFLAG_RECOVERING)) {
const char *from_user = "", *from_host = "", *to_user = "", *to_host = "", *contact_user = "", *contact_host = "";
const char *user_agent = "", *call_id = "";
const char *to_tag = "";
@@ -5487,7 +5564,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
const char *val;
if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {
nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_WITH_THIS_MSG(de->data->e_msg),
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_EVENT_STR("talk"), TAG_END());
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_EVENT_STR("talk"), TAG_END());
}
}
@@ -5742,7 +5819,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
sofia_set_flag_locked(tech_pvt, TFLAG_3PCC);
//sofia_glue_tech_choose_port(tech_pvt, 0);
//sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
switch_channel_set_flag(channel, TFLAG_LATE_NEGOTIATION);
sofia_set_flag(tech_pvt, TFLAG_LATE_NEGOTIATION);
//Moves into CS_INIT so call moves forward into the dialplan
switch_channel_set_state(channel, CS_INIT);
} else {
@@ -5969,7 +6046,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
}
break;
case nua_callstate_ready:
if (r_sdp && !is_dup_sdp && switch_rtp_ready(tech_pvt->rtp_session)) {
if (r_sdp && !is_dup_sdp && switch_rtp_ready(tech_pvt->rtp_session) && !sofia_test_flag(tech_pvt, TFLAG_NOSDP_REINVITE)) {
/* sdp changed since 18X w sdp, we're supposed to ignore it but we, of course, were pressured into supporting it */
uint8_t match = 0;
@@ -6263,7 +6340,6 @@ void *SWITCH_THREAD_FUNC nightmare_xfer_thread_run(switch_thread_t *thread, void
mark_transfer_record(session, nhelper->bridge_to_uuid, tuuid_str);
switch_ivr_uuid_bridge(nhelper->bridge_to_uuid, tuuid_str);
switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER");
sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
} else {
switch_channel_hangup(switch_core_session_get_channel(tsession), SWITCH_CAUSE_ORIGINATOR_CANCEL);
status = SWITCH_STATUS_FALSE;
@@ -6278,7 +6354,7 @@ void *SWITCH_THREAD_FUNC nightmare_xfer_thread_run(switch_thread_t *thread, void
}
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
NUTAG_SUBSTATE(nua_substate_terminated),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
SIPTAG_PAYLOAD_STR(status == SWITCH_STATUS_SUCCESS ? "SIP/2.0 200 OK\r\n" :
"SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(nhelper->event), TAG_END());
@@ -6509,7 +6585,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Denying Attended Transfer, variable [deny_refer_requests] was set to true\n");
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END());
} else if (switch_channel_test_flag(channel_b, CF_ORIGINATOR)) {
@@ -6564,7 +6640,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_core_session_rwunlock(a_session);
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp),
TAG_END());
if (b_tech_pvt && !sofia_test_flag(b_tech_pvt, TFLAG_BYE)) {
@@ -6583,7 +6659,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
}
} else {
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END());
}
@@ -6630,7 +6706,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_ivr_uuid_bridge(br_b, br_a);
switch_channel_set_variable(channel_b, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER");
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp),
TAG_END());
sofia_clear_flag_locked(b_tech_pvt, TFLAG_SIP_HOLD);
@@ -6644,7 +6720,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"Cannot transfer channels that are not in a bridge.\n");
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"),
SIPTAG_EVENT_STR(etmp), TAG_END());
} else {
switch_core_session_t *t_session, *hup_session;
@@ -6694,14 +6770,14 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
nua_notify(tech_pvt->nh,
NUTAG_NEWSUB(1),
SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END());
switch_core_session_rwunlock(t_session);
switch_channel_hangup(hup_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Session to transfer to not found.\n");
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END());
}
}
@@ -6815,7 +6891,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Transfer! [%s]\n", br_a);
switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER_ERROR");
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp),
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp),
TAG_END());
}
}
@@ -6857,13 +6933,13 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "BLIND_TRANSFER");
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END());
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END());
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Cannot Blind Transfer 1 Legged calls\n");
switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER_ERROR");
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END());
NUTAG_SUBSTATE(nua_substate_terminated),SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden\r\n"), SIPTAG_EVENT_STR(etmp), TAG_END());
}
}
@@ -7074,11 +7150,13 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "media_control+xml")) {
switch_core_session_t *other_session;
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
sofia_glue_build_vid_refresh_message(other_session, sip->sip_payload->pl_data);
switch_core_session_rwunlock(other_session);
} else {
sofia_glue_build_vid_refresh_message(session, sip->sip_payload->pl_data);
if (switch_channel_test_flag(channel, CF_VIDEO)) {
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
sofia_glue_build_vid_refresh_message(other_session, sip->sip_payload->pl_data);
switch_core_session_rwunlock(other_session);
} else {
switch_channel_set_flag(channel, CF_VIDEO_REFRESH_REQ);
}
}
} else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf-relay")) {
@@ -8436,10 +8514,34 @@ void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t
switch_caller_profile_t *acp = a_tech_pvt->caller_profile;
if (ua && switch_stristr("snom", ua)) {
if (zstr(acp->caller_id_name)) {
snprintf(message, sizeof(message), "From:\r\nTo: %s\r\n", acp->caller_id_number);
const char *ver_str = NULL;
int version = 0;
ver_str = switch_stristr( "/", ua);
if ( ver_str ) {
char *argv[4] = { 0 };
char *dotted = strdup( ver_str + 1 );
if ( dotted ) {
switch_separate_string(dotted, '.', argv, (sizeof(argv) / sizeof(argv[0])));
if ( argv[0] && argv[1] && argv[2] ) {
version = ( atoi(argv[0]) * 10000 ) + ( atoi(argv[1]) * 100 ) + atoi(argv[2]);
}
}
switch_safe_free( dotted );
}
if ( version >= 80424 ) {
if (zstr(acp->caller_id_name)) {
snprintf(message, sizeof(message), "From: %s\r\nTo:\r\n", acp->caller_id_number);
} else {
snprintf(message, sizeof(message), "From: \"%s\" %s\r\nTo:\r\n", acp->caller_id_name, acp->caller_id_number);
}
} else {
snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", acp->caller_id_name, acp->caller_id_number);
if (zstr(acp->caller_id_name)) {
snprintf(message, sizeof(message), "From:\r\nTo: %s\r\n", acp->caller_id_number);
} else {
snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", acp->caller_id_name, acp->caller_id_number);
}
}
nua_info(b_tech_pvt->nh,
SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
+154 -46
View File
@@ -1142,6 +1142,37 @@ sofia_transport_t sofia_glue_str2transport(const char *str)
return SOFIA_TRANSPORT_UNKNOWN;
}
enum tport_tls_verify_policy sofia_glue_str2tls_verify_policy(const char * str){
char *ptr_next;
int len;
enum tport_tls_verify_policy ret;
char *ptr_cur = (char *) str;
ret = TPTLS_VERIFY_NONE;
while (ptr_cur) {
if ((ptr_next = strchr(ptr_cur, '|'))) {
len = ptr_next++ - ptr_cur;
} else {
len = strlen(ptr_cur);
}
if (!strncasecmp(ptr_cur, "in",len)) {
ret |= TPTLS_VERIFY_IN;
} else if (!strncasecmp(ptr_cur, "out",len)) {
ret |= TPTLS_VERIFY_OUT;
} else if (!strncasecmp(ptr_cur, "all",len)) {
ret |= TPTLS_VERIFY_ALL;
} else if (!strncasecmp(ptr_cur, "subjects_in",len)) {
ret |= TPTLS_VERIFY_SUBJECTS_IN;
} else if (!strncasecmp(ptr_cur, "subjects_out",len)) {
ret |= TPTLS_VERIFY_SUBJECTS_OUT;
} else if (!strncasecmp(ptr_cur, "subjects_all",len)) {
ret |= TPTLS_VERIFY_SUBJECTS_ALL;
}
ptr_cur = ptr_next;
}
return ret;
}
char *sofia_glue_find_parameter_value(switch_core_session_t *session, const char *str, const char *param)
{
const char *param_ptr;
@@ -2894,7 +2925,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
tech_pvt->read_codec.agreed_pt = tech_pvt->agreed_pt;
if (force != 2) {
switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec);
switch_core_session_set_real_read_codec(tech_pvt->session, &tech_pvt->read_codec);
switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec);
}
@@ -5108,7 +5139,22 @@ char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup)
{
char *url = NULL, *e;
if ((url = strchr(buf, '<')) && (e = strchr(url, '>'))) {
while(*buf == ' ') {
buf++;
}
if (*buf == '"') {
buf++;
if((e = strchr(buf, '"'))) {
buf = e+1;
}
}
while(*buf == ' ') {
buf++;
}
if ((url = strchr(buf, '<')) && (e = switch_find_end_paren(url, '<', '>'))) {
url++;
if (to_dup) {
url = strdup(url);
@@ -5684,7 +5730,6 @@ static int recover_callback(void *pArg, int argc, char **argv, char **columnName
int sofia_glue_recover(switch_bool_t flush)
{
sofia_profile_t *profile;
char *sql;
int r = 0;
switch_console_callback_match_t *matches;
@@ -5693,35 +5738,45 @@ int sofia_glue_recover(switch_bool_t flush)
switch_console_callback_match_node_t *m;
for (m = matches->head; m; m = m->next) {
if ((profile = sofia_glue_find_profile(m->val))) {
struct recover_helper h = { 0 };
h.profile = profile;
h.total = 0;
sofia_clear_pflag_locked(profile, PFLAG_STANDBY);
if (flush) {
sql = switch_mprintf("delete from sip_recovery where profile_name='%q'", profile->name);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
} else {
sql = switch_mprintf("select profile_name, hostname, uuid, metadata "
"from sip_recovery where runtime_uuid!='%q' and profile_name='%q'", switch_core_get_uuid(), profile->name);
sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, recover_callback, &h);
r += h.total;
free(sql);
sql = NULL;
sql = switch_mprintf("delete "
"from sip_recovery where runtime_uuid!='%q' and profile_name='%q'", switch_core_get_uuid(), profile->name);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
r += sofia_glue_profile_recover(profile, flush);
}
}
switch_console_free_matches(&matches);
}
return r;
}
int sofia_glue_profile_recover(sofia_profile_t *profile, switch_bool_t flush)
{
char *sql;
int r = 0;
if (profile) {
struct recover_helper h = { 0 };
h.profile = profile;
h.total = 0;
sofia_clear_pflag_locked(profile, PFLAG_STANDBY);
if (flush) {
sql = switch_mprintf("delete from sip_recovery where profile_name='%q'", profile->name);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
} else {
sql = switch_mprintf("select profile_name, hostname, uuid, metadata "
"from sip_recovery where runtime_uuid!='%q' and profile_name='%q'", switch_core_get_uuid(), profile->name);
sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, recover_callback, &h);
r += h.total;
free(sql);
sql = NULL;
sql = switch_mprintf("delete "
"from sip_recovery where runtime_uuid!='%q' and profile_name='%q'", switch_core_get_uuid(), profile->name);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
}
return r;
}
@@ -5854,7 +5909,8 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
" mwi_user VARCHAR(255),\n"
" mwi_host VARCHAR(255),\n"
" orig_server_host VARCHAR(255),\n"
" orig_hostname VARCHAR(255)\n"
" orig_hostname VARCHAR(255),\n"
" sub_host VARCHAR(255)\n"
");\n";
char recovery_sql[] =
@@ -5971,6 +6027,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
"create index sr_call_id on sip_registrations (call_id)",
"create index sr_sip_user on sip_registrations (sip_user)",
"create index sr_sip_host on sip_registrations (sip_host)",
"create index sr_sub_host on sip_registrations (sub_host)",
"create index sr_mwi_user on sip_registrations (mwi_user)",
"create index sr_mwi_host on sip_registrations (mwi_host)",
"create index sr_profile_name on sip_registrations (profile_name)",
@@ -6050,7 +6107,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
}
test_sql = switch_mprintf("delete from sip_registrations where (contact like '%%TCP%%' "
test_sql = switch_mprintf("delete from sip_registrations where (sub_host is null or contact like '%%TCP%%' "
"or status like '%%TCP%%' or status like '%%TLS%%') and hostname='%q' "
"and network_ip like '%%' and network_port like '%%' and sip_username "
"like '%%' and mwi_user like '%%' and mwi_host like '%%' "
@@ -6216,6 +6273,7 @@ void sofia_glue_actually_execute_sql_trans(sofia_profile_t *profile, char *sql,
void sofia_glue_actually_execute_sql(sofia_profile_t *profile, char *sql, switch_mutex_t *mutex)
{
switch_cache_db_handle_t *dbh = NULL;
char *err = NULL;
if (mutex) {
switch_mutex_lock(mutex);
@@ -6226,7 +6284,12 @@ void sofia_glue_actually_execute_sql(sofia_profile_t *profile, char *sql, switch
goto end;
}
switch_cache_db_execute_sql(dbh, sql, NULL);
switch_cache_db_execute_sql(dbh, sql, &err);
if (err) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR: [%s]\n%s\n", err, sql);
free(err);
}
end:
@@ -6274,7 +6337,7 @@ switch_bool_t sofia_glue_execute_sql_callback(sofia_profile_t *profile,
char *sofia_glue_execute_sql2str(sofia_profile_t *profile, switch_mutex_t *mutex, char *sql, char *resbuf, size_t len)
{
char *ret = NULL;
char *err = NULL;
switch_cache_db_handle_t *dbh = NULL;
if (!(dbh = sofia_glue_get_db_handle(profile))) {
@@ -6286,7 +6349,12 @@ char *sofia_glue_execute_sql2str(sofia_profile_t *profile, switch_mutex_t *mutex
switch_mutex_lock(mutex);
}
ret = switch_cache_db_execute_sql2str(dbh, sql, resbuf, len, NULL);
ret = switch_cache_db_execute_sql2str(dbh, sql, resbuf, len, &err);
if (err) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR: [%s]\n%s\n", err, sql);
free(err);
}
if (mutex) {
switch_mutex_unlock(mutex);
@@ -6462,9 +6530,14 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
nua_handle_t *nh;
sofia_destination_t *dst = NULL;
char *contact_str, *contact, *user_via = NULL;
char *route_uri = NULL;
char *route_uri = NULL, *p;
contact = sofia_glue_get_url_from_contact((char *) o_contact, 1);
if ((p = strstr(contact, ";fs_"))) {
*p = '\0';
}
if (!zstr(network_ip) && sofia_glue_check_nat(profile, network_ip)) {
char *ptr = NULL;
//const char *transport_str = NULL;
@@ -6512,6 +6585,7 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
NUTAG_NEWSUB(1),
TAG_IF(dst->route_uri, NUTAG_PROXY(route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)),
TAG_IF(user_via, SIPTAG_VIA_STR(user_via)),
SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
TAG_IF(event, SIPTAG_EVENT_STR(event)),
TAG_IF(contenttype, SIPTAG_CONTENT_TYPE_STR(contenttype)), TAG_IF(body, SIPTAG_PAYLOAD_STR(body)), TAG_END());
@@ -6701,7 +6775,7 @@ void sofia_glue_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str
}
}
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sofia_dispatch_event_t *de, sofia_nat_parse_t *np)
char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, nua_handle_t *nh, sofia_dispatch_event_t *de, sofia_nat_parse_t *np)
{
char *contact_str = NULL;
const char *contact_host;//, *contact_user;
@@ -6798,7 +6872,8 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sof
np->is_nat = "No contact host";
}
if (np->is_nat) {
if (np->is_nat && !np->fs_path) {
contact_host = np->network_ip;
switch_snprintf(new_port, sizeof(new_port), ":%d", np->network_port);
port = NULL;
@@ -6810,17 +6885,50 @@ char *sofia_glue_gen_contact_str(sofia_profile_t *profile, sip_t const *sip, sof
}
ipv6 = strchr(contact_host, ':');
if (contact->m_url->url_params) {
contact_str = switch_mprintf("%s <sip:%s@%s%s%s%s;%s>%s",
display, contact->m_url->url_user,
ipv6 ? "[" : "",
contact_host, ipv6 ? "]" : "", new_port, contact->m_url->url_params, np->is_nat ? ";fs_nat=yes" : "");
} else {
contact_str = switch_mprintf("%s <sip:%s@%s%s%s%s>%s",
display,
contact->m_url->url_user, ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, np->is_nat ? ";fs_nat=yes" : "");
}
if (np->is_nat && np->fs_path) {
char *full_contact = sip_header_as_string(nh->nh_home, (void *) contact);
char *full_contact_dup;
char *path_encoded;
int path_encoded_len;
char *path_val;
const char *tp;
full_contact_dup = sofia_glue_get_url_from_contact(full_contact, 1);
if ((tp = switch_stristr("transport=", full_contact_dup))) {
tp += 10;
}
if (zstr(tp)) {
tp = "udp";
}
path_val = switch_mprintf("sip:%s:%d;transport=%s", np->network_ip, np->network_port, tp);
path_encoded_len = (int)(strlen(path_val) * 3) + 1;
switch_zmalloc(path_encoded, path_encoded_len);
switch_copy_string(path_encoded, ";fs_path=", 10);
switch_url_encode(path_val, path_encoded + 9, path_encoded_len - 9);
contact_str = switch_mprintf("%s <%s;fs_nat=yes%s>", display, full_contact_dup, path_encoded);
free(full_contact_dup);
free(path_encoded);
free(path_val);
} else {
if (contact->m_url->url_params) {
contact_str = switch_mprintf("%s <sip:%s@%s%s%s%s;%s>%s",
display, contact->m_url->url_user,
ipv6 ? "[" : "",
contact_host, ipv6 ? "]" : "", new_port, contact->m_url->url_params, np->is_nat ? ";fs_nat=yes" : "");
} else {
contact_str = switch_mprintf("%s <sip:%s@%s%s%s%s>%s",
display,
contact->m_url->url_user, ipv6 ? "[" : "", contact_host, ipv6 ? "]" : "", new_port, np->is_nat ? ";fs_nat=yes" : "");
}
}
return contact_str;
}
File diff suppressed because it is too large. Load diff
+50 -128
View File
@@ -278,6 +278,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
{
sofia_gateway_t *check, *gateway_ptr, *last = NULL;
switch_event_t *event;
int delta = 0;
switch_mutex_lock(profile->gw_mutex);
for (gateway_ptr = profile->gateways; gateway_ptr; gateway_ptr = gateway_ptr->next) {
@@ -353,8 +354,9 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
nua_options(nh,
TAG_IF(gateway_ptr->register_sticky_proxy, NUTAG_PROXY(gateway_ptr->register_sticky_proxy)),
TAG_IF(user_via, SIPTAG_VIA_STR(user_via)),
SIPTAG_TO_STR(gateway_ptr->register_from),
SIPTAG_CONTACT_STR(gateway_ptr->register_contact), SIPTAG_FROM_STR(gateway_ptr->register_from), TAG_END());
SIPTAG_TO_STR(gateway_ptr->options_to_uri), SIPTAG_FROM_STR(gateway_ptr->options_from_uri),
TAG_IF(gateway_ptr->options_user_agent, SIPTAG_USER_AGENT_STR(gateway_ptr->options_user_agent)),
TAG_END());
switch_safe_free(user_via);
user_via = NULL;
@@ -373,12 +375,18 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
gateway_ptr->failures = 0;
if (gateway_ptr->freq > 60) {
gateway_ptr->expires = now + (gateway_ptr->freq - 15);
if (gateway_ptr->freq > 30) {
delta = (gateway_ptr->freq - 15);
} else {
gateway_ptr->expires = now + (gateway_ptr->freq - 2);
delta = (gateway_ptr->freq / 2);
}
if (delta < 1) {
delta = 1;
}
gateway_ptr->expires = now + delta;
gateway_ptr->state = REG_STATE_REGED;
gateway_ptr->status = SOFIA_GATEWAY_UP;
break;
@@ -386,9 +394,9 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
case REG_STATE_UNREGISTER:
sofia_reg_kill_reg(gateway_ptr);
gateway_ptr->state = REG_STATE_NOREG;
gateway_ptr->status = SOFIA_GATEWAY_DOWN;
break;
case REG_STATE_UNREGED:
gateway_ptr->status = SOFIA_GATEWAY_DOWN;
gateway_ptr->retry = 0;
if (!gateway_ptr->nh) {
@@ -419,6 +427,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
NUTAG_OUTBOUND("no-options-keepalive"), NUTAG_OUTBOUND("no-validate"), NUTAG_KEEPALIVE(0), TAG_NULL());
gateway_ptr->retry = now + gateway_ptr->retry_seconds;
} else {
gateway_ptr->status = SOFIA_GATEWAY_DOWN;
nua_unregister(gateway_ptr->nh,
NUTAG_URL(gateway_ptr->register_url),
TAG_IF(user_via, SIPTAG_VIA_STR(user_via)),
@@ -564,19 +573,6 @@ int sofia_reg_nat_callback(void *pArg, int argc, char **argv, char **columnNames
}
int sofia_sub_del_callback(void *pArg, int argc, char **argv, char **columnNames)
{
sofia_profile_t *profile = (sofia_profile_t *) pArg;
nua_handle_t *nh;
if (argv[0]) {
if ((nh = nua_handle_by_call_id(profile->nua, argv[0]))) {
nua_handle_destroy(nh);
}
}
return 0;
}
void sofia_reg_send_reboot(sofia_profile_t *profile, const char *user, const char *host, const char *contact, const char *user_agent,
const char *network_ip)
{
@@ -752,18 +748,6 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
sofia_glue_actually_execute_sql(profile, sql, NULL);
if (now) {
switch_snprintf(sql, sizeof(sql),
"select call_id from sip_subscriptions where (expires = -1 or (expires > 0 and expires <= %ld)) and hostname='%s'", (long) now,
mod_sofia_globals.hostname);
} else {
switch_snprintfv(sql, sizeof(sql), "select sub_to_user,sub_to_host,call_id from sip_subscriptions where expires >= -1 and hostname='%q'",
mod_sofia_globals.hostname);
}
sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_sub_del_callback, profile);
sofia_presence_check_subscriptions(profile, now);
if (now) {
@@ -871,10 +855,6 @@ void sofia_reg_check_sync(sofia_profile_t *profile)
switch_snprintfv(sql, sizeof(sql), "delete from sip_authentication where expires > 0 and hostname='%q'", mod_sofia_globals.hostname);
sofia_glue_actually_execute_sql(profile, sql, NULL);
switch_snprintfv(sql, sizeof(sql), "select sub_to_user,sub_to_host,call_id from sip_subscriptions where expires >= -1 and hostname='%q'",
mod_sofia_globals.hostname);
sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_sub_del_callback, profile);
switch_snprintfv(sql, sizeof(sql), "delete from sip_subscriptions where expires >= -1 and hostname='%q'", mod_sofia_globals.hostname);
sofia_glue_actually_execute_sql(profile, sql, NULL);
@@ -1056,14 +1036,11 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
switch_event_t *auth_params = NULL;
int r = 0;
long reg_count = 0;
int delete_subs;
const char *agent = "unknown";
const char *pres_on_reg = NULL;
int send_pres = 0;
int is_tls = 0, is_tcp = 0;
delete_subs = sofia_test_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
if (v_event && *v_event) pres_on_reg = switch_event_get_header(*v_event, "send-presence-on-register");
if (!(send_pres = switch_true(pres_on_reg))) {
@@ -1114,10 +1091,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
switch_goto_int(r, 1, end);
}
if (!reg_host) {
if (zstr(reg_host)) {
reg_host = to_host;
}
if (!sub_host) {
if (zstr(sub_host)) {
sub_host = to_host;
}
@@ -1270,7 +1247,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
}
if (contact && exptime && v_event && *v_event) {
char *exp_var;
uint32_t exp_var;
uint32_t exp_max_deviation_var;
char *allow_multireg = NULL;
int auto_connectile = 0;
@@ -1363,12 +1341,24 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
}
}
if ((exp_var = switch_event_get_header(*v_event, "sip-force-expires"))) {
int tmp = atoi(exp_var);
if (tmp > 0) {
exptime = tmp;
if ( (( exp_var = atoi(switch_event_get_header_nil(*v_event, "sip-force-expires")) )) ||
(( exp_var = profile->sip_force_expires )) ) {
if (exp_var > 0) {
exptime = exp_var;
}
}
if ( (( exp_max_deviation_var = atoi(switch_event_get_header_nil(*v_event, "sip-expires-max-deviation")) )) ||
(( exp_max_deviation_var = profile->sip_expires_max_deviation )) ) {
if (exp_max_deviation_var > 0) {
int exp_deviation;
srand( (unsigned) ( (unsigned)(intptr_t)switch_thread_self() + switch_micro_time_now() ) );
/* random number between negative exp_max_deviation_var and positive exp_max_deviation_var: */
exp_deviation = ( rand() % ( exp_max_deviation_var * 2 ) ) - exp_max_deviation_var;
exptime += exp_deviation;
}
}
}
if (auth_res != AUTH_OK && auth_res != AUTH_RENEWED && !stale) {
@@ -1489,18 +1479,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
username = switch_event_get_header(auth_params, "sip_auth_username");
realm = switch_event_get_header(auth_params, "sip_auth_realm");
}
if (auth_res != AUTH_RENEWED) {
if (auth_res != AUTH_RENEWED || !multi_reg) {
if (multi_reg) {
if (delete_subs) {
if (reg_count == 1) {
sql = switch_mprintf("update sip_subscriptions set expires=%ld where sip_user='%q' and sip_host='%q' and contact='%q'",
(long) switch_epoch_time_now(NULL), to_user, sub_host, contact_str);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
}
if (multi_reg_contact) {
sql =
switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q' and contact='%q'", to_user, reg_host, contact_str);
@@ -1508,10 +1488,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
sql = switch_mprintf("delete from sip_registrations where call_id='%q'", call_id);
}
} else {
if (delete_subs) {
sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q'", to_user, sub_host);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", to_user, reg_host);
}
switch_mutex_lock(profile->ireg_mutex);
@@ -1544,14 +1520,19 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
sql = switch_mprintf("insert into sip_registrations "
"(call_id,sip_user,sip_host,presence_hosts,contact,status,rpid,expires,"
"user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm,"
"mwi_user,mwi_host, orig_server_host, orig_hostname) "
"values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q')",
call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : reg_host,
"mwi_user,mwi_host, orig_server_host, orig_hostname, sub_host) "
"values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q','%q')",
call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : "",
contact_str, reg_desc, rpid, (long) switch_epoch_time_now(NULL) + (long) exptime + 60,
agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm,
mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname);
mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname, sub_host);
} else {
sql = switch_mprintf("update sip_registrations set expires = %ld where sip_user='%q' and sip_host='%q' and contact='%q'", (long) switch_epoch_time_now(NULL) + (long) exptime + 60, to_user, reg_host, contact_str);
sql = switch_mprintf("update sip_registrations set "
"sub_host='%q', network_ip='%q',network_port='%q',"
"expires = %ld where sip_user='%q' and sip_host='%q' and contact='%q'",
sub_host, network_ip, network_port_c,
(long) switch_epoch_time_now(NULL) + (long) exptime + 60,
to_user, reg_host, contact_str);
}
if (sql) {
@@ -1573,7 +1554,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "profile-name", profile->name);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-user", to_user);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "from-host", reg_host);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "presence-hosts", profile->presence_hosts ? profile->presence_hosts : reg_host);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "presence-hosts", profile->presence_hosts ? profile->presence_hosts : "n/a");
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "contact", contact_str);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "call-id", call_id);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "rpid", rpid);
@@ -1596,38 +1577,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
"Register:\nFrom: [%s@%s]\nContact: [%s]\nExpires: [%ld]\n", to_user, reg_host, contact_str, (long) exptime);
}
#if 0
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent",
(sip && sip->sip_user_agent) ? sip->sip_user_agent->g_string : "unknown");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, sub_host);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Registered");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
switch_event_fire(&event);
}
if (sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER) ||
(reg_count == 1 && sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER))) {
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "sip");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, sub_host);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s@%s", to_user, sub_host);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Registered");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_subtype", "probe");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
switch_event_fire(&event);
}
}
#endif
} else {
int send = 1;
@@ -1649,18 +1598,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
switch_event_fire(&event);
}
#if 0
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "sip");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s+%s@%s", SOFIA_CHAT_PROTO, to_user, sub_host);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "unavailable");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
switch_event_fire(&event);
}
#endif
if (multi_reg) {
char *icontact, *p;
@@ -1671,17 +1609,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
if ((p = strchr(icontact + 4, ':'))) {
*p = '\0';
}
if (delete_subs) {
if (multi_reg_contact) {
sql =
switch_mprintf("update sip_subscriptions set expires=%ld where sip_user='%q' and sip_host='%q' and contact='%q'",
(long) switch_epoch_time_now(NULL), to_user, sub_host, contact_str);
} else {
sql = switch_mprintf("update sip_subscriptions set expires=%ld where call_id='%q'", (long) switch_epoch_time_now(NULL), call_id);
}
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
if (multi_reg_contact) {
sql =
@@ -1694,12 +1621,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
switch_safe_free(icontact);
} else {
if (delete_subs) {
if ((sql = switch_mprintf("update sip_subscriptions set expires=%ld where sip_user='%q' and sip_host='%q'",
(long) switch_epoch_time_now(NULL), to_user, sub_host))) {
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
}
if ((sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", to_user, reg_host))) {
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
}
@@ -2116,7 +2038,7 @@ void sofia_reg_handle_sip_r_challenge(int status,
if (!var_gateway && realm) {
char rb[512] = "";
char *p = (char *) realm;
while ((*p == '"')) {
while (*p == '"') {
p++;
}
switch_set_string(rb, p);