add wait_for_bye_transaction config parameter, fixes auth of BYE

sayer/1.4-spce2.6
Stefan Sayer 15 years ago
parent b8aef4d13d
commit 51cae30c0c

@ -105,6 +105,8 @@ AmSipDialog::provisional_100rel AmConfig::rel100 = REL100_SUPPORTED;
vector <string> AmConfig::CodecOrder;
bool AmConfig::WaitForByeTransaction = false;
Dtmf::InbandDetectorType
AmConfig::DefaultDTMFDetector = Dtmf::SEMSInternal;
bool AmConfig::IgnoreSIGCHLD = true;
@ -452,6 +454,10 @@ int AmConfig::readConfiguration()
}
}
if(cfg.hasParameter("wait_for_bye_transaction")){
WaitForByeTransaction = (cfg.getParameter("wait_for_bye_transaction") == "yes");
}
// single codec in 200 OK
if(cfg.hasParameter("single_codec_in_ok")){
SingleCodecInOK = (cfg.getParameter("single_codec_in_ok") == "yes");

@ -143,6 +143,8 @@ struct AmConfig
/** If 200 OK reply should be limited to preferred codec only */
static bool SingleCodecInOK;
static vector <string> CodecOrder;
static bool WaitForByeTransaction;
enum ApplicationSelector {
App_RURIUSER,

@ -363,6 +363,11 @@ void AmSipDialog::updateStatus(const AmSipReply& reply)
// there is nothing we can do anymore...
}
}
if((trans_method == "BYE") && (reply.code >= 200)){
// final reply to BYE: Disconnecting -> Disconnected
status = Disconnected;
}
break;
case Pending:
@ -795,7 +800,10 @@ int AmSipDialog::bye(const string& hdrs, int flags)
send_200_ack(it->second);
}
}
status = Disconnected;
if (AmConfig::WaitForByeTransaction)
status = Disconnecting;
else
status = Disconnected;
return sendRequest("BYE", "", "", hdrs, flags);
case Pending:

@ -426,6 +426,16 @@ use_default_signature=yes
#
# dtmf_detector=spandsp
# optional parameter: wait_for_bye_transaction={yes|no}
#
# when SEMS stops a call sending BYE as UAC, this option sets whether
# SEMS waits for the BYE transaction to finish before forgetting the call.
# This may be necessary e.g. to authenticate the BYE request.
#
# default: no
#
# wait_for_bye_transaction=yes
# optional parameter: unhandled_reply_loglevel={error|warn|info|debug|no}
#
# the default application logic implemented in the applications is to stop

Loading…
Cancel
Save