Commit aceb76b1 authored by Simon Morlat's avatar Simon Morlat

Don't remove x-target-uris header if not target uris are resolved through...

Don't remove x-target-uris header if not target uris are resolved through registrar db, so that the fallback route mecanism can expedite the request to the fallback proxy WITH the x-target-uris header.
Clarify documentation of resolve-route parameter.
Remove dummy xcode project.
parent ce4f8f26
This diff is collapsed.
//
// main.cpp
// dummy
//
// Created by jeh on 24/09/2014.
// Copyright (c) 2014 Belledonne Communications. All rights reserved.
//
#include <iostream>
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
return 0;
}
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXContainerItemProxy section */
225C6CF619D2FBD7009ED695 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 225C6CF219D2FBD6009ED695 /* dummy.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 225C6CE819D2FBD6009ED695;
remoteInfo = dummy;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
225C6BC319D2F883009ED695 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
225C6BC519D2F883009ED695 /* dummy */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dummy; sourceTree = BUILT_PRODUCTS_DIR; };
225C6CF219D2FBD6009ED695 /* dummy.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = dummy.xcodeproj; path = dummy/dummy.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
225C6BC219D2F883009ED695 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
225C6BB619D2F80E009ED695 = {
isa = PBXGroup;
children = (
225C6CF219D2FBD6009ED695 /* dummy.xcodeproj */,
225C6BC619D2F883009ED695 /* Products */,
);
sourceTree = "<group>";
};
225C6BC619D2F883009ED695 /* Products */ = {
isa = PBXGroup;
children = (
225C6BC519D2F883009ED695 /* dummy */,
);
name = Products;
sourceTree = "<group>";
};
225C6CF319D2FBD6009ED695 /* Products */ = {
isa = PBXGroup;
children = (
225C6CF719D2FBD7009ED695 /* dummy */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXLegacyTarget section */
225C6BBB19D2F80E009ED695 /* flex */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "$(ACTION) PATH=/opt/local/bin:$PATH";
buildConfigurationList = 225C6BBE19D2F80E009ED695 /* Build configuration list for PBXLegacyTarget "flex" */;
buildPhases = (
);
buildToolPath = /usr/bin/make;
buildWorkingDirectory = "/Volumes/Macintosh_HD/Users/jehanmonnier/workspaces/workspace-flexisip/flexisip/build";
dependencies = (
);
name = flex;
passBuildSettingsInEnvironment = 1;
productName = flex;
};
/* End PBXLegacyTarget section */
/* Begin PBXNativeTarget section */
225C6BC419D2F883009ED695 /* dummy */ = {
isa = PBXNativeTarget;
buildConfigurationList = 225C6BCA19D2F883009ED695 /* Build configuration list for PBXNativeTarget "dummy" */;
buildPhases = (
225C6BC119D2F883009ED695 /* Sources */,
225C6BC219D2F883009ED695 /* Frameworks */,
225C6BC319D2F883009ED695 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = dummy;
productName = dummy;
productReference = 225C6BC519D2F883009ED695 /* dummy */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
225C6BB719D2F80E009ED695 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0600;
ORGANIZATIONNAME = "Belledonne Communications";
TargetAttributes = {
225C6BBB19D2F80E009ED695 = {
CreatedOnToolsVersion = 6.0.1;
};
225C6BC419D2F883009ED695 = {
CreatedOnToolsVersion = 6.0.1;
};
};
};
buildConfigurationList = 225C6BBA19D2F80E009ED695 /* Build configuration list for PBXProject "flex" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 225C6BB619D2F80E009ED695;
productRefGroup = 225C6BC619D2F883009ED695 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 225C6CF319D2FBD6009ED695 /* Products */;
ProjectRef = 225C6CF219D2FBD6009ED695 /* dummy.xcodeproj */;
},
);
projectRoot = "";
targets = (
225C6BBB19D2F80E009ED695 /* flex */,
225C6BC419D2F883009ED695 /* dummy */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
225C6CF719D2FBD7009ED695 /* dummy */ = {
isa = PBXReferenceProxy;
fileType = "compiled.mach-o.executable";
path = dummy;
remoteRef = 225C6CF619D2FBD7009ED695 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXSourcesBuildPhase section */
225C6BC119D2F883009ED695 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
225C6BBC19D2F80E009ED695 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
225C6BBD19D2F80E009ED695 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
name = Release;
};
225C6BBF19D2F80E009ED695 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEBUGGING_SYMBOLS = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
225C6BC019D2F80E009ED695 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
OTHER_CFLAGS = "";
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
225C6BCB19D2F883009ED695 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
225C6BCC19D2F883009ED695 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
225C6BBA19D2F80E009ED695 /* Build configuration list for PBXProject "flex" */ = {
isa = XCConfigurationList;
buildConfigurations = (
225C6BBC19D2F80E009ED695 /* Debug */,
225C6BBD19D2F80E009ED695 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
225C6BBE19D2F80E009ED695 /* Build configuration list for PBXLegacyTarget "flex" */ = {
isa = XCConfigurationList;
buildConfigurations = (
225C6BBF19D2F80E009ED695 /* Debug */,
225C6BC019D2F80E009ED695 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
225C6BCA19D2F883009ED695 /* Build configuration list for PBXNativeTarget "dummy" */ = {
isa = XCConfigurationList;
buildConfigurations = (
225C6BCB19D2F883009ED695 /* Debug */,
225C6BCC19D2F883009ED695 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 225C6BB719D2F80E009ED695 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:flex.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "225C6BBB19D2F80E009ED695"
BuildableName = "flex"
BlueprintName = "flex"
ReferencedContainer = "container:flex.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "225C6BBB19D2F80E009ED695"
BuildableName = "flex"
BlueprintName = "flex"
ReferencedContainer = "container:flex.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "225C6BBB19D2F80E009ED695"
BuildableName = "flex"
BlueprintName = "flex"
ReferencedContainer = "container:flex.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>dummy.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>flex.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>225C6BBB19D2F80E009ED695</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>225C6BC419D2F883009ED695</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
......@@ -52,6 +52,7 @@ void ModuleRouter::onDeclare(GenericStruct *mc) {
{Integer, "message-accept-timeout",
"Maximum duration for accepting a text message if no response is received from any recipients."
" This property is meaningful when message-fork-late is set to true.", "15"},
{String, "fallback-route", "Default route to apply when the recipient is unreachable. [sip:host:port]", ""},
{Boolean, "allow-target-factorization",
"During a call forking, allow several INVITEs going to the same next hop to be grouped into "
"a single one. A proprietary custom header 'X-target-uris' is added to the INVITE to indicate the final "
......@@ -66,8 +67,9 @@ void ModuleRouter::onDeclare(GenericStruct *mc) {
{Boolean, "remove-to-tag", "Remove to tag from 183, 180, and 101 responses to workaround buggy gateways",
"false"},
{String, "preroute", "Rewrite username with given value.", ""},
{Boolean, "resolve-routes", "Whether or not to resolve all routes and forward the event to it if it's not us", "false"},
{String, "fallback-route", "Default route to apply when the recipient is unreachable. [sip:host:port]", ""},
{Boolean, "resolve-routes", "Whether or not to resolve next hope in route header against registrar database."
" This is an extension to RFC3261, and should not be used unless in some specific deployment cases."
" A next hope in route header is otherwise resolved through standard DNS procedure by the Forward module.", "false"},
{Boolean, "parent-domain-fallback", "Whether or not to fallback to the parent domain if there is no fallback route set and the recipient is unreachable", "false"},
config_item_end};
mc->addChildrenValues(configs);
......@@ -810,6 +812,14 @@ class TargetUriListFetcher : public ContactUpdateListener,
mListener->onError();
}else{
if (mRecord->count() > 0){
/*
* When contacts are found, we then remove the X-target-uris.
* If no contacts are found, the X-target-uris is left as it is, so that the if a fallback route is specified,
* the proxy pointed by this fallback route will process it.
*/
sip_unknown_t *h = ModuleToolbox::getCustomHeaderByName(mEv->getMsgSip()->getSip(), "X-Target-Uris");
if (h) sip_header_remove(mEv->getMsgSip()->getMsg(), mEv->getMsgSip()->getSip(), (sip_header_t *)h);
/*also add aliases in the ExtendedContact list for the searched AORs, so that they are added to the ForkMap.*/
sip_route_t *iter;
for (iter = mUriList; iter != NULL; iter = iter->r_next) {
......@@ -968,7 +978,6 @@ void ModuleRouter::onRequest(shared_ptr<RequestSipEvent> &ev) {
RegistrarDb::get()->fetch(sipurl, onRoutingListener, mAllowDomainRegistrations, true);
} else {
auto fetcher = make_shared<TargetUriListFetcher>(this, ev, onRoutingListener, h);
sip_header_remove(ms->getMsg(), sip, (sip_header_t *)h);
fetcher->fetch(mAllowDomainRegistrations, true);
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment