Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flexisip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
flexisip
Commits
e7210cbc
Commit
e7210cbc
authored
May 23, 2019
by
Simon Morlat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proprerty to prevent flexisip to send self-generated provisional responses during call forking.
parent
7ca8dc84
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
17 deletions
+23
-17
forkcontext.hh
include/flexisip/forkcontext.hh
+10
-11
forkcallcontext.cc
src/forkcallcontext.cc
+5
-0
forkcontext.cc
src/forkcontext.cc
+0
-6
module-router.cc
src/module-router.cc
+8
-0
No files found.
include/flexisip/forkcontext.hh
View file @
e7210cbc
...
...
@@ -27,17 +27,16 @@ namespace flexisip {
class
OnContactRegisteredListener
;
class
ForkContextConfig
{
public
:
ForkContextConfig
();
int
mDeliveryTimeout
;
/* in seconds, used for "late" forking*/
int
mUrgentTimeout
;
/*timeout for sending buffered urgent or retryable reponses (like 415).*/
int
mPushResponseTimeout
;
/*timeout for receiving response to push */
bool
mForkLate
;
bool
mTreatAllErrorsAsUrgent
;
/*treat all SIP response code as urgent replies in the fork mechanism.*/
bool
mForkNoGlobalDecline
;
bool
mTreatDeclineAsUrgent
;
/*treat 603 declined as a urgent response, only useful is mForkNoGlobalDecline==true*/
int
mCurrentBranchesTimeout
;
/*timeout for receiving response on current branches*/
struct
ForkContextConfig
{
int
mDeliveryTimeout
=
0
;
/* in seconds, used for "late" forking*/
int
mUrgentTimeout
=
5
;
/*timeout for sending buffered urgent or retryable reponses (like 415).*/
int
mPushResponseTimeout
=
0
;
/*timeout for receiving response to push */
int
mCurrentBranchesTimeout
=
0
;
/*timeout for receiving response on current branches*/
bool
mForkLate
=
false
;
bool
mTreatAllErrorsAsUrgent
=
false
;
/*treat all SIP response code as urgent replies in the fork mechanism.*/
bool
mForkNoGlobalDecline
=
false
;
bool
mTreatDeclineAsUrgent
=
false
;
/*treat 603 declined as a urgent response, only useful is mForkNoGlobalDecline==true*/
bool
mPermitSelfGeneratedProvisionalResponse
=
true
;
/* Self explicit. Ex: 110 Push sent, 180 Ringing*/
};
class
ForkContext
;
...
...
src/forkcallcontext.cc
View file @
e7210cbc
...
...
@@ -158,6 +158,11 @@ void ForkCallContext::onResponse(const shared_ptr<BranchInfo> &br, const shared_
// This is actually called when we want to simulate a ringing event by sending a 180, or for example to signal the caller that we've sent
// a push notification.
void
ForkCallContext
::
sendResponse
(
int
code
,
char
const
*
phrase
)
{
if
(
!
mCfg
->
mPermitSelfGeneratedProvisionalResponse
){
LOGD
(
"ForkCallContext::sendResponse(): self-generated provisional response are disabled by configuration."
);
return
;
}
int
previousCode
=
getLastResponseCode
();
if
(
previousCode
>
code
||
!
mIncoming
){
/* Don't send a response with status code lesser than last transmitted response. */
...
...
src/forkcontext.cc
View file @
e7210cbc
...
...
@@ -28,12 +28,6 @@ const int ForkContext::sUrgentCodes[] = {401, 407, 415, 420, 484, 488, 606, 603,
const
int
ForkContext
::
sAllCodesUrgent
[]
=
{
-
1
,
0
};
ForkContextConfig
::
ForkContextConfig
()
:
mDeliveryTimeout
(
0
),
mUrgentTimeout
(
5
),
mForkLate
(
false
),
mTreatAllErrorsAsUrgent
(
false
),
mForkNoGlobalDecline
(
false
),
mTreatDeclineAsUrgent
(
false
),
mCurrentBranchesTimeout
(
0
)
{
}
ForkContextListener
::~
ForkContextListener
()
{
}
...
...
src/module-router.cc
View file @
e7210cbc
...
...
@@ -61,6 +61,13 @@ void ModuleRouter::onDeclare(GenericStruct *mc) {
"targets of the "
"INVITE."
,
"false"
},
{
Boolean
,
"permit-self-generated-provisional-response"
,
"Whether the proxy is allowed to generate and send provisional responses during a call forking process. "
"A typical example for this is the '110 Push sent' emitted by the proxy when at least one push notification has "
"been sent to a target UA while routing an INVITE. "
"Some old versions of Linphone (below linphone-sdk 4.2) suffer from an issue when receiving such kind of provisional "
"responses that don't come from a remote client. This setting is mainly intended to temporarily workaround this situation."
,
"true"
},
{
String
,
"generated-contact-route"
,
"Generate a contact from the TO header and route it to the above destination. [sip:host:port]"
,
""
},
{
String
,
"generated-contact-expected-realm"
,
...
...
@@ -108,6 +115,7 @@ void ModuleRouter::onLoad(const GenericStruct *mc) {
mForkCfg
->
mDeliveryTimeout
=
mc
->
get
<
ConfigInt
>
(
"call-fork-timeout"
)
->
read
();
mForkCfg
->
mTreatDeclineAsUrgent
=
mc
->
get
<
ConfigBoolean
>
(
"treat-decline-as-urgent"
)
->
read
();
mForkCfg
->
mCurrentBranchesTimeout
=
mc
->
get
<
ConfigInt
>
(
"call-fork-current-branches-timeout"
)
->
read
();
mForkCfg
->
mPermitSelfGeneratedProvisionalResponse
=
mc
->
get
<
ConfigBoolean
>
(
"permit-self-generated-provisional-response"
)
->
read
();
//Forking configuration for MESSAGEs
mMessageForkCfg
=
make_shared
<
ForkContextConfig
>
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment