/* * Copyright (C) 1997-2000 SpellCaster Telecommunications Inc. * $Id: call.h,v 1.3 2004/08/15 23:22:03 bcrl Exp $ * Released under the GNU Public License. See LICENSE file for details. */ #ifndef CALL_H #define CALL_H #include "d_aps_if.h" #include "ctrlfd.h" extern unsigned int callIdent; class CInterface; class DialResponse_t; class Call : public ctrlfd_die_listener { private: ctrlfd_t *m_cfd; public: CInterface *m_iface; unsigned m_wait_for_hangup; unsigned int ident; /* semi-unique 'handle' for user apps to refer to the call */ channel_t *ch; virtual void ctrlfd_die_notification(ctrlfd_t *cfd) { m_cfd = NULL; } #define MAX_CALL_USERS 16 Call **call_users[MAX_CALL_USERS]; int n_call_users; void CallUser(Call **callp) { if (n_call_users >= MAX_CALL_USERS) *(char *)0 = 0; call_users[n_call_users++] = callp; } void DiscardCallUser(Call **callp) { int i; if (n_call_users <= 0) *(char *)0 = 0; if (*callp != this) *(char *)0 = 0; for (i=0; idie_notify(this); } friend void DialReport(DialResponse_t *dr); }; class DialResponse_t { public: Call *call; int status; char msg[256]; DialResponse_t() { status = 0; msg[0] = 0; call = 0; } DialResponse_t(Call *c) { status = 0; msg[0] = 0; call = c; } }; #endif /* ndef CALL_H */