mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
pika-choo i choose you
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@331 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
@@ -211,12 +211,12 @@
|
||||
|
||||
|
||||
#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)); \
|
||||
zap_log(ZAP_LOG_WARNING, "Why bother changing state on %d:%dfrom %s to %s\n", obj->span_id, obj->chan_id, zap_channel_state2str(obj->state), zap_channel_state2str(s)); \
|
||||
} else if (zap_test_flag(obj, ZAP_CHANNEL_READY)) { \
|
||||
int st = obj->state; \
|
||||
zap_channel_set_state(obj, s); \
|
||||
if (obj->state == s) zap_log(ZAP_LOG_DEBUG, "Changing state from %s to %s\n", zap_channel_state2str(st), zap_channel_state2str(s)); \
|
||||
else zap_log(ZAP_LOG_WARNING, "VETO Changing state from %s to %s\n", zap_channel_state2str(st), zap_channel_state2str(s)); \
|
||||
if (obj->state == s) zap_log(ZAP_LOG_DEBUG, "Changing state on %d:%d from %s to %s\n", obj->span_id, obj->chan_id, zap_channel_state2str(st), zap_channel_state2str(s)); \
|
||||
else zap_log(ZAP_LOG_WARNING, "VETO Changing state on %d:%d from %s to %s\n", obj->span_id, obj->chan_id, zap_channel_state2str(st), zap_channel_state2str(s)); \
|
||||
}
|
||||
|
||||
|
||||
@@ -344,7 +344,6 @@ struct zap_channel {
|
||||
zap_event_t event_header;
|
||||
char last_error[256];
|
||||
zio_event_cb_t event_callback;
|
||||
void *mod_data;
|
||||
uint32_t skip_read_frames;
|
||||
zap_buffer_t *dtmf_buffer;
|
||||
zap_buffer_t *digit_buffer;
|
||||
@@ -365,6 +364,7 @@ struct zap_channel {
|
||||
zap_fsk_data_state_t fsk;
|
||||
uint8_t fsk_buf[80];
|
||||
uint32_t ring_count;
|
||||
void *mod_data;
|
||||
struct zap_caller_data caller_data;
|
||||
struct zap_span *span;
|
||||
struct zap_io_interface *zio;
|
||||
@@ -416,7 +416,8 @@ struct zap_span {
|
||||
teletone_multi_tone_t tone_finder[ZAP_TONEMAP_INVALID+1];
|
||||
zap_channel_t channels[ZAP_MAX_CHANNELS_SPAN];
|
||||
zio_channel_outgoing_call_t outgoing_call;
|
||||
void *app_data;
|
||||
void *mod_data;
|
||||
char *type;
|
||||
};
|
||||
|
||||
|
||||
@@ -429,6 +430,7 @@ struct zap_io_interface {
|
||||
zio_open_t open;
|
||||
zio_close_t close;
|
||||
zio_channel_destroy_t channel_destroy;
|
||||
zio_span_destroy_t span_destroy;
|
||||
zio_get_alarms_t get_alarms;
|
||||
zio_command_t command;
|
||||
zio_wait_t wait;
|
||||
@@ -505,6 +507,8 @@ void zap_global_set_default_logger(int level);
|
||||
uint32_t zap_separate_string(char *buf, char delim, char **array, int arraylen);
|
||||
void print_bits(uint8_t *b, int bl, char *buf, int blen, int e, uint8_t ss);
|
||||
void print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen);
|
||||
int zap_hash_equalkeys(void *k1, void *k2);
|
||||
uint32_t zap_hash_hashfromstring(void *ky);
|
||||
ZIO_CODEC_FUNCTION(zio_slin2ulaw);
|
||||
ZIO_CODEC_FUNCTION(zio_ulaw2slin);
|
||||
ZIO_CODEC_FUNCTION(zio_slin2alaw);
|
||||
|
53
libs/freetdm/src/include/zap_pika.h
Normal file
53
libs/freetdm/src/include/zap_pika.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2007, Anthony Minessale II
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of the original author; nor the names of any contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef ZAP_PIKA_H
|
||||
#define ZAP_PIKA_H
|
||||
#include "openzap.h"
|
||||
#include "pikahmpapi.h"
|
||||
/* Openzap PIKA hardware interface functions */
|
||||
zap_status_t pika_init(zap_io_interface_t **zint);
|
||||
zap_status_t pika_destroy(void);
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
* indent-tabs-mode:t
|
||||
* tab-width:4
|
||||
* c-basic-offset:4
|
||||
* End:
|
||||
* For VIM:
|
||||
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
||||
*/
|
@@ -267,10 +267,11 @@ typedef enum {
|
||||
} zap_chan_type_t;
|
||||
|
||||
typedef enum {
|
||||
ZAP_CHANNEL_FEATURE_DTMF = (1 << 0),
|
||||
ZAP_CHANNEL_FEATURE_CODECS = (1 << 1),
|
||||
ZAP_CHANNEL_FEATURE_INTERVAL = (1 << 2),
|
||||
ZAP_CHANNEL_FEATURE_CALLERID = (1 << 3)
|
||||
ZAP_CHANNEL_FEATURE_DTMF_DETECT = (1 << 0),
|
||||
ZAP_CHANNEL_FEATURE_DTMF_GENERATE = (1 << 1),
|
||||
ZAP_CHANNEL_FEATURE_CODECS = (1 << 2),
|
||||
ZAP_CHANNEL_FEATURE_INTERVAL = (1 << 3),
|
||||
ZAP_CHANNEL_FEATURE_CALLERID = (1 << 4)
|
||||
} zap_channel_feature_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -339,6 +340,7 @@ typedef struct zap_span zap_span_t;
|
||||
#define ZIO_OPEN_ARGS (zap_channel_t *zchan)
|
||||
#define ZIO_CLOSE_ARGS (zap_channel_t *zchan)
|
||||
#define ZIO_CHANNEL_DESTROY_ARGS (zap_channel_t *zchan)
|
||||
#define ZIO_SPAN_DESTROY_ARGS (zap_span_t *span)
|
||||
#define ZIO_COMMAND_ARGS (zap_channel_t *zchan, zap_command_t command, void *obj)
|
||||
#define ZIO_WAIT_ARGS (zap_channel_t *zchan, zap_wait_flag_t *flags, int32_t to)
|
||||
#define ZIO_GET_ALARMS_ARGS (zap_channel_t *zchan)
|
||||
@@ -356,6 +358,7 @@ typedef zap_status_t (*zio_configure_t) ZIO_CONFIGURE_ARGS ;
|
||||
typedef zap_status_t (*zio_open_t) ZIO_OPEN_ARGS ;
|
||||
typedef zap_status_t (*zio_close_t) ZIO_CLOSE_ARGS ;
|
||||
typedef zap_status_t (*zio_channel_destroy_t) ZIO_CHANNEL_DESTROY_ARGS ;
|
||||
typedef zap_status_t (*zio_span_destroy_t) ZIO_SPAN_DESTROY_ARGS ;
|
||||
typedef zap_status_t (*zio_get_alarms_t) ZIO_GET_ALARMS_ARGS ;
|
||||
typedef zap_status_t (*zio_command_t) ZIO_COMMAND_ARGS ;
|
||||
typedef zap_status_t (*zio_wait_t) ZIO_WAIT_ARGS ;
|
||||
@@ -373,6 +376,7 @@ typedef zap_status_t (*zio_write_t) ZIO_WRITE_ARGS ;
|
||||
#define ZIO_OPEN_FUNCTION(name) zap_status_t name ZIO_OPEN_ARGS
|
||||
#define ZIO_CLOSE_FUNCTION(name) zap_status_t name ZIO_CLOSE_ARGS
|
||||
#define ZIO_CHANNEL_DESTROY_FUNCTION(name) zap_status_t name ZIO_CHANNEL_DESTROY_ARGS
|
||||
#define ZIO_SPAN_DESTROY_FUNCTION(name) zap_status_t name ZIO_SPAN_DESTROY_ARGS
|
||||
#define ZIO_GET_ALARMS_FUNCTION(name) zap_status_t name ZIO_GET_ALARMS_ARGS
|
||||
#define ZIO_COMMAND_FUNCTION(name) zap_status_t name ZIO_COMMAND_ARGS
|
||||
#define ZIO_WAIT_FUNCTION(name) zap_status_t name ZIO_WAIT_ARGS
|
||||
@@ -410,6 +414,69 @@ typedef struct value zap_hash_val_t;
|
||||
typedef struct zap_bitstream zap_bitstream_t;
|
||||
typedef struct zap_fsk_modulator zap_fsk_modulator_t;
|
||||
|
||||
typedef enum {
|
||||
ZAP_CAUSE_UNALLOCATED = 0,
|
||||
ZAP_CAUSE_SUCCESS = 1,
|
||||
ZAP_CAUSE_NO_ROUTE_TRANSIT_NET = 2,
|
||||
ZAP_CAUSE_NO_ROUTE_DESTINATION = 3,
|
||||
ZAP_CAUSE_CHANNEL_UNACCEPTABLE = 6,
|
||||
ZAP_CAUSE_CALL_AWARDED_DELIVERED = 7,
|
||||
ZAP_CAUSE_NORMAL_CLEARING = 16,
|
||||
ZAP_CAUSE_USER_BUSY = 17,
|
||||
ZAP_CAUSE_NO_USER_RESPONSE = 18,
|
||||
ZAP_CAUSE_NO_ANSWER = 19,
|
||||
ZAP_CAUSE_SUBSCRIBER_ABSENT = 20,
|
||||
ZAP_CAUSE_CALL_REJECTED = 21,
|
||||
ZAP_CAUSE_NUMBER_CHANGED = 22,
|
||||
ZAP_CAUSE_REDIRECTION_TO_NEW_DESTINATION = 23,
|
||||
ZAP_CAUSE_EXCHANGE_ROUTING_ERROR = 25,
|
||||
ZAP_CAUSE_DESTINATION_OUT_OF_ORDER = 27,
|
||||
ZAP_CAUSE_INVALID_NUMBER_FORMAT = 28,
|
||||
ZAP_CAUSE_FACILITY_REJECTED = 29,
|
||||
ZAP_CAUSE_RESPONSE_TO_STATUS_ENQUIRY = 30,
|
||||
ZAP_CAUSE_NORMAL_UNSPECIFIED = 31,
|
||||
ZAP_CAUSE_NORMAL_CIRCUIT_CONGESTION = 34,
|
||||
ZAP_CAUSE_NETWORK_OUT_OF_ORDER = 38,
|
||||
ZAP_CAUSE_NORMAL_TEMPORARY_FAILURE = 41,
|
||||
ZAP_CAUSE_SWITCH_CONGESTION = 42,
|
||||
ZAP_CAUSE_ACCESS_INFO_DISCARDED = 43,
|
||||
ZAP_CAUSE_REQUESTED_CHAN_UNAVAIL = 44,
|
||||
ZAP_CAUSE_PRE_EMPTED = 45,
|
||||
ZAP_CAUSE_FACILITY_NOT_SUBSCRIBED = 50,
|
||||
ZAP_CAUSE_OUTGOING_CALL_BARRED = 52,
|
||||
ZAP_CAUSE_INCOMING_CALL_BARRED = 54,
|
||||
ZAP_CAUSE_BEARERCAPABILITY_NOTAUTH = 57,
|
||||
ZAP_CAUSE_BEARERCAPABILITY_NOTAVAIL = 58,
|
||||
ZAP_CAUSE_SERVICE_UNAVAILABLE = 63,
|
||||
ZAP_CAUSE_BEARERCAPABILITY_NOTIMPL = 65,
|
||||
ZAP_CAUSE_CHAN_NOT_IMPLEMENTED = 66,
|
||||
ZAP_CAUSE_FACILITY_NOT_IMPLEMENTED = 69,
|
||||
ZAP_CAUSE_SERVICE_NOT_IMPLEMENTED = 79,
|
||||
ZAP_CAUSE_INVALID_CALL_REFERENCE = 81,
|
||||
ZAP_CAUSE_INCOMPATIBLE_DESTINATION = 88,
|
||||
ZAP_CAUSE_INVALID_MSG_UNSPECIFIED = 95,
|
||||
ZAP_CAUSE_MANDATORY_IE_MISSING = 96,
|
||||
ZAP_CAUSE_MESSAGE_TYPE_NONEXIST = 97,
|
||||
ZAP_CAUSE_WRONG_MESSAGE = 98,
|
||||
ZAP_CAUSE_IE_NONEXIST = 99,
|
||||
ZAP_CAUSE_INVALID_IE_CONTENTS = 100,
|
||||
ZAP_CAUSE_WRONG_CALL_STATE = 101,
|
||||
ZAP_CAUSE_RECOVERY_ON_TIMER_EXPIRE = 102,
|
||||
ZAP_CAUSE_MANDATORY_IE_LENGTH_ERROR = 103,
|
||||
ZAP_CAUSE_PROTOCOL_ERROR = 111,
|
||||
ZAP_CAUSE_INTERWORKING = 127,
|
||||
ZAP_CAUSE_ORIGINATOR_CANCEL = 487,
|
||||
ZAP_CAUSE_CRASH = 500,
|
||||
ZAP_CAUSE_SYSTEM_SHUTDOWN = 501,
|
||||
ZAP_CAUSE_LOSE_RACE = 502,
|
||||
ZAP_CAUSE_MANAGER_REQUEST = 503,
|
||||
ZAP_CAUSE_BLIND_TRANSFER = 600,
|
||||
ZAP_CAUSE_ATTENDED_TRANSFER = 601,
|
||||
ZAP_CAUSE_ALLOTTED_TIMEOUT = 602,
|
||||
ZAP_CAUSE_USER_CHALLENGE = 603,
|
||||
ZAP_CAUSE_MEDIA_TIMEOUT = 604
|
||||
} zap_call_cause_t;
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
|
Reference in New Issue
Block a user