bool MonLogAction::execute(AmSession* sess, 
			   DSMCondition::EventType event,
			   map<string,string>* event_params) {
  GET_SCSESSION();

  string prop = resolveVars(par1, sess, sc_sess, event_params);
  string val  = resolveVars(par2, sess, sc_sess, event_params);
  
  MONITORING_LOG(sess->getLocalTag().c_str(), prop.c_str(), val.c_str());

  return false;
}
void AmB2ABCallerSession::relayEvent(AmEvent* ev)
{
  if(other_id.empty()){
    B2ABConnectLegEvent* co_ev  = dynamic_cast<B2ABConnectLegEvent*>(ev);   
    if( co_ev ) {
      setupCalleeSession(createCalleeSession(), co_ev);
      if (other_id.length()) {
	MONITORING_LOG(getLocalTag().c_str(), "b2b_leg", other_id.c_str());
      }
    }
  }

  AmB2ABSession::relayEvent(ev);
}
Example #3
0
void ConferenceDialog::setupAudio()
{
  if(!ConferenceFactory::JoinSound.empty()) {
	
    JoinSound.reset(new AmAudioFile());
    if(JoinSound->open(ConferenceFactory::JoinSound,
		       AmAudioFile::Read))
      JoinSound.reset(0);
  }

  if(!ConferenceFactory::DropSound.empty()) {
	
    DropSound.reset(new AmAudioFile());
    if(DropSound->open(ConferenceFactory::DropSound,
		       AmAudioFile::Read))
      DropSound.reset(0);
  }


  play_list.close();// !!!

  if(dialout_channel.get()){

    DBG("adding dialout_channel to the playlist (dialedout = %i)\n",dialedout);
    play_list.addToPlaylist(new AmPlaylistItem(dialout_channel.get(),
					       dialout_channel.get()));
  }
  else {

    channel.reset(AmConferenceStatus::getChannel(conf_id,getLocalTag()));

    play_list.addToPlaylist(new AmPlaylistItem(channel.get(),
					       channel.get()));
  }

  setInOut(&play_list,&play_list);
    
  setCallgroup(conf_id);
  
  MONITORING_LOG(getLocalTag().c_str(), "conf_id", conf_id.c_str());
	
  if(dialedout || !allow_dialout) {
    DBG("Dialout not enabled or dialout channel. Disabling DTMF detection.\n");
    setDtmfDetectionEnabled(false);
  }
}
void AmB2BCallerSession::relayEvent(AmEvent* ev)
{
  if(other_id.empty()){

    if(dynamic_cast<B2BEvent*>(ev)){

      B2BSipEvent*     sip_ev = dynamic_cast<B2BSipEvent*>(ev);
      B2BConnectEvent* co_ev  = dynamic_cast<B2BConnectEvent*>(ev);
	    
      if( (sip_ev && sip_ev->forward) || co_ev ) {
	createCalleeSession();
	if (other_id.length()) {
	  MONITORING_LOG(getLocalTag().c_str(), "b2b_leg", other_id.c_str());
	}
      }
    }
  }

  AmB2BSession::relayEvent(ev);
}
Example #5
0
int AmB2BCallerSession::relayEvent(AmEvent* ev)
{
  if(getOtherId().empty() && !getStopped()){

    bool create_callee = false;
    B2BSipEvent* sip_ev = dynamic_cast<B2BSipEvent*>(ev);
    if (sip_ev && sip_ev->forward)
      create_callee = true;
    else
      create_callee = dynamic_cast<B2BConnectEvent*>(ev) != NULL;

    if (create_callee) {
      createCalleeSession();
      if (getOtherId().length()) {
	MONITORING_LOG(getLocalTag().c_str(), "b2b_leg", getOtherId().c_str());
      }
    }

  }

  return AmB2BSession::relayEvent(ev);
}
void AmB2ABCallerSession::setupCalleeSession(AmB2ABCalleeSession* callee_session,
					     B2ABConnectLegEvent* ev) 
{

  if (NULL == callee_session)
    return;

  other_id = AmSession::getNewId();
  //  return;
  assert(callee_session);

  AmSipDialog& callee_dlg = callee_session->dlg;
  callee_dlg.callid       = AmSession::getNewId() + "@" + AmConfig::LocalIP;
  callee_dlg.local_tag    = other_id; 


  MONITORING_LOG(other_id.c_str(), 
		 "dir",  "out");

  callee_session->start();

  AmSessionContainer* sess_cont = AmSessionContainer::instance();
  sess_cont->addSession(other_id,callee_session);
}