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);
}
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();
}
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
}