indent
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@205 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
f59addad71
commit
dce12e0eaa
|
@ -90,3 +90,15 @@ uint8_t ulaw_to_alaw(uint8_t ulaw)
|
||||||
}
|
}
|
||||||
/*- End of function --------------------------------------------------------*/
|
/*- End of function --------------------------------------------------------*/
|
||||||
/*- End of file ------------------------------------------------------------*/
|
/*- End of file ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -262,3 +262,15 @@ hashtable_destroy(struct hashtable *h, int free_keys, int free_values)
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -174,3 +174,15 @@ hashtable_iterator_search(struct hashtable_itr *itr,
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -382,3 +382,14 @@ uint8_t ulaw_to_alaw(uint8_t ulaw);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/*- End of file ------------------------------------------------------------*/
|
/*- End of file ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -202,3 +202,14 @@ hashtable_destroy(struct hashtable *h, int free_keys, int free_values);
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -110,3 +110,15 @@ int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -84,3 +84,13 @@ indexFor(unsigned int tablelength, unsigned int hashvalue)
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -235,6 +235,8 @@ struct zap_caller_data {
|
||||||
struct zap_channel {
|
struct zap_channel {
|
||||||
uint32_t span_id;
|
uint32_t span_id;
|
||||||
uint32_t chan_id;
|
uint32_t chan_id;
|
||||||
|
uint32_t physical_span_id;
|
||||||
|
uint32_t physical_chan_id;
|
||||||
zap_chan_type_t type;
|
zap_chan_type_t type;
|
||||||
zap_socket_t sockfd;
|
zap_socket_t sockfd;
|
||||||
zap_channel_flag_t flags;
|
zap_channel_flag_t flags;
|
||||||
|
@ -264,10 +266,10 @@ struct zap_channel {
|
||||||
uint8_t needed_tones[ZAP_TONEMAP_INVALID];
|
uint8_t needed_tones[ZAP_TONEMAP_INVALID];
|
||||||
uint8_t detected_tones[ZAP_TONEMAP_INVALID];
|
uint8_t detected_tones[ZAP_TONEMAP_INVALID];
|
||||||
zap_tonemap_t last_detected_tone;
|
zap_tonemap_t last_detected_tone;
|
||||||
|
|
||||||
uint32_t token_count;
|
uint32_t token_count;
|
||||||
char chan_name[128];
|
char chan_name[128];
|
||||||
char chan_number[32];
|
char chan_number[32];
|
||||||
|
zap_filehandle_t fds[2];
|
||||||
struct zap_caller_data caller_data;
|
struct zap_caller_data caller_data;
|
||||||
struct zap_span *span;
|
struct zap_span *span;
|
||||||
struct zap_io_interface *zio;
|
struct zap_io_interface *zio;
|
||||||
|
@ -384,3 +386,14 @@ ZIO_CODEC_FUNCTION(zio_alaw2ulaw);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#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:
|
||||||
|
*/
|
||||||
|
|
|
@ -425,3 +425,15 @@ static __inline__ int tdmv_api_writemsg_tdm(sng_fd_t fd, void *hdrbuf, int hdrle
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _SANGOMA_TDM_API_H */
|
#endif /* _SANGOMA_TDM_API_H */
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -46,3 +46,14 @@ zap_status_t zap_analog_start(zap_span_t *span);
|
||||||
zap_status_t zap_analog_configure_span(zap_span_t *span, char *tonemap, uint32_t digit_timeout, uint32_t max_dialstr, zio_signal_cb_t sig_cb);
|
zap_status_t zap_analog_configure_span(zap_span_t *span, char *tonemap, uint32_t digit_timeout, uint32_t max_dialstr, zio_signal_cb_t sig_cb);
|
||||||
|
|
||||||
#endif
|
#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:
|
||||||
|
*/
|
||||||
|
|
|
@ -47,3 +47,15 @@ zap_status_t zap_isdn_init(void);
|
||||||
zap_status_t zap_isdn_configure_span(zap_span_t *span, Q921NetUser_t mode, Q931Dialect_t dialect, zio_signal_cb_t sig_cb);
|
zap_status_t zap_isdn_configure_span(zap_span_t *span, Q921NetUser_t mode, Q931Dialect_t dialect, zio_signal_cb_t sig_cb);
|
||||||
|
|
||||||
#endif
|
#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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -39,3 +39,14 @@ zap_status_t skel_init(zap_software_interface_t **zint);
|
||||||
zap_status_t skel_destroy(void);
|
zap_status_t skel_destroy(void);
|
||||||
|
|
||||||
#endif
|
#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:
|
||||||
|
*/
|
||||||
|
|
|
@ -37,3 +37,15 @@ zap_status_t zap_mutex_trylock(zap_mutex_t *mutex);
|
||||||
zap_status_t zap_mutex_unlock(zap_mutex_t *mutex);
|
zap_status_t zap_mutex_unlock(zap_mutex_t *mutex);
|
||||||
|
|
||||||
#endif
|
#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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,12 @@ typedef unsigned __int64 uint64_t;
|
||||||
typedef unsigned __int32 uint32_t;
|
typedef unsigned __int32 uint32_t;
|
||||||
typedef __int32 int32_t;
|
typedef __int32 int32_t;
|
||||||
typedef intptr_t zap_ssize_t;
|
typedef intptr_t zap_ssize_t;
|
||||||
|
typedef int zap_filehandle_t;
|
||||||
#else
|
#else
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
typedef int zap_socket_t;
|
typedef int zap_socket_t;
|
||||||
typedef ssize_t zap_ssize_t;
|
typedef ssize_t zap_ssize_t;
|
||||||
|
typedef int zap_filehandle_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef size_t zap_size_t;
|
typedef size_t zap_size_t;
|
||||||
|
@ -167,8 +169,8 @@ typedef enum {
|
||||||
ZAP_COMMAND_GET_CODEC,
|
ZAP_COMMAND_GET_CODEC,
|
||||||
ZAP_COMMAND_SET_NATIVE_CODEC,
|
ZAP_COMMAND_SET_NATIVE_CODEC,
|
||||||
ZAP_COMMAND_GET_NATIVE_CODEC,
|
ZAP_COMMAND_GET_NATIVE_CODEC,
|
||||||
ZAP_COMMAND_ENABLE_TONE_DETECT,
|
ZAP_COMMAND_ENABLE_DTMF_DETECT,
|
||||||
ZAP_COMMAND_DISABLE_TONE_DETECT,
|
ZAP_COMMAND_DISABLE_DTMF_DETECT,
|
||||||
ZAP_COMMAND_SEND_DTMF,
|
ZAP_COMMAND_SEND_DTMF,
|
||||||
ZAP_COMMAND_SET_DTMF_ON_PERIOD,
|
ZAP_COMMAND_SET_DTMF_ON_PERIOD,
|
||||||
ZAP_COMMAND_GET_DTMF_ON_PERIOD,
|
ZAP_COMMAND_GET_DTMF_ON_PERIOD,
|
||||||
|
@ -180,6 +182,8 @@ typedef enum {
|
||||||
ZAP_COMMAND_ONHOOK,
|
ZAP_COMMAND_ONHOOK,
|
||||||
ZAP_COMMAND_ENABLE_PROGRESS_DETECT,
|
ZAP_COMMAND_ENABLE_PROGRESS_DETECT,
|
||||||
ZAP_COMMAND_DISABLE_PROGRESS_DETECT,
|
ZAP_COMMAND_DISABLE_PROGRESS_DETECT,
|
||||||
|
ZAP_COMMAND_TRACE_INPUT,
|
||||||
|
ZAP_COMMAND_TRACE_OUTPUT,
|
||||||
ZAP_COMMAND_COUNT
|
ZAP_COMMAND_COUNT
|
||||||
} zap_command_t;
|
} zap_command_t;
|
||||||
|
|
||||||
|
@ -322,3 +326,15 @@ typedef struct hashtable_itr zap_hash_itr_t;
|
||||||
typedef struct key zap_hash_key_t;
|
typedef struct key zap_hash_key_t;
|
||||||
typedef struct value zap_hash_val_t;
|
typedef struct value zap_hash_val_t;
|
||||||
#endif
|
#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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -39,3 +39,15 @@ zap_status_t wanpipe_init(zap_io_interface_t **zint);
|
||||||
zap_status_t wanpipe_destroy(void);
|
zap_status_t wanpipe_destroy(void);
|
||||||
|
|
||||||
#endif
|
#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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -229,3 +229,14 @@ zap_status_t zt_init(zap_io_interface_t **zint);
|
||||||
zap_status_t zt_destroy(void);
|
zap_status_t zt_destroy(void);
|
||||||
|
|
||||||
#endif
|
#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:
|
||||||
|
*/
|
||||||
|
|
|
@ -314,3 +314,13 @@ int main(int argc, char *argv[])
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -238,3 +238,14 @@ int sangoma_run_pri(struct sangoma_pri *spri)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -100,3 +100,15 @@ int main(int argc, char *argv[])
|
||||||
zap_global_destroy();
|
zap_global_destroy();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -72,3 +72,14 @@ int main(int argc, char *argv[])
|
||||||
zap_global_destroy();
|
zap_global_destroy();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -41,3 +41,14 @@ int main(int argc, char *argv[])
|
||||||
zap_global_destroy();
|
zap_global_destroy();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -135,7 +135,7 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zap_channel_command(chan, ZAP_COMMAND_ENABLE_TONE_DETECT, &tt) != ZAP_SUCCESS) {
|
if (zap_channel_command(chan, ZAP_COMMAND_ENABLE_DTMF_DETECT, &tt) != ZAP_SUCCESS) {
|
||||||
snprintf(chan->last_error, sizeof(chan->last_error), "error initilizing tone detector!");
|
snprintf(chan->last_error, sizeof(chan->last_error), "error initilizing tone detector!");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -483,6 +483,7 @@ static zap_status_t process_event(zap_span_t *span, zap_event_t *event)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (event->channel->state == ZAP_CHANNEL_STATE_DOWN && !zap_test_flag(event->channel, ZAP_CHANNEL_INTHREAD)) {
|
if (event->channel->state == ZAP_CHANNEL_STATE_DOWN && !zap_test_flag(event->channel, ZAP_CHANNEL_INTHREAD)) {
|
||||||
|
/*zap_channel_command(event->channel, ZAP_COMMAND_TRACE_INPUT, "/tmp/inbound.ul");*/
|
||||||
sig.event_id = ZAP_SIGEVENT_START;
|
sig.event_id = ZAP_SIGEVENT_START;
|
||||||
zap_set_string(event->channel->caller_data.dnis, event->channel->chan_number);
|
zap_set_string(event->channel->caller_data.dnis, event->channel->chan_number);
|
||||||
data->sig_cb(&sig);
|
data->sig_cb(&sig);
|
||||||
|
@ -585,3 +586,13 @@ zap_status_t zap_analog_start(zap_span_t *span)
|
||||||
return zap_thread_create_detached(zap_analog_run, span);
|
return zap_thread_create_detached(zap_analog_run, span);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -332,6 +332,8 @@ zap_status_t zap_span_add_channel(zap_span_t *span, zap_socket_t sockfd, zap_cha
|
||||||
new_chan->span_id = span->span_id;
|
new_chan->span_id = span->span_id;
|
||||||
new_chan->chan_id = span->chan_count;
|
new_chan->chan_id = span->chan_count;
|
||||||
new_chan->span = span;
|
new_chan->span = span;
|
||||||
|
new_chan->fds[0] = -1;
|
||||||
|
new_chan->fds[1] = -1;
|
||||||
zap_mutex_create(&new_chan->mutex);
|
zap_mutex_create(&new_chan->mutex);
|
||||||
zap_buffer_create(&new_chan->digit_buffer, 128, 128, 0);
|
zap_buffer_create(&new_chan->digit_buffer, 128, 128, 0);
|
||||||
zap_set_flag(new_chan, ZAP_CHANNEL_CONFIGURED | ZAP_CHANNEL_READY);
|
zap_set_flag(new_chan, ZAP_CHANNEL_CONFIGURED | ZAP_CHANNEL_READY);
|
||||||
|
@ -689,12 +691,18 @@ zap_status_t zap_channel_outgoing_call(zap_channel_t *zchan)
|
||||||
|
|
||||||
zap_status_t zap_channel_done(zap_channel_t *zchan)
|
zap_status_t zap_channel_done(zap_channel_t *zchan)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
assert(zchan != NULL);
|
assert(zchan != NULL);
|
||||||
|
|
||||||
memset(&zchan->caller_data, 0, sizeof(zchan->caller_data));
|
memset(&zchan->caller_data, 0, sizeof(zchan->caller_data));
|
||||||
zap_clear_flag_locked(zchan, ZAP_CHANNEL_INUSE);
|
zap_clear_flag_locked(zchan, ZAP_CHANNEL_INUSE);
|
||||||
|
for (i = 0; i < 2; i++) {
|
||||||
|
if (zchan->fds[i] > -1) {
|
||||||
|
close(zchan->fds[i]);
|
||||||
|
zchan->fds[i] = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
return ZAP_SUCCESS;
|
return ZAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -780,6 +788,36 @@ zap_status_t zap_channel_command(zap_channel_t *zchan, zap_command_t command, vo
|
||||||
zap_mutex_lock(zchan->mutex);
|
zap_mutex_lock(zchan->mutex);
|
||||||
|
|
||||||
switch(command) {
|
switch(command) {
|
||||||
|
case ZAP_COMMAND_TRACE_INPUT:
|
||||||
|
{
|
||||||
|
char *path = (char *) obj;
|
||||||
|
if (zchan->fds[0] > 0) {
|
||||||
|
close(zchan->fds[0]);
|
||||||
|
zchan->fds[0] = -1;
|
||||||
|
}
|
||||||
|
if ((zchan->fds[0] = open(path, O_WRONLY|O_CREAT|O_TRUNC, 755)) > -1) {
|
||||||
|
GOTO_STATUS(done, ZAP_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
snprintf(zchan->last_error, sizeof(zchan->last_error), "%s", strerror(errno));
|
||||||
|
GOTO_STATUS(done, ZAP_FAIL);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ZAP_COMMAND_TRACE_OUTPUT:
|
||||||
|
{
|
||||||
|
char *path = (char *) obj;
|
||||||
|
if (zchan->fds[1] > 0) {
|
||||||
|
close(zchan->fds[0]);
|
||||||
|
zchan->fds[1] = -1;
|
||||||
|
}
|
||||||
|
if ((zchan->fds[1] = open(path, O_WRONLY|O_CREAT|O_TRUNC, 755)) > -1) {
|
||||||
|
GOTO_STATUS(done, ZAP_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
snprintf(zchan->last_error, sizeof(zchan->last_error), "%s", strerror(errno));
|
||||||
|
GOTO_STATUS(done, ZAP_FAIL);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ZAP_COMMAND_SET_INTERVAL:
|
case ZAP_COMMAND_SET_INTERVAL:
|
||||||
{
|
{
|
||||||
if (!zap_channel_test_feature(zchan, ZAP_CHANNEL_FEATURE_INTERVAL)) {
|
if (!zap_channel_test_feature(zchan, ZAP_CHANNEL_FEATURE_INTERVAL)) {
|
||||||
|
@ -863,7 +901,7 @@ zap_status_t zap_channel_command(zap_channel_t *zchan, zap_command_t command, vo
|
||||||
GOTO_STATUS(done, ZAP_SUCCESS);
|
GOTO_STATUS(done, ZAP_SUCCESS);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ZAP_COMMAND_ENABLE_TONE_DETECT:
|
case ZAP_COMMAND_ENABLE_DTMF_DETECT:
|
||||||
{
|
{
|
||||||
/* if they don't have thier own, use ours */
|
/* if they don't have thier own, use ours */
|
||||||
if (!zap_channel_test_feature(zchan, ZAP_CHANNEL_FEATURE_DTMF)) {
|
if (!zap_channel_test_feature(zchan, ZAP_CHANNEL_FEATURE_DTMF)) {
|
||||||
|
@ -880,7 +918,7 @@ zap_status_t zap_channel_command(zap_channel_t *zchan, zap_command_t command, vo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ZAP_COMMAND_DISABLE_TONE_DETECT:
|
case ZAP_COMMAND_DISABLE_DTMF_DETECT:
|
||||||
{
|
{
|
||||||
if (!zap_channel_test_feature(zchan, ZAP_CHANNEL_FEATURE_DTMF)) {
|
if (!zap_channel_test_feature(zchan, ZAP_CHANNEL_FEATURE_DTMF)) {
|
||||||
zap_tone_type_t tt = ZAP_COMMAND_OBJ_INT;
|
zap_tone_type_t tt = ZAP_COMMAND_OBJ_INT;
|
||||||
|
@ -1216,6 +1254,9 @@ zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *data
|
||||||
}
|
}
|
||||||
|
|
||||||
status = zchan->zio->read(zchan, data, datalen);
|
status = zchan->zio->read(zchan, data, datalen);
|
||||||
|
if (zchan->fds[0]) {
|
||||||
|
write(zchan->fds[0], data, *datalen);
|
||||||
|
}
|
||||||
|
|
||||||
if (status == ZAP_SUCCESS && zap_test_flag(zchan, ZAP_CHANNEL_TRANSCODE) && zchan->effective_codec != zchan->native_codec) {
|
if (status == ZAP_SUCCESS && zap_test_flag(zchan, ZAP_CHANNEL_TRANSCODE) && zchan->effective_codec != zchan->native_codec) {
|
||||||
if (zchan->native_codec == ZAP_CODEC_ULAW && zchan->effective_codec == ZAP_CODEC_SLIN) {
|
if (zchan->native_codec == ZAP_CODEC_ULAW && zchan->effective_codec == ZAP_CODEC_SLIN) {
|
||||||
|
@ -1391,6 +1432,10 @@ zap_status_t zap_channel_write(zap_channel_t *zchan, void *data, zap_size_t data
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (zchan->fds[1]) {
|
||||||
|
write(zchan->fds[1], data, *datalen);
|
||||||
|
}
|
||||||
|
|
||||||
status = zchan->zio->write(zchan, data, datalen);
|
status = zchan->zio->write(zchan, data, datalen);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
@ -1731,3 +1776,13 @@ void print_bits(uint8_t *b, int bl, char *buf, int blen, int e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -250,3 +250,14 @@ zap_status_t zap_isdn_configure_span(zap_span_t *span, Q921NetUser_t mode, Q931D
|
||||||
|
|
||||||
return ZAP_SUCCESS;
|
return ZAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -108,3 +108,15 @@ zap_status_t skel_destroy(void)
|
||||||
{
|
{
|
||||||
return ZAP_FAIL;
|
return ZAP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
|
@ -217,3 +217,14 @@ zap_status_t zap_mutex_unlock(zap_mutex_t *mutex)
|
||||||
#endif
|
#endif
|
||||||
return ZAP_SUCCESS;
|
return ZAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -72,6 +72,8 @@ static unsigned wp_open_range(zap_span_t *span, unsigned spanno, unsigned start,
|
||||||
|
|
||||||
if (sockfd != WP_INVALID_SOCKET && zap_span_add_channel(span, sockfd, type, &chan) == ZAP_SUCCESS) {
|
if (sockfd != WP_INVALID_SOCKET && zap_span_add_channel(span, sockfd, type, &chan) == ZAP_SUCCESS) {
|
||||||
zap_log(ZAP_LOG_INFO, "configuring device s%dc%d as OpenZAP device %d:%d fd:%d\n", spanno, x, chan->span_id, chan->chan_id, sockfd);
|
zap_log(ZAP_LOG_INFO, "configuring device s%dc%d as OpenZAP device %d:%d fd:%d\n", spanno, x, chan->span_id, chan->chan_id, sockfd);
|
||||||
|
chan->physical_span_id = spanno;
|
||||||
|
chan->physical_chan_id = x;
|
||||||
if (type == ZAP_CHAN_TYPE_FXS || type == ZAP_CHAN_TYPE_FXO) {
|
if (type == ZAP_CHAN_TYPE_FXS || type == ZAP_CHAN_TYPE_FXO) {
|
||||||
wanpipe_tdm_api_t tdm_api;
|
wanpipe_tdm_api_t tdm_api;
|
||||||
|
|
||||||
|
@ -532,3 +534,14 @@ zap_status_t wanpipe_destroy(void)
|
||||||
memset(&wanpipe_interface, 0, sizeof(wanpipe_interface));
|
memset(&wanpipe_interface, 0, sizeof(wanpipe_interface));
|
||||||
return ZAP_SUCCESS;
|
return ZAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
|
@ -90,6 +90,9 @@ static unsigned zt_open_range(zap_span_t *span, unsigned start, unsigned end, za
|
||||||
}
|
}
|
||||||
zap_log(ZAP_LOG_INFO, "configuring device %s as OpenZAP device %d:%d fd:%d\n", path, chan->span_id, chan->chan_id, sockfd);
|
zap_log(ZAP_LOG_INFO, "configuring device %s as OpenZAP device %d:%d fd:%d\n", path, chan->span_id, chan->chan_id, sockfd);
|
||||||
|
|
||||||
|
chan->physical_span_id = ztp.span_no;
|
||||||
|
chan->physical_chan_id = ztp.chan_no;
|
||||||
|
|
||||||
if (type == ZAP_CHAN_TYPE_FXS || type == ZAP_CHAN_TYPE_FXO) {
|
if (type == ZAP_CHAN_TYPE_FXS || type == ZAP_CHAN_TYPE_FXO) {
|
||||||
if (ztp.g711_type == ZT_G711_ALAW) {
|
if (ztp.g711_type == ZT_G711_ALAW) {
|
||||||
chan->native_codec = chan->effective_codec = ZAP_CODEC_ALAW;
|
chan->native_codec = chan->effective_codec = ZAP_CODEC_ALAW;
|
||||||
|
@ -559,3 +562,14 @@ zap_status_t zt_destroy(void)
|
||||||
memset(&zt_interface, 0, sizeof(zt_interface));
|
memset(&zt_interface, 0, sizeof(zt_interface));
|
||||||
return ZAP_SUCCESS;
|
return ZAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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:
|
||||||
|
*/
|
||||||
|
|
Loading…
Reference in New Issue