1 /*
2  * Copyright (C) 2006 iptego GmbH
3  *
4  * This file is part of SEMS, a free SIP media server.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20 #ifndef PY_SEMSB2ABDIALOG_H
21 #define PY_SEMSB2ABDIALOG_H
22 
23 #include "PySems.h"
24 #include "AmApi.h"
25 #include "AmB2ABSession.h"
26 #include "AmPlaylist.h"
27 
28 class PySemsB2ABCalleeDialog;
29 
30 /** \brief pySems wrapper for base of pySems dialog classes */
31 class PySemsB2ABDialog : public AmB2ABCallerSession,
32   public PySemsDialogBase
33 {
34  public:
35   AmPlaylist playlist;
36 
37   PySemsB2ABDialog();
38   virtual ~PySemsB2ABDialog();
39 
40   void onEarlySessionStart();
41   void onSessionStart();
42 
43   // @see AmEventHandler
44   void process(AmEvent* event);
45 
46   void onBeforeDestroy();
47 
48   AmB2ABCalleeSession* createCalleeSession();
49 };
50 
51 /** \brief base class for events in Py-B2AB sessions */
52 struct PySemsB2ABEvent: public B2ABEvent
53 {
54  public:
PySemsB2ABEventPySemsB2ABEvent55  PySemsB2ABEvent(int ev_id)
56    : B2ABEvent(ev_id)
57   {}
58 };
59 
60 /** \brief pySems wrapper for B leg in pysems B2AB session */
61 class PySemsB2ABCalleeDialog : public AmB2ABCalleeSession
62 {
63  public:
PySemsB2ABCalleeDialog(const string & other_local_tag,AmSessionAudioConnector * connector)64  PySemsB2ABCalleeDialog(const string& other_local_tag,
65 			AmSessionAudioConnector* connector)
66    : AmB2ABCalleeSession(other_local_tag, connector) { }
~PySemsB2ABCalleeDialog()67   virtual ~PySemsB2ABCalleeDialog() { }
68  protected:
69   void onB2ABEvent(B2ABEvent* ev);
70 
71   virtual void onPyB2ABEvent(PySemsB2ABEvent* py_ev);
72 };
73 #endif
74