update
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@34 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
2c0331cfb9
commit
32c4d00007
|
@ -212,15 +212,17 @@ zap_status_t zap_channel_open_any(const char *name, unsigned span_id, zap_direct
|
||||||
j = span_max;
|
j = span_max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
span = &zint->spans[j];
|
span = &zint->spans[j];
|
||||||
|
|
||||||
if (!zap_test_flag(span, ZAP_SPAN_CONFIGURED)) {
|
if (!zap_test_flag(span, ZAP_SPAN_CONFIGURED)) {
|
||||||
goto next_loop;
|
goto next_loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (direction == ZAP_TOP_DOWN) {
|
if (direction == ZAP_TOP_DOWN) {
|
||||||
if (j == span_max) {
|
if (j > span_max) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -228,7 +230,7 @@ zap_status_t zap_channel_open_any(const char *name, unsigned span_id, zap_direct
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (direction == ZAP_TOP_DOWN) {
|
if (direction == ZAP_TOP_DOWN) {
|
||||||
i = 1;
|
i = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -238,7 +240,7 @@ zap_status_t zap_channel_open_any(const char *name, unsigned span_id, zap_direct
|
||||||
for(;;) {
|
for(;;) {
|
||||||
|
|
||||||
if (direction == ZAP_TOP_DOWN) {
|
if (direction == ZAP_TOP_DOWN) {
|
||||||
if (i == span->chan_count) {
|
if (i > span->chan_count) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -246,7 +248,7 @@ zap_status_t zap_channel_open_any(const char *name, unsigned span_id, zap_direct
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check = &span->channels[i];
|
check = &span->channels[i];
|
||||||
|
|
||||||
if (zap_test_flag(check, ZAP_CHANNEL_READY) && !zap_test_flag(check, ZAP_CHANNEL_OPEN)) {
|
if (zap_test_flag(check, ZAP_CHANNEL_READY) && !zap_test_flag(check, ZAP_CHANNEL_OPEN)) {
|
||||||
|
|
|
@ -15,8 +15,9 @@ int main(int argc, char *argv[])
|
||||||
printf("OpenZAP loaded\n");
|
printf("OpenZAP loaded\n");
|
||||||
|
|
||||||
|
|
||||||
if (zap_channel_open("wanpipe", 1, 1, &chan) == ZAP_SUCCESS) {
|
if (zap_channel_open_any("wanpipe", 0, ZAP_TOP_DOWN, &chan) == ZAP_SUCCESS) {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
|
printf("opened channel %d:%d\n", chan->span_id, chan->chan_id);
|
||||||
|
|
||||||
if (zap_channel_command(chan, ZAP_COMMAND_SET_INTERVAL, &ms) == ZAP_SUCCESS) {
|
if (zap_channel_command(chan, ZAP_COMMAND_SET_INTERVAL, &ms) == ZAP_SUCCESS) {
|
||||||
ms = 0;
|
ms = 0;
|
||||||
|
@ -53,6 +54,8 @@ int main(int argc, char *argv[])
|
||||||
printf("wait fail [%s]\n", chan->last_error);
|
printf("wait fail [%s]\n", chan->last_error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
printf("open fail [%s]\n", chan->last_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
zap_global_destroy();
|
zap_global_destroy();
|
||||||
|
|
Loading…
Reference in New Issue