mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
add some options
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@372 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
@@ -369,6 +369,10 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj)
|
||||
zap_channel_command(zchan, ZAP_COMMAND_GENERATE_RING_OFF, NULL);
|
||||
}
|
||||
|
||||
if (zchan->token_count == 1) {
|
||||
zap_clear_flag(zchan, ZAP_CHANNEL_HOLD);
|
||||
}
|
||||
|
||||
if (zap_test_flag(zchan, ZAP_CHANNEL_HOLD)) {
|
||||
zap_clear_flag(zchan, ZAP_CHANNEL_HOLD);
|
||||
sig.event_id = ZAP_SIGEVENT_ADD_CALL;
|
||||
@@ -519,7 +523,7 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj)
|
||||
}
|
||||
|
||||
if (zap_channel_read(zchan, frame, &len) != ZAP_SUCCESS) {
|
||||
zap_log(ZAP_LOG_ERROR, "READ ERROR\n");
|
||||
zap_log(ZAP_LOG_ERROR, "READ ERROR [%s]\n", zchan->last_error);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@@ -654,11 +654,15 @@ ZIO_SPAN_NEXT_EVENT_FUNCTION(zt_next_event)
|
||||
static ZIO_READ_FUNCTION(zt_read)
|
||||
{
|
||||
zap_ssize_t r = 0;
|
||||
//*datalen = zchan->packet_len;
|
||||
int errs = 0;
|
||||
|
||||
r = read(zchan->sockfd, data, *datalen);
|
||||
while (errs++ < 100) {
|
||||
if ((r = read(zchan->sockfd, data, *datalen)) > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (r >= 0) {
|
||||
if (r > 0) {
|
||||
*datalen = r;
|
||||
if (zchan->type == ZAP_CHAN_TYPE_DQ921) {
|
||||
*datalen -= 2;
|
||||
|
Reference in New Issue
Block a user