Fix: Do not send notify IDs that are not 0, 1 or 2
[lcr.git] / action.cpp
index 3fc6449..b42e301 100644 (file)
@@ -112,7 +112,7 @@ void EndpointAppPBX::action_dialing_internal(void)
                end_trace();
                release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, 0, 0, 0);
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNALLOCATED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNALLOCATED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_86");
                return;
        }
@@ -123,7 +123,7 @@ void EndpointAppPBX::action_dialing_internal(void)
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
                release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, 0, 0, 0);
-               message_disconnect_port(portlist, CAUSE_REJECTED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_REJECTED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_81");
                return;
        }
@@ -257,7 +257,7 @@ void EndpointAppPBX::action_dialing_external(void)
                release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_REJECTED, 0, 0, 0);
                set_tone(portlist, "cause_82");
                denied:
-               message_disconnect_port(portlist, CAUSE_REJECTED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_REJECTED, LOCATION_PRIVATE_LOCAL, "", NULL);
                new_state(EPOINT_STATE_OUT_DISCONNECT);
                return;
        }
@@ -324,7 +324,7 @@ void EndpointAppPBX::action_dialing_vbox_record(void)
                end_trace();
 
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                return;
        }
@@ -335,7 +335,7 @@ void EndpointAppPBX::action_dialing_vbox_record(void)
                add_trace("extension", NULL, "%s", rparam->string_value);
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNALLOCATED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNALLOCATED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_86");
                return;
        }
@@ -345,7 +345,7 @@ void EndpointAppPBX::action_dialing_vbox_record(void)
                trace_header("ACTION vbox-record (internal calls are denied)", DIRECTION_NONE);
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_REJECTED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_REJECTED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_81");
                return;
        }
@@ -402,7 +402,7 @@ void EndpointAppPBX::action_init_partyline(void)
                end_trace();
                noroom:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                return;
        }
@@ -500,7 +500,7 @@ void EndpointAppPBX::action_dialing_login(void)
                        end_trace();
                        /* extension doesn't exist */
                        new_state(EPOINT_STATE_OUT_DISCONNECT);
-                       message_disconnect_port(portlist, CAUSE_UNALLOCATED, LOCATION_PRIVATE_LOCAL, "");
+                       message_disconnect_port(portlist, CAUSE_UNALLOCATED, LOCATION_PRIVATE_LOCAL, "", NULL);
                        set_tone(portlist, "cause_86");
                        return;
                }
@@ -591,7 +591,7 @@ void EndpointAppPBX::action_init_change_callerid(void)
                /* service not available */
                trace_header("ACTION change-callerid (denied for this caller)", DIRECTION_NONE);
                end_trace();
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                new_state(EPOINT_STATE_OUT_DISCONNECT);
                set_tone(portlist,"cause_87");
                return;
@@ -681,7 +681,7 @@ void EndpointAppPBX::_action_callerid_calleridnext(int next)
        add_trace("new", "caller id", "%s", numberrize_callerinfo(new_id, new_type, options.national, options.international));
        add_trace("new", "present", "%s", (new_present==INFO_PRESENT_RESTRICTED)?"restricted":"allowed");
        end_trace();
-       message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
+       message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "", NULL);
        new_state(EPOINT_STATE_OUT_DISCONNECT);
        set_tone(portlist,"activated");
 }
@@ -712,7 +712,7 @@ void EndpointAppPBX::action_init_change_forward(void)
                trace_header("ACTION change-forward (denied for this caller)", DIRECTION_NONE);
                end_trace();
                /* service not available */             
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                new_state(EPOINT_STATE_OUT_DISCONNECT);
                set_tone(portlist,"cause_87");
                return;
@@ -776,7 +776,7 @@ void EndpointAppPBX::action_dialing_forward(void)
                write_extension(&e_ext, e_ext.number);
        }
        /* function (de)activated */
-       message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
+       message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "", NULL);
        new_state(EPOINT_STATE_OUT_DISCONNECT);
        if (dest[0])
                set_tone(portlist,"activated");
@@ -796,7 +796,7 @@ void EndpointAppPBX::action_init_redial_reply(void)
                trace_header("ACTION redial/reply (no last number stored)", DIRECTION_NONE);
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                return;
        }
@@ -910,7 +910,7 @@ void EndpointAppPBX::action_dialing_powerdial(void)
                trace_header("ACTION powerdial (no last number stored)", DIRECTION_NONE);
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                return;
        }
@@ -976,7 +976,7 @@ void EndpointAppPBX::action_dialing_callback(void)
                disconnect:
 
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                e_cbcaller[0] = e_cbdialing[0] = '\0';
@@ -1076,7 +1076,7 @@ void EndpointAppPBX::action_dialing_abbrev(void)
                trace_header("ACTION abbreviation (only for extension)", DIRECTION_NONE);
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                return;
        }
@@ -1091,7 +1091,7 @@ void EndpointAppPBX::action_dialing_abbrev(void)
                add_trace("abbrev", NULL, "%s", abbrev);
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNALLOCATED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNALLOCATED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_01");
                return;
        }
@@ -1246,7 +1246,7 @@ void EndpointAppPBX::action_dialing_test(void)
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
                SPRINT(causestr,"cause_%02x",cause);
-               message_disconnect_port(portlist, cause, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, cause, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, causestr);
                break;
 
@@ -1256,7 +1256,7 @@ void EndpointAppPBX::action_dialing_test(void)
                add_trace("cause", NULL, "16");
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "release");
                break;
 
@@ -1297,7 +1297,7 @@ void EndpointAppPBX::action_init_play(void)
 
                disconnect:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                return;
@@ -1569,7 +1569,7 @@ void EndpointAppPBX::_action_goto_menu(int mode)
 
                disconnect:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_SERVICEUNAVAIL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                return;
@@ -1587,6 +1587,7 @@ void EndpointAppPBX::_action_goto_menu(int mode)
        /* if the 'menu' was selected, we will flush all digits */
        if (mode) {
                e_dialinginfo.id[0] = 0;
+               e_dialinginfo.sending_complete = 0;
                e_extdialing = e_dialinginfo.id;
        } else {
                /* remove digits that are required to match the rule */
@@ -1681,7 +1682,7 @@ void EndpointAppPBX::action_dialing_disconnect(void)
        new_state(EPOINT_STATE_OUT_DISCONNECT);
        set_tone(portlist, cause_string);
        if (!(rparam = routeparam(e_action, PARAM_CONNECT))) {
-               message_disconnect_port(portlist, cause, location, display);
+               message_disconnect_port(portlist, cause, location, display, NULL);
        } else {
                message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
                SCPY(message->param.notifyinfo.display, display);
@@ -2018,7 +2019,7 @@ void EndpointAppPBX::action_dialing_password(void)
                e_connectedmode = 0;
                e_dtmf = 0;
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_10");
                return;
        }
@@ -2053,6 +2054,7 @@ void EndpointAppPBX::action_dialing_password_wr(void)
  */
 void EndpointAppPBX::action_init_pots_retrieve(void)
 {
+#ifdef ISDN_P_FXS_POTS
        struct route_param *rparam;
        struct port_list *portlist = ea_endpoint->ep_portlist;
        class Port *port;
@@ -2067,7 +2069,7 @@ void EndpointAppPBX::action_init_pots_retrieve(void)
 
                disconnect:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                return;
@@ -2102,13 +2104,11 @@ void EndpointAppPBX::action_init_pots_retrieve(void)
                goto disconnect;
        }
 
-#ifdef ISDN_P_FXS_POTS
        /* release our call */
        ourfxs->hangup_ind(0);
 
        /* retrieve selected call */
        fxs->retrieve_ind(0);
-#endif
 
        /* split if selected call is member of a 3pty */
        epoint = find_epoint_id(ACTIVE_EPOINT(fxs->p_epointlist));
@@ -2116,6 +2116,7 @@ void EndpointAppPBX::action_init_pots_retrieve(void)
                PDEBUG(DEBUG_EPOINT, "EPOINT(%d) try spliting 3pty. this may fail because we don't have a 3pty.\n", epoint->ep_serial);
                ((class EndpointAppPBX *)epoint->ep_app)->split_3pty();
        }
+#endif
 }
 
 
@@ -2123,6 +2124,7 @@ void EndpointAppPBX::action_init_pots_retrieve(void)
  */
 void EndpointAppPBX::action_init_pots_release(void)
 {
+#ifdef ISDN_P_FXS_POTS
        struct route_param *rparam;
        struct port_list *portlist = ea_endpoint->ep_portlist;
        class Port *port;
@@ -2136,7 +2138,7 @@ void EndpointAppPBX::action_init_pots_release(void)
 
                disconnect:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                return;
@@ -2174,18 +2176,17 @@ void EndpointAppPBX::action_init_pots_release(void)
 #if 0
        /* disconnect our call */
        new_state(EPOINT_STATE_OUT_DISCONNECT);
-       message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
+       message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "", NULL);
        set_tone(portlist, "hangup");
        e_action = NULL;
 #endif
 
-#ifdef ISDN_P_FXS_POTS
        /* release selected call */
        fxs->hangup_ind(0);
-#endif
 
        /* indicate timeout, so next action will be processed */
        process_dialing(1);
+#endif
 }
 
 
@@ -2193,6 +2194,7 @@ void EndpointAppPBX::action_init_pots_release(void)
  */
 void EndpointAppPBX::action_init_pots_reject(void)
 {
+#ifdef ISDN_P_FXS_POTS
        struct port_list *portlist = ea_endpoint->ep_portlist;
        class Port *port;
        class Pfxs *ourfxs, *fxs;
@@ -2206,7 +2208,7 @@ void EndpointAppPBX::action_init_pots_reject(void)
                end_trace();
                disconnect:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                return;
@@ -2230,13 +2232,12 @@ void EndpointAppPBX::action_init_pots_reject(void)
                goto disconnect;
        }
 
-#ifdef ISDN_P_FXS_POTS
        /* reject alerting call */
        fxs->reject_ind(0);
-#endif
 
        /* indicate timeout, so next action will be processed */
        process_dialing(1);
+#endif
 }
 
 
@@ -2244,6 +2245,7 @@ void EndpointAppPBX::action_init_pots_reject(void)
  */
 void EndpointAppPBX::action_init_pots_answer(void)
 {
+#ifdef ISDN_P_FXS_POTS
        struct port_list *portlist = ea_endpoint->ep_portlist;
        class Port *port;
        class Pfxs *ourfxs, *fxs;
@@ -2257,7 +2259,7 @@ void EndpointAppPBX::action_init_pots_answer(void)
                end_trace();
                disconnect:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                return;
@@ -2281,7 +2283,6 @@ void EndpointAppPBX::action_init_pots_answer(void)
                goto disconnect;
        }
 
-#ifdef ISDN_P_FXS_POTS
        /* release our call */
        ourfxs->hangup_ind(0);
 
@@ -2295,6 +2296,7 @@ void EndpointAppPBX::action_init_pots_answer(void)
  */
 void EndpointAppPBX::action_init_pots_3pty(void)
 {
+#ifdef ISDN_P_FXS_POTS
        struct port_list *portlist = ea_endpoint->ep_portlist;
        class Port *port;
        class Pfxs *ourfxs, *fxs, *fxs1 = NULL, *fxs2 = NULL;
@@ -2310,7 +2312,7 @@ void EndpointAppPBX::action_init_pots_3pty(void)
                end_trace();
                disconnect:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                return;
@@ -2337,12 +2339,9 @@ void EndpointAppPBX::action_init_pots_3pty(void)
                goto disconnect;
        }
 
-#ifdef ISDN_P_FXS_POTS
        /* release our call */
        ourfxs->hangup_ind(0);
-#endif
 
-#ifdef ISDN_P_FXS_POTS
        /* retrieve latest active call */
        if (fxs2->p_m_fxs_age > fxs1->p_m_fxs_age) {
                fxs2->retrieve_ind(0);
@@ -2351,9 +2350,6 @@ void EndpointAppPBX::action_init_pots_3pty(void)
                fxs1->retrieve_ind(0);
                epoint = find_epoint_id(ACTIVE_EPOINT(fxs2->p_epointlist));
        }
-#else
-       epoint = NULL;
-#endif
 
        if (!epoint) {
                trace_header("ACTION pots-3pty (interal error: no endpoint)", DIRECTION_NONE);
@@ -2373,12 +2369,14 @@ void EndpointAppPBX::action_init_pots_3pty(void)
                end_trace();
                return;
        }
+#endif
 }
 
 /* process pots-transfer
  */
 void EndpointAppPBX::action_init_pots_transfer(void)
 {
+#ifdef ISDN_P_FXS_POTS
        struct route_param *rparam;
        struct port_list *portlist = ea_endpoint->ep_portlist;
        class Port *port;
@@ -2392,7 +2390,7 @@ void EndpointAppPBX::action_init_pots_transfer(void)
 
                disconnect:
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                e_action = NULL;
                return;
@@ -2429,15 +2427,14 @@ void EndpointAppPBX::action_init_pots_transfer(void)
                goto disconnect;
        }
 
-#ifdef ISDN_P_FXS_POTS
        /* retrieve call */
        if (fxs2->p_m_fxs_age > fxs1->p_m_fxs_age)
                fxs2->retrieve_ind(0);
        else
                fxs1->retrieve_ind(0);
-#endif
        /* bridge calls */
        join_join_fxs();
+#endif
 }
 
 
@@ -2477,7 +2474,7 @@ void EndpointAppPBX::process_dialing(int timeout)
                add_trace("max-levels", NULL, "%d", RULE_NESTING);
                end_trace();
                new_state(EPOINT_STATE_OUT_DISCONNECT);
-               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL, "", NULL);
                set_tone(portlist, "cause_3f");
                unsched_timer(&e_action_timeout);
                unsched_timer(&e_match_timeout);
@@ -2504,7 +2501,7 @@ void EndpointAppPBX::process_dialing(int timeout)
                        /* nothing more, so we release */
                        PDEBUG(DEBUG_ROUTE|DEBUG_EPOINT, "EPOINT(%d): action timed out, and we have no next action, so we disconnect.\n", ea_endpoint->ep_serial);
                        new_state(EPOINT_STATE_OUT_DISCONNECT);
-                       message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
+                       message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "", NULL);
                        set_tone(portlist, "cause_3f");
                        goto end;
                }
@@ -2533,7 +2530,7 @@ void EndpointAppPBX::process_dialing(int timeout)
                        goto end;
                }
                /* invalid dialing */
-               message_disconnect_port(portlist, CAUSE_INCALID, LOCATION_PRIVATE_LOCAL, "");
+               message_disconnect_port(portlist, CAUSE_INCALID, LOCATION_PRIVATE_LOCAL, "", NULL);
                        message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_DISCONNECT);
                        message->param.disconnectinfo.cause = CAUSE_INVALID;
                        message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;