当前位置: 首页>>代码示例>>C++>>正文


C++ UserList::get_sms方法代码示例

本文整理汇总了C++中UserList::get_sms方法的典型用法代码示例。如果您正苦于以下问题:C++ UserList::get_sms方法的具体用法?C++ UserList::get_sms怎么用?C++ UserList::get_sms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserList的用法示例。


在下文中一共展示了UserList::get_sms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mh_alarm_bc


//.........这里部分代码省略.........

  if ( time_DToFloat( 0, &diff) > 600)
    return 1;

  // Check if already handled
  if ( event->Info.EventFlags & pwr_mEventFlagsMask_Email) {
    if ( post->email_check( &event->Info.Id))
      return 1;
    else
      post->email_register( &event->Info.Id);
  }
  

  if ( event->Info.EventFlags & pwr_mEventFlagsMask_SMS) {
    if ( post->sms_check( &event->Info.Id))
      return 1;
    else
      post->sms_register( &event->Info.Id);
  }

  post->replace_symbol( str, event->Msg.Receiver);

  rcvnum = dcli_parse( str, ",", "",
		     (char *) rcv_array, sizeof( rcv_array)/sizeof( rcv_array[0]),
		     sizeof( rcv_array[0]), 0);
  
  for ( int i = 0; i < rcvnum; i++) {

    dcli_trim( str, rcv_array[i]);

    s = strrchr( str, '.');
    if ( s) {
      *s = 0;
      strncpy( group, post->systemgroup, sizeof(group));
      strncat( group, ".", sizeof(group));
      strncat( group, str, sizeof(group));
      strncpy( user, s+1, sizeof(user));
    }
    else {
      strncpy( group, post->systemgroup, sizeof(group));
      strncpy( user, str, sizeof(user));
    }
  
    SystemName *sn = new SystemName( group);
    sts = sn->parse();
    if ( EVEN(sts)) {
      delete sn;
      errh_Error( "Post systemgroup parse error, %m", sts);
      continue;
    }

    SystemList *sl = post->udb->find_system( sn);
    delete sn;
    if ( !sl) {
      errh_Error( "No such system group, %s", group);
      continue;
    }

    UserList *ul = (UserList *) sl->find_user( user);
    if ( !ul) {
      errh_Error( "No such user, %s", user);
      continue;
    }
  
    if ( event->Info.EventFlags & pwr_mEventFlagsMask_Email &&
	 strcmp( post->conf->EmailCmd, "") != 0) {
      char address[40];
      pwr_tCmd cmd;
      
      ul->get_email( address, sizeof(address));
      
      post->format_email_text( MsgP, text, sizeof(text));
      post->format_cmd( cmd,  post->conf->EmailCmd, address, text);

      if ( post->conf->Options & pwr_mPostOptionsMask_Log)
	errh_Info( "Email: %s", cmd);

      system( cmd);
      post->conf->SentEmail++;
      
    }
    if ( event->Info.EventFlags & pwr_mEventFlagsMask_SMS &&
	 strcmp( post->conf->SMS_Cmd, "") != 0) {
      char sms[40];
      pwr_tCmd cmd;
    
      ul->get_sms( sms, sizeof(sms));

      post->format_sms_text( MsgP, text, sizeof(text));
      post->format_cmd( cmd,  post->conf->SMS_Cmd, sms, text);
      
      if ( post->conf->Options & pwr_mPostOptionsMask_Log)
	errh_Info( "SMS: %s", cmd);

      system( cmd);
      post->conf->SentSMS++;
    }
  }
  return 1;
}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:101,代码来源:rt_post.cpp


注:本文中的UserList::get_sms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。