@ -906,14 +906,14 @@ void AmSession::onSipReply(const AmSipReply& reply,
AmSipDialog : : status2str [ old_dlg_status ] ,
AmSipDialog : : status2str [ old_dlg_status ] ,
sess_stopped . get ( ) ? " true " : " false " ) ;
sess_stopped . get ( ) ? " true " : " false " ) ;
DBG ( " negotiate_onreply = %s \n " , negotiate_onreply ? " true " : " false " ) ;
if ( negotiate_onreply ) {
if ( negotiate_onreply ) {
if ( old_dlg_status < AmSipDialog : : Connected ) {
if ( old_dlg_status < AmSipDialog : : Connected ) {
DBG ( " old is < conn \n " ) ;
switch ( dlg . getStatus ( ) ) {
switch ( dlg . getStatus ( ) ) {
case AmSipDialog : : Connected :
case AmSipDialog : : Connected :
DBG ( " case conn \n " ) ;
try {
try {
RTPStream ( ) - > setMonitorRTPTimeout ( true ) ;
RTPStream ( ) - > setMonitorRTPTimeout ( true ) ;
@ -942,7 +942,7 @@ void AmSession::onSipReply(const AmSipReply& reply,
break ;
break ;
case AmSipDialog : : Pending :
case AmSipDialog : : Pending :
DBG ( " case pending \n " ) ;
switch ( reply . code ) {
switch ( reply . code ) {
// todo: 180 with body (remote rbt)
// todo: 180 with body (remote rbt)
case 180 : {
case 180 : {
@ -979,7 +979,13 @@ void AmSession::onSipReply(const AmSipReply& reply,
}
}
} break ;
} break ;
default : break ; // continue waiting.
default : break ; // continue waiting.
}
} break ;
case AmSipDialog : : Disconnected : {
// status change: <Connected -> Disconnected => outbound call failed
onOutboundCallFailed ( reply ) ;
} ; break ;
} // switch dlg status
} // switch dlg status
} // status < Connected
} // status < Connected
} //if negotiate_onreply
} //if negotiate_onreply
@ -1039,6 +1045,11 @@ void AmSession::onBye(const AmSipRequest& req)
setStopped ( ) ;
setStopped ( ) ;
}
}
void AmSession : : onOutboundCallFailed ( const AmSipReply & reply ) {
DBG ( " Outbound call failed. Stopping session. \n " ) ;
setStopped ( ) ;
}
int AmSession : : acceptAudio ( const string & body ,
int AmSession : : acceptAudio ( const string & body ,
const string & hdrs ,
const string & hdrs ,
string * sdp_reply )
string * sdp_reply )