mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-15 07:44:13 +00:00
sangoma api probably working
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@274 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
1 parent
441b487329
commit
5b432cdb8a
5 files changed
+180
-86
No files matched your search
@@ -172,6 +172,7 @@
|
||||
\return true value if the object has the flags defined
|
||||
*/
|
||||
#define zap_test_flag(obj, flag) ((obj)->flags & flag)
|
||||
#define zap_test_pflag(obj, flag) ((obj)->pflags & flag)
|
||||
|
||||
/*!
|
||||
\brief Set a flag on an arbitrary object
|
||||
@@ -184,6 +185,12 @@
|
||||
(obj)->flags |= (flag); \
|
||||
zap_mutex_unlock(obj->mutex);
|
||||
|
||||
#define zap_set_pflag(obj, flag) (obj)->pflags |= (flag)
|
||||
#define zap_set_pflag_locked(obj, flag) assert(obj->mutex != NULL); \
|
||||
zap_mutex_lock(obj->mutex); \
|
||||
(obj)->pflags |= (flag); \
|
||||
zap_mutex_unlock(obj->mutex);
|
||||
|
||||
/*!
|
||||
\brief Clear a flag on an arbitrary object while locked
|
||||
\command obj the object to test
|
||||
@@ -193,6 +200,11 @@
|
||||
|
||||
#define zap_clear_flag_locked(obj, flag) assert(obj->mutex != NULL); zap_mutex_lock(obj->mutex); (obj)->flags &= ~(flag); zap_mutex_unlock(obj->mutex);
|
||||
|
||||
#define zap_clear_pflag(obj, flag) (obj)->pflags &= ~(flag)
|
||||
|
||||
#define zap_clear_pflag_locked(obj, flag) assert(obj->mutex != NULL); zap_mutex_lock(obj->mutex); (obj)->pflags &= ~(flag); zap_mutex_unlock(obj->mutex);
|
||||
|
||||
|
||||
#define zap_set_state_locked(obj, s) if ( obj->state == s ) { \
|
||||
zap_log(ZAP_LOG_WARNING, "Why bother changing state from %s to %s\n", zap_channel_state2str(obj->state), zap_channel_state2str(s)); \
|
||||
} else if (zap_test_flag(obj, ZAP_CHANNEL_READY)) { \
|
||||
@@ -311,6 +323,7 @@ struct zap_channel {
|
||||
zap_chan_type_t type;
|
||||
zap_socket_t sockfd;
|
||||
zap_channel_flag_t flags;
|
||||
uint32_t pflags;
|
||||
zap_channel_feature_t features;
|
||||
zap_codec_t effective_codec;
|
||||
zap_codec_t native_codec;
|
||||
@@ -334,6 +347,7 @@ struct zap_channel {
|
||||
uint32_t dtmf_off;
|
||||
teletone_generation_session_t tone_session;
|
||||
zap_time_t last_event_time;
|
||||
zap_time_t ring_time;
|
||||
char tokens[ZAP_MAX_TOKENS+1][ZAP_TOKEN_STRLEN];
|
||||
uint8_t needed_tones[ZAP_TONEMAP_INVALID];
|
||||
uint8_t detected_tones[ZAP_TONEMAP_INVALID];
|
||||
|
||||
@@ -123,9 +123,9 @@ typedef enum {
|
||||
ZAP_ANALOG_START_KEWL,
|
||||
ZAP_ANALOG_START_LOOP,
|
||||
ZAP_ANALOG_START_GROUND,
|
||||
ZAP_ANALOG_START_INVALID
|
||||
ZAP_ANALOG_START_NA
|
||||
} zap_analog_start_type_t;
|
||||
#define START_TYPE_STRINGS "KEWL", "LOOP", "GROUND", "INVALID"
|
||||
#define START_TYPE_STRINGS "KEWL", "LOOP", "GROUND", "NA"
|
||||
ZAP_STR2ENUM_P(zap_str2zap_analog_start_type, zap_analog_start_type2str, zap_analog_start_type_t)
|
||||
|
||||
typedef enum {
|
||||
@@ -136,9 +136,10 @@ typedef enum {
|
||||
ZAP_OOB_FLASH,
|
||||
ZAP_OOB_RING_START,
|
||||
ZAP_OOB_RING_STOP,
|
||||
ZAP_OOB_NOOP,
|
||||
ZAP_OOB_INVALID
|
||||
} zap_oob_event_t;
|
||||
#define OOB_STRINGS "DTMF", "ONHOOK", "OFFHOOK", "WINK", "FLASH", "RING_START", "RING_STOP", "INVALID"
|
||||
#define OOB_STRINGS "DTMF", "ONHOOK", "OFFHOOK", "WINK", "FLASH", "RING_START", "RING_STOP", "NOOP", "INVALID"
|
||||
ZAP_STR2ENUM_P(zap_str2zap_oob_event, zap_oob_event2str, zap_oob_event_t)
|
||||
|
||||
typedef enum {
|
||||
@@ -257,7 +258,6 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
ZAP_CHANNEL_STATE_DOWN,
|
||||
ZAP_CHANNEL_STATE_UP,
|
||||
ZAP_CHANNEL_STATE_HANGUP,
|
||||
ZAP_CHANNEL_STATE_HOLD,
|
||||
ZAP_CHANNEL_STATE_DIALTONE,
|
||||
@@ -265,7 +265,6 @@ typedef enum {
|
||||
ZAP_CHANNEL_STATE_RING,
|
||||
ZAP_CHANNEL_STATE_BUSY,
|
||||
ZAP_CHANNEL_STATE_ATTN,
|
||||
ZAP_CHANNEL_STATE_IDLE,
|
||||
ZAP_CHANNEL_STATE_GENRING,
|
||||
ZAP_CHANNEL_STATE_DIALING,
|
||||
ZAP_CHANNEL_STATE_GET_CALLERID,
|
||||
@@ -274,11 +273,13 @@ typedef enum {
|
||||
ZAP_CHANNEL_STATE_RESTART,
|
||||
ZAP_CHANNEL_STATE_PROGRESS_MEDIA,
|
||||
ZAP_CHANNEL_STATE_PROGRESS,
|
||||
ZAP_CHANNEL_STATE_IDLE,
|
||||
ZAP_CHANNEL_STATE_UP,
|
||||
ZAP_CHANNEL_STATE_INVALID
|
||||
} zap_channel_state_t;
|
||||
#define CHANNEL_STATE_STRINGS "DOWN", "UP", "HANGUP", "HOLD", "DIALTONE", "COLLECT", \
|
||||
"RING", "BUSY", "ATTN", "IDLE", "GENRING", "DIALING", "GET_CALLERID", "CALLWAITING", \
|
||||
"TERMINATING", "RESTART", "PROGRESS_MEDIA", "PROGRESS", "INVALID"
|
||||
#define CHANNEL_STATE_STRINGS "DOWN", "HANGUP", "HOLD", "DIALTONE", "COLLECT", \
|
||||
"RING", "BUSY", "ATTN", "GENRING", "DIALING", "GET_CALLERID", "CALLWAITING", \
|
||||
"TERMINATING", "RESTART", "PROGRESS_MEDIA", "PROGRESS", "IDLE", "UP", "INVALID"
|
||||
ZAP_STR2ENUM_P(zap_str2zap_channel_state, zap_channel_state2str, zap_channel_state_t)
|
||||
|
||||
typedef enum {
|
||||
|
||||
Reference in new issue
Block a user