trace_header("NEW STATE", DIRECTION_NONE);
add_trace("state", "old", "%s", state_name[e_state]);
add_trace("state", "new", "%s", state_name[state]);
trace_header("NEW STATE", DIRECTION_NONE);
add_trace("state", "old", "%s", state_name[e_state]);
add_trace("state", "new", "%s", state_name[state]);
admin_call_response(e_adminid, ADMIN_CALL_RELEASE, "", joincause, joinlocation, 0);
/* if a release is pending */
admin_call_response(e_adminid, ADMIN_CALL_RELEASE, "", joincause, joinlocation, 0);
/* if a release is pending */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d): do pending release (joincause %d location %d)\n", ea_endpoint->ep_serial, joincause, joinlocation);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d): do pending release (joincause %d location %d)\n", ea_endpoint->ep_serial, joincause, joinlocation);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = joincause;
message->param.disconnectinfo.location = joinlocation;
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = joincause;
message->param.disconnectinfo.location = joinlocation;
if (e_hold_id)
join_release(e_hold_id, ea_endpoint->ep_serial, 1, joinlocation, joincause);
e_hold_id = 0;
}
#endif
}
if (e_hold_id)
join_release(e_hold_id, ea_endpoint->ep_serial, 1, joinlocation, joincause);
e_hold_id = 0;
}
#endif
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) do pending release (portcause %d portlocation)\n", ea_endpoint->ep_serial, portcause, portlocation);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) do pending release (portcause %d portlocation)\n", ea_endpoint->ep_serial, portcause, portlocation);
SPRINT(cause, "cause_%02x", portcause);
set_tone(portlist, cause);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_RELEASE);
SPRINT(cause, "cause_%02x", portcause);
set_tone(portlist, cause);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_RELEASE);
/* reset some stuff */
new_state(EPOINT_STATE_IDLE);
memset(&e_connectinfo, 0, sizeof(struct connect_info));
/* reset some stuff */
new_state(EPOINT_STATE_IDLE);
memset(&e_connectinfo, 0, sizeof(struct connect_info));
memcpy(&e_callbackinfo, &e_callerinfo, sizeof(e_callbackinfo));
memset(&e_dialinginfo, 0, sizeof(e_dialinginfo));
/* create dialing by callerinfo */
memcpy(&e_callbackinfo, &e_callerinfo, sizeof(e_callbackinfo));
memset(&e_dialinginfo, 0, sizeof(e_dialinginfo));
/* create dialing by callerinfo */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) preparing callback to internal: %s interface %s\n", ea_endpoint->ep_serial, e_ext.number, e_extension_interface);
/* create callback to the current terminal */
SCPY(e_dialinginfo.id, e_ext.number);
SCPY(e_dialinginfo.interfaces, e_extension_interface);
e_dialinginfo.itype = INFO_ITYPE_ISDN_EXTENSION;
e_dialinginfo.ntype = INFO_NTYPE_UNKNOWN;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) preparing callback to internal: %s interface %s\n", ea_endpoint->ep_serial, e_ext.number, e_extension_interface);
/* create callback to the current terminal */
SCPY(e_dialinginfo.id, e_ext.number);
SCPY(e_dialinginfo.interfaces, e_extension_interface);
e_dialinginfo.itype = INFO_ITYPE_ISDN_EXTENSION;
e_dialinginfo.ntype = INFO_NTYPE_UNKNOWN;
/* numberrize caller id and use it to dial to the callback */
SCPY(e_dialinginfo.id, numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype, options.national, options.international));
}
/* numberrize caller id and use it to dial to the callback */
SCPY(e_dialinginfo.id, numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype, options.national, options.international));
}
/* NOTE: is caller is is not available for this extesion, it has been removed by apply_callerid_restriction already */
/* internal extension's caller id */
/* NOTE: is caller is is not available for this extesion, it has been removed by apply_callerid_restriction already */
/* internal extension's caller id */
if (present == INFO_PRESENT_RESTRICTED)
SCAT(display, "anonymous");
else
if (present == INFO_PRESENT_RESTRICTED)
SCAT(display, "anonymous");
else
if (present == INFO_PRESENT_RESTRICTED)
SCAT(display, "anonymous");
else
if (present == INFO_PRESENT_RESTRICTED)
SCAT(display, "anonymous");
else
case NOTIFY_STATE_ACTIVE:
/* we are already active, so we don't do anything */
break;
case NOTIFY_STATE_SUSPEND:
notify = INFO_NOTIFY_USER_RESUMED;
case NOTIFY_STATE_ACTIVE:
/* we are already active, so we don't do anything */
break;
case NOTIFY_STATE_SUSPEND:
notify = INFO_NOTIFY_USER_RESUMED;
set_tone(portlist, NULL);
portlist = portlist->next;
}
set_tone(portlist, NULL);
portlist = portlist->next;
}
set_tone(portlist, NULL);
portlist = portlist->next;
}
set_tone(portlist, NULL);
portlist = portlist->next;
}
set_tone(portlist, NULL);
portlist = portlist->next;
}
set_tone(portlist, NULL);
portlist = portlist->next;
}
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
message->param.notifyinfo.notify = notify;
message_put(message);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
message->param.notifyinfo.notify = notify;
message_put(message);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) IGNORING keypad received not from extension.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) IGNORING keypad received not from extension.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) keypad received during connect but not during a call.\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) keypad received during connect but not during a call.\n", ea_endpoint->ep_serial);
break;
}
&& !(e_ext.own_proceeding && e_state == EPOINT_STATE_OUT_PROCEEDING)
&& !(e_ext.own_alerting && e_state == EPOINT_STATE_OUT_ALERTING)
&& !(e_ext.own_cause && e_state == EPOINT_STATE_OUT_DISCONNECT)
&& !(e_ext.own_proceeding && e_state == EPOINT_STATE_OUT_PROCEEDING)
&& !(e_ext.own_alerting && e_state == EPOINT_STATE_OUT_ALERTING)
&& !(e_ext.own_cause && e_state == EPOINT_STATE_OUT_DISCONNECT)
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) tone not provided since patterns are available\n", ea_endpoint->ep_serial);
tone = "";
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) tone not provided since patterns are available\n", ea_endpoint->ep_serial);
tone = "";
}
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_TONE);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_TONE);
SCPY(message->param.tone.name, tone);
message_put(message);
logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
SCPY(message->param.tone.name, tone);
message_put(message);
logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
interface = interface_first;
/* first find the given interface or, if not given, one with no extension */
checknext:
interface = interface_first;
/* first find the given interface or, if not given, one with no extension */
checknext:
+ if (!interface) {
+ if (!there_is_an_external && !(ifname && ifname[0])) {
+ trace_header("CHANNEL SELECTION (no external interface specified)", DIRECTION_NONE);
+ add_trace("info", NULL, "Add 'external' parameter to interface.conf.");
+ end_trace();
+ }
add_trace("interface", NULL, "%s", ifname);
end_trace();
goto foundif;
}
add_trace("interface", NULL, "%s", ifname);
end_trace();
goto foundif;
}
add_trace("interface", NULL, "%s", interface->name);
end_trace();
goto foundif;
add_trace("interface", NULL, "%s", interface->name);
end_trace();
goto foundif;
/* no ports */
trace_header("CHANNEL SELECTION (active ports, skipping)", DIRECTION_NONE);
add_trace("interface", NULL, "%s", interface->name);
/* no ports */
trace_header("CHANNEL SELECTION (active ports, skipping)", DIRECTION_NONE);
add_trace("interface", NULL, "%s", interface->name);
- if (interface->hunt == HUNT_ROUNDROBIN)
- {
- while(ifport_start->next && index<interface->hunt_next)
- {
+ if (interface->hunt == HUNT_ROUNDROBIN) {
+ while(ifport_start->next && index<interface->hunt_next) {
trace_header("CHANNEL SELECTION (port not available, skipping)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (port not available, skipping)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (port blocked by admin, skipping)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (port blocked by admin, skipping)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (port's layer 2 is down, skipping)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (port's layer 2 is down, skipping)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
case CHANNEL_FREE: /* free channel */
if (mISDNport->b_reserved >= mISDNport->b_num)
break; /* all channel in use or reserverd */
/* find channel */
i = 0;
case CHANNEL_FREE: /* free channel */
if (mISDNport->b_reserved >= mISDNport->b_num)
break; /* all channel in use or reserverd */
/* find channel */
i = 0;
*channel = i+1+(i>=15);
trace_header("CHANNEL SELECTION (selecting free channel)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
*channel = i+1+(i>=15);
trace_header("CHANNEL SELECTION (selecting free channel)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
trace_header("CHANNEL SELECTION (cannot ask for 'any' channel, all reserved)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (cannot ask for 'any' channel, all reserved)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (channel out of range)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (channel out of range)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (channel out of range)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
trace_header("CHANNEL SELECTION (channel out of range)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
add_trace("position", NULL, "%d", index);
*channel = selchannel->channel;
trace_header("CHANNEL SELECTION (selecting given channel)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
*channel = selchannel->channel;
trace_header("CHANNEL SELECTION (selecting given channel)", DIRECTION_NONE);
add_trace("port", NULL, "%d", ifport->portnum);
/* NOTE: currently the try_card feature is not supported. it should be used later to try another card, if the outgoing call fails on one port */
/* check what dialinginfo.itype we got */
/* NOTE: currently the try_card feature is not supported. it should be used later to try another card, if the outgoing call fails on one port */
/* check what dialinginfo.itype we got */
/* *********************** call to extension or vbox */
case INFO_ITYPE_ISDN_EXTENSION:
/* check if we deny incoming calls when we use an extension */
/* *********************** call to extension or vbox */
case INFO_ITYPE_ISDN_EXTENSION:
/* check if we deny incoming calls when we use an extension */
PERROR("EPOINT(%d) noknocking and currently a call\n", ea_endpoint->ep_serial);
release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_BUSY, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYSPE_ join, port */
return; /* must exit here */
PERROR("EPOINT(%d) noknocking and currently a call\n", ea_endpoint->ep_serial);
release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_BUSY, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYSPE_ join, port */
return; /* must exit here */
// if (strchr(exten, ','))
// *strchr(exten, ',') = '\0';
// if (!read_extension(&e_ext, exten))
// if (strchr(exten, ','))
// *strchr(exten, ',') = '\0';
// if (!read_extension(&e_ext, exten))
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) extension %s not configured\n", ea_endpoint->ep_serial, e_dialinginfo.id);
release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_OUTOFORDER, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYPE, join, port */
return; /* must exit here */
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) extension %s not configured\n", ea_endpoint->ep_serial, e_dialinginfo.id);
release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_OUTOFORDER, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYPE, join, port */
return; /* must exit here */
}
e_callerinfo.present = INFO_PRESENT_ALLOWED;
}
if (!!strcmp(p, "vbox") || (e_capainfo.bearer_capa==INFO_BC_AUDIO) || (e_capainfo.bearer_capa==INFO_BC_SPEECH))
e_callerinfo.present = INFO_PRESENT_ALLOWED;
}
if (!!strcmp(p, "vbox") || (e_capainfo.bearer_capa==INFO_BC_AUDIO) || (e_capainfo.bearer_capa==INFO_BC_SPEECH))
- while(checkapp)
- {
- if (checkapp != this) /* any other endpoint except our own */
- {
- if (!strcmp(checkapp->e_ext.number, e_ext.number))
- {
+ while(checkapp) {
+ if (checkapp != this) { /* any other endpoint except our own */
+ if (!strcmp(checkapp->e_ext.number, e_ext.number)) {
e_callerinfo.present = INFO_PRESENT_ALLOWED;
}
if (!!strcmp(p, "vbox") || (e_capainfo.bearer_capa==INFO_BC_AUDIO) || (e_capainfo.bearer_capa==INFO_BC_SPEECH))
e_callerinfo.present = INFO_PRESENT_ALLOWED;
}
if (!!strcmp(p, "vbox") || (e_capainfo.bearer_capa==INFO_BC_AUDIO) || (e_capainfo.bearer_capa==INFO_BC_SPEECH))
e_cfnr_release = now + e_ext.cfnr_delay;
e_cfnr_call = now + e_ext.cfnr_delay + 1; /* call one second after release */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) setting time for call-forward-busy to %s with delay %ld.\n", ea_endpoint->ep_serial, e_ext.cfnr, e_ext.cfnr_delay);
e_cfnr_release = now + e_ext.cfnr_delay;
e_cfnr_call = now + e_ext.cfnr_delay + 1; /* call one second after release */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) setting time for call-forward-busy to %s with delay %ld.\n", ea_endpoint->ep_serial, e_ext.cfnr, e_ext.cfnr_delay);
/* call to all internal interfaces */
p = e_ext.interfaces;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) generating multiple joins for extension %s to interfaces %s\n", ea_endpoint->ep_serial, e_dialinginfo.id, p);
/* call to all internal interfaces */
p = e_ext.interfaces;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) generating multiple joins for extension %s to interfaces %s\n", ea_endpoint->ep_serial, e_dialinginfo.id, p);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) calling to interface %s\n", ea_endpoint->ep_serial, ifname);
/* hunt for mISDNport and create Port */
mISDNport = hunt_port(ifname, &channel);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) calling to interface %s\n", ea_endpoint->ep_serial, ifname);
/* hunt for mISDNport and create Port */
mISDNport = hunt_port(ifname, &channel);
trace_header("INTERFACE (not found or busy)", DIRECTION_NONE);
add_trace("interface", NULL, "%s", ifname);
end_trace();
trace_header("INTERFACE (not found or busy)", DIRECTION_NONE);
add_trace("interface", NULL, "%s", ifname);
end_trace();
dialinginfo.ntype = e_dialinginfo.ntype;
/* create port_list relation */
portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, mISDNport->earlyb);
dialinginfo.ntype = e_dialinginfo.ntype;
/* create port_list relation */
portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, mISDNport->earlyb);
PERROR("EPOINT(%d) cannot allocate port_list relation\n", ea_endpoint->ep_serial);
delete port;
goto check_anycall_intern;
}
/* directory.list */
PERROR("EPOINT(%d) cannot allocate port_list relation\n", ea_endpoint->ep_serial);
delete port;
goto check_anycall_intern;
}
/* directory.list */
dirname = parse_directory(e_callerinfo.id, e_callerinfo.ntype);
if (dirname)
SCPY(e_callerinfo.name, dirname);
dirname = parse_directory(e_callerinfo.id, e_callerinfo.ntype);
if (dirname)
SCPY(e_callerinfo.name, dirname);
SCPY(message->param.setup.callerinfo.id, e_ext.clip_prefix);
SCAT(message->param.setup.callerinfo.id, numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype, options.national, options.international));
message->param.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
}
SCPY(message->param.setup.callerinfo.id, e_ext.clip_prefix);
SCAT(message->param.setup.callerinfo.id, numberrize_callerinfo(e_callerinfo.id,e_callerinfo.ntype, options.national, options.international));
message->param.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
}
SCPY(message->param.setup.callerinfo.id2, e_ext.clip_prefix);
SCAT(message->param.setup.callerinfo.id2, numberrize_callerinfo(e_callerinfo.id2,e_callerinfo.ntype2, options.national, options.international));
message->param.setup.callerinfo.ntype2 = INFO_NTYPE_UNKNOWN;
}
/* use internal caller id */
SCPY(message->param.setup.callerinfo.id2, e_ext.clip_prefix);
SCAT(message->param.setup.callerinfo.id2, numberrize_callerinfo(e_callerinfo.id2,e_callerinfo.ntype2, options.national, options.international));
message->param.setup.callerinfo.ntype2 = INFO_NTYPE_UNKNOWN;
}
/* use internal caller id */
SCPY(message->param.setup.callerinfo.id, e_callerinfo.extension);
message->param.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
message->param.setup.callerinfo.ntype2 = INFO_NTYPE_NOTPRESENT;
SCPY(message->param.setup.callerinfo.id, e_callerinfo.extension);
message->param.setup.callerinfo.ntype = INFO_NTYPE_UNKNOWN;
message->param.setup.callerinfo.ntype2 = INFO_NTYPE_NOTPRESENT;
cfnr_only: /* entry point for cfnr */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call extension %s for external destiantion(s) '%s'\n", ea_endpoint->ep_serial, e_dialinginfo.id, p);
// i=0;
cfnr_only: /* entry point for cfnr */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call extension %s for external destiantion(s) '%s'\n", ea_endpoint->ep_serial, e_dialinginfo.id, p);
// i=0;
FATAL("No memory for VBOX Port instance\n");
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) allocated port %s\n", ea_endpoint->ep_serial, port->p_name);
UCPY(cfp, e_ext.number); /* cfp or any other direct forward/vbox */
FATAL("No memory for VBOX Port instance\n");
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) allocated port %s\n", ea_endpoint->ep_serial, port->p_name);
UCPY(cfp, e_ext.number); /* cfp or any other direct forward/vbox */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cfp external %s\n", ea_endpoint->ep_serial, cfp);
/* hunt for mISDNport and create Port */
mISDNport = hunt_port(e_dialinginfo.interfaces[0]?e_dialinginfo.interfaces:NULL, &channel);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cfp external %s\n", ea_endpoint->ep_serial, cfp);
/* hunt for mISDNport and create Port */
mISDNport = hunt_port(e_dialinginfo.interfaces[0]?e_dialinginfo.interfaces:NULL, &channel);
/* creating EXTERNAL port*/
SPRINT(portname, "%s-%d-out", mISDNport->ifport->interface->name, mISDNport->portnum);
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);
if (!port)
FATAL("No memory for Port instance\n");
earlyb = mISDNport->earlyb;
/* creating EXTERNAL port*/
SPRINT(portname, "%s-%d-out", mISDNport->ifport->interface->name, mISDNport->portnum);
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);
if (!port)
FATAL("No memory for Port instance\n");
earlyb = mISDNport->earlyb;
port = NULL;
trace_header("INTERFACE (too busy)", DIRECTION_NONE);
add_trace("interface", NULL, "%s", e_dialinginfo.interfaces[0]?e_dialinginfo.interfaces:"any interface");
end_trace();
}
}
port = NULL;
trace_header("INTERFACE (too busy)", DIRECTION_NONE);
add_trace("interface", NULL, "%s", e_dialinginfo.interfaces[0]?e_dialinginfo.interfaces:"any interface");
end_trace();
}
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) no port found or created, which is idle.\n", ea_endpoint->ep_serial);
goto check_anycall_intern;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) no port found or created, which is idle.\n", ea_endpoint->ep_serial);
goto check_anycall_intern;
}
dialinginfo.itype = INFO_ITYPE_ISDN;
dialinginfo.ntype = e_dialinginfo.ntype;
portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, earlyb);
dialinginfo.itype = INFO_ITYPE_ISDN;
dialinginfo.ntype = e_dialinginfo.ntype;
portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, earlyb);
PERROR("EPOINT(%d) cannot allocate port_list relation\n", ea_endpoint->ep_serial);
delete port;
goto check_anycall_intern;
PERROR("EPOINT(%d) cannot allocate port_list relation\n", ea_endpoint->ep_serial);
delete port;
goto check_anycall_intern;
memcpy(&message->param.setup.redirinfo, &e_redirinfo, sizeof(struct redir_info));
memcpy(&message->param.setup.callerinfo, &e_callerinfo, sizeof(struct caller_info));
/* if clip is hidden */
memcpy(&message->param.setup.redirinfo, &e_redirinfo, sizeof(struct redir_info));
memcpy(&message->param.setup.callerinfo, &e_callerinfo, sizeof(struct caller_info));
/* if clip is hidden */
SCPY(message->param.setup.callerinfo.id, e_ext.callerid);
SCPY(message->param.setup.callerinfo.extension, e_ext.number);
message->param.setup.callerinfo.ntype = e_ext.callerid_type;
SCPY(message->param.setup.callerinfo.id, e_ext.callerid);
SCPY(message->param.setup.callerinfo.extension, e_ext.number);
message->param.setup.callerinfo.ntype = e_ext.callerid_type;
trace_header("INTERFACE (no extension's interface)", DIRECTION_NONE);
end_trace();
if (!ea_endpoint->ep_join_id)
trace_header("INTERFACE (no extension's interface)", DIRECTION_NONE);
end_trace();
if (!ea_endpoint->ep_join_id)
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) dialing external: '%s'\n", ea_endpoint->ep_serial, e_dialinginfo.id);
/* call to extenal interfaces */
p = e_dialinginfo.id;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) dialing external: '%s'\n", ea_endpoint->ep_serial, e_dialinginfo.id);
/* call to extenal interfaces */
p = e_dialinginfo.id;
/* hunt for mISDNport and create Port */
/* hunt for mISDNport and create Port */
mISDNport = hunt_port(e_dialinginfo.interfaces[0]?e_dialinginfo.interfaces:NULL, &channel);
/* hunt for mISDNport and create Port */
/* hunt for mISDNport and create Port */
mISDNport = hunt_port(e_dialinginfo.interfaces[0]?e_dialinginfo.interfaces:NULL, &channel);
trace_header("INTERFACE (too busy)", DIRECTION_NONE);
add_trace("interface", NULL, "%s", e_dialinginfo.interfaces[0]?e_dialinginfo.interfaces:"any interface");
end_trace();
trace_header("INTERFACE (too busy)", DIRECTION_NONE);
add_trace("interface", NULL, "%s", e_dialinginfo.interfaces[0]?e_dialinginfo.interfaces:"any interface");
end_trace();
dialinginfo.itype = INFO_ITYPE_ISDN;
dialinginfo.ntype = e_dialinginfo.ntype;
portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, mISDNport->earlyb);
dialinginfo.itype = INFO_ITYPE_ISDN;
dialinginfo.ntype = e_dialinginfo.ntype;
portlist = ea_endpoint->portlist_new(port->p_serial, port->p_type, mISDNport->earlyb);
PERROR("EPOINT(%d) cannot allocate port_list relation\n", ea_endpoint->ep_serial);
delete port;
goto check_anycall_extern;
PERROR("EPOINT(%d) cannot allocate port_list relation\n", ea_endpoint->ep_serial);
delete port;
goto check_anycall_extern;
trace_header("INTERFACE (no free ports found)", DIRECTION_NONE);
end_trace();
if (!ea_endpoint->ep_join_id)
trace_header("INTERFACE (no free ports found)", DIRECTION_NONE);
end_trace();
if (!ea_endpoint->ep_join_id)
e_powerdialing = -1; /* leave power dialing on */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) starting redial of powerdial.\n", ea_endpoint->ep_serial);
e_powerdialing = -1; /* leave power dialing on */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) starting redial of powerdial.\n", ea_endpoint->ep_serial);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-no-response time has expired, hanging up.\n", ea_endpoint->ep_serial);
e_cfnr_release = 0;
/* release all ports */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-no-response time has expired, hanging up.\n", ea_endpoint->ep_serial);
e_cfnr_release = 0;
/* release all ports */
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = CAUSE_NORMAL; /* normal clearing */
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = CAUSE_NORMAL; /* normal clearing */
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-busy time has expired, calling the forwarded number: %s.\n", ea_endpoint->ep_serial, e_ext.cfnr);
out_setup();
e_cfnr_call = 0;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-busy time has expired, calling the forwarded number: %s.\n", ea_endpoint->ep_serial, e_ext.cfnr);
out_setup();
e_cfnr_call = 0;
e_callback = 0; /* done with callback */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) starting callback.\n", ea_endpoint->ep_serial);
new_state(EPOINT_STATE_OUT_SETUP);
e_callback = 0; /* done with callback */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) starting callback.\n", ea_endpoint->ep_serial);
new_state(EPOINT_STATE_OUT_SETUP);
message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
set_tone(portlist, "cause_10");
}
message_disconnect_port(portlist, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, "");
set_tone(portlist, "cause_10");
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot hooflash while child process is running.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot hooflash while child process is running.\n", ea_endpoint->ep_serial);
return;
}
release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYPE, join, port */
}
e_ruleset = ruleset_main;
release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYPE, join, port */
}
e_ruleset = ruleset_main;
SCPY(e_dialinginfo.id, e_ext.prefix);
e_extdialing = e_dialinginfo.id;
e_join_pattern = 0;
SCPY(e_dialinginfo.id, e_ext.prefix);
e_extdialing = e_dialinginfo.id;
e_join_pattern = 0;
// e_dtmf = param->setup.dtmf;
/* screen incoming caller id */
interface = interface_first;
// e_dtmf = param->setup.dtmf;
/* screen incoming caller id */
interface = interface_first;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) incoming call is extension\n", ea_endpoint->ep_serial);
/* port makes call from extension */
SCPY(e_callerinfo.extension, e_callerinfo.id);
SCPY(e_ext.number, e_callerinfo.extension);
SCPY(e_extension_interface, e_callerinfo.interface);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) incoming call is extension\n", ea_endpoint->ep_serial);
/* port makes call from extension */
SCPY(e_callerinfo.extension, e_callerinfo.id);
SCPY(e_ext.number, e_callerinfo.extension);
SCPY(e_extension_interface, e_callerinfo.interface);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call from extension '%s'\n", ea_endpoint->ep_serial, e_ext.number);
/* get extension's info about caller */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call from extension '%s'\n", ea_endpoint->ep_serial, e_ext.number);
/* get extension's info about caller */
/* extension doesn't exist */
trace_header("EXTENSION (not created)", DIRECTION_IN);
add_trace("extension", NULL, "%s", e_ext.number);
/* extension doesn't exist */
trace_header("EXTENSION (not created)", DIRECTION_IN);
add_trace("extension", NULL, "%s", e_ext.number);
SPRINT(buffer, "%s%s", e_ext.next, e_dialinginfo.id);
SCPY(e_dialinginfo.id, buffer);
e_ext.next[0] = '\0';
writeext = 1;
SPRINT(buffer, "%s%s", e_ext.next, e_dialinginfo.id);
SCPY(e_dialinginfo.id, buffer);
e_ext.next[0] = '\0';
writeext = 1;
SPRINT(buffer, "%s%s", e_ext.prefix, e_dialinginfo.id);
SCPY(e_dialinginfo.id, buffer);
}
SPRINT(buffer, "%s%s", e_ext.prefix, e_dialinginfo.id);
SCPY(e_dialinginfo.id, buffer);
}
if (e_ext.name[0])
SCPY(e_callerinfo.name, e_ext.name);
/* use caller id (or if exist: id_next_call) for this call */
if (e_ext.name[0])
SCPY(e_callerinfo.name, e_ext.name);
/* use caller id (or if exist: id_next_call) for this call */
SCPY(e_callerinfo.id, e_ext.id_next_call);
/* if we restrict the pesentation */
if (e_ext.id_next_call_present==INFO_PRESENT_ALLOWED && e_callerinfo.present==INFO_PRESENT_RESTRICTED)
SCPY(e_callerinfo.id, e_ext.id_next_call);
/* if we restrict the pesentation */
if (e_ext.id_next_call_present==INFO_PRESENT_ALLOWED && e_callerinfo.present==INFO_PRESENT_RESTRICTED)
SCPY(e_callerinfo.id, e_ext.callerid);
/* if we restrict the pesentation */
if (e_ext.callerid_present==INFO_PRESENT_ALLOWED && e_callerinfo.present==INFO_PRESENT_RESTRICTED)
SCPY(e_callerinfo.id, e_ext.callerid);
/* if we restrict the pesentation */
if (e_ext.callerid_present==INFO_PRESENT_ALLOWED && e_callerinfo.present==INFO_PRESENT_RESTRICTED)
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
message->param.mISDNsignal.message = mISDNSIGNAL_VOLUME;
message->param.mISDNsignal.rx_gain = e_ext.tx_gain;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
message->param.mISDNsignal.message = mISDNSIGNAL_VOLUME;
message->param.mISDNsignal.rx_gain = e_ext.tx_gain;
/* check if we are a terminal */
if (e_ext.number[0] == '\0')
PERROR("Port(%d) cannot record because we are not a terminal\n", ea_endpoint->ep_serial);
/* check if we are a terminal */
if (e_ext.number[0] == '\0')
PERROR("Port(%d) cannot record because we are not a terminal\n", ea_endpoint->ep_serial);
port = find_port_id(portlist->port_id);
if (port)
port->open_record(e_ext.record, 0, 0, e_ext.number, e_ext.anon_ignore, "", 0);
}
}
port = find_port_id(portlist->port_id);
if (port)
port->open_record(e_ext.record, 0, 0, e_ext.number, e_ext.anon_ignore, "", 0);
}
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call from external port\n", ea_endpoint->ep_serial);
/* no terminal identification */
e_ext.number[0] = '\0';
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call from external port\n", ea_endpoint->ep_serial);
/* no terminal identification */
e_ext.number[0] = '\0';
if (e_ext.number[0])
set_tone(portlist, "dialpbx");
else
set_tone(portlist, "dialtone");
}
process_dialing();
if (e_ext.number[0])
set_tone(portlist, "dialpbx");
else
set_tone(portlist, "dialtone");
}
process_dialing();
/* request MORE info, if not already at higher state */
new_state(EPOINT_STATE_IN_OVERLAP);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_OVERLAP);
/* request MORE info, if not already at higher state */
new_state(EPOINT_STATE_IN_OVERLAP);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_OVERLAP);
/* concat dialing string */
SCAT(e_dialinginfo.id, param->information.id);
process_dialing();
/* concat dialing string */
SCAT(e_dialinginfo.id, param->information.id);
process_dialing();
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) keypad information received after disconnect: %s.\n", ea_endpoint->ep_serial, param->information.id);
/* processing keypad function */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) keypad information received after disconnect: %s.\n", ea_endpoint->ep_serial, param->information.id);
/* processing keypad function */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) keypad information received during connect: %s.\n", ea_endpoint->ep_serial, param->information.id);
/* processing keypad function */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) keypad information received during connect: %s.\n", ea_endpoint->ep_serial, param->information.id);
/* processing keypad function */
set_tone(portlist, "dialing");
}
if (e_action)
if (e_action->index==ACTION_OUTDIAL
|| e_action->index==ACTION_EXTERNAL
set_tone(portlist, "dialing");
}
if (e_action)
if (e_action->index==ACTION_OUTDIAL
|| e_action->index==ACTION_EXTERNAL
if (!e_extdialing)
set_tone(portlist, "dialing");
else if (!e_extdialing[0])
if (!e_extdialing)
set_tone(portlist, "dialing");
else if (!e_extdialing[0])
void EndpointAppPBX::port_dtmf(struct port_list *portlist, int message_type, union parameter *param)
{
/* only if dtmf detection is enabled */
void EndpointAppPBX::port_dtmf(struct port_list *portlist, int message_type, union parameter *param)
{
/* only if dtmf detection is enabled */
NOTE: vbox is now handled due to overlap state
/* if vbox_play is done, the dtmf digits are just used as they come */
if (e_action)
NOTE: vbox is now handled due to overlap state
/* if vbox_play is done, the dtmf digits are just used as they come */
if (e_action)
e_dialinginfo.id[strlen(e_dialinginfo.id)+1] = '\0';
e_dialinginfo.id[strlen(e_dialinginfo.id)] = param->dtmf;
process_dialing();
e_dialinginfo.id[strlen(e_dialinginfo.id)+1] = '\0';
e_dialinginfo.id[strlen(e_dialinginfo.id)] = param->dtmf;
process_dialing();
/* the last digit was too far in the past to be a sequence */
if (param->dtmf == '*')
/* only start is allowed in the sequence */
e_dtmf_last = '*';
else
e_dtmf_last = '\0';
/* the last digit was too far in the past to be a sequence */
if (param->dtmf == '*')
/* only start is allowed in the sequence */
e_dtmf_last = '*';
else
e_dtmf_last = '\0';
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) dtmf sequence *%c# detected.\n", ea_endpoint->ep_serial, e_dtmf_last);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) dtmf sequence *%c# detected.\n", ea_endpoint->ep_serial, e_dtmf_last);
- || (e_state!=EPOINT_STATE_CONNECT && e_dtmf_time+3>=now && e_dtmf_last=='#')) /* when disconnected, just #. when dialing, ##. */
- {
+ || (e_state!=EPOINT_STATE_CONNECT && e_dtmf_time+3>=now && e_dtmf_last=='#')) { /* when disconnected, just #. when dialing, ##. */
- if (e_state==EPOINT_STATE_IN_OVERLAP)// && e_state==e_connectedmode)
- {
- if (e_dialinginfo.id[0]=='\0' && !e_action)
- {
+ if (e_state==EPOINT_STATE_IN_OVERLAP){ // && e_state==e_connectedmode)
+ if (e_dialinginfo.id[0]=='\0' && !e_action) {
set_tone(portlist, "dialing");
}
/* concat dialing string */
set_tone(portlist, "dialing");
}
/* concat dialing string */
e_dialinginfo.id[strlen(e_dialinginfo.id)+1] = '\0';
e_dialinginfo.id[strlen(e_dialinginfo.id)] = param->dtmf;
process_dialing();
e_dialinginfo.id[strlen(e_dialinginfo.id)+1] = '\0';
e_dialinginfo.id[strlen(e_dialinginfo.id)] = param->dtmf;
process_dialing();
/* signal to call tool */
admin_call_response(e_adminid, ADMIN_CALL_SETUP_ACK, "", 0, 0, 0);
/* signal to call tool */
admin_call_response(e_adminid, ADMIN_CALL_SETUP_ACK, "", 0, 0, 0);
/* send what we have not dialed yet, because we had no setup complete */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) dialing pending digits: '%s'\n", ea_endpoint->ep_serial, e_dialing_queue);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_INFORMATION);
/* send what we have not dialed yet, because we had no setup complete */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) dialing pending digits: '%s'\n", ea_endpoint->ep_serial, e_dialing_queue);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_INFORMATION);
/* indicate patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PATTERN);
message_put(message);
/* indicate patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PATTERN);
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
/* indicate no patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOPATTERN);
message_put(message);
/* indicate no patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOPATTERN);
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, message_type);
memcpy(&message->param, param, sizeof(union parameter));
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, message_type);
memcpy(&message->param, param, sizeof(union parameter));
message_put(message);
/* indicate patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PATTERN);
message_put(message);
/* indicate patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PATTERN);
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
/* indicate no patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOPATTERN);
message_put(message);
/* indicate no patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOPATTERN);
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, message_type);
memcpy(&message->param, param, sizeof(union parameter));
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, message_type);
memcpy(&message->param, param, sizeof(union parameter));
message_put(message);
/* indicate patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PATTERN);
message_put(message);
/* indicate patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PATTERN);
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
/* indicate no patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOPATTERN);
message_put(message);
/* indicate no patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOPATTERN);
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, message_type);
memcpy(&message->param, param, sizeof(union parameter));
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, message_type);
memcpy(&message->param, param, sizeof(union parameter));
message_put(message);
memcpy(&e_connectinfo, ¶m->connectinfo, sizeof(e_connectinfo));
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) removing all other ports (start)\n", ea_endpoint->ep_serial);
memcpy(&e_connectinfo, ¶m->connectinfo, sizeof(e_connectinfo));
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) removing all other ports (start)\n", ea_endpoint->ep_serial);
tportlist = ea_endpoint->ep_portlist;
if (tportlist->port_id == port_id) /* if the first portlist is the calling one, the second must be a different one */
tportlist = tportlist->next;
tportlist = ea_endpoint->ep_portlist;
if (tportlist->port_id == port_id) /* if the first portlist is the calling one, the second must be a different one */
tportlist = tportlist->next;
SCPY(e_extension_interface, e_connectinfo.interface);
/* for internal and am calls, we get the extension's id */
SCPY(e_extension_interface, e_connectinfo.interface);
/* for internal and am calls, we get the extension's id */
SCPY(e_connectinfo.id, e_ext.callerid);
SCPY(e_connectinfo.extension, e_ext.number);
e_connectinfo.itype = INFO_ITYPE_ISDN_EXTENSION;
e_connectinfo.ntype = e_ext.callerid_type;
e_connectinfo.present = e_ext.callerid_present;
}
SCPY(e_connectinfo.id, e_ext.callerid);
SCPY(e_connectinfo.extension, e_ext.number);
e_connectinfo.itype = INFO_ITYPE_ISDN_EXTENSION;
e_connectinfo.ntype = e_ext.callerid_type;
e_connectinfo.present = e_ext.callerid_present;
}
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
message->param.mISDNsignal.message = mISDNSIGNAL_VOLUME;
message->param.mISDNsignal.rx_gain = e_ext.tx_gain;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
message->param.mISDNsignal.message = mISDNSIGNAL_VOLUME;
message->param.mISDNsignal.rx_gain = e_ext.tx_gain;
SCPY(e_connectinfo.id, nationalize_callerinfo(port->p_dialinginfo.id, &e_connectinfo.ntype, options.national, options.international));
e_connectinfo.present = INFO_PRESENT_ALLOWED;
}
SCPY(e_connectinfo.id, nationalize_callerinfo(port->p_dialinginfo.id, &e_connectinfo.ntype, options.national, options.international));
e_connectinfo.present = INFO_PRESENT_ALLOWED;
}
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, message_type);
memcpy(&message->param.connectinfo, &e_connectinfo, sizeof(struct connect_info));
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, message_type);
memcpy(&message->param.connectinfo, &e_connectinfo, sizeof(struct connect_info));
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
/* callback */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we have a callback, so we create a call with cbcaller: \"%s\".\n", ea_endpoint->ep_serial, e_cbcaller);
SCPY(e_ext.number, e_cbcaller);
/* callback */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we have a callback, so we create a call with cbcaller: \"%s\".\n", ea_endpoint->ep_serial, e_cbcaller);
SCPY(e_ext.number, e_cbcaller);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) callback from extension '%s'\n", ea_endpoint->ep_serial, e_ext.number);
/* get extension's info about terminal */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) callback from extension '%s'\n", ea_endpoint->ep_serial, e_ext.number);
/* get extension's info about terminal */
/* extension doesn't exist */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) rejecting callback from not existing extension: '%s'\n", ea_endpoint->ep_serial, e_ext.number);
message_disconnect_port(portlist, CAUSE_REJECTED, LOCATION_PRIVATE_LOCAL, "");
/* extension doesn't exist */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) rejecting callback from not existing extension: '%s'\n", ea_endpoint->ep_serial, e_ext.number);
message_disconnect_port(portlist, CAUSE_REJECTED, LOCATION_PRIVATE_LOCAL, "");
/* use caller id (or if exist: id_next_call) for this call */
e_callerinfo.screen = INFO_SCREEN_NETWORK;
SCPY(e_callerinfo.extension, e_ext.number);
/* use caller id (or if exist: id_next_call) for this call */
e_callerinfo.screen = INFO_SCREEN_NETWORK;
SCPY(e_callerinfo.extension, e_ext.number);
SCPY(e_callerinfo.id, e_ext.id_next_call);
e_callerinfo.present = e_ext.id_next_call_present;
e_callerinfo.ntype = e_ext.id_next_call_type;
e_ext.id_next_call_present = -1;
/* extension is written */
write_extension(&e_ext, e_ext.number);
SCPY(e_callerinfo.id, e_ext.id_next_call);
e_callerinfo.present = e_ext.id_next_call_present;
e_callerinfo.ntype = e_ext.id_next_call_type;
e_ext.id_next_call_present = -1;
/* extension is written */
write_extension(&e_ext, e_ext.number);
SCPY(e_callerinfo.id, e_ext.callerid);
e_callerinfo.present = e_ext.callerid_present;
e_callerinfo.ntype = e_ext.callerid_type;
SCPY(e_callerinfo.id, e_ext.callerid);
e_callerinfo.present = e_ext.callerid_present;
e_callerinfo.ntype = e_ext.callerid_type;
/* make call state to enter password */
new_state(EPOINT_STATE_IN_OVERLAP);
e_action = &action_password_write;
/* make call state to enter password */
new_state(EPOINT_STATE_IN_OVERLAP);
e_action = &action_password_write;
e_extdialing = strchr(e_dialinginfo.id, '\0');
e_password_timeout = now+20;
process_dialing();
e_extdialing = strchr(e_dialinginfo.id, '\0');
e_password_timeout = now+20;
process_dialing();
/* incoming call (callback) */
e_ruleset = ruleset_main;
if (e_ruleset)
e_rule = e_ruleset->rule_first;
e_action = NULL;
e_extdialing = e_dialinginfo.id;
/* incoming call (callback) */
e_ruleset = ruleset_main;
if (e_ruleset)
e_rule = e_ruleset->rule_first;
e_action = NULL;
e_extdialing = e_dialinginfo.id;
set_tone(portlist, "hold");
}
/* start recording if enabled, not when answering machine answers */
set_tone(portlist, "hold");
}
/* start recording if enabled, not when answering machine answers */
/* check if we are a terminal */
if (e_ext.number[0] == '\0')
PERROR("Port(%d) cannot record because we are not a terminal\n", ea_endpoint->ep_serial);
/* check if we are a terminal */
if (e_ext.number[0] == '\0')
PERROR("Port(%d) cannot record because we are not a terminal\n", ea_endpoint->ep_serial);
port = find_port_id(portlist->port_id);
if (port)
port->open_record(e_ext.record, 0, 0, e_ext.number, e_ext.anon_ignore, "", 0);
port = find_port_id(portlist->port_id);
if (port)
port->open_record(e_ext.record, 0, 0, e_ext.number, e_ext.anon_ignore, "", 0);
admin_call_response(e_adminid, (message_type==MESSAGE_DISCONNECT)?ADMIN_CALL_DISCONNECT:ADMIN_CALL_RELEASE, "", param->disconnectinfo.cause, param->disconnectinfo.location, 0);
//#warning does this work? only disconnect when incoming port hat not already disconnected yet?
admin_call_response(e_adminid, (message_type==MESSAGE_DISCONNECT)?ADMIN_CALL_DISCONNECT:ADMIN_CALL_RELEASE, "", param->disconnectinfo.cause, param->disconnectinfo.location, 0);
//#warning does this work? only disconnect when incoming port hat not already disconnected yet?
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are already disconnected.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are already disconnected.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) new multipoint cause %d location %d.\n", ea_endpoint->ep_serial, e_multipoint_cause, e_multipoint_location);
/* check if we have more than one portlist relation and we just ignore the disconnect */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) new multipoint cause %d location %d.\n", ea_endpoint->ep_serial, e_multipoint_cause, e_multipoint_location);
/* check if we have more than one portlist relation and we just ignore the disconnect */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) the disconnect was from a multipoint call. we just release that relation.\n", ea_endpoint->ep_serial);
portlist = ea_endpoint->ep_portlist;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) the disconnect was from a multipoint call. we just release that relation.\n", ea_endpoint->ep_serial);
portlist = ea_endpoint->ep_portlist;
if (portlist->port_id == port_id)
break;
portlist = portlist->next;
}
if (!portlist)
FATAL("EPOINT(%d) no portlist related to the calling port.\n", ea_endpoint->ep_serial);
if (portlist->port_id == port_id)
break;
portlist = portlist->next;
}
if (!portlist)
FATAL("EPOINT(%d) no portlist related to the calling port.\n", ea_endpoint->ep_serial);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = CAUSE_NORMAL; /* normal clearing */
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = CAUSE_NORMAL; /* normal clearing */
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
/* use cause from port after connect */
cause = param->disconnectinfo.cause;
location = param->disconnectinfo.location;
/* use cause from port after connect */
cause = param->disconnectinfo.cause;
location = param->disconnectinfo.location;
/* tone to disconnected end */
SPRINT(buffer, "cause_%02x", cause);
if (ea_endpoint->ep_portlist)
/* tone to disconnected end */
SPRINT(buffer, "cause_%02x", cause);
if (ea_endpoint->ep_portlist)
if (joinpbx_countrelations(ea_endpoint->ep_join_id)==2 // we must count relations, in order not to disturb the conference ; NOTE: asterisk always counts two, since it is a point to point call
&& message_type != MESSAGE_RELEASE) // if we release, we are done
haspatterns = 1;
if (joinpbx_countrelations(ea_endpoint->ep_join_id)==2 // we must count relations, in order not to disturb the conference ; NOTE: asterisk always counts two, since it is a point to point call
&& message_type != MESSAGE_RELEASE) // if we release, we are done
haspatterns = 1;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) the port has patterns.\n", ea_endpoint->ep_serial);
/* indicate patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PATTERN);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) the port has patterns.\n", ea_endpoint->ep_serial);
/* indicate patterns */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_PATTERN);
trace_header("TIMEOUT", DIRECTION_IN);
message_type = MESSAGE_DISCONNECT;
trace_header("TIMEOUT", DIRECTION_IN);
message_type = MESSAGE_DISCONNECT;
case PORT_STATE_OUT_SETUP:
case PORT_STATE_OUT_OVERLAP:
add_trace("state", NULL, "outgoing setup/dialing");
case PORT_STATE_OUT_SETUP:
case PORT_STATE_OUT_OVERLAP:
add_trace("state", NULL, "outgoing setup/dialing");
new_state(EPOINT_STATE_OUT_DISCONNECT);
SPRINT(cause, "cause_%02x", param->disconnectinfo.cause);
SCPY(e_tone, cause);
new_state(EPOINT_STATE_OUT_DISCONNECT);
SPRINT(cause, "cause_%02x", param->disconnectinfo.cause);
SCPY(e_tone, cause);
set_tone(portlist, cause);
message_disconnect_port(portlist, param->disconnectinfo.cause, param->disconnectinfo.location, "");
portlist = portlist->next;
set_tone(portlist, cause);
message_disconnect_port(portlist, param->disconnectinfo.cause, param->disconnectinfo.location, "");
portlist = portlist->next;
/* 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);
/* 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);
e_rx_state = track_notify(e_rx_state, param->notifyinfo.notify);
}
/* if we get notification from stack, local shows if we disabled/enabled audio stream */
e_rx_state = track_notify(e_rx_state, param->notifyinfo.notify);
}
/* if we get notification from stack, local shows if we disabled/enabled audio stream */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 0;
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 0;
message_put(message);
/* set volume of rx and tx */
if (param->setup.callerinfo.itype == INFO_ITYPE_ISDN_EXTENSION)
if (e_ext.tx_gain!=0 || e_ext.rx_gain!=0)
/* set volume of rx and tx */
if (param->setup.callerinfo.itype == INFO_ITYPE_ISDN_EXTENSION)
if (e_ext.tx_gain!=0 || e_ext.rx_gain!=0)
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
message->param.mISDNsignal.message = mISDNSIGNAL_VOLUME;
message->param.mISDNsignal.rx_gain = e_ext.tx_gain;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
message->param.mISDNsignal.message = mISDNSIGNAL_VOLUME;
message->param.mISDNsignal.rx_gain = e_ext.tx_gain;
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOTIFY);
memcpy(&message->param.notifyinfo, ¶m->notifyinfo, sizeof(struct notify_info));
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_NOTIFY);
memcpy(&message->param.notifyinfo, ¶m->notifyinfo, sizeof(struct notify_info));
message_put(message);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) warning: port is not related to this endpoint. This may happen, if port has been released after the message was created.\n", ea_endpoint->ep_serial);
return;
}
// PDEBUG(DEBUG_EPOINT, "received message %d (terminal %s, caller id %s)\n", message, e_ext.number, e_callerinfo.id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) warning: port is not related to this endpoint. This may happen, if port has been released after the message was created.\n", ea_endpoint->ep_serial);
return;
}
// PDEBUG(DEBUG_EPOINT, "received message %d (terminal %s, caller id %s)\n", message, e_ext.number, e_callerinfo.id);
case MESSAGE_DATA: /* data from port */
/* check if there is a call */
if (!ea_endpoint->ep_join_id)
case MESSAGE_DATA: /* data from port */
/* check if there is a call */
if (!ea_endpoint->ep_join_id)
case MESSAGE_TONE_EOF: /* tone is end of file */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) current tone is now end of file.\n", ea_endpoint->ep_serial);
case MESSAGE_TONE_EOF: /* tone is end of file */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) current tone is now end of file.\n", ea_endpoint->ep_serial);
case MESSAGE_TONE_COUNTER: /* counter info received */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) received counter information: %d / %d seconds after start of tone.\n", ea_endpoint->ep_serial, param->counter.current, param->counter.max);
if (e_action)
case MESSAGE_TONE_COUNTER: /* counter info received */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) received counter information: %d / %d seconds after start of tone.\n", ea_endpoint->ep_serial, param->counter.current, param->counter.max);
if (e_action)
e_vbox_counter = param->counter.current;
if (param->counter.max >= 0)
e_vbox_counter_max = param->counter.max;
e_vbox_counter = param->counter.current;
if (param->counter.max >= 0)
e_vbox_counter_max = param->counter.max;
/* PORT sends SETUP message */
case MESSAGE_SETUP:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) incoming call from callerid=%s, dialing=%s\n", ea_endpoint->ep_serial, param->setup.callerinfo.id, param->setup.dialinginfo.id);
/* PORT sends SETUP message */
case MESSAGE_SETUP:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) incoming call from callerid=%s, dialing=%s\n", ea_endpoint->ep_serial, param->setup.callerinfo.id, param->setup.dialinginfo.id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in idle state.\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in idle state.\n", ea_endpoint->ep_serial);
break;
}
/* PORT sends MORE message */
case MESSAGE_OVERLAP:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) outgoing call is accepted [overlap dialing] (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
/* PORT sends MORE message */
case MESSAGE_OVERLAP:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) outgoing call is accepted [overlap dialing] (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup state (for port_list: another portlist might have changed the state already).\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup state (for port_list: another portlist might have changed the state already).\n", ea_endpoint->ep_serial);
break;
}
case MESSAGE_PROCEEDING: /* port is proceeding */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) outgoing call is proceeding (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_OUT_SETUP
case MESSAGE_PROCEEDING: /* port is proceeding */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) outgoing call is proceeding (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_OUT_SETUP
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in overlap state (for port_list: another portlist might have changed the state already).\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in overlap state (for port_list: another portlist might have changed the state already).\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) outgoing call is ringing (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_OUT_SETUP
&& e_state!=EPOINT_STATE_OUT_OVERLAP
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) outgoing call is ringing (terminal '%s', caller id '%s')\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_OUT_SETUP
&& e_state!=EPOINT_STATE_OUT_OVERLAP
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup or proceeding state (for port_list: another portlist might have changed the state already).\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup or proceeding state (for port_list: another portlist might have changed the state already).\n", ea_endpoint->ep_serial);
break;
}
if (e_state!=EPOINT_STATE_OUT_SETUP
&& e_state!=EPOINT_STATE_OUT_OVERLAP
&& e_state!=EPOINT_STATE_OUT_PROCEEDING
if (e_state!=EPOINT_STATE_OUT_SETUP
&& e_state!=EPOINT_STATE_OUT_OVERLAP
&& e_state!=EPOINT_STATE_OUT_PROCEEDING
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup, proceeding or alerting state.\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup, proceeding or alerting state.\n", ea_endpoint->ep_serial);
break;
}
/* join MESSAGE_CRYPT */
void EndpointAppPBX::join_crypt(struct port_list *portlist, int message_type, union parameter *param)
{
/* join MESSAGE_CRYPT */
void EndpointAppPBX::join_crypt(struct port_list *portlist, int message_type, union parameter *param)
{
/* message from remote port to "crypt manager" */
case CU_ACTK_REQ: /* activate key-exchange */
case CU_ACTS_REQ: /* activate shared key */
/* message from remote port to "crypt manager" */
case CU_ACTK_REQ: /* activate key-exchange */
case CU_ACTS_REQ: /* activate shared key */
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_INFORMATION);
memcpy(&message->param.information, ¶m->information, sizeof(struct dialing_info));
message_put(message);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_INFORMATION);
memcpy(&message->param.information, ¶m->information, sizeof(struct dialing_info));
message_put(message);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_FACILITY);
memcpy(&message->param.facilityinfo, ¶m->facilityinfo, sizeof(struct facility_info));
message_put(message);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_FACILITY);
memcpy(&message->param.facilityinfo, ¶m->facilityinfo, sizeof(struct facility_info));
message_put(message);
/* disconnect audio */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 0;
message_put(message);
}
/* disconnect audio */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 0;
message_put(message);
}
if (e_dialinginfo.id[0])
set_tone(portlist, "dialing");
else
set_tone(portlist, "dialtone");
return;
}
if (e_dialinginfo.id[0])
set_tone(portlist, "dialing");
else
set_tone(portlist, "dialtone");
return;
}
/* connect / disconnect audio */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
if (e_ext.own_proceeding)
/* connect / disconnect audio */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
if (e_ext.own_proceeding)
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_PROCEEDING);
message_put(message);
logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_PROCEEDING);
message_put(message);
logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
/* connect / disconnect audio */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
if (e_ext.own_alerting)
/* connect / disconnect audio */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
if (e_ext.own_alerting)
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_ALERTING);
message_put(message);
logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
}
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_ALERTING);
message_put(message);
logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
}
set_tone(portlist, "ringpbx");
else
set_tone(portlist, "ringing");
set_tone(portlist, "ringpbx");
else
set_tone(portlist, "ringing");
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_CONNECT);
memcpy(&message->param, param, sizeof(union parameter));
/* screen clip if prefix is required */
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_CONNECT);
memcpy(&message->param, param, sizeof(union parameter));
/* screen clip if prefix is required */
SCPY(message->param.connectinfo.id, e_ext.clip_prefix);
SCAT(message->param.connectinfo.id, numberrize_callerinfo(e_connectinfo.id,e_connectinfo.ntype, options.national, options.international));
message->param.connectinfo.ntype = INFO_NTYPE_UNKNOWN;
}
/* use internal caller id */
SCPY(message->param.connectinfo.id, e_ext.clip_prefix);
SCAT(message->param.connectinfo.id, numberrize_callerinfo(e_connectinfo.id,e_connectinfo.ntype, options.national, options.international));
message->param.connectinfo.ntype = INFO_NTYPE_UNKNOWN;
}
/* use internal caller id */
SCPY(message->param.connectinfo.id, e_connectinfo.extension);
message->param.connectinfo.ntype = INFO_NTYPE_UNKNOWN;
}
SCPY(message->param.connectinfo.id, e_connectinfo.extension);
message->param.connectinfo.ntype = INFO_NTYPE_UNKNOWN;
}
e_tx_state = NOTIFY_STATE_ACTIVE;
/* we are powerdialing, if e_powerdialing is set and limit is not exceeded if given */
e_tx_state = NOTIFY_STATE_ACTIVE;
/* we are powerdialing, if e_powerdialing is set and limit is not exceeded if given */
release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYPE, join, port */
/* set time for power dialing */
release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYPE, join, port */
/* set time for power dialing */
e_join_pattern = 0;
}
set_tone(ea_endpoint->ep_portlist, "redial");
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') redialing in %d seconds\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id, (int)e_powerdelay);
/* send proceeding when powerdialing and still setup (avoid dialing timeout) */
e_join_pattern = 0;
}
set_tone(ea_endpoint->ep_portlist, "redial");
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') redialing in %d seconds\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id, (int)e_powerdelay);
/* send proceeding when powerdialing and still setup (avoid dialing timeout) */
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_PROCEEDING);
message_put(message);
logmessage(message->type, &message->param, ea_endpoint->ep_portlist->port_id, DIRECTION_OUT);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_PROCEEDING);
message_put(message);
logmessage(message->type, &message->param, ea_endpoint->ep_portlist->port_id, DIRECTION_OUT);
/* set_tone(portlist, "proceeding"); */
}
/* send display of powerdialing */
/* set_tone(portlist, "proceeding"); */
}
/* send display of powerdialing */
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
if (e_powerlimit)
SPRINT(message->param.notifyinfo.display, "Retry %d of %d", e_powercount, e_powerlimit);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
if (e_powerlimit)
SPRINT(message->param.notifyinfo.display, "Retry %d of %d", e_powercount, e_powerlimit);
&& e_state!=EPOINT_STATE_IN_OVERLAP
&& e_state!=EPOINT_STATE_IN_PROCEEDING
&& e_state!=EPOINT_STATE_IN_ALERTING)
&& e_state!=EPOINT_STATE_IN_OVERLAP
&& e_state!=EPOINT_STATE_IN_PROCEEDING
&& e_state!=EPOINT_STATE_IN_ALERTING)
process_hangup(param->disconnectinfo.cause, param->disconnectinfo.location);
release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, param->disconnectinfo.cause); /* RELEASE_TYPE, join, port */
return; /* must exit here */
}
/* save cause */
process_hangup(param->disconnectinfo.cause, param->disconnectinfo.location);
release(RELEASE_ALL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, param->disconnectinfo.cause); /* RELEASE_TYPE, join, port */
return; /* must exit here */
}
/* save cause */
e_join_cause = param->disconnectinfo.cause;
e_join_location = param->disconnectinfo.location;
}
/* on release we need the audio again! */
e_join_cause = param->disconnectinfo.cause;
e_join_location = param->disconnectinfo.location;
}
/* on release we need the audio again! */
SPRINT(cause, "cause_%02x", param->disconnectinfo.cause);
/* if own_cause, we must release the join */
if (e_ext.own_cause /* own cause */
SPRINT(cause, "cause_%02x", param->disconnectinfo.cause);
/* if own_cause, we must release the join */
if (e_ext.own_cause /* own cause */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we have own cause or we have no patterns. (own_cause=%d pattern=%d)\n", ea_endpoint->ep_serial, e_ext.own_cause, e_join_pattern);
if (message_type != MESSAGE_RELEASE)
release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYPE, join, port */
e_join_pattern = 0;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we have own cause or we have no patterns. (own_cause=%d pattern=%d)\n", ea_endpoint->ep_serial, e_ext.own_cause, e_join_pattern);
if (message_type != MESSAGE_RELEASE)
release(RELEASE_JOIN, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL, LOCATION_PRIVATE_LOCAL, CAUSE_NORMAL); /* RELEASE_TYPE, join, port */
e_join_pattern = 0;
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_join_id, EPOINT_TO_JOIN, MESSAGE_AUDIOPATH);
message->param.audiopath = 1;
message_put(message);
set_tone(portlist, cause);
message_disconnect_port(portlist, param->disconnectinfo.cause, param->disconnectinfo.location, "");
portlist = portlist->next;
set_tone(portlist, cause);
message_disconnect_port(portlist, param->disconnectinfo.cause, param->disconnectinfo.location, "");
portlist = portlist->next;
/* if we already in setup state, we just update the dialing with new digits */
if (e_state == EPOINT_STATE_OUT_SETUP
/* if we already in setup state, we just update the dialing with new digits */
if (e_state == EPOINT_STATE_OUT_SETUP
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we are in setup state, so we do overlap dialing.\n", ea_endpoint->ep_serial);
/* if digits changed, what we have already dialed */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we are in setup state, so we do overlap dialing.\n", ea_endpoint->ep_serial);
/* if digits changed, what we have already dialed */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we have dialed digits which have been changed or we have a new multidial, so we must redial.\n", ea_endpoint->ep_serial);
/* release all ports */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we have dialed digits which have been changed or we have a new multidial, so we must redial.\n", ea_endpoint->ep_serial);
/* release all ports */
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = CAUSE_NORMAL; /* normal clearing */
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = CAUSE_NORMAL; /* normal clearing */
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) redial in progress, so we update the dialing number to %s.\n", ea_endpoint->ep_serial, param->setup.dialinginfo.id);
memcpy(&e_dialinginfo, ¶m->setup.dialinginfo, sizeof(e_dialinginfo));
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) redial in progress, so we update the dialing number to %s.\n", ea_endpoint->ep_serial, param->setup.dialinginfo.id);
memcpy(&e_dialinginfo, ¶m->setup.dialinginfo, sizeof(e_dialinginfo));
return;
}
/* queue digits */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) digits '%s' are queued because we didn't receive a setup acknowledge.\n", ea_endpoint->ep_serial, param->setup.dialinginfo.id);
SCAT(e_dialing_queue, param->setup.dialinginfo.id + strlen(e_dialinginfo.id));
/* queue digits */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) digits '%s' are queued because we didn't receive a setup acknowledge.\n", ea_endpoint->ep_serial, param->setup.dialinginfo.id);
SCAT(e_dialing_queue, param->setup.dialinginfo.id + strlen(e_dialinginfo.id));
/* get what we have not dialed yet */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we have already dialed '%s', we received '%s', what's left '%s'.\n", ea_endpoint->ep_serial, e_dialinginfo.id, param->setup.dialinginfo.id, param->setup.dialinginfo.id+strlen(e_dialinginfo.id));
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_INFORMATION);
/* get what we have not dialed yet */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) we have already dialed '%s', we received '%s', what's left '%s'.\n", ea_endpoint->ep_serial, e_dialinginfo.id, param->setup.dialinginfo.id, param->setup.dialinginfo.id+strlen(e_dialinginfo.id));
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_INFORMATION);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in idle state.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in idle state.\n", ea_endpoint->ep_serial);
return;
}
if (param->setup.dialinginfo.itype==INFO_ITYPE_ISDN_EXTENSION || param->setup.dialinginfo.itype==INFO_ITYPE_VBOX)
SCPY(e_ext.number, param->setup.dialinginfo.id);
/* if an internal extension is dialed, get extension's info about caller */
if (param->setup.dialinginfo.itype==INFO_ITYPE_ISDN_EXTENSION || param->setup.dialinginfo.itype==INFO_ITYPE_VBOX)
SCPY(e_ext.number, param->setup.dialinginfo.id);
/* if an internal extension is dialed, get extension's info about caller */
e_ext.number[0] = '\0';
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) the called terminal='%s' is not found in directory tree!\n", ea_endpoint->ep_serial, e_ext.number);
}
e_ext.number[0] = '\0';
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) the called terminal='%s' is not found in directory tree!\n", ea_endpoint->ep_serial, e_ext.number);
}
memcpy(&e_capainfo, ¶m->setup.capainfo, sizeof(e_capainfo));
/* process (voice over) data calls */
memcpy(&e_capainfo, ¶m->setup.capainfo, sizeof(e_capainfo));
/* process (voice over) data calls */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) handling data call as audio call: '%s'\n", ea_endpoint->ep_serial, e_ext.number);
memset(&e_capainfo, 0, sizeof(e_capainfo));
e_capainfo.bearer_capa = INFO_BC_AUDIO;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) handling data call as audio call: '%s'\n", ea_endpoint->ep_serial, e_ext.number);
memset(&e_capainfo, 0, sizeof(e_capainfo));
e_capainfo.bearer_capa = INFO_BC_AUDIO;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
memcpy(&message->param, param, sizeof(union parameter));
message_put(message);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
memcpy(&message->param, param, sizeof(union parameter));
message_put(message);
new_state = track_notify(e_tx_state, param->notifyinfo.notify);
// /* if notification was generated locally, we turn hold music on/off */
// if (param->notifyinfo.local)
// NOTE: we always assume that we send hold music on suspension of call, because we don't track if audio is available or not (we assume that we always have no audio, to make it easier)
{
new_state = track_notify(e_tx_state, param->notifyinfo.notify);
// /* if notification was generated locally, we turn hold music on/off */
// if (param->notifyinfo.local)
// NOTE: we always assume that we send hold music on suspension of call, because we don't track if audio is available or not (we assume that we always have no audio, to make it easier)
{
- if (new_state!=NOTIFY_STATE_HOLD && new_state!=NOTIFY_STATE_SUSPEND)
- {
- if (!strcmp(e_tone, "hold")) // don't interrupt other tones
- {
- while(portlist)
- {
+ if (new_state!=NOTIFY_STATE_HOLD && new_state!=NOTIFY_STATE_SUSPEND) {
+ if (!strcmp(e_tone, "hold")) { // don't interrupt other tones
+ while(portlist) {
set_tone(portlist, "hold");
portlist = portlist->next;
}
set_tone(portlist, "hold");
portlist = portlist->next;
}
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
memcpy(&message->param.notifyinfo, ¶m->notifyinfo, sizeof(struct notify_info));
/* handle restricted caller ids */
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
memcpy(&message->param.notifyinfo, ¶m->notifyinfo, sizeof(struct notify_info));
/* handle restricted caller ids */
- if (message_type == MESSAGE_DATA)
- {
- if (join_id == ea_endpoint->ep_join_id) // still linked with JOIN
- {
+ if (message_type == MESSAGE_DATA) {
+ if (join_id == ea_endpoint->ep_join_id) { // still linked with JOIN
}
// PDEBUG(DEBUG_EPOINT, "EPOINT(%d) received message %d for active JOIN (terminal %s, caller id %s state=%d)\n", ea_endpoint->ep_serial, message, e_ext.number, e_callerinfo.id, e_state);
}
// PDEBUG(DEBUG_EPOINT, "EPOINT(%d) received message %d for active JOIN (terminal %s, caller id %s state=%d)\n", ea_endpoint->ep_serial, message, e_ext.number, e_callerinfo.id, e_state);
/* JOIN SENDS TONE message */
case MESSAGE_TONE:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received tone message: '%d'\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id, param->tone.name);
/* JOIN SENDS TONE message */
case MESSAGE_TONE:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received tone message: '%d'\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id, param->tone.name);
case MESSAGE_OVERLAP:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received 'more info required'\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_IN_SETUP
case MESSAGE_OVERLAP:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received 'more info required'\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_IN_SETUP
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup state.\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup state.\n", ea_endpoint->ep_serial);
break;
}
/* JOIN sends PROCEEDING message */
case MESSAGE_PROCEEDING:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s (caller id '%s') received proceeding\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
/* JOIN sends PROCEEDING message */
case MESSAGE_PROCEEDING:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s (caller id '%s') received proceeding\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup state.\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup state.\n", ea_endpoint->ep_serial);
break;
}
case MESSAGE_ALERTING:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received alerting\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_IN_OVERLAP
case MESSAGE_ALERTING:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received alerting\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_IN_OVERLAP
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup or proceeding state.\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup or proceeding state.\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received connect\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_IN_OVERLAP
&& e_state!=EPOINT_STATE_IN_PROCEEDING
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received connect\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
if (e_state!=EPOINT_STATE_IN_OVERLAP
&& e_state!=EPOINT_STATE_IN_PROCEEDING
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup, proceeding or alerting state.\n", ea_endpoint->ep_serial);
break;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ignored because we are not in setup, proceeding or alerting state.\n", ea_endpoint->ep_serial);
break;
}
/* JOIN has pattern available */
case MESSAGE_PATTERN: /* indicating pattern available */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received pattern availability.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
/* JOIN has pattern available */
case MESSAGE_PATTERN: /* indicating pattern available */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received pattern availability.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
set_tone(portlist, NULL);
portlist = portlist->next;
}
set_tone(portlist, NULL);
portlist = portlist->next;
}
/* JOIN has no pattern available */
case MESSAGE_NOPATTERN: /* indicating no pattern available */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received pattern NOT available.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
/* JOIN has no pattern available */
case MESSAGE_NOPATTERN: /* indicating no pattern available */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received pattern NOT available.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
PDEBUG(DEBUG_EPOINT, "-> pattern becomes unavailable\n");
e_join_pattern = 0;
/* disconnect our audio tx and rx */
PDEBUG(DEBUG_EPOINT, "-> pattern becomes unavailable\n");
e_join_pattern = 0;
/* disconnect our audio tx and rx */
case MESSAGE_ENABLEKEYPAD:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received keypad enable request.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
e_enablekeypad = 1;
case MESSAGE_ENABLEKEYPAD:
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) epoint with terminal '%s' (caller id '%s') received keypad enable request.\n", ea_endpoint->ep_serial, e_ext.number, e_callerinfo.id);
e_enablekeypad = 1;
- while(portlist)
- {
- if ((port = find_port_id(portlist->port_id)))
- {
- if (port->p_type == PORT_TYPE_VBOX_OUT)
- {
- if (match_list(extensions, eapp->e_ext.number))
- {
+ while(portlist) {
+ if ((port = find_port_id(portlist->port_id))) {
+ if (port->p_type == PORT_TYPE_VBOX_OUT) {
+ if (match_list(extensions, eapp->e_ext.number)) {
}
if ((port->p_type==PORT_TYPE_DSS1_NT_OUT || port->p_type==PORT_TYPE_DSS1_TE_OUT || port->p_type==PORT_TYPE_GSM_OUT)
&& port->p_state==PORT_STATE_OUT_ALERTING)
}
if ((port->p_type==PORT_TYPE_DSS1_NT_OUT || port->p_type==PORT_TYPE_DSS1_TE_OUT || port->p_type==PORT_TYPE_GSM_OUT)
&& port->p_state==PORT_STATE_OUT_ALERTING)
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) nobody is ringing internally (or we don't have her in the access list), so we disconnect.\n", ea_endpoint->ep_serial);
reject:
set_tone(ea_endpoint->ep_portlist, "cause_10");
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) nobody is ringing internally (or we don't have her in the access list), so we disconnect.\n", ea_endpoint->ep_serial);
reject:
set_tone(ea_endpoint->ep_portlist, "cause_10");
PERROR("EPOINT(%d) ringing endpoint has no join.\n", ea_endpoint->ep_serial);
goto reject;
}
join = find_join_id(eapp->ea_endpoint->ep_join_id);
PERROR("EPOINT(%d) ringing endpoint has no join.\n", ea_endpoint->ep_serial);
goto reject;
}
join = find_join_id(eapp->ea_endpoint->ep_join_id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ringing endpoint's join is not a PBX join, so we must reject.\n", ea_endpoint->ep_serial);
goto reject;
}
joinpbx = (class JoinPBX *)join;
relation = joinpbx->j_relation;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) ringing endpoint's join is not a PBX join, so we must reject.\n", ea_endpoint->ep_serial);
goto reject;
}
joinpbx = (class JoinPBX *)join;
relation = joinpbx->j_relation;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) found ringing endpoint: %d.\n", ea_endpoint->ep_serial, eapp->ea_endpoint->ep_serial);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) found ringing endpoint: %d.\n", ea_endpoint->ep_serial, eapp->ea_endpoint->ep_serial);
class Join *debug_c = join_first;
class Endpoint *debug_e = epoint_first;
class Port *debug_p = port_first;
class Join *debug_c = join_first;
class Endpoint *debug_e = epoint_first;
class Port *debug_p = port_first;
joinpbx_debug(joinpbx, "EndpointAppPBX::pick_join(before)");
PDEBUG(DEBUG_EPOINT, "showing all joins:\n");
joinpbx_debug(joinpbx, "EndpointAppPBX::pick_join(before)");
PDEBUG(DEBUG_EPOINT, "showing all joins:\n");
PDEBUG(DEBUG_EPOINT, "join=%ld\n", debug_c->j_serial);
debug_c = debug_c->next;
}
PDEBUG(DEBUG_EPOINT, "showing all endpoints:\n");
PDEBUG(DEBUG_EPOINT, "join=%ld\n", debug_c->j_serial);
debug_c = debug_c->next;
}
PDEBUG(DEBUG_EPOINT, "showing all endpoints:\n");
PDEBUG(DEBUG_EPOINT, "ep=%ld, join=%ld\n", debug_e->ep_serial, debug_e->ep_join_id);
debug_e = debug_e->next;
}
PDEBUG(DEBUG_EPOINT, "showing all ports:\n");
PDEBUG(DEBUG_EPOINT, "ep=%ld, join=%ld\n", debug_e->ep_serial, debug_e->ep_join_id);
debug_e = debug_e->next;
}
PDEBUG(DEBUG_EPOINT, "showing all ports:\n");
PDEBUG(DEBUG_EPOINT, "port=%ld, ep=%ld (active)\n", debug_p->p_serial, ACTIVE_EPOINT(debug_p->p_epointlist));
debug_p = debug_p->next;
}
PDEBUG(DEBUG_EPOINT, "port=%ld, ep=%ld (active)\n", debug_p->p_serial, ACTIVE_EPOINT(debug_p->p_epointlist));
debug_p = debug_p->next;
}
/* beeing paranoid, we make call update */
joinpbx->j_updatebridge = 1;
/* beeing paranoid, we make call update */
joinpbx->j_updatebridge = 1;
class Join *debug_c = join_first;
class Endpoint *debug_e = epoint_first;
class Port *debug_p = port_first;
class Join *debug_c = join_first;
class Endpoint *debug_e = epoint_first;
class Port *debug_p = port_first;
joinpbx_debug(joinpbx, "EndpointAppPBX::pick_join(after)");
PDEBUG(DEBUG_EPOINT, "showing all joins:\n");
joinpbx_debug(joinpbx, "EndpointAppPBX::pick_join(after)");
PDEBUG(DEBUG_EPOINT, "showing all joins:\n");
PDEBUG(DEBUG_EPOINT, "join=%ld\n", debug_c->j_serial);
debug_c = debug_c->next;
}
PDEBUG(DEBUG_EPOINT, "showing all endpoints:\n");
PDEBUG(DEBUG_EPOINT, "join=%ld\n", debug_c->j_serial);
debug_c = debug_c->next;
}
PDEBUG(DEBUG_EPOINT, "showing all endpoints:\n");
PDEBUG(DEBUG_EPOINT, "ep=%ld, join=%ld\n", debug_e->ep_serial, debug_e->ep_join_id);
debug_e = debug_e->next;
}
PDEBUG(DEBUG_EPOINT, "showing all ports:\n");
PDEBUG(DEBUG_EPOINT, "ep=%ld, join=%ld\n", debug_e->ep_serial, debug_e->ep_join_id);
debug_e = debug_e->next;
}
PDEBUG(DEBUG_EPOINT, "showing all ports:\n");
PDEBUG(DEBUG_EPOINT, "port=%ld, ep=%ld\n", debug_p->p_serial, ACTIVE_EPOINT(debug_p->p_epointlist));
debug_p = debug_p->next;
}
PDEBUG(DEBUG_EPOINT, "port=%ld, ep=%ld\n", debug_p->p_serial, ACTIVE_EPOINT(debug_p->p_epointlist));
debug_p = debug_p->next;
}
class Port *our_port, *other_port;
class Pdss1 *our_pdss1, *other_pdss1;
class Port *our_port, *other_port;
class Pdss1 *our_pdss1, *other_pdss1;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our join doesn't exist anymore.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our join doesn't exist anymore.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: join is not a pbx join.\n", ea_endpoint->ep_serial);
return;
}
our_joinpbx = (class JoinPBX *)our_join;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: join is not a pbx join.\n", ea_endpoint->ep_serial);
return;
}
our_joinpbx = (class JoinPBX *)our_join;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we are not internal extension.\n", ea_endpoint->ep_serial);
return;
}
our_port = find_port_id(ea_endpoint->ep_portlist->port_id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we are not internal extension.\n", ea_endpoint->ep_serial);
return;
}
our_port = find_port_id(ea_endpoint->ep_portlist->port_id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our port doesn't exist anymore.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: our port doesn't exist anymore.\n", ea_endpoint->ep_serial);
return;
}
/* find an endpoint that is on hold and has the same mISDNport that we are on */
other_eapp = apppbx_first;
/* find an endpoint that is on hold and has the same mISDNport that we are on */
other_eapp = apppbx_first;
other_eapp = other_eapp->next;
continue;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint candiate: (ep%d) terminal='%s' port=%s join=%d.\n", ea_endpoint->ep_serial, other_eapp->ea_endpoint->ep_serial, other_eapp->e_ext.number, (other_eapp->ea_endpoint->ep_portlist)?"YES":"NO", other_eapp->ea_endpoint->ep_join_id);
if (other_eapp->e_ext.number[0] /* has terminal */
&& other_eapp->ea_endpoint->ep_portlist /* has port */
other_eapp = other_eapp->next;
continue;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint candiate: (ep%d) terminal='%s' port=%s join=%d.\n", ea_endpoint->ep_serial, other_eapp->ea_endpoint->ep_serial, other_eapp->e_ext.number, (other_eapp->ea_endpoint->ep_portlist)?"YES":"NO", other_eapp->ea_endpoint->ep_join_id);
if (other_eapp->e_ext.number[0] /* has terminal */
&& other_eapp->ea_endpoint->ep_portlist /* has port */
other_pdss1 = (class Pdss1 *)other_port;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type isdn! comparing our portnum=%d with other's portnum=%d hold=%s ces=%d\n", ea_endpoint->ep_serial, our_pdss1->p_m_mISDNport->portnum, other_pdss1->p_m_mISDNport->portnum, (other_pdss1->p_m_hold)?"YES":"NO", other_pdss1->p_m_d_ces);
if (other_pdss1->p_m_hold /* port is on hold */
&& other_pdss1->p_m_mISDNport == our_pdss1->p_m_mISDNport /* same isdn interface */
&& other_pdss1->p_m_d_ces == our_pdss1->p_m_d_ces) /* same tei+sapi */
break;
other_pdss1 = (class Pdss1 *)other_port;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of type isdn! comparing our portnum=%d with other's portnum=%d hold=%s ces=%d\n", ea_endpoint->ep_serial, our_pdss1->p_m_mISDNport->portnum, other_pdss1->p_m_mISDNport->portnum, (other_pdss1->p_m_hold)?"YES":"NO", other_pdss1->p_m_d_ces);
if (other_pdss1->p_m_hold /* port is on hold */
&& other_pdss1->p_m_mISDNport == our_pdss1->p_m_mISDNport /* same isdn interface */
&& other_pdss1->p_m_d_ces == our_pdss1->p_m_d_ces) /* same tei+sapi */
break;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of other type!\n", ea_endpoint->ep_serial);
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port is of other type!\n", ea_endpoint->ep_serial);
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port doesn't exist enymore.\n", ea_endpoint->ep_serial);
}
}
other_eapp = other_eapp->next;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) comparing other endpoint's port doesn't exist enymore.\n", ea_endpoint->ep_serial);
}
}
other_eapp = other_eapp->next;
}
- if (!other_eapp)
- {
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no other endpoint on same isdn interface with port on hold.\n", ea_endpoint->ep_serial);
+ if (!other_eapp) {
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: no other endpoint on same isdn terminal.\n", ea_endpoint->ep_serial);
- if (other_eapp->ea_endpoint->ep_join_id == ea_endpoint->ep_join_id)
- {
- PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we an the other have the same join.\n", ea_endpoint->ep_serial);
+ if (other_eapp->ea_endpoint->ep_join_id == ea_endpoint->ep_join_id) {
+ PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: we and the other have the same join.\n", ea_endpoint->ep_serial);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: other join doesn't exist anymore.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: other join doesn't exist anymore.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: other join is not a pbx join.\n", ea_endpoint->ep_serial);
return;
}
other_joinpbx = (class JoinPBX *)other_join;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: other join is not a pbx join.\n", ea_endpoint->ep_serial);
return;
}
other_joinpbx = (class JoinPBX *)other_join;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: both joins are partylines.\n", ea_endpoint->ep_serial);
return;
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) cannot join: both joins are partylines.\n", ea_endpoint->ep_serial);
return;
}
/* remove relation to endpoint for join on hold */
other_relation = other_joinpbx->j_relation;
other_relation_pointer = &other_joinpbx->j_relation;
/* remove relation to endpoint for join on hold */
other_relation = other_joinpbx->j_relation;
other_relation_pointer = &other_joinpbx->j_relation;
/* detach other endpoint on hold */
*other_relation_pointer = other_relation->next;
FREE(other_relation, sizeof(struct join_relation));
/* detach other endpoint on hold */
*other_relation_pointer = other_relation->next;
FREE(other_relation, sizeof(struct join_relation));
/* change join/hold pointer of endpoint to the new join */
temp_epoint = find_epoint_id(other_relation->epoint_id);
/* change join/hold pointer of endpoint to the new join */
temp_epoint = find_epoint_id(other_relation->epoint_id);
/* join call relations */
our_relation = our_joinpbx->j_relation;
our_relation_pointer = &our_joinpbx->j_relation;
/* join call relations */
our_relation = our_joinpbx->j_relation;
our_relation_pointer = &our_joinpbx->j_relation;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) join is not a pbx join.\n", ea_endpoint->ep_serial);
*errstr = "No PBX Call";
return(1);
}
joinpbx = (class JoinPBX *)join;
relation = joinpbx->j_relation;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) join is not a pbx join.\n", ea_endpoint->ep_serial);
*errstr = "No PBX Call";
return(1);
}
joinpbx = (class JoinPBX *)join;
relation = joinpbx->j_relation;
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) join has more than two relations.\n", ea_endpoint->ep_serial);
*errstr = "Err: Conference";
return(1);
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) join has more than two relations.\n", ea_endpoint->ep_serial);
*errstr = "Err: Conference";
return(1);
}
PERROR("EPOINT(%d) SOFTWARE ERROR: both join relations are related to our endpoint.\n", ea_endpoint->ep_serial);
*errstr = "Software Error";
return(1);
PERROR("EPOINT(%d) SOFTWARE ERROR: both join relations are related to our endpoint.\n", ea_endpoint->ep_serial);
*errstr = "Software Error";
return(1);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint has not port.\n", ea_endpoint->ep_serial);
*errstr = "No Call";
return(1);
}
*port = find_port_id(epoint->ep_portlist->port_id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint has not port.\n", ea_endpoint->ep_serial);
*errstr = "No Call";
return(1);
}
*port = find_port_id(epoint->ep_portlist->port_id);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint has an none existing port.\n", ea_endpoint->ep_serial);
*errstr = "No Call";
return(1);
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint has an none existing port.\n", ea_endpoint->ep_serial);
*errstr = "No Call";
return(1);
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint has not an external port.\n", ea_endpoint->ep_serial);
*errstr = "No Ext Call";
return(1);
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint has not an external port.\n", ea_endpoint->ep_serial);
*errstr = "No Ext Call";
return(1);
}
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint's port is not in connected state.\n", ea_endpoint->ep_serial);
*errstr = "No Ext Connect";
return(1);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) 2nd endpoint's port is not in connected state.\n", ea_endpoint->ep_serial);
*errstr = "No Ext Connect";
return(1);
case MESSAGE_SETUP:
trace_header("SETUP", dir);
if (dir == DIRECTION_OUT)
case MESSAGE_SETUP:
trace_header("SETUP", dir);
if (dir == DIRECTION_OUT)
if (param->setup.callerinfo.extension[0])
add_trace("extension", NULL, "%s", param->setup.callerinfo.extension);
add_trace("caller id", "number", "%s", numberrize_callerinfo(param->setup.callerinfo.id, param->setup.callerinfo.ntype, options.national, options.international));
if (param->setup.callerinfo.extension[0])
add_trace("extension", NULL, "%s", param->setup.callerinfo.extension);
add_trace("caller id", "number", "%s", numberrize_callerinfo(param->setup.callerinfo.id, param->setup.callerinfo.ntype, options.national, options.international));
case INFO_PRESENT_RESTRICTED:
add_trace("caller id", "present", "restricted");
break;
case INFO_PRESENT_RESTRICTED:
add_trace("caller id", "present", "restricted");
break;
add_trace("caller id2", "number", "%s", numberrize_callerinfo(param->setup.callerinfo.id2, param->setup.callerinfo.ntype2, options.national, options.international));
add_trace("caller id2", "number", "%s", numberrize_callerinfo(param->setup.callerinfo.id2, param->setup.callerinfo.ntype2, options.national, options.international));
case INFO_PRESENT_RESTRICTED:
add_trace("caller id2", "present", "restricted");
break;
case INFO_PRESENT_RESTRICTED:
add_trace("caller id2", "present", "restricted");
break;
add_trace("redir'ing", "number", "%s", numberrize_callerinfo(param->setup.redirinfo.id, param->setup.redirinfo.ntype, options.national, options.international));
add_trace("redir'ing", "number", "%s", numberrize_callerinfo(param->setup.redirinfo.id, param->setup.redirinfo.ntype, options.national, options.international));
case INFO_PRESENT_RESTRICTED:
add_trace("redir'ing", "present", "restricted");
break;
case INFO_PRESENT_RESTRICTED:
add_trace("redir'ing", "present", "restricted");
break;
if (param->connectinfo.extension[0])
add_trace("extension", NULL, "%s", param->connectinfo.extension);
add_trace("connect id", "number", "%s", numberrize_callerinfo(param->connectinfo.id, param->connectinfo.ntype, options.national, options.international));
if (param->connectinfo.extension[0])
add_trace("extension", NULL, "%s", param->connectinfo.extension);
add_trace("connect id", "number", "%s", numberrize_callerinfo(param->connectinfo.id, param->connectinfo.ntype, options.national, options.international));
case INFO_PRESENT_RESTRICTED:
add_trace("connect id", "present", "restricted");
break;
case INFO_PRESENT_RESTRICTED:
add_trace("connect id", "present", "restricted");
break;
if (dir == DIRECTION_IN)
add_trace("from", NULL, "CH(%lu)", port_id);
add_trace("cause", "value", "%d", param->disconnectinfo.cause);
if (dir == DIRECTION_IN)
add_trace("from", NULL, "CH(%lu)", port_id);
add_trace("cause", "value", "%d", param->disconnectinfo.cause);
add_trace("from", NULL, "CH(%lu)", port_id);
if (param->notifyinfo.notify)
add_trace("indicator", NULL, "%s", logtext);
add_trace("from", NULL, "CH(%lu)", port_id);
if (param->notifyinfo.notify)
add_trace("indicator", NULL, "%s", logtext);
add_trace("redir'on", "number", "%s", numberrize_callerinfo(param->notifyinfo.id, param->notifyinfo.ntype, options.national, options.international));
add_trace("redir'on", "number", "%s", numberrize_callerinfo(param->notifyinfo.id, param->notifyinfo.ntype, options.national, options.international));
case INFO_PRESENT_RESTRICTED:
add_trace("redir'on", "present", "restricted");
break;
case INFO_PRESENT_RESTRICTED:
add_trace("redir'on", "present", "restricted");
break;
add_trace("to", NULL, "CH(%lu)", port_id);
if (dir == DIRECTION_IN)
add_trace("from", NULL, "CH(%lu)", port_id);
add_trace("to", NULL, "CH(%lu)", port_id);
if (dir == DIRECTION_IN)
add_trace("from", NULL, "CH(%lu)", port_id);
add_trace("directory", NULL, "%s", param->tone.dir[0]?param->tone.dir:"default");
add_trace("name", NULL, "%s", param->tone.name);
} else
add_trace("directory", NULL, "%s", param->tone.dir[0]?param->tone.dir:"default");
add_trace("name", NULL, "%s", param->tone.name);
} else
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_DISCONNECT);
message->param.disconnectinfo.cause = cause;
message->param.disconnectinfo.location = location;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_DISCONNECT);
message->param.disconnectinfo.cause = cause;
message->param.disconnectinfo.location = location;
SCPY(message->param.disconnectinfo.display, display);
else
SCPY(message->param.disconnectinfo.display, get_isdn_cause(cause, location, e_ext.display_cause));
SCPY(message->param.disconnectinfo.display, display);
else
SCPY(message->param.disconnectinfo.display, get_isdn_cause(cause, location, e_ext.display_cause));
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
if (display[0])
SCPY(message->param.notifyinfo.display, display);
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_NOTIFY);
if (display[0])
SCPY(message->param.notifyinfo.display, display);
logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
}
logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
}