extension_state.h

Go to the documentation of this file.
00001 /* vim: set et sw=3 tw=0 fo=croqlaw cino=t0:
00002  *
00003  * Astxx, the Asterisk C++ API and Utility Library.
00004  * Copyright (C) 2005-2007  Matthew A. Nicholson
00005  * Copyright (C) 2005-2007  Digium, Inc.
00006  * 
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License version 2.1 as published by the Free Software Foundation.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00027 #ifndef ASTXX_MANAGER_ACTION_EXTENSION_STATE_H
00028 #define ASTXX_MANAGER_ACTION_EXTENSION_STATE_H
00029 
00030 #include <astxx/manager/basic_action.h>
00031 #include <astxx/manager/message.h>
00032 #include <string>
00033 #include <boost/lexical_cast.hpp>
00034 
00035 namespace astxx {
00036    namespace manager {
00037       namespace action {
00038          using boost::lexical_cast;
00039 
00044          class extension_state : public basic_action {
00045             public:
00051                extension_state(const std::string& context, const std::string& exten)
00052                   : context(context), exten(exten) {
00053                }
00054          
00060                extension_state(const std::string& context, unsigned int exten)
00061                   : context(context), exten(lexical_cast<std::string>(exten)) {
00062                }
00063                
00064                message::action action() const {
00065                   message::action action("ExtensionState");
00066                   action["Context"] = context;
00067                   action["Exten"] = exten;
00068 
00069                   return action;
00070                }
00071 
00072             private:
00073                std::string context;
00074                std::string exten;
00075          };
00076       }
00077    }
00078 }
00079 
00080 #endif

Generated on Thu Jul 3 01:32:42 2008 for Astxx by  doxygen 1.5.6