X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=lcradmin.c;h=f8a1ac8d0aa37c8ae361e8836f6bf463de6b19a3;hp=0138de93d8f84402700896c02e11221a530523f4;hb=5463e1b62a39ce417b610584e3d34a8bc30ac15e;hpb=e9bfe48fc5254e79e59c6ffc1698912175edf4e3 diff --git a/lcradmin.c b/lcradmin.c index 0138de9..f8a1ac8 100644 --- a/lcradmin.c +++ b/lcradmin.c @@ -25,6 +25,7 @@ #include "macro.h" #include "options.h" #include "join.h" +#include "select.h" #include "joinpbx.h" #include "extension.h" #include "message.h" @@ -179,6 +180,10 @@ int debug_port(struct admin_message *msg, struct admin_message *m, int line, int color(blue); addstr("'out >> disc'"); break; + case ADMIN_STATE_RELEASE: + color(blue); + addstr("'release'"); + break; default: color(blue); addstr("'--NONE--'"); @@ -616,7 +621,10 @@ const char *admin_state(int sock, char *argv[]) /* show interface summary */ move(++line>1?line:1, 0); color(white); - if (m[i].u.i.block >= 2) { + if (m[i].u.i.portnum == -100) { + SPRINT(buffer, "%s %s", m[i].u.i.interface_name, (m[i].u.i.extension)?" exten":""); + addstr(buffer); + } else if (m[i].u.i.block >= 2) { if (m[i].u.i.portnum < 0) SPRINT(buffer, "%s (port ?: %s)%s", m[i].u.i.interface_name, m[i].u.i.portname, (m[i].u.i.extension)?" exten":""); else @@ -729,7 +737,7 @@ const char *admin_state(int sock, char *argv[]) break; case B_STATE_ACTIVE: color(green); - addstr("busy "); + addstr("active "); break; case B_STATE_DEACTIVATING: color(yellow); @@ -1296,6 +1304,8 @@ const char *admin_portinfo(int sock, int argc, char *argv[]) else printf("\t status = unblocked\n"); printf("\t mode = %s %s%s%s\n", (m[i].u.i.ntmode)?"NT-mode":"TE-mode", (m[i].u.i.ptp)?"ptp":"ptmp", (m[i].u.i.l1hold)?" l1hold":"", (m[i].u.i.l2hold)?" l2hold":""); + printf("\t out-channel = %s\n", m[i].u.i.out_channel); + printf("\t in-channel = %s\n", m[i].u.i.in_channel); if (m[i].u.i.l1link < 0) printf("\t l1 link = unknown\n"); else @@ -1574,7 +1584,11 @@ next: goto next; case ADMIN_CALL_NOTIFY: - printf("NOTIFY\n notify=%d\n number=%s\n", msg.u.call.notify, msg.u.call.callerid); fflush(stdout); + printf("NOTIFY\n notify=%d\n number=%s\n", msg.u.call.notify_progress, msg.u.call.callerid); fflush(stdout); + goto next; + + case ADMIN_CALL_PROGRESS: + printf("PROGRESS\n progress=%d\n location=%d\n", msg.u.call.notify_progress, msg.u.call.location); fflush(stdout); goto next; case ADMIN_CALL_DISCONNECT: @@ -1675,7 +1689,7 @@ int main(int argc, char *argv[]) int sock, conn; struct sockaddr_un sock_address; const char *ret = "invalid mode"; - + char options_error[256]; /* show options */ if (argc <= 1) { @@ -1751,7 +1765,7 @@ int main(int argc, char *argv[]) goto usage; } - if (read_options() == 0) { + if (read_options(options_error) == 0) { exit(EXIT_FAILURE); }