X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=apppbx.cpp;h=2cf482630a4d0ae90c2bbd96f751252347fa357c;hp=0369bb9c2845ec276195433cebdcfadb8f8152e2;hb=0562b894ff8302ad4ca2d0df1f659cc18f6af5fb;hpb=04fc928a2c5f0262e85c09cced1ef20a9fd15f3d diff --git a/apppbx.cpp b/apppbx.cpp index 0369bb9..2cf4826 100644 --- a/apppbx.cpp +++ b/apppbx.cpp @@ -796,7 +796,7 @@ void EndpointAppPBX::out_setup(int cfnr) 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); @@ -917,7 +917,7 @@ void EndpointAppPBX::out_setup(int cfnr) 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; @@ -1079,7 +1079,7 @@ void EndpointAppPBX::out_setup(int cfnr) 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); @@ -2229,8 +2229,6 @@ void EndpointAppPBX::port_notify(struct port_list *portlist, int message_type, u logmessage(message_type, param, portlist->port_id, DIRECTION_IN); struct lcr_msg *message; - const char *logtext = ""; - char buffer[64]; /* signal to call tool */ admin_call_response(e_adminid, ADMIN_CALL_NOTIFY, numberrize_callerinfo(param->notifyinfo.id,param->notifyinfo.ntype, options.national, options.international), 0, 0, param->notifyinfo.notify); @@ -2274,86 +2272,6 @@ void EndpointAppPBX::port_notify(struct port_list *portlist, int message_type, u break; } - /* get name of notify */ - switch(param->notifyinfo.notify) { - case 0x00: - logtext = "NULL"; - break; - case 0x80: - logtext = "USER_SUSPENDED"; - break; - case 0x82: - logtext = "BEARER_SERVICE_CHANGED"; - break; - case 0x81: - logtext = "USER_RESUMED"; - break; - case 0xc2: - logtext = "CONFERENCE_ESTABLISHED"; - break; - case 0xc3: - logtext = "CONFERENCE_DISCONNECTED"; - break; - case 0xc4: - logtext = "OTHER_PARTY_ADDED"; - break; - case 0xc5: - logtext = "ISOLATED"; - break; - case 0xc6: - logtext = "REATTACHED"; - break; - case 0xc7: - logtext = "OTHER_PARTY_ISOLATED"; - break; - case 0xc8: - logtext = "OTHER_PARTY_REATTACHED"; - break; - case 0xc9: - logtext = "OTHER_PARTY_SPLIT"; - break; - case 0xca: - logtext = "OTHER_PARTY_DISCONNECTED"; - break; - case 0xcb: - logtext = "CONFERENCE_FLOATING"; - break; - case 0xcc: - logtext = "CONFERENCE_DISCONNECTED_PREEMTED"; - break; - case 0xcf: - logtext = "CONFERENCE_FLOATING_SERVED_USER_PREEMTED"; - break; - case 0xe0: - logtext = "CALL_IS_A_WAITING_CALL"; - break; - case 0xe8: - logtext = "DIVERSION_ACTIVATED"; - break; - case 0xe9: - logtext = "RESERVED_CT_1"; - break; - case 0xea: - logtext = "RESERVED_CT_2"; - break; - case 0xee: - logtext = "REVERSE_CHARGING"; - break; - case 0xf9: - logtext = "REMOTE_HOLD"; - break; - case 0xfa: - logtext = "REMOTE_RETRIEVAL"; - break; - case 0xfb: - logtext = "CALL_IS_DIVERTING"; - break; - default: - SPRINT(buffer, "%d", param->notifyinfo.notify - 0x80); - logtext = buffer; - - } - /* notify call if available */ if (ea_endpoint->ep_join_id) { message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOTIFY); @@ -2471,6 +2389,19 @@ void EndpointAppPBX::port_enablekeypad(struct port_list *portlist, int message_t } +/* port MESSAGE_DISABLE_DEJITTER */ +void EndpointAppPBX::port_disable_dejitter(struct port_list *portlist, int message_type, union parameter *param) +{ + struct lcr_msg *message; + + logmessage(message_type, param, portlist->port_id, DIRECTION_IN); + + message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_DISABLE_DEJITTER); + memcpy(&message->param, param, sizeof(union parameter)); + message_put(message); +} + + /* port sends message to the endpoint */ void EndpointAppPBX::ea_message_port(unsigned int port_id, int message_type, union parameter *param) @@ -2657,6 +2588,11 @@ void EndpointAppPBX::ea_message_port(unsigned int port_id, int message_type, uni port_enablekeypad(portlist, message_type, param); break; + case MESSAGE_DISABLE_DEJITTER: + PDEBUG(DEBUG_EPOINT, "EPOINT(%d) incoming disable dejitter message (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id); + port_disable_dejitter(portlist, message_type, param); + break; + default: PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received a wrong message: %d\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id, message_type); @@ -3181,6 +3117,19 @@ void EndpointAppPBX::join_dtmf(struct port_list *portlist, int message_type, uni } } +/* join MESSAGE_DISABLE_DEJITTER */ +void EndpointAppPBX::join_disable_dejitter(struct port_list *portlist, int message_type, union parameter *param) +{ + struct lcr_msg *message; + + while(portlist) { + message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_DISABLE_DEJITTER); + memcpy(&message->param, param, sizeof(union parameter)); + message_put(message); + portlist = portlist->next; + } +} + /* JOIN sends messages to the endpoint */ void EndpointAppPBX::ea_message_join(unsigned int join_id, int message_type, union parameter *param) @@ -3352,6 +3301,12 @@ void EndpointAppPBX::ea_message_join(unsigned int join_id, int message_type, uni join_dtmf(portlist, message_type, param); break; + /* JOIN sends a DISABLE_DEJITTER message */ + case MESSAGE_DISABLE_DEJITTER: + PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received disable dejitter.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id); + join_disable_dejitter(portlist, message_type, param); + break; + default: PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received a wrong message: #%d\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id, message_type); } @@ -4032,6 +3987,10 @@ void EndpointAppPBX::logmessage(int message_type, union parameter *param, unsign add_trace("from", NULL, "CH(%lu)", port_id); if (param->setup.callerinfo.extension[0]) add_trace("extension", NULL, "%s", param->setup.callerinfo.extension); + if (param->setup.callerinfo.interface[0]) + add_trace("interface", "from", "%s", param->setup.callerinfo.interface); + if (param->setup.dialinginfo.interfaces[0]) + add_trace("interface", "to", "%s", param->setup.dialinginfo.interfaces); add_trace("caller id", "number", "%s", numberrize_callerinfo(param->setup.callerinfo.id, param->setup.callerinfo.ntype, options.national, options.international)); switch(param->setup.callerinfo.present) { case INFO_PRESENT_RESTRICTED: @@ -4432,6 +4391,13 @@ void EndpointAppPBX::logmessage(int message_type, union parameter *param, unsign end_trace(); break; + case MESSAGE_DISABLE_DEJITTER: + trace_header("DISBALE_DEJITTER", dir); + if (param->queue) + add_trace("queue", NULL, "%d", param->queue); + end_trace(); + break; + default: PERROR("EPOINT(%d) message not of correct type (%d)\n", ea_endpoint->ep_serial, message_type); }