Fixed outbound H.323 calls correctly marking call as answered when fast connect used.
Fixed correct media "frames/packet" for G.711, default to 20ms worth.
This commit is contained in:
parent
468739da29
commit
f8143eedd4
|
@ -310,9 +310,12 @@ bool FSManager::Initialise(switch_loadable_module_interface_t *iface)
|
||||||
OpalMediaFormatList allCodecs = OpalMediaFormat::GetAllRegisteredMediaFormats();
|
OpalMediaFormatList allCodecs = OpalMediaFormat::GetAllRegisteredMediaFormats();
|
||||||
for (OpalMediaFormatList::iterator it = allCodecs.begin(); it != allCodecs.end(); ++it) {
|
for (OpalMediaFormatList::iterator it = allCodecs.begin(); it != allCodecs.end(); ++it) {
|
||||||
if (it->GetMediaType() == OpalMediaType::Audio()) {
|
if (it->GetMediaType() == OpalMediaType::Audio()) {
|
||||||
it->SetOptionInteger(OpalAudioFormat::RxFramesPerPacketOption(), 1);
|
int ms_per_frame = it->GetFrameTime()/it->GetTimeUnits();
|
||||||
it->SetOptionInteger(OpalAudioFormat::TxFramesPerPacketOption(), 1);
|
int frames_in_20_ms = (ms_per_frame+19)/ms_per_frame;
|
||||||
|
it->SetOptionInteger(OpalAudioFormat::RxFramesPerPacketOption(), frames_in_20_ms);
|
||||||
|
it->SetOptionInteger(OpalAudioFormat::TxFramesPerPacketOption(), frames_in_20_ms);
|
||||||
OpalMediaFormat::SetRegisteredMediaFormat(*it);
|
OpalMediaFormat::SetRegisteredMediaFormat(*it);
|
||||||
|
PTRACE(4, "mod_opal\tSet " << *it << " to " << frames_in_20_ms << "frames/packet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // IMPLEMENT_MULTI_FAME_AUDIO
|
#endif // IMPLEMENT_MULTI_FAME_AUDIO
|
||||||
|
@ -602,6 +605,20 @@ bool FSConnection::OnIncoming()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FSConnection::OnEstablished()
|
||||||
|
{
|
||||||
|
OpalLocalConnection::OnEstablished();
|
||||||
|
|
||||||
|
if (switch_channel_direction(m_fsChannel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
|
||||||
|
PTRACE(4, "mod_opal\tOnEstablished for outbound call, checking for media");
|
||||||
|
if (GetMediaStream(OpalMediaType::Audio(), true) != NULL && GetMediaStream(OpalMediaType::Audio(), false) != NULL) {
|
||||||
|
PTRACE(3, "mod_opal\tOnEstablished for outbound call, making call answered");
|
||||||
|
switch_channel_mark_answered(m_fsChannel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FSConnection::OnReleased()
|
void FSConnection::OnReleased()
|
||||||
{
|
{
|
||||||
m_rxAudioOpened.Signal(); // Just in case
|
m_rxAudioOpened.Signal(); // Just in case
|
||||||
|
@ -786,19 +803,27 @@ void FSConnection::OnPatchMediaStream(PBoolean isSource, OpalMediaPatch & patch)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (switch_channel_direction(m_fsChannel) == SWITCH_CALL_DIRECTION_INBOUND) {
|
if (switch_channel_direction(m_fsChannel) == SWITCH_CALL_DIRECTION_INBOUND) {
|
||||||
|
PTRACE(4, "mod_opal\tOnPatchMediaStream for inbound call, flagging media opened");
|
||||||
if (isSource)
|
if (isSource)
|
||||||
m_rxAudioOpened.Signal();
|
m_rxAudioOpened.Signal();
|
||||||
else
|
else
|
||||||
m_txAudioOpened.Signal();
|
m_txAudioOpened.Signal();
|
||||||
}
|
}
|
||||||
else if (GetMediaStream(OpalMediaType::Audio(), !isSource) != NULL) {
|
else {
|
||||||
|
PTRACE(4, "mod_opal\tOnPatchMediaStream for outbound call, checking media");
|
||||||
|
if (GetMediaStream(OpalMediaType::Audio(), !isSource) != NULL) {
|
||||||
// Have open media in both directions.
|
// Have open media in both directions.
|
||||||
if (IsEstablished())
|
if (IsEstablished()) {
|
||||||
|
PTRACE(3, "mod_opal\tOnPatchMediaStream for outbound call, making call answered");
|
||||||
switch_channel_mark_answered(m_fsChannel);
|
switch_channel_mark_answered(m_fsChannel);
|
||||||
else if (!IsReleased())
|
}
|
||||||
|
else if (!IsReleased()) {
|
||||||
|
PTRACE(3, "mod_opal\tOnPatchMediaStream for outbound call, making call pre-answered");
|
||||||
switch_channel_mark_pre_answered(m_fsChannel);
|
switch_channel_mark_pre_answered(m_fsChannel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch_status_t FSConnection::on_init()
|
switch_status_t FSConnection::on_init()
|
||||||
|
|
|
@ -248,6 +248,7 @@ class FSConnection : public OpalLocalConnection
|
||||||
|
|
||||||
virtual bool OnOutgoingSetUp();
|
virtual bool OnOutgoingSetUp();
|
||||||
virtual bool OnIncoming();
|
virtual bool OnIncoming();
|
||||||
|
virtual void OnEstablished();
|
||||||
virtual void OnReleased();
|
virtual void OnReleased();
|
||||||
virtual PBoolean SetAlerting(const PString & calleeName, PBoolean withMedia);
|
virtual PBoolean SetAlerting(const PString & calleeName, PBoolean withMedia);
|
||||||
virtual OpalMediaStream *CreateMediaStream(const OpalMediaFormat &, unsigned, PBoolean);
|
virtual OpalMediaStream *CreateMediaStream(const OpalMediaFormat &, unsigned, PBoolean);
|
||||||
|
|
Loading…
Reference in New Issue