|
|
|
|
@ -793,19 +793,26 @@ int AmSipDialog::bye(const string& hdrs, int flags)
|
|
|
|
|
switch(status){
|
|
|
|
|
|
|
|
|
|
case Disconnecting:
|
|
|
|
|
case Connected:
|
|
|
|
|
for (TransMap::iterator it=uac_trans.begin();
|
|
|
|
|
it != uac_trans.end(); it++) {
|
|
|
|
|
if (it->second.method == "INVITE"){
|
|
|
|
|
// finish any UAC transaction before sending BYE
|
|
|
|
|
send_200_ack(it->second);
|
|
|
|
|
}
|
|
|
|
|
case Connected: {
|
|
|
|
|
// collect INVITE UAC transactions
|
|
|
|
|
vector<AmSipTransaction> ack_trans;
|
|
|
|
|
for (TransMap::iterator it=uac_trans.begin(); it != uac_trans.end(); it++) {
|
|
|
|
|
if (it->second.method == "INVITE"){
|
|
|
|
|
ack_trans.push_back(it->second);
|
|
|
|
|
}
|
|
|
|
|
if (AmConfig::WaitForByeTransaction)
|
|
|
|
|
status = Disconnecting;
|
|
|
|
|
else
|
|
|
|
|
status = Disconnected;
|
|
|
|
|
return sendRequest("BYE", "", "", hdrs, flags);
|
|
|
|
|
}
|
|
|
|
|
// finish any UAC transaction before sending BYE
|
|
|
|
|
for (vector<AmSipTransaction>::iterator it=
|
|
|
|
|
ack_trans.begin(); it != ack_trans.end(); it++) {
|
|
|
|
|
send_200_ack(*it);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (AmConfig::WaitForByeTransaction)
|
|
|
|
|
status = Disconnecting;
|
|
|
|
|
else
|
|
|
|
|
status = Disconnected;
|
|
|
|
|
return sendRequest("BYE", "", "", hdrs, flags);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case Pending:
|
|
|
|
|
status = Disconnecting;
|
|
|
|
|
|