I've never done this before, please let me know how I can improve!
*** yate/libs/ysig/yatesig.h 2018-06-22 09:16:52.781426453 -0230
--- yate-andrew/libs/ysig/yatesig.h 2018-06-21 20:10:01.514867348 -0230
***************
*** 1565,1570 ****
--- 1565,1571 ----
OffHook = 21, // The hook is up
RingBegin = 22, // Start ringing
RingEnd = 23, // Stop ringing
+ NetworkDisconnect = 24, // OSI - Open Switch Interval to signal call end on FXS
RingerOn = 30, // An FXS started the FXO's ringer
RingerOff = 31, // An FXS stopped the FXO's ringer
Wink = 32, // On hook momentarily
*** yate/modules/server/mgcpca.cpp 2018-06-22 09:17:09.213459432 -0230
--- yate-andrew/modules/server/mgcpca.cpp 2018-06-22 09:19:49.669782522 -0230
***************
*** 1993,1998 ****
--- 1993,2000 ----
return sendRequest("D/" + *tone);
}
break;
+ case SignallingCircuitEvent::NetworkDisconnect:
+ return fxs() && sendRequest("L/osi(to=500)"); //MGCP default is 900ms
case SignallingCircuitEvent::GenericTone:
if (params) {
const String* tone = params->getParam(YSTRING("tone"));
*** yate/modules/server/analog.cpp 2018-06-22 09:17:09.197459399 -0230
--- yate-andrew/modules/server/analog.cpp 2018-06-21 20:43:42.843357095 -0230
***************
*** 1711,1716 ****
--- 1712,1719 ----
if (m_callEndedTimer.interval()) {
m_callEndedTimer.start();
m_line->changeState(AnalogLine::CallEnded);
+ Debug(this,DebugAll,"Call ended. Sending OSI via sendEvent(SignallingCircuitEvent::NetworkDisconnected) [%p]",this);
+ m_line->sendEvent(SignallingCircuitEvent::NetworkDisconnect);
if (!setAnnouncement("call-ended",m_callEndedTarget))
ref();
}