socket mISDN work
[lcr.git] / apppbx.cpp
index 66aba31..3788c85 100644 (file)
@@ -678,9 +678,9 @@ foundif:
        }
 
        /* see if link is up on PTP*/
-       if (mISDNport->ptp && !mISDNport->l2link)
+       if (mISDNport->l2hold && !mISDNport->l2link)
        {
-               trace_header("CHANNEL SELECTION (port is ptp with layer 2 down, skipping)", DIRECTION_NONE);
+               trace_header("CHANNEL SELECTION (port holds layer 2, but layer 2 is down, skipping)", DIRECTION_NONE);
                add_trace("port", NULL, "%d", ifport->portnum);
                add_trace("position", NULL, "%d", index);
                end_trace();
@@ -2845,7 +2845,7 @@ void EndpointAppPBX::join_facility(struct port_list *portlist, int message_type,
 {
        struct message *message;
 
-       if (!e_ext.facility)
+       if (!e_ext.facility && e_ext.number[0])
        {
                return;
        }
@@ -2877,7 +2877,10 @@ void EndpointAppPBX::join_overlap(struct port_list *portlist, int message_type,
        }
        if (e_action) if (e_action->index == ACTION_OUTDIAL || e_action->index == ACTION_EXTERNAL)
        {
-                       set_tone(portlist, "dialtone");
+                       if (e_dialinginfo.id[0])
+                               set_tone(portlist, "dialing");
+                       else
+                               set_tone(portlist, "dialtone");
                        return;
        }
        if (e_ext.number[0])
@@ -3120,7 +3123,7 @@ void EndpointAppPBX::join_disconnect_release(int message_type, union parameter *
 void EndpointAppPBX::join_setup(struct port_list *portlist, int message_type, union parameter *param)
 {
        struct message *message;
-       struct interface        *interface;
+//     struct interface        *interface;
 
        /* if we already in setup state, we just update the dialing with new digits */
        if (e_state == EPOINT_STATE_OUT_SETUP
@@ -3878,12 +3881,12 @@ void EndpointAppPBX::join_join(void)
        {
                if (other_relation->epoint_id == other_eapp->ea_endpoint->ep_serial)
                {
-               /* detach other endpoint on hold */
+                       /* detach other endpoint on hold */
                        *other_relation_pointer = other_relation->next;
                        FREE(other_relation, sizeof(struct join_relation));
                        cmemuse--;
                        other_relation = *other_relation_pointer;
-                       other_eapp->ea_endpoint->ep_join_id = NULL;
+                       other_eapp->ea_endpoint->ep_join_id = 0;
                        continue;
                }