Пример #1
0
void SWPrepaidSIPDialog::process(AmEvent* ev)
{
  AmAudioEvent* audio_ev = dynamic_cast<AmAudioEvent*>(ev);
  if(audio_ev && (audio_ev->event_id == AmAudioEvent::noAudio) && m_state == CC_Teardown) {
    DBG("SWPrepaidSIPDialog::process: Playlist is empty!\n");
    terminateLeg();

    ev->processed = true;
    return;
  }

  AmPluginEvent* plugin_event = dynamic_cast<AmPluginEvent*>(ev);
  if(plugin_event && plugin_event->name == "timer_timeout") {
    int timer_id = plugin_event->data.get(0).asInt();
    if (timer_id == TIMERID_CREDIT_TIMEOUT) {
      DBG("timer timeout, no more credit\n");
      stopAccounting();
      terminateOtherLeg();
      terminateLeg();

      ev->processed = true;
      return;
    }
  }

  AmB2BCallerSession::process(ev);
}
Пример #2
0
void SWPrepaidSIPDialog::onBye(const AmSipRequest& req)
{
  if (m_state == CC_Connected) {
    stopAccounting();
  }
  terminateOtherLeg();
  setStopped();
}
Пример #3
0
void MyCCDialog::onBye(const AmSipRequest& req)
{
  DBG("onBye: stopSession\n");
  if (state == CC_Connected) {
    stopAccounting();
  }
  terminateOtherLeg();
  setStopped();
}
Пример #4
0
void SWPrepaidSIPDialog::onOtherBye(const AmSipRequest& req)
{
  stopAccounting();
  AmB2BCallerSession::onOtherBye(req);
}
Пример #5
0
void MyCCDialog::onOtherBye(const AmSipRequest& req) {
  DBG("onOtherBye\n");
  stopAccounting();
  AmB2BCallerSession::onOtherBye(req); // will stop the session
}