~davewalker/ubuntu/maverick/asterisk/lp_705014

« back to all changes in this revision

Viewing changes to include/asterisk/channel.h

  • Committer: Bazaar Package Importer
  • Author(s): Kilian Krause
  • Date: 2005-03-09 22:09:05 UTC
  • mto: (1.2.1 upstream) (8.2.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20050309220905-9afy6hcpw96xbr6j
Tags: upstream-1.0.6
ImportĀ upstreamĀ versionĀ 1.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * General Asterisk channel definitions.
5
5
 * 
6
 
 * Copyright (C) 1999, Mark Spencer
 
6
 * Copyright (C) 1999-2004, Digium, Inc.
7
7
 *
8
 
 * Mark Spencer <markster@linux-support.net>
 
8
 * Mark Spencer <markster@digium.com>
9
9
 *
10
10
 * This program is free software, distributed under the terms of
11
11
 * the GNU General Public License
19
19
#include <asterisk/chanvars.h>
20
20
#include <unistd.h>
21
21
#include <setjmp.h>
22
 
#include <pthread.h>
 
22
#if defined(__APPLE__)
 
23
#include <asterisk/poll-compat.h>
 
24
#else
 
25
#include <sys/poll.h>
 
26
#endif
23
27
 
24
28
#if defined(__cplusplus) || defined(c_plusplus)
25
29
extern "C" {
100
104
        /*! Lock, can be used to lock a channel for some operations */
101
105
        ast_mutex_t lock;                       
102
106
        /*! Procedure causing blocking */
103
 
        char *blockproc;                        
 
107
        const char *blockproc;                  
104
108
 
105
109
        /*! Current application */
106
110
        char *appl;                             
148
152
        /*! Malloc'd Dialed Number Identifier */
149
153
        char *dnid;                             
150
154
        /*! Malloc'd Caller ID */
151
 
        char *callerid;                         
 
155
        char *callerid;
152
156
        /*! Malloc'd ANI */
153
157
        char *ani;                      
154
158
        /*! Malloc'd RDNIS */
266
270
                ast_clear_flag(dstchan, mode);
267
271
}       
268
272
 
 
273
struct ast_bridge_config {
 
274
        int play_to_caller;
 
275
        int play_to_callee;
 
276
        int allowredirect_in;
 
277
        int allowredirect_out;
 
278
        int allowdisconnect_in;
 
279
        int allowdisconnect_out;
 
280
        long timelimit;
 
281
        long play_warning;
 
282
        long warning_freq;
 
283
        char *warning_sound;
 
284
        char *end_sound;
 
285
        char *start_sound;
 
286
        int firstpass;
 
287
};
 
288
 
269
289
struct chanmon;
270
290
 
271
291
#define LOAD_OH(oh) {   \
322
342
#define AST_STATE_BUSY          7               
323
343
/*! Digits (or equivalent) have been dialed while offhook */
324
344
#define AST_STATE_DIALING_OFFHOOK       8
 
345
/*! Channel has detected an incoming call and is waiting for ring */
 
346
#define AST_STATE_PRERING       9
325
347
 
326
348
/* Bits 16-32 of state are reserved for flags */
327
349
/*! Do not transmit voice data */
599
621
 * Read a char of text from a channel
600
622
 * Returns 0 on success, -1 on failure
601
623
 */
 
624
 
 
625
int ast_senddigit(struct ast_channel *chan, char digit);
 
626
 
602
627
int ast_recvchar(struct ast_channel *chan, int timeout);
603
628
 
604
629
//! Browse channels in use
606
631
 * \param prev where you want to start in the channel list
607
632
 * Browse the channels currently in use 
608
633
 * Returns the next channel in the list, NULL on end.
 
634
 * If it returns a channel, that channel *has been locked*!
609
635
 */
610
 
struct ast_channel *ast_channel_walk(struct ast_channel *prev);
 
636
struct ast_channel *ast_channel_walk_locked(struct ast_channel *prev);
 
637
 
 
638
//! Get channel by name (locks channel)
 
639
struct ast_channel *ast_get_channel_by_name_locked(char *channame);
611
640
 
612
641
//! Waits for a digit
613
642
/*! 
665
694
 * \param rc destination channel(?)
666
695
 * Bridge two channels (c0 and c1) together.  If an important frame occurs, we return that frame in
667
696
   *rf (remember, it could be NULL) and which channel (0 or 1) in rc */
668
 
int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc);
 
697
//int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc);
 
698
int ast_channel_bridge(struct ast_channel *c0,struct ast_channel *c1,struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc);
669
699
 
670
700
//! Weird function made for call transfers
671
701
/*! 
777
807
   and 1 if supported and requested */
778
808
int ast_transfer(struct ast_channel *chan, char *dest);
779
809
 
 
810
int ast_do_masquerade(struct ast_channel *chan);
 
811
 
780
812
/* Misc. functions below */
781
813
 
 
814
/* Helper function for migrating select to poll */
 
815
static inline int ast_fdisset(struct pollfd *pfds, int fd, int max, int *start)
 
816
{
 
817
        int x;
 
818
        for (x=start ? *start : 0;x<max;x++)
 
819
                if (pfds[x].fd == fd) {
 
820
                        if (start) {
 
821
                                if (x==*start)
 
822
                                        (*start)++;
 
823
                        }
 
824
                        return pfds[x].revents;
 
825
                }
 
826
        return 0;
 
827
}
 
828
 
782
829
//! Waits for activity on a group of channels
783
830
/*! 
784
831
 * \param nfds the maximum number of file descriptors in the sets