Cleanup: Make interface name be part of Port class
authorAndreas Eversberg <jolly@eversberg.eu>
Sun, 19 Aug 2012 07:42:43 +0000 (09:42 +0200)
committerAndreas Eversberg <jolly@eversberg.eu>
Sun, 16 Dec 2012 09:11:46 +0000 (10:11 +0100)
18 files changed:
appbridge.cpp
apppbx.cpp
dss1.cpp
dss1.h
gsm.cpp
gsm.h
gsm_bs.cpp
gsm_ms.cpp
mISDN.cpp
mISDN.h
port.cpp
port.h
remote.cpp
remote.h
sip.cpp
ss5.cpp
ss5.h
vbox.cpp

index b69d47b..1202fc9 100644 (file)
@@ -193,7 +193,7 @@ fail:
                        port = ss5_hunt_line(mISDNport);
                else
 #endif
                        port = ss5_hunt_line(mISDNport);
                else
 #endif
-               port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+               port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, mISDNport->ifport->interface, channel, mISDNport->ifport->channel_force, mode);
                earlyb = mISDNport->earlyb;
 #else
                trace_header("INTERFACE (has no function)", DIRECTION_NONE);
                earlyb = mISDNport->earlyb;
 #else
                trace_header("INTERFACE (has no function)", DIRECTION_NONE);
index 2a76c89..67594e5 100644 (file)
@@ -796,7 +796,7 @@ void EndpointAppPBX::out_setup(int cfnr)
                                        port = ss5_hunt_line(mISDNport);
                                else
 #endif
                                        port = ss5_hunt_line(mISDNport);
                                else
 #endif
-                               port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+                               port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, mISDNport->ifport->interface, channel, mISDNport->ifport->channel_force, mode);
                                earlyb = mISDNport->earlyb;
 #else
                        trace_header("INTERFACE (has no function)", DIRECTION_NONE);
                                earlyb = mISDNport->earlyb;
 #else
                        trace_header("INTERFACE (has no function)", DIRECTION_NONE);
@@ -917,7 +917,7 @@ void EndpointAppPBX::out_setup(int cfnr)
                                                port = ss5_hunt_line(mISDNport);
                                        else
 #endif
                                                port = ss5_hunt_line(mISDNport);
                                        else
 #endif
-                                               port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+                                               port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, mISDNport->ifport->interface, channel, mISDNport->ifport->channel_force, mode);
                                        if (!port)
                                                FATAL("No memory for Port instance\n");
                                        earlyb = mISDNport->earlyb;
                                        if (!port)
                                                FATAL("No memory for Port instance\n");
                                        earlyb = mISDNport->earlyb;
@@ -1079,7 +1079,7 @@ void EndpointAppPBX::out_setup(int cfnr)
                                                port = ss5_hunt_line(mISDNport);
                                        else
 #endif
                                                port = ss5_hunt_line(mISDNport);
                                        else
 #endif
-                                       port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, channel, mISDNport->ifport->channel_force, mode);
+                                       port = new Pdss1((mISDNport->ntmode)?PORT_TYPE_DSS1_NT_OUT:PORT_TYPE_DSS1_TE_OUT, mISDNport, portname, &port_settings, mISDNport->ifport->interface, channel, mISDNport->ifport->channel_force, mode);
                                        earlyb = mISDNport->earlyb;
 #else
                                        trace_header("INTERFACE (has no function)", DIRECTION_NONE);
                                        earlyb = mISDNport->earlyb;
 #else
                                        trace_header("INTERFACE (has no function)", DIRECTION_NONE);
index 51b43a1..fe4188a 100644 (file)
--- a/dss1.cpp
+++ b/dss1.cpp
@@ -28,7 +28,7 @@ static int delete_event(struct lcr_work *work, void *instance, int index);
 /*
  * constructor
  */
 /*
  * constructor
  */
-Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode) : PmISDN(type, mISDNport, portname, settings, channel, exclusive, mode)
+Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, struct interface *interface, int channel, int exclusive, int mode) : PmISDN(type, mISDNport, portname, settings, interface, channel, exclusive, mode)
 {
        p_callerinfo.itype = (mISDNport->ifport->interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
        p_m_d_ntmode = mISDNport->ntmode;
 {
        p_callerinfo.itype = (mISDNport->ifport->interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
        p_m_d_ntmode = mISDNport->ntmode;
@@ -3043,7 +3043,7 @@ int stack2manager(struct mISDNport *mISDNport, unsigned int cmd, unsigned int pi
                case MT_SETUP:
                /* creating port object, transparent until setup with hdlc */
                SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
                case MT_SETUP:
                /* creating port object, transparent until setup with hdlc */
                SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
-               if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0, B_MODE_TRANSPARENT)))
+               if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, mISDNport->ifport->interface, 0, 0, B_MODE_TRANSPARENT)))
 
                        FATAL("Cannot create Port instance.\n");
                pdss1->message_isdn(cmd, pid, l3m);
 
                        FATAL("Cannot create Port instance.\n");
                pdss1->message_isdn(cmd, pid, l3m);
@@ -3052,7 +3052,7 @@ int stack2manager(struct mISDNport *mISDNport, unsigned int cmd, unsigned int pi
                case MT_RESUME:
                /* creating port object, transparent until setup with hdlc */
                SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
                case MT_RESUME:
                /* creating port object, transparent until setup with hdlc */
                SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
-               if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0, B_MODE_TRANSPARENT)))
+               if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, mISDNport->ifport->interface, 0, 0, B_MODE_TRANSPARENT)))
                        FATAL("Cannot create Port instance.\n");
                pdss1->message_isdn(cmd, pid, l3m);
                break;
                        FATAL("Cannot create Port instance.\n");
                pdss1->message_isdn(cmd, pid, l3m);
                break;
diff --git a/dss1.h b/dss1.h
index 2f5901d..0c603d4 100644 (file)
--- a/dss1.h
+++ b/dss1.h
@@ -13,7 +13,7 @@
 class Pdss1 : public PmISDN
 {
        public:
 class Pdss1 : public PmISDN
 {
        public:
-       Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode);
+       Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, struct interface *interface, int channel, int exclusive, int mode);
        ~Pdss1();
        unsigned int p_m_d_l3id;                /* current l3 process id */
        struct lcr_work p_m_d_delete;           /* timer for audio transmission */
        ~Pdss1();
        unsigned int p_m_d_l3id;                /* current l3 process id */
        struct lcr_work p_m_d_delete;           /* timer for audio transmission */
diff --git a/gsm.cpp b/gsm.cpp
index 31a7967..eeb91e8 100644 (file)
--- a/gsm.cpp
+++ b/gsm.cpp
@@ -155,7 +155,7 @@ static int delete_event(struct lcr_work *work, void *instance, int index);
 /*
  * constructor
  */
 /*
  * constructor
  */
-Pgsm::Pgsm(int type, char *portname, struct port_settings *settings, struct interface *interface) : Port(type, portname, settings)
+Pgsm::Pgsm(int type, char *portname, struct port_settings *settings, struct interface *interface) : Port(type, portname, settings, interface)
 {
        p_g_tones = 0;
        if (interface->is_tones == IS_YES)
 {
        p_g_tones = 0;
        if (interface->is_tones == IS_YES)
@@ -168,7 +168,6 @@ Pgsm::Pgsm(int type, char *portname, struct port_settings *settings, struct inte
                p_g_rtp_bridge = 1;
        p_g_rtp_payloads = 0;
        memset(&p_g_samples, 0, sizeof(p_g_samples));
                p_g_rtp_bridge = 1;
        p_g_rtp_payloads = 0;
        memset(&p_g_samples, 0, sizeof(p_g_samples));
-       SCPY(p_g_interface_name, interface->name); 
        p_callerinfo.itype = (interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
        memset(&p_g_delete, 0, sizeof(p_g_delete));
        add_work(&p_g_delete, delete_event, this, 0);
        p_callerinfo.itype = (interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
        memset(&p_g_delete, 0, sizeof(p_g_delete));
        add_work(&p_g_delete, delete_event, this, 0);
@@ -364,7 +363,7 @@ void Pgsm::modify_lchan(int media_type)
                return;
 
        p_g_media_type = media_type;
                return;
 
        p_g_media_type = media_type;
-       gsm_trace_header(p_g_interface_name, this, MNCC_LCHAN_MODIFY, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_LCHAN_MODIFY, DIRECTION_OUT);
        mode = create_mncc(MNCC_LCHAN_MODIFY, p_g_callref);
        switch (media_type) {
        case MEDIA_TYPE_GSM_EFR:
        mode = create_mncc(MNCC_LCHAN_MODIFY, p_g_callref);
        switch (media_type) {
        case MEDIA_TYPE_GSM_EFR:
@@ -391,7 +390,7 @@ void Pgsm::call_proc_ind(unsigned int msg_type, unsigned int callref, struct gsm
        struct lcr_msg *message;
        struct gsm_mncc *frame;
 
        struct lcr_msg *message;
        struct gsm_mncc *frame;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        end_trace();
 
        message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROCEEDING);
        end_trace();
 
        message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROCEEDING);
@@ -400,7 +399,7 @@ void Pgsm::call_proc_ind(unsigned int msg_type, unsigned int callref, struct gsm
        new_state(PORT_STATE_OUT_PROCEEDING);
 
        if (p_g_earlyb && !p_g_tch_connected) { /* only if ... */
        new_state(PORT_STATE_OUT_PROCEEDING);
 
        if (p_g_earlyb && !p_g_tch_connected) { /* only if ... */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
@@ -414,7 +413,7 @@ void Pgsm::alert_ind(unsigned int msg_type, unsigned int callref, struct gsm_mnc
        struct lcr_msg *message;
        struct gsm_mncc *frame;
 
        struct lcr_msg *message;
        struct gsm_mncc *frame;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        end_trace();
 
        message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_ALERTING);
        end_trace();
 
        message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_ALERTING);
@@ -423,7 +422,7 @@ void Pgsm::alert_ind(unsigned int msg_type, unsigned int callref, struct gsm_mnc
        new_state(PORT_STATE_OUT_ALERTING);
 
        if (p_g_earlyb && !p_g_tch_connected) { /* only if ... */
        new_state(PORT_STATE_OUT_ALERTING);
 
        if (p_g_earlyb && !p_g_tch_connected) { /* only if ... */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
@@ -442,9 +441,9 @@ void Pgsm::setup_cnf(unsigned int msg_type, unsigned int callref, struct gsm_mnc
        p_connectinfo.present = INFO_PRESENT_ALLOWED;
        p_connectinfo.screen = INFO_SCREEN_NETWORK;
        p_connectinfo.ntype = INFO_NTYPE_UNKNOWN;
        p_connectinfo.present = INFO_PRESENT_ALLOWED;
        p_connectinfo.screen = INFO_SCREEN_NETWORK;
        p_connectinfo.ntype = INFO_NTYPE_UNKNOWN;
-       SCPY(p_connectinfo.interface, p_g_interface_name);
+       SCPY(p_connectinfo.interface, p_interface_name);
 
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        if (p_connectinfo.id[0])
                add_trace("connect", "number", "%s", p_connectinfo.id);
        else if (mncc->imsi[0])
        if (p_connectinfo.id[0])
                add_trace("connect", "number", "%s", p_connectinfo.id);
        else if (mncc->imsi[0])
@@ -454,7 +453,7 @@ void Pgsm::setup_cnf(unsigned int msg_type, unsigned int callref, struct gsm_mnc
        end_trace();
 
        /* send resp */
        end_trace();
 
        /* send resp */
-       gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_COMPL_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_SETUP_COMPL_REQ, DIRECTION_OUT);
        resp = create_mncc(MNCC_SETUP_COMPL_REQ, p_g_callref);
        end_trace();
        send_and_free_mncc(p_g_lcr_gsm, resp->msg_type, resp);
        resp = create_mncc(MNCC_SETUP_COMPL_REQ, p_g_callref);
        end_trace();
        send_and_free_mncc(p_g_lcr_gsm, resp->msg_type, resp);
@@ -462,7 +461,7 @@ void Pgsm::setup_cnf(unsigned int msg_type, unsigned int callref, struct gsm_mnc
        new_state(PORT_STATE_CONNECT);
 
        if (!p_g_tch_connected) { /* only if ... */
        new_state(PORT_STATE_CONNECT);
 
        if (!p_g_tch_connected) { /* only if ... */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
@@ -502,13 +501,13 @@ void Pgsm::setup_compl_ind(unsigned int msg_type, unsigned int callref, struct g
 {
        struct gsm_mncc *frame;
 
 {
        struct gsm_mncc *frame;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        end_trace();
 
        new_state(PORT_STATE_CONNECT);
 
        if (!p_g_tch_connected) { /* only if ... */
        end_trace();
 
        new_state(PORT_STATE_CONNECT);
 
        if (!p_g_tch_connected) { /* only if ... */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
@@ -523,7 +522,7 @@ void Pgsm::disc_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc
        int cause = 16, location = 0;
        struct gsm_mncc *resp;
 
        int cause = 16, location = 0;
        struct gsm_mncc *resp;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        if (mncc->fields & MNCC_F_CAUSE) {
                location = mncc->cause.location;
                cause = mncc->cause.value;
        if (mncc->fields & MNCC_F_CAUSE) {
                location = mncc->cause.location;
                cause = mncc->cause.value;
@@ -535,7 +534,7 @@ void Pgsm::disc_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc
 
        /* send release */
        resp = create_mncc(MNCC_REL_REQ, p_g_callref);
 
        /* send release */
        resp = create_mncc(MNCC_REL_REQ, p_g_callref);
-       gsm_trace_header(p_g_interface_name, this, MNCC_REL_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_REL_REQ, DIRECTION_OUT);
 #if 0
        resp->fields |= MNCC_F_CAUSE;
        resp->cause.coding = 3;
 #if 0
        resp->fields |= MNCC_F_CAUSE;
        resp->cause.coding = 3;
@@ -567,7 +566,7 @@ void Pgsm::rel_ind(unsigned int msg_type, unsigned int callref, struct gsm_mncc
        int location = 0, cause = 16;
        struct lcr_msg *message;
 
        int location = 0, cause = 16;
        struct lcr_msg *message;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        if (mncc->fields & MNCC_F_CAUSE) {
                location = mncc->cause.location;
                cause = mncc->cause.value;
        if (mncc->fields & MNCC_F_CAUSE) {
                location = mncc->cause.location;
                cause = mncc->cause.value;
@@ -595,7 +594,7 @@ void Pgsm::notify_ind(unsigned int msg_type, unsigned int callref, struct gsm_mn
 {
        struct lcr_msg *message;
 
 {
        struct lcr_msg *message;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        add_trace("notify", NULL, "%d", mncc->notify);
        end_trace();
 
        add_trace("notify", NULL, "%d", mncc->notify);
        end_trace();
 
@@ -621,7 +620,7 @@ void Pgsm::message_notify(unsigned int epoint_id, int message_id, union paramete
                        memcpy(&p_g_notify_pending->param, param, sizeof(union parameter));
                } else {
                        /* sending notification */
                        memcpy(&p_g_notify_pending->param, param, sizeof(union parameter));
                } else {
                        /* sending notification */
-                       gsm_trace_header(p_g_interface_name, this, MNCC_NOTIFY_REQ, DIRECTION_OUT);
+                       gsm_trace_header(p_interface_name, this, MNCC_NOTIFY_REQ, DIRECTION_OUT);
                        add_trace("notify", NULL, "%d", notify);
                        end_trace();
                        mncc = create_mncc(MNCC_NOTIFY_REQ, p_g_callref);
                        add_trace("notify", NULL, "%d", notify);
                        end_trace();
                        mncc = create_mncc(MNCC_NOTIFY_REQ, p_g_callref);
@@ -698,7 +697,7 @@ void Pgsm::message_alerting(unsigned int epoint_id, int message_id, union parame
        struct gsm_mncc *mncc;
 
        /* send alert */
        struct gsm_mncc *mncc;
 
        /* send alert */
-       gsm_trace_header(p_g_interface_name, this, MNCC_ALERT_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_ALERT_REQ, DIRECTION_OUT);
        mncc = create_mncc(MNCC_ALERT_REQ, p_g_callref);
        if (p_g_tones) {
                mncc->fields |= MNCC_F_PROGRESS;
        mncc = create_mncc(MNCC_ALERT_REQ, p_g_callref);
        if (p_g_tones) {
                mncc->fields |= MNCC_F_PROGRESS;
@@ -715,7 +714,7 @@ void Pgsm::message_alerting(unsigned int epoint_id, int message_id, union parame
        new_state(PORT_STATE_IN_ALERTING);
 
        if (p_g_tones && !p_g_tch_connected) { /* only if ... */
        new_state(PORT_STATE_IN_ALERTING);
 
        if (p_g_tones && !p_g_tch_connected) { /* only if ... */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                mncc = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, mncc->msg_type, mncc);
                end_trace();
                mncc = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, mncc->msg_type, mncc);
@@ -731,11 +730,11 @@ void Pgsm::message_connect(unsigned int epoint_id, int message_id, union paramet
        /* copy connected information */
        memcpy(&p_connectinfo, &param->connectinfo, sizeof(p_connectinfo));
        /* screen outgoing caller id */
        /* copy connected information */
        memcpy(&p_connectinfo, &param->connectinfo, sizeof(p_connectinfo));
        /* screen outgoing caller id */
-       do_screen(1, p_connectinfo.id, sizeof(p_connectinfo.id), &p_connectinfo.ntype, &p_connectinfo.present, p_g_interface_name);
+       do_screen(1, p_connectinfo.id, sizeof(p_connectinfo.id), &p_connectinfo.ntype, &p_connectinfo.present, p_interface_name);
 
        /* send connect */
        mncc = create_mncc(MNCC_SETUP_RSP, p_g_callref);
 
        /* send connect */
        mncc = create_mncc(MNCC_SETUP_RSP, p_g_callref);
-       gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_RSP, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_SETUP_RSP, DIRECTION_OUT);
        /* caller information */
        mncc->fields |= MNCC_F_CONNECTED;
        mncc->connected.plan = 1;
        /* caller information */
        mncc->fields |= MNCC_F_CONNECTED;
        mncc->connected.plan = 1;
@@ -810,7 +809,7 @@ void Pgsm::message_disconnect(unsigned int epoint_id, int message_id, union para
 
        /* send disconnect */
        mncc = create_mncc(MNCC_DISC_REQ, p_g_callref);
 
        /* send disconnect */
        mncc = create_mncc(MNCC_DISC_REQ, p_g_callref);
-       gsm_trace_header(p_g_interface_name, this, MNCC_DISC_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_DISC_REQ, DIRECTION_OUT);
        if (p_g_tones) {
                mncc->fields |= MNCC_F_PROGRESS;
                mncc->progress.coding = 3; /* GSM */
        if (p_g_tones) {
                mncc->fields |= MNCC_F_PROGRESS;
                mncc->progress.coding = 3; /* GSM */
@@ -833,7 +832,7 @@ void Pgsm::message_disconnect(unsigned int epoint_id, int message_id, union para
        new_state(PORT_STATE_OUT_DISCONNECT);
 
        if (p_g_tones && !p_g_tch_connected) { /* only if ... */
        new_state(PORT_STATE_OUT_DISCONNECT);
 
        if (p_g_tones && !p_g_tch_connected) { /* only if ... */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                mncc = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, mncc->msg_type, mncc);
                end_trace();
                mncc = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, mncc->msg_type, mncc);
@@ -849,7 +848,7 @@ void Pgsm::message_release(unsigned int epoint_id, int message_id, union paramet
 
        /* send release */
        mncc = create_mncc(MNCC_REL_REQ, p_g_callref);
 
        /* send release */
        mncc = create_mncc(MNCC_REL_REQ, p_g_callref);
-       gsm_trace_header(p_g_interface_name, this, MNCC_REL_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_REL_REQ, DIRECTION_OUT);
        mncc->fields |= MNCC_F_CAUSE;
        mncc->cause.coding = 3;
        mncc->cause.location = param->disconnectinfo.location;
        mncc->fields |= MNCC_F_CAUSE;
        mncc->cause.coding = 3;
        mncc->cause.location = param->disconnectinfo.location;
diff --git a/gsm.h b/gsm.h
index 00bb295..c152f42 100644 (file)
--- a/gsm.h
+++ b/gsm.h
@@ -34,7 +34,6 @@ class Pgsm : public Port
        Pgsm(int type, char *portname, struct port_settings *settings, struct interface *interface);
        ~Pgsm();
 
        Pgsm(int type, char *portname, struct port_settings *settings, struct interface *interface);
        ~Pgsm();
 
-       char p_g_interface_name[64];
        signed short p_g_samples[160]; /* last received audi packet */
        int p_g_tones; /* set, if tones are to be generated */
        int p_g_earlyb; /* set, if patterns are available */
        signed short p_g_samples[160]; /* last received audi packet */
        int p_g_tones; /* set, if tones are to be generated */
        int p_g_earlyb; /* set, if patterns are available */
index ee4bf04..4855a5c 100644 (file)
@@ -90,7 +90,7 @@ void Pgsm_bs::call_conf_ind(unsigned int msg_type, unsigned int callref, struct
        unsigned char payload_types[8];
        int payloads = 0;
 
        unsigned char payload_types[8];
        int payloads = 0;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        if (mncc->fields & MNCC_F_CAUSE) {
                add_trace("cause", "coding", "%d", mncc->cause.coding);
                add_trace("cause", "location", "%", mncc->cause.location);
        if (mncc->fields & MNCC_F_CAUSE) {
                add_trace("cause", "coding", "%d", mncc->cause.coding);
                add_trace("cause", "location", "%", mncc->cause.location);
@@ -132,7 +132,7 @@ void Pgsm_bs::call_conf_ind(unsigned int msg_type, unsigned int callref, struct
                        message_put(message);
                        /* send release */
                        mncc = create_mncc(MNCC_REL_REQ, p_g_callref);
                        message_put(message);
                        /* send release */
                        mncc = create_mncc(MNCC_REL_REQ, p_g_callref);
-                       gsm_trace_header(p_g_interface_name, this, MNCC_REL_REQ, DIRECTION_OUT);
+                       gsm_trace_header(p_interface_name, this, MNCC_REL_REQ, DIRECTION_OUT);
                        mncc->fields |= MNCC_F_CAUSE;
                        mncc->cause.coding = 3;
                        mncc->cause.location = LOCATION_PRIVATE_LOCAL;
                        mncc->fields |= MNCC_F_CAUSE;
                        mncc->cause.coding = 3;
                        mncc->cause.location = LOCATION_PRIVATE_LOCAL;
@@ -163,14 +163,14 @@ void Pgsm_bs::start_dtmf_ind(unsigned int msg_type, unsigned int callref, struct
 {
        struct gsm_mncc *resp;
 
 {
        struct gsm_mncc *resp;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        add_trace("keypad", NULL, "%c", mncc->keypad);
        end_trace();
        SPRINT(p_dialinginfo.id, "%c", mncc->keypad);
        p_dialinginfo.ntype = INFO_NTYPE_UNKNOWN;
 
        /* send resp */
        add_trace("keypad", NULL, "%c", mncc->keypad);
        end_trace();
        SPRINT(p_dialinginfo.id, "%c", mncc->keypad);
        p_dialinginfo.ntype = INFO_NTYPE_UNKNOWN;
 
        /* send resp */
-       gsm_trace_header(p_g_interface_name, this, MNCC_START_DTMF_RSP, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_START_DTMF_RSP, DIRECTION_OUT);
        add_trace("keypad", NULL, "%c", mncc->keypad);
        end_trace();
        resp = create_mncc(MNCC_START_DTMF_RSP, p_g_callref);
        add_trace("keypad", NULL, "%c", mncc->keypad);
        end_trace();
        resp = create_mncc(MNCC_START_DTMF_RSP, p_g_callref);
@@ -229,12 +229,12 @@ void Pgsm_bs::stop_dtmf_ind(unsigned int msg_type, unsigned int callref, struct
 {
        struct gsm_mncc *resp;
 
 {
        struct gsm_mncc *resp;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        add_trace("keypad", NULL, "%c", mncc->keypad);
        end_trace();
 
        /* send resp */
        add_trace("keypad", NULL, "%c", mncc->keypad);
        end_trace();
 
        /* send resp */
-       gsm_trace_header(p_g_interface_name, this, MNCC_STOP_DTMF_RSP, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_STOP_DTMF_RSP, DIRECTION_OUT);
        add_trace("keypad", NULL, "%c", mncc->keypad);
        end_trace();
        resp = create_mncc(MNCC_STOP_DTMF_RSP, p_g_callref);
        add_trace("keypad", NULL, "%c", mncc->keypad);
        end_trace();
        resp = create_mncc(MNCC_STOP_DTMF_RSP, p_g_callref);
@@ -251,7 +251,7 @@ void Pgsm_bs::hold_ind(unsigned int msg_type, unsigned int callref, struct gsm_m
        struct lcr_msg *message;
        struct gsm_mncc *resp, *frame;
 
        struct lcr_msg *message;
        struct gsm_mncc *resp, *frame;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        end_trace();
 
        /* notify the hold of call */
        end_trace();
 
        /* notify the hold of call */
@@ -261,14 +261,14 @@ void Pgsm_bs::hold_ind(unsigned int msg_type, unsigned int callref, struct gsm_m
        message_put(message);
 
        /* acknowledge hold */
        message_put(message);
 
        /* acknowledge hold */
-       gsm_trace_header(p_g_interface_name, this, MNCC_HOLD_CNF, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_HOLD_CNF, DIRECTION_OUT);
        end_trace();
        resp = create_mncc(MNCC_HOLD_CNF, p_g_callref);
        send_and_free_mncc(p_g_lcr_gsm, resp->msg_type, resp);
 
        /* disable audio */
        if (p_g_tch_connected) { /* it should be true */
        end_trace();
        resp = create_mncc(MNCC_HOLD_CNF, p_g_callref);
        send_and_free_mncc(p_g_lcr_gsm, resp->msg_type, resp);
 
        /* disable audio */
        if (p_g_tch_connected) { /* it should be true */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_DROP, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_DROP, DIRECTION_OUT);
                end_trace();
                frame = create_mncc(MNCC_FRAME_DROP, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
                end_trace();
                frame = create_mncc(MNCC_FRAME_DROP, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
@@ -283,7 +283,7 @@ void Pgsm_bs::retr_ind(unsigned int msg_type, unsigned int callref, struct gsm_m
        struct lcr_msg *message;
        struct gsm_mncc *resp, *frame;
 
        struct lcr_msg *message;
        struct gsm_mncc *resp, *frame;
 
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        end_trace();
 
        /* notify the retrieve of call */
        end_trace();
 
        /* notify the retrieve of call */
@@ -293,14 +293,14 @@ void Pgsm_bs::retr_ind(unsigned int msg_type, unsigned int callref, struct gsm_m
        message_put(message);
 
        /* acknowledge retr */
        message_put(message);
 
        /* acknowledge retr */
-       gsm_trace_header(p_g_interface_name, this, MNCC_RETRIEVE_CNF, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_RETRIEVE_CNF, DIRECTION_OUT);
        end_trace();
        resp = create_mncc(MNCC_RETRIEVE_CNF, p_g_callref);
        send_and_free_mncc(p_g_lcr_gsm, resp->msg_type, resp);
 
        /* enable audio */
        if (!p_g_tch_connected) { /* it should be true */
        end_trace();
        resp = create_mncc(MNCC_RETRIEVE_CNF, p_g_callref);
        send_and_free_mncc(p_g_lcr_gsm, resp->msg_type, resp);
 
        /* enable audio */
        if (!p_g_tch_connected) { /* it should be true */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
@@ -320,7 +320,7 @@ void Pgsm_bs::select_payload_type(struct gsm_mncc *mncc, unsigned char *payload_
 
        *payloads = 0;
 
 
        *payloads = 0;
 
-       gsm_trace_header(p_g_interface_name, this, 1 /* codec negotioation */, DIRECTION_NONE);
+       gsm_trace_header(p_interface_name, this, 1 /* codec negotioation */, DIRECTION_NONE);
        if ((mncc->fields & MNCC_F_BEARER_CAP)) {
                /* select preferred payload type from list */
                int i;
        if ((mncc->fields & MNCC_F_BEARER_CAP)) {
                /* select preferred payload type from list */
                int i;
@@ -403,21 +403,21 @@ void Pgsm_bs::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        unsigned char payload_types[8];
        int payloads = 0;
 
        unsigned char payload_types[8];
        int payloads = 0;
 
-       interface = getinterfacebyname(p_g_interface_name);
+       interface = getinterfacebyname(p_interface_name);
        if (!interface) {
        if (!interface) {
-               PERROR("Cannot find interface %s.\n", p_g_interface_name);
+               PERROR("Cannot find interface %s.\n", p_interface_name);
                return;
        }
 
        /* process given callref */
                return;
        }
 
        /* process given callref */
-       gsm_trace_header(p_g_interface_name, this, 0, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, 0, DIRECTION_IN);
        add_trace("callref", "new", "0x%x", callref);
        if (p_g_callref) {
                /* release in case the ID is already in use */
                add_trace("error", NULL, "callref already in use");
                end_trace();
                mncc = create_mncc(MNCC_REJ_REQ, callref);
        add_trace("callref", "new", "0x%x", callref);
        if (p_g_callref) {
                /* release in case the ID is already in use */
                add_trace("error", NULL, "callref already in use");
                end_trace();
                mncc = create_mncc(MNCC_REJ_REQ, callref);
-               gsm_trace_header(p_g_interface_name, this, MNCC_REJ_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_REJ_REQ, DIRECTION_OUT);
                mncc->fields |= MNCC_F_CAUSE;
                mncc->cause.coding = 3;
                mncc->cause.location = 1;
                mncc->fields |= MNCC_F_CAUSE;
                mncc->cause.coding = 3;
                mncc->cause.location = 1;
@@ -447,7 +447,7 @@ void Pgsm_bs::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        SCPY(p_callerinfo.imsi, mncc->imsi);
        p_callerinfo.screen = INFO_SCREEN_NETWORK;
        p_callerinfo.ntype = INFO_NTYPE_UNKNOWN;
        SCPY(p_callerinfo.imsi, mncc->imsi);
        p_callerinfo.screen = INFO_SCREEN_NETWORK;
        p_callerinfo.ntype = INFO_NTYPE_UNKNOWN;
-       SCPY(p_callerinfo.interface, p_g_interface_name);
+       SCPY(p_callerinfo.interface, p_interface_name);
 
        /* dialing information */
        SCAT(p_dialinginfo.id, mncc->called.number);
 
        /* dialing information */
        SCAT(p_dialinginfo.id, mncc->called.number);
@@ -490,7 +490,7 @@ void Pgsm_bs::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        /* if no given payload type is supported, we reject the call */
        if (!payloads) {
                mncc = create_mncc(MNCC_REJ_REQ, callref);
        /* if no given payload type is supported, we reject the call */
        if (!payloads) {
                mncc = create_mncc(MNCC_REJ_REQ, callref);
-               gsm_trace_header(p_g_interface_name, this, MNCC_REJ_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_REJ_REQ, DIRECTION_OUT);
                mncc->fields |= MNCC_F_CAUSE;
                mncc->cause.coding = 3;
                mncc->cause.location = 1;
                mncc->fields |= MNCC_F_CAUSE;
                mncc->cause.coding = 3;
                mncc->cause.location = 1;
@@ -510,7 +510,7 @@ void Pgsm_bs::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        /* useruser */
 
        /* what infos did we got ... */
        /* useruser */
 
        /* what infos did we got ... */
-       gsm_trace_header(p_g_interface_name, this, msg_type, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, msg_type, DIRECTION_IN);
        if (p_callerinfo.id[0])
                add_trace("calling", "number", "%s", p_callerinfo.id);
        else
        if (p_callerinfo.id[0])
                add_trace("calling", "number", "%s", p_callerinfo.id);
        else
@@ -532,7 +532,7 @@ void Pgsm_bs::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
                modify_lchan(media_types[0]);
 
        /* send call proceeding */
                modify_lchan(media_types[0]);
 
        /* send call proceeding */
-       gsm_trace_header(p_g_interface_name, this, MNCC_CALL_PROC_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_CALL_PROC_REQ, DIRECTION_OUT);
        proceeding = create_mncc(MNCC_CALL_PROC_REQ, p_g_callref);
        if (p_g_tones) {
                proceeding->fields |= MNCC_F_PROGRESS;
        proceeding = create_mncc(MNCC_CALL_PROC_REQ, p_g_callref);
        if (p_g_tones) {
                proceeding->fields |= MNCC_F_PROGRESS;
@@ -549,7 +549,7 @@ void Pgsm_bs::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        new_state(PORT_STATE_IN_PROCEEDING);
 
        if (p_g_tones && !p_g_tch_connected) { /* only if ... */
        new_state(PORT_STATE_IN_PROCEEDING);
 
        if (p_g_tones && !p_g_tch_connected) { /* only if ... */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
@@ -755,7 +755,7 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
 
        /* no GSM MNCC connection */
        if (p_g_lcr_gsm->mncc_lfd.fd < 0) {
 
        /* no GSM MNCC connection */
        if (p_g_lcr_gsm->mncc_lfd.fd < 0) {
-               gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
                add_trace("failure", NULL, "No MNCC connection.");
                end_trace();
                message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
                add_trace("failure", NULL, "No MNCC connection.");
                end_trace();
                message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
@@ -769,7 +769,7 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
 
        /* no number */
        if (!p_dialinginfo.id[0]) {
 
        /* no number */
        if (!p_dialinginfo.id[0]) {
-               gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
                add_trace("failure", NULL, "No dialed subscriber given.");
                end_trace();
                message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
                add_trace("failure", NULL, "No dialed subscriber given.");
                end_trace();
                message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
@@ -786,7 +786,7 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
                int i;
 
                p_g_rtp_payloads = 0;
                int i;
 
                p_g_rtp_payloads = 0;
-               gsm_trace_header(p_g_interface_name, this, 1 /* codec negotioation */, DIRECTION_NONE);
+               gsm_trace_header(p_interface_name, this, 1 /* codec negotioation */, DIRECTION_NONE);
                for (i = 0; i < param->setup.rtpinfo.payloads; i++) {
                        switch (param->setup.rtpinfo.media_types[i]) {
                        case MEDIA_TYPE_GSM:
                for (i = 0; i < param->setup.rtpinfo.payloads; i++) {
                        switch (param->setup.rtpinfo.media_types[i]) {
                        case MEDIA_TYPE_GSM:
@@ -806,7 +806,7 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
                }
                end_trace();
                if (!p_g_rtp_payloads) {
                }
                end_trace();
                if (!p_g_rtp_payloads) {
-                       gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
+                       gsm_trace_header(p_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
                        add_trace("failure", NULL, "No payload given that is supported by GSM");
                        end_trace();
                        message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
                        add_trace("failure", NULL, "No payload given that is supported by GSM");
                        end_trace();
                        message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
@@ -821,7 +821,7 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
 
 //             SCPY(&p_m_tones_dir, param->setup.ext.tones_dir);
        /* screen outgoing caller id */
 
 //             SCPY(&p_m_tones_dir, param->setup.ext.tones_dir);
        /* screen outgoing caller id */
-       do_screen(1, p_callerinfo.id, sizeof(p_callerinfo.id), &p_callerinfo.ntype, &p_callerinfo.present, p_g_interface_name);
+       do_screen(1, p_callerinfo.id, sizeof(p_callerinfo.id), &p_callerinfo.ntype, &p_callerinfo.present, p_interface_name);
 
        /* attach only if not already */
        epointlist = p_epointlist;
 
        /* attach only if not already */
        epointlist = p_epointlist;
@@ -834,12 +834,12 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame
                epointlist_new(epoint_id);
 
        /* creating l3id */
                epointlist_new(epoint_id);
 
        /* creating l3id */
-       gsm_trace_header(p_g_interface_name, this, 0, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, 0, DIRECTION_OUT);
        p_g_callref = new_callref++;
        add_trace("callref", "new", "0x%x", p_g_callref);
        end_trace();
 
        p_g_callref = new_callref++;
        add_trace("callref", "new", "0x%x", p_g_callref);
        end_trace();
 
-       gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
        mncc = create_mncc(MNCC_SETUP_REQ, p_g_callref);
        /* caller information */
        mncc->fields |= MNCC_F_CALLING;
        mncc = create_mncc(MNCC_SETUP_REQ, p_g_callref);
        /* caller information */
        mncc->fields |= MNCC_F_CALLING;
index 7c43232..b3eabc4 100644 (file)
@@ -72,21 +72,21 @@ void Pgsm_ms::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        struct gsm_mncc *proceeding, *frame;
        struct interface *interface;
 
        struct gsm_mncc *proceeding, *frame;
        struct interface *interface;
 
-       interface = getinterfacebyname(p_g_interface_name);
+       interface = getinterfacebyname(p_interface_name);
        if (!interface) {
        if (!interface) {
-               PERROR("Cannot find interface %s.\n", p_g_interface_name);
+               PERROR("Cannot find interface %s.\n", p_interface_name);
                return;
        }
 
        /* process given callref */
                return;
        }
 
        /* process given callref */
-       gsm_trace_header(p_g_interface_name, this, 0, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, 0, DIRECTION_IN);
        add_trace("callref", "new", "0x%x", callref);
        if (p_g_callref) {
                /* release in case the ID is already in use */
                add_trace("error", NULL, "callref already in use");
                end_trace();
                mncc = create_mncc(MNCC_REJ_REQ, callref);
        add_trace("callref", "new", "0x%x", callref);
        if (p_g_callref) {
                /* release in case the ID is already in use */
                add_trace("error", NULL, "callref already in use");
                end_trace();
                mncc = create_mncc(MNCC_REJ_REQ, callref);
-               gsm_trace_header(p_g_interface_name, this, MNCC_REJ_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_REJ_REQ, DIRECTION_OUT);
                mncc->fields |= MNCC_F_CAUSE;
                mncc->cause.coding = 3;
                mncc->cause.location = 1;
                mncc->fields |= MNCC_F_CAUSE;
                mncc->cause.coding = 3;
                mncc->cause.location = 1;
@@ -104,7 +104,7 @@ void Pgsm_ms::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        p_g_callref = callref;
        end_trace();
 
        p_g_callref = callref;
        end_trace();
 
-       gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_IND, DIRECTION_IN);
+       gsm_trace_header(p_interface_name, this, MNCC_SETUP_IND, DIRECTION_IN);
        /* caller information */
        p_callerinfo.ntype = INFO_NTYPE_NOTPRESENT;
        if (mncc->fields & MNCC_F_CALLING) {
        /* caller information */
        p_callerinfo.ntype = INFO_NTYPE_NOTPRESENT;
        if (mncc->fields & MNCC_F_CALLING) {
@@ -157,7 +157,7 @@ void Pgsm_ms::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
                add_trace("calling", "screen", "%d", mncc->calling.screen);
                add_trace("calling", "number", "%s", mncc->calling.number);
        }
                add_trace("calling", "screen", "%d", mncc->calling.screen);
                add_trace("calling", "number", "%s", mncc->calling.number);
        }
-       SCPY(p_callerinfo.interface, p_g_interface_name);
+       SCPY(p_callerinfo.interface, p_interface_name);
        /* dialing information */
        if (mncc->fields & MNCC_F_CALLED) {
                SCAT(p_dialinginfo.id, mncc->called.number);
        /* dialing information */
        if (mncc->fields & MNCC_F_CALLED) {
                SCAT(p_dialinginfo.id, mncc->called.number);
@@ -280,7 +280,7 @@ void Pgsm_ms::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        modify_lchan(RTP_PT_GSM_FULL);
 
        /* send call proceeding */
        modify_lchan(RTP_PT_GSM_FULL);
 
        /* send call proceeding */
-       gsm_trace_header(p_g_interface_name, this, MNCC_CALL_CONF_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_CALL_CONF_REQ, DIRECTION_OUT);
        proceeding = create_mncc(MNCC_CALL_CONF_REQ, p_g_callref);
        /* bearer capability (mandatory, if not present in setup message) */
        if (!(mncc->fields & MNCC_F_BEARER_CAP)) {
        proceeding = create_mncc(MNCC_CALL_CONF_REQ, p_g_callref);
        /* bearer capability (mandatory, if not present in setup message) */
        if (!(mncc->fields & MNCC_F_BEARER_CAP)) {
@@ -302,7 +302,7 @@ void Pgsm_ms::setup_ind(unsigned int msg_type, unsigned int callref, struct gsm_
        new_state(PORT_STATE_IN_PROCEEDING);
 
        if (p_g_tones && !p_g_tch_connected) { /* only if ... */
        new_state(PORT_STATE_IN_PROCEEDING);
 
        if (p_g_tones && !p_g_tch_connected) { /* only if ... */
-               gsm_trace_header(p_g_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_FRAME_RECV, DIRECTION_OUT);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
                end_trace();
                frame = create_mncc(MNCC_FRAME_RECV, p_g_callref);
                send_and_free_mncc(p_g_lcr_gsm, frame->msg_type, frame);
@@ -450,7 +450,7 @@ void Pgsm_ms::message_setup(unsigned int epoint_id, int message_id, union parame
 
        /* no instance */
        if (!p_g_lcr_gsm || p_g_lcr_gsm->mncc_lfd.fd < 0) {
 
        /* no instance */
        if (!p_g_lcr_gsm || p_g_lcr_gsm->mncc_lfd.fd < 0) {
-               gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
                add_trace("failure", NULL, "MS %s instance is unavailable", p_g_ms_name);
                end_trace();
                message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
                add_trace("failure", NULL, "MS %s instance is unavailable", p_g_ms_name);
                end_trace();
                message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
@@ -464,7 +464,7 @@ void Pgsm_ms::message_setup(unsigned int epoint_id, int message_id, union parame
        
        /* no number */
        if (!p_dialinginfo.id[0]) {
        
        /* no number */
        if (!p_dialinginfo.id[0]) {
-               gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
                add_trace("failure", NULL, "No dialed subscriber given.");
                end_trace();
                message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
                add_trace("failure", NULL, "No dialed subscriber given.");
                end_trace();
                message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
@@ -487,12 +487,12 @@ void Pgsm_ms::message_setup(unsigned int epoint_id, int message_id, union parame
                epointlist_new(epoint_id);
 
        /* creating l3id */
                epointlist_new(epoint_id);
 
        /* creating l3id */
-       gsm_trace_header(p_g_interface_name, this, 0, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, 0, DIRECTION_OUT);
        p_g_callref = new_callref++;
        add_trace("callref", "new", "0x%x", p_g_callref);
        end_trace();
 
        p_g_callref = new_callref++;
        add_trace("callref", "new", "0x%x", p_g_callref);
        end_trace();
 
-       gsm_trace_header(p_g_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
+       gsm_trace_header(p_interface_name, this, MNCC_SETUP_REQ, DIRECTION_OUT);
        mncc = create_mncc(MNCC_SETUP_REQ, p_g_callref);
        if (!strncasecmp(p_dialinginfo.id, "emerg", 5)) {
                mncc->emergency = 1;
        mncc = create_mncc(MNCC_SETUP_REQ, p_g_callref);
        if (!strncasecmp(p_dialinginfo.id, "emerg", 5)) {
                mncc->emergency = 1;
@@ -574,7 +574,7 @@ void Pgsm_ms::dtmf_statemachine(struct gsm_mncc *mncc)
                        p_g_dtmf_state = DTMF_ST_IDLE;
                        return;
                }
                        p_g_dtmf_state = DTMF_ST_IDLE;
                        return;
                }
-               gsm_trace_header(p_g_interface_name, this, MNCC_START_DTMF_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_START_DTMF_REQ, DIRECTION_OUT);
                dtmf = create_mncc(MNCC_START_DTMF_REQ, p_g_callref);
                dtmf->keypad = p_g_dtmf[p_g_dtmf_index++];
                p_g_dtmf_state = DTMF_ST_START;
                dtmf = create_mncc(MNCC_START_DTMF_REQ, p_g_callref);
                dtmf->keypad = p_g_dtmf[p_g_dtmf_index++];
                p_g_dtmf_state = DTMF_ST_START;
@@ -593,7 +593,7 @@ void Pgsm_ms::dtmf_statemachine(struct gsm_mncc *mncc)
                PDEBUG(DEBUG_GSM, "DTMF is on\n");
                break;
        case DTMF_ST_MARK:
                PDEBUG(DEBUG_GSM, "DTMF is on\n");
                break;
        case DTMF_ST_MARK:
-               gsm_trace_header(p_g_interface_name, this, MNCC_STOP_DTMF_REQ, DIRECTION_OUT);
+               gsm_trace_header(p_interface_name, this, MNCC_STOP_DTMF_REQ, DIRECTION_OUT);
                dtmf = create_mncc(MNCC_STOP_DTMF_REQ, p_g_callref);
                p_g_dtmf_state = DTMF_ST_STOP;
                end_trace();
                dtmf = create_mncc(MNCC_STOP_DTMF_REQ, p_g_callref);
                p_g_dtmf_state = DTMF_ST_STOP;
                end_trace();
index 760c289..cb7576f 100644 (file)
--- a/mISDN.cpp
+++ b/mISDN.cpp
@@ -122,7 +122,7 @@ int load_timer(struct lcr_timer *timer, void *instance, int index);
 /*
  * constructor
  */
 /*
  * constructor
  */
-PmISDN::PmISDN(int type, mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode) : Port(type, portname, settings)
+PmISDN::PmISDN(int type, mISDNport *mISDNport, char *portname, struct port_settings *settings, struct interface *interface, int channel, int exclusive, int mode) : Port(type, portname, settings, interface)
 {
        p_m_mISDNport = mISDNport;
        p_m_portnum = mISDNport->portnum;
 {
        p_m_mISDNport = mISDNport;
        p_m_portnum = mISDNport->portnum;
diff --git a/mISDN.h b/mISDN.h
index aad6f72..32136d1 100644 (file)
--- a/mISDN.h
+++ b/mISDN.h
@@ -100,7 +100,7 @@ void bchannel_event(struct mISDNport *mISDNport, int i, int event);
 class PmISDN : public Port
 {
        public:
 class PmISDN : public Port
 {
        public:
-       PmISDN(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode);
+       PmISDN(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, struct interface *interface, int channel, int exclusive, int mode);
        ~PmISDN();
        void bchannel_receive(struct mISDNhead *hh, unsigned char *data, int len);
        void transmit(unsigned char *buffer, int length);
        ~PmISDN();
        void bchannel_receive(struct mISDNhead *hh, unsigned char *data, int len);
        void transmit(unsigned char *buffer, int length);
index 98a644f..f1f92d1 100644 (file)
--- a/port.cpp
+++ b/port.cpp
@@ -148,7 +148,7 @@ struct epoint_list *Port::epointlist_new(unsigned int epoint_id)
 /*
  * port constructor
  */
 /*
  * port constructor
  */
-Port::Port(int type, const char *portname, struct port_settings *settings)
+Port::Port(int type, const char *portname, struct port_settings *settings, struct interface *interface)
 {
        class Port *temp, **tempp;
 
 {
        class Port *temp, **tempp;
 
@@ -159,6 +159,8 @@ Port::Port(int type, const char *portname, struct port_settings *settings)
                memset(&p_settings, 0, sizeof(p_settings));
        }
        SCPY(p_name, portname);
                memset(&p_settings, 0, sizeof(p_settings));
        }
        SCPY(p_name, portname);
+       if (interface)
+               SCPY(p_interface_name, interface->name);
        p_tone_dir[0] = '\0';
        p_type = type;
        p_serial = port_serial++;
        p_tone_dir[0] = '\0';
        p_type = type;
        p_serial = port_serial++;
@@ -197,7 +199,7 @@ Port::Port(int type, const char *portname, struct port_settings *settings)
 
        classuse++;
 
 
        classuse++;
 
-       PDEBUG(DEBUG_PORT, "new port (%d) of type 0x%x, name '%s'\n", p_serial, type, portname);
+       PDEBUG(DEBUG_PORT, "new port (%d) of type 0x%x, name '%s' interface '%s'\n", p_serial, type, portname, p_interface_name);
 }
 
 
 }
 
 
@@ -209,7 +211,7 @@ Port::~Port(void)
        class Port *temp, **tempp;
        struct lcr_msg *message;
 
        class Port *temp, **tempp;
        struct lcr_msg *message;
 
-       PDEBUG(DEBUG_PORT, "removing port (%d) of type 0x%x, name '%s'\n", p_serial, p_type, p_name);
+       PDEBUG(DEBUG_PORT, "removing port (%d) of type 0x%x, name '%s' interface '%s'\n", p_serial, p_type, p_name, p_interface_name);
 
        if (p_bridge) {
                PDEBUG(DEBUG_PORT, "Removing us from bridge %u\n", p_bridge->bridge_id);
 
        if (p_bridge) {
                PDEBUG(DEBUG_PORT, "Removing us from bridge %u\n", p_bridge->bridge_id);
diff --git a/port.h b/port.h
index 5ecbbbb..af9610f 100644 (file)
--- a/port.h
+++ b/port.h
@@ -177,7 +177,7 @@ class Port
 {
        public:
        /* methods */
 {
        public:
        /* methods */
-       Port(int type, const char *portname, struct port_settings *settings);
+       Port(int type, const char *portname, struct port_settings *settings, struct interface *interface);
        virtual ~Port();
        class Port *next;                       /* next port in list */
        int p_type;                             /* type of port */
        virtual ~Port();
        class Port *next;                       /* next port in list */
        int p_type;                             /* type of port */
@@ -188,6 +188,7 @@ class Port
        virtual void update_load(void);
 
        struct port_settings p_settings;
        virtual void update_load(void);
 
        struct port_settings p_settings;
+       char p_interface_name[64];
        
        /* tone */
        char p_tone_dir[256];                   /* name of current directory */
        
        /* tone */
        char p_tone_dir[256];                   /* name of current directory */
index 81268b5..d181fb8 100644 (file)
@@ -16,14 +16,13 @@ unsigned int new_remote = 1000;
 /*
  * constructor
  */
 /*
  * constructor
  */
-Premote::Premote(int type, char *portname, struct port_settings *settings, struct interface *interface, int remote_id) : Port(type, portname, settings)
+Premote::Premote(int type, char *portname, struct port_settings *settings, struct interface *interface, int remote_id) : Port(type, portname, settings, interface)
 {
        union parameter param;
 
        p_callerinfo.itype = (interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
        p_r_ref = new_remote++;
        SCPY(p_r_remote_app, interface->remote_app);
 {
        union parameter param;
 
        p_callerinfo.itype = (interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
        p_r_ref = new_remote++;
        SCPY(p_r_remote_app, interface->remote_app);
-       SCPY(p_r_interface_name, interface->name);
        p_r_tones = (interface->is_tones == IS_YES);
 
        /* send new ref to remote socket */
        p_r_tones = (interface->is_tones == IS_YES);
 
        /* send new ref to remote socket */
@@ -59,9 +58,9 @@ int Premote::message_epoint(unsigned int epoint_id, int message_type, union para
        switch (message_type) {
        case MESSAGE_SETUP:
                struct interface *interface;
        switch (message_type) {
        case MESSAGE_SETUP:
                struct interface *interface;
-               interface = getinterfacebyname(p_r_interface_name);
+               interface = getinterfacebyname(p_interface_name);
                if (!interface) {
                if (!interface) {
-                       PERROR("Cannot find interface %s.\n", p_r_interface_name);
+                       PERROR("Cannot find interface %s.\n", p_interface_name);
                        return 0;
                }
                /* attach only if not already */
                        return 0;
                }
                /* attach only if not already */
@@ -133,9 +132,9 @@ void Premote::message_remote(int message_type, union parameter *param)
                break;
 
        case MESSAGE_SETUP:
                break;
 
        case MESSAGE_SETUP:
-               interface = getinterfacebyname(p_r_interface_name);
+               interface = getinterfacebyname(p_interface_name);
                if (!interface) {
                if (!interface) {
-                       PERROR("Cannot find interface %s.\n", p_r_interface_name);
+                       PERROR("Cannot find interface %s.\n", p_interface_name);
                        return;
                }
 
                        return;
                }
 
index bdb20f3..f7afa6a 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -10,7 +10,6 @@ class Premote : public Port
        unsigned int p_r_ref;
        int p_r_remote_id; /* remote instance (socket) */
        char p_r_remote_app[32];
        unsigned int p_r_ref;
        int p_r_remote_id; /* remote instance (socket) */
        char p_r_remote_app[32];
-       char p_r_interface_name[64];
        int p_r_tones;
 
        int message_epoint(unsigned int epoint_id, int message_id, union parameter *param);
        int p_r_tones;
 
        int message_epoint(unsigned int epoint_id, int message_id, union parameter *param);
diff --git a/sip.cpp b/sip.cpp
index c6670fc..7d16328 100644 (file)
--- a/sip.cpp
+++ b/sip.cpp
@@ -35,7 +35,7 @@ static int delete_event(struct lcr_work *work, void *instance, int index);
 /*
  * initialize SIP port
  */
 /*
  * initialize SIP port
  */
-Psip::Psip(int type, char *portname, struct port_settings *settings, struct interface *interface) : Port(type, portname, settings)
+Psip::Psip(int type, char *portname, struct port_settings *settings, struct interface *interface) : Port(type, portname, settings, interface)
 {
        p_s_rtp_bridge = 0;
        if (interface->rtp_bridge)
 {
        p_s_rtp_bridge = 0;
        if (interface->rtp_bridge)
diff --git a/ss5.cpp b/ss5.cpp
index 7157d8f..321f4f3 100644 (file)
--- a/ss5.cpp
+++ b/ss5.cpp
@@ -252,7 +252,7 @@ void ss5_create_channel(struct mISDNport *mISDNport, int i)
        memset(&port_settings, 0, sizeof(port_settings));
        SCPY(port_settings.tones_dir, options.tones_dir);
 
        memset(&port_settings, 0, sizeof(port_settings));
        SCPY(port_settings.tones_dir, options.tones_dir);
 
-       ss5port = new Pss5(PORT_TYPE_SS5_IDLE, mISDNport, portname, &port_settings, i + (i>=15) + 1, 1, B_MODE_TRANSPARENT);
+       ss5port = new Pss5(PORT_TYPE_SS5_IDLE, mISDNport, portname, &port_settings, mISDNport->ifport->interface, i + (i>=15) + 1, 1, B_MODE_TRANSPARENT);
        if (!ss5port)
                FATAL("No memory for Pss5 class.\n");
        if (!ss5port->p_m_b_channel)
        if (!ss5port)
                FATAL("No memory for Pss5 class.\n");
        if (!ss5port->p_m_b_channel)
@@ -338,7 +338,7 @@ int queue_event(struct lcr_work *work, void *instance, int index);
 /*
  * constructor
  */
 /*
  * constructor
  */
-Pss5::Pss5(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode) : PmISDN(type, mISDNport, portname, settings, channel, exclusive, mode)
+Pss5::Pss5(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, struct interface *interface, int channel, int exclusive, int mode) : PmISDN(type, mISDNport, portname, settings, interface, channel, exclusive, mode)
 {
        p_callerinfo.itype = (mISDNport->ifport->interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
        p_m_s_state = SS5_STATE_IDLE;
 {
        p_callerinfo.itype = (mISDNport->ifport->interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
        p_m_s_state = SS5_STATE_IDLE;
diff --git a/ss5.h b/ss5.h
index 8a0c20d..adedac7 100644 (file)
--- a/ss5.h
+++ b/ss5.h
@@ -23,7 +23,7 @@
 class Pss5 : public PmISDN
 {
        public:
 class Pss5 : public PmISDN
 {
        public:
-       Pss5(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode);
+       Pss5(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, struct interface *interface, int channel, int exclusive, int mode);
        ~Pss5();
        int message_epoint(unsigned int epoint_id, int message, union parameter *param);
        void set_tone(const char *dir, const char *name);
        ~Pss5();
        int message_epoint(unsigned int epoint_id, int message, union parameter *param);
        void set_tone(const char *dir, const char *name);
index b0268cc..15475d9 100644 (file)
--- a/vbox.cpp
+++ b/vbox.cpp
@@ -23,7 +23,7 @@ int record_timeout(struct lcr_timer *timer, void *instance, int index);
 /*
  * initialize vbox port
  */
 /*
  * initialize vbox port
  */
-VBoxPort::VBoxPort(int type, struct port_settings *settings) : Port(type, "vbox", settings)
+VBoxPort::VBoxPort(int type, struct port_settings *settings) : Port(type, "vbox", settings, NULL)
 {
        p_vbox_timeout = 0;
        p_vbox_announce_fh = -1;
 {
        p_vbox_timeout = 0;
        p_vbox_announce_fh = -1;