Merge branch 'master' into smgmaster

This commit is contained in:
Konrad Hammel 2010-11-05 15:04:17 -04:00
commit 6993e4101a
14 changed files with 1026 additions and 404 deletions

View File

@ -63,6 +63,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_sangoma_isdn", "src\f
{93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_r2", "src\ftmod\ftmod_r2\ftmod_r2.vcproj", "{94F04D58-5EB8-4B48-8FE5-75EBF468073B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftmod_r2", "src\ftmod\ftmod_r2\ftmod_r2.2008.vcproj", "{08C3EA27-A51D-47F8-B47D-B189C649CF30}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -158,6 +162,18 @@ Global
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Release|Win32.ActiveCfg = Release|Win32
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Release|Win32.Build.0 = Release|Win32
{B2AF4EA6-0CD7-4529-9EB5-5AF43DB90395}.Release|x64.ActiveCfg = Release|Win32
{94F04D58-5EB8-4B48-8FE5-75EBF468073B}.Debug|Win32.ActiveCfg = Debug|Win32
{94F04D58-5EB8-4B48-8FE5-75EBF468073B}.Debug|Win32.Build.0 = Debug|Win32
{94F04D58-5EB8-4B48-8FE5-75EBF468073B}.Debug|x64.ActiveCfg = Debug|Win32
{94F04D58-5EB8-4B48-8FE5-75EBF468073B}.Release|Win32.ActiveCfg = Release|Win32
{94F04D58-5EB8-4B48-8FE5-75EBF468073B}.Release|Win32.Build.0 = Release|Win32
{94F04D58-5EB8-4B48-8FE5-75EBF468073B}.Release|x64.ActiveCfg = Release|Win32
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Debug|Win32.ActiveCfg = Debug|Win32
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Debug|Win32.Build.0 = Debug|Win32
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Debug|x64.ActiveCfg = Debug|Win32
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Release|Win32.ActiveCfg = Release|Win32
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Release|Win32.Build.0 = Release|Win32
{08C3EA27-A51D-47F8-B47D-B189C649CF30}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -2007,6 +2007,7 @@ static FIO_SIGNAL_CB_FUNCTION(on_r2_signal)
break;
case FTDM_SIGEVENT_PROGRESS:
case FTDM_SIGEVENT_PROGRESS_MEDIA:
{
if ((session = ftdm_channel_get_session(sigmsg->channel, 0))) {
channel = switch_core_session_get_channel(session);

View File

@ -928,12 +928,12 @@ FT_DECLARE(ftdm_status_t) ftdm_span_find(uint32_t id, ftdm_span_t **span)
}
FT_DECLARE(ftdm_status_t) ftdm_span_poll_event(ftdm_span_t *span, uint32_t ms)
FT_DECLARE(ftdm_status_t) ftdm_span_poll_event(ftdm_span_t *span, uint32_t ms, short *poll_events)
{
assert(span->fio != NULL);
if (span->fio->poll_event) {
return span->fio->poll_event(span, ms);
return span->fio->poll_event(span, ms, poll_events);
} else {
ftdm_log(FTDM_LOG_ERROR, "poll_event method not implemented in module %s!", span->fio->name);
}

View File

@ -966,7 +966,7 @@ static void *ftdm_analog_run(ftdm_thread_t *me, void *obj)
int waitms = 1000;
ftdm_status_t status;
if ((status = ftdm_span_poll_event(span, waitms)) != FTDM_FAIL) {
if ((status = ftdm_span_poll_event(span, waitms, NULL)) != FTDM_FAIL) {
errs = 0;
}

View File

@ -657,7 +657,7 @@ static void *ftdm_analog_em_run(ftdm_thread_t *me, void *obj)
int waitms = 10;
ftdm_status_t status;
status = ftdm_span_poll_event(span, waitms);
status = ftdm_span_poll_event(span, waitms, NULL);
switch(status) {
case FTDM_SUCCESS:

View File

@ -1558,7 +1558,7 @@ static __inline__ void check_events(ftdm_span_t *span)
{
ftdm_status_t status;
status = ftdm_span_poll_event(span, 5);
status = ftdm_span_poll_event(span, 5, NULL);
switch(status) {
case FTDM_SUCCESS:

View File

@ -907,7 +907,7 @@ static __inline__ void check_events(ftdm_span_t *span)
{
ftdm_status_t status;
status = ftdm_span_poll_event(span, 5);
status = ftdm_span_poll_event(span, 5, NULL);
switch(status) {
case FTDM_SUCCESS:

View File

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ftmod_r2"
ProjectGUID="{08C3EA27-A51D-47F8-B47D-B189C649CF30}"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\include;&quot;c:\Program Files\openr2\include\openr2&quot;;&quot;C:\Program Files\openr2\include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FTMOD_R2_EXPORTS;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="freetdm.lib openr2.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="&quot;C:\Program Files\openr2\lib&quot;;&quot;$(OutDir)&quot;"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\include;C:\Program Files\openr2\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FTMOD_R2_EXPORTS;"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<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>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\ftmod_r2.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

File diff suppressed because it is too large Load Diff

View File

@ -1725,7 +1725,7 @@ static __inline__ ftdm_status_t check_events(ftdm_span_t *span, int ms_timeout)
ftdm_status_t status;
ftdm_sangoma_boost_data_t *sangoma_boost_data = span->signal_data;
status = ftdm_span_poll_event(span, ms_timeout);
status = ftdm_span_poll_event(span, ms_timeout, NULL);
switch(status) {
case FTDM_SUCCESS:

View File

@ -335,7 +335,26 @@ void ft_to_sngss7_acm (ftdm_channel_t * ftdmchan)
acm.bckCallInd.isdnAccInd.pres = PRSNT_NODEF;
acm.bckCallInd.isdnAccInd.val = ISDNACC_NONISDN;
acm.bckCallInd.echoCtrlDevInd.pres = PRSNT_NODEF;
acm.bckCallInd.echoCtrlDevInd.val = 0x1; /* ec device present */
switch (ftdmchan->caller_data.bearer_capability) {
/**********************************************************************/
case (FTDM_BEARER_CAP_SPEECH):
acm.bckCallInd.echoCtrlDevInd.val = 0x1;
break;
/**********************************************************************/
case (FTDM_BEARER_CAP_64K_UNRESTRICTED):
acm.bckCallInd.echoCtrlDevInd.val = 0x0;
break;
/**********************************************************************/
case (FTDM_BEARER_CAP_3_1KHZ_AUDIO):
acm.bckCallInd.echoCtrlDevInd.val = 0x1;
break;
/**********************************************************************/
default:
SS7_ERROR_CHAN(ftdmchan, "Unknown Bearer capability falling back to speech%s\n", " ");
acm.bckCallInd.echoCtrlDevInd.val = 0x1;
break;
/**********************************************************************/
} /* switch (ftdmchan->caller_data.bearer_capability) */
acm.bckCallInd.sccpMethInd.pres = PRSNT_NODEF;
acm.bckCallInd.sccpMethInd.val = SCCPMTH_NOIND;

View File

@ -132,7 +132,8 @@ uint8_t copy_cgPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCgPtyNum *cgPtyNum)
tmp[0] = ftdm->cid_num.digits[k];
/* check if the digit is a number and that is not null */
while (!(isdigit(tmp[0])) && (tmp[0] != '\0')) {
while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
/* move on to the next value */
k++;
tmp[0] = ftdm->cid_num.digits[k];
@ -141,14 +142,15 @@ uint8_t copy_cgPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCgPtyNum *cgPtyNum)
/* check if tmp is null or a digit */
if (tmp[0] != '\0') {
/* push it into the lower nibble */
lower = atoi(&tmp[0]);
lower = strtol(&tmp[0], (char **)NULL, 16);
/* move to the next digit */
k++;
/* grab a digit from the ftdm digits */
tmp[0] = ftdm->cid_num.digits[k];
/* check if the digit is a number and that is not null */
while (!(isdigit(tmp[0])) && (tmp[0] != '\0')) {
while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
k++;
tmp[0] = ftdm->cid_num.digits[k];
} /* while(!(isdigit(tmp))) */
@ -156,7 +158,7 @@ uint8_t copy_cgPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCgPtyNum *cgPtyNum)
/* check if tmp is null or a digit */
if (tmp[0] != '\0') {
/* push the digit into the upper nibble */
upper = (atoi(&tmp[0])) << 4;
upper = (strtol(&tmp[0], (char **)NULL, 16)) << 4;
} else {
/* there is no upper ... fill in 0 */
upper = 0x0;
@ -243,7 +245,8 @@ uint8_t copy_cdPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCdPtyNum *cdPtyNum)
tmp[0] = ftdm->dnis.digits[k];
/* check if the digit is a number and that is not null */
while (!(isdigit(tmp[0])) && (tmp[0] != '\0')) {
while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
/* move on to the next value */
k++;
tmp[0] = ftdm->dnis.digits[k];
@ -252,14 +255,15 @@ uint8_t copy_cdPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCdPtyNum *cdPtyNum)
/* check if tmp is null or a digit */
if (tmp[0] != '\0') {
/* push it into the lower nibble */
lower = atoi(&tmp[0]);
lower = strtol(&tmp[0], (char **)NULL, 16);
/* move to the next digit */
k++;
/* grab a digit from the ftdm digits */
tmp[0] = ftdm->dnis.digits[k];
/* check if the digit is a number and that is not null */
while (!(isdigit(tmp[0])) && (tmp[0] != '\0')) {
while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
k++;
tmp[0] = ftdm->dnis.digits[k];
} /* while(!(isdigit(tmp))) */
@ -267,7 +271,7 @@ uint8_t copy_cdPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCdPtyNum *cdPtyNum)
/* check if tmp is null or a digit */
if (tmp[0] != '\0') {
/* push the digit into the upper nibble */
upper = (atoi(&tmp[0])) << 4;
upper = (strtol(&tmp[0], (char **)NULL, 16)) << 4;
} else {
/* there is no upper ... fill in ST */
upper = 0xF0;
@ -984,6 +988,7 @@ ftdm_status_t encode_subAddrIE_nsap(const char *subAddr, char *subAddrIE, int ty
/* confirm it is a digit */
if (!isdigit(tmp[0])) {
SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
/* move to the next character in subAddr */
x++;
@ -1068,6 +1073,7 @@ ftdm_status_t encode_subAddrIE_nat(const char *subAddr, char *subAddrIE, int typ
/* confirm it is a hex digit */
while ((!isxdigit(tmp[0])) && (tmp[0] != '\0')) {
SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
/* move to the next character in subAddr */
x++;
tmp[0] = subAddr[x];
@ -1084,6 +1090,7 @@ ftdm_status_t encode_subAddrIE_nat(const char *subAddr, char *subAddrIE, int typ
/* check if the digit is a hex digit and that is not null */
while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
x++;
tmp[0] = subAddr[x];
} /* while(!(isdigit(tmp))) */

View File

@ -899,11 +899,11 @@ FIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
continue; /* should never happen but happens when shutting down */
}
pfds[j] = ftdmchan->mod_data;
inflags[j] = POLLPRI;
inflags[j] = poll_events ? poll_events[j] : POLLPRI;
#else
memset(&pfds[j], 0, sizeof(pfds[j]));
pfds[j].fd = span->channels[i]->sockfd;
pfds[j].events = POLLPRI;
pfds[j].events = poll_events ? poll_events[j] : POLLPRI;
#endif
/* The driver probably should be able to do this wink/flash/ringing by itself this is sort of a hack to make it work! */

View File

@ -459,7 +459,7 @@ struct ftdm_memory_handler {
#define FIO_CHANNEL_GET_SIG_STATUS_ARGS (ftdm_channel_t *ftdmchan, ftdm_signaling_status_t *status)
#define FIO_SPAN_SET_SIG_STATUS_ARGS (ftdm_span_t *span, ftdm_signaling_status_t status)
#define FIO_SPAN_GET_SIG_STATUS_ARGS (ftdm_span_t *span, ftdm_signaling_status_t *status)
#define FIO_SPAN_POLL_EVENT_ARGS (ftdm_span_t *span, uint32_t ms)
#define FIO_SPAN_POLL_EVENT_ARGS (ftdm_span_t *span, uint32_t ms, short *poll_events)
#define FIO_SPAN_NEXT_EVENT_ARGS (ftdm_span_t *span, ftdm_event_t **event)
#define FIO_SIGNAL_CB_ARGS (ftdm_sigmsg_t *sigmsg)
#define FIO_EVENT_CB_ARGS (ftdm_channel_t *ftdmchan, ftdm_event_t *event)
@ -817,12 +817,13 @@ FT_DECLARE(void) ftdm_channel_flush_dtmf(ftdm_channel_t *ftdmchan);
*
* \param span The span to wait events for
* \param ms Milliseconds timeout
* \param poll_events Array of events to poll for, for each channel on the span
*
* \retval FTDM_SUCCESS success (at least one event available)
* \retval FTDM_TIMEOUT Timed out waiting for events
* \retval FTDM_FAIL failure
*/
FT_DECLARE(ftdm_status_t) ftdm_span_poll_event(ftdm_span_t *span, uint32_t ms);
FT_DECLARE(ftdm_status_t) ftdm_span_poll_event(ftdm_span_t *span, uint32_t ms, short *poll_events);
/*!
* \brief Find a span by its id