git-svn-id: http://svn.openzap.org/svn/openzap/trunk@34 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2007-05-18 18:28:32 +00:00
parent 2c0331cfb9
commit 32c4d00007
2 changed files with 11 additions and 6 deletions

View File

@ -212,6 +212,8 @@ zap_status_t zap_channel_open_any(const char *name, unsigned span_id, zap_direct
j = span_max;
}
for(;;) {
span = &zint->spans[j];
@ -220,7 +222,7 @@ zap_status_t zap_channel_open_any(const char *name, unsigned span_id, zap_direct
}
if (direction == ZAP_TOP_DOWN) {
if (j == span_max) {
if (j > span_max) {
break;
}
} else {
@ -238,7 +240,7 @@ zap_status_t zap_channel_open_any(const char *name, unsigned span_id, zap_direct
for(;;) {
if (direction == ZAP_TOP_DOWN) {
if (i == span->chan_count) {
if (i > span->chan_count) {
break;
}
} else {

View File

@ -15,8 +15,9 @@ int main(int argc, char *argv[])
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;
printf("opened channel %d:%d\n", chan->span_id, chan->chan_id);
if (zap_channel_command(chan, ZAP_COMMAND_SET_INTERVAL, &ms) == ZAP_SUCCESS) {
ms = 0;
@ -53,6 +54,8 @@ int main(int argc, char *argv[])
printf("wait fail [%s]\n", chan->last_error);
}
}
} else {
printf("open fail [%s]\n", chan->last_error);
}
zap_global_destroy();