/*
* constructor
*/
-Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive) : PmISDN(type, mISDNport, portname, settings, channel, exclusive)
+Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive, int mode) : PmISDN(type, mISDNport, portname, settings, channel, exclusive, mode)
{
p_callerinfo.itype = (mISDNport->ifport->interface->extension)?INFO_ITYPE_ISDN_EXTENSION:INFO_ITYPE_ISDN;
p_m_d_ntmode = mISDNport->ntmode;
+ p_m_d_tespecial = mISDNport->tespecial;
p_m_d_l3id = 0;
p_m_d_ces = -1;
p_m_d_queue = NULL;
p_m_d_collect_cause = 0;
p_m_d_collect_location = 0;
- PDEBUG(DEBUG_ISDN, "Created new mISDNPort(%s). Currently %d objects use, %s port #%d\n", portname, mISDNport->use, (mISDNport->ntmode)?"NT":"TE", p_m_portnum);
+ PDEBUG(DEBUG_ISDN, "Created new mISDNPort(%s). Currently %d objects use, %s%s port #%d\n", portname, mISDNport->use, (mISDNport->ntmode)?"NT":"TE", (mISDNport->tespecial)?" (special)":"", p_m_portnum);
}
/* exclusive channel requests must be in the list */
if (exclusive)
{
+ /* no exclusive channel */
if (!channel)
{
add_trace("conclusion", NULL, "exclusively requested channel not in list");
end_trace();
return(-6); // channel unacceptable
}
- i = selchannel->channel-1-(selchannel->channel>=17);
+ /* get index for channel */
+ i = channel-1-(channel>=17);
+ if (i < 0 || i >= p_m_mISDNport->b_num || channel == 16)
+ {
+ add_trace("conclusion", NULL, "exclusively requested channel outside interface range");
+ end_trace();
+ return(-6); // channel unacceptable
+ }
+ /* check if busy */
if (p_m_mISDNport->b_port[i] == NULL)
goto use_channel;
add_trace("conclusion", NULL, "exclusively requested channel is busy");
/* requested channels in list will be used */
if (channel)
{
- i = selchannel->channel-1-(selchannel->channel>=17);
+ /* get index for channel */
+ i = channel-1-(channel>=17);
+ if (i < 0 || i >= p_m_mISDNport->b_num || channel == 16)
+ {
+ add_trace("info", NULL, "requested channel %d outside interface range", channel);
+ } else /* if inside range (else) check if available */
if (p_m_mISDNport->b_port[i] == NULL)
goto use_channel;
}
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
{
int calling_type, calling_plan, calling_present, calling_screen;
+ int calling_type2, calling_plan2, calling_present2, calling_screen2;
int called_type, called_plan;
int redir_type, redir_plan, redir_present, redir_screen, redir_reason;
int hlc_coding, hlc_presentation, hlc_interpretation, hlc_hlc, hlc_exthlc;
end_trace();
l1l2l3_trace_header(p_m_mISDNport, this, L3_SETUP_IND, DIRECTION_IN);
- dec_ie_calling_pn(l3m, &calling_type, &calling_plan, &calling_present, &calling_screen, (unsigned char *)p_callerinfo.id, sizeof(p_callerinfo.id));
+ dec_ie_calling_pn(l3m, &calling_type, &calling_plan, &calling_present, &calling_screen, (unsigned char *)p_callerinfo.id, sizeof(p_callerinfo.id), &calling_type2, &calling_plan2, &calling_present2, &calling_screen2, (unsigned char *)p_callerinfo.id2, sizeof(p_callerinfo.id2));
dec_ie_called_pn(l3m, &called_type, &called_plan, (unsigned char *)p_dialinginfo.id, sizeof(p_dialinginfo.id));
dec_ie_keypad(l3m, (unsigned char *)keypad, sizeof(keypad));
/* te-mode: CNIP (calling name identification presentation) */
- if (!p_m_d_ntmode)
- dec_facility_centrex(l3m, (unsigned char *)p_callerinfo.name, sizeof(p_callerinfo.name));
+ dec_facility_centrex(l3m, (unsigned char *)p_callerinfo.name, sizeof(p_callerinfo.name));
dec_ie_useruser(l3m, &useruser_protocol, useruser, &useruser_len);
dec_ie_complete(l3m, &p_dialinginfo.sending_complete);
dec_ie_redir_nr(l3m, &redir_type, &redir_plan, &redir_present, &redir_screen, &redir_reason, (unsigned char *)p_redirinfo.id, sizeof(p_redirinfo.id));
dec_ie_channel_id(l3m, &exclusive, &channel);
dec_ie_hlc(l3m, &hlc_coding, &hlc_interpretation, &hlc_presentation, &hlc_hlc, &hlc_exthlc);
dec_ie_bearer(l3m, &bearer_coding, &bearer_capability, &bearer_mode, &bearer_rate, &bearer_multi, &bearer_user);
+ dec_ie_display(l3m, (unsigned char *)p_dialinginfo.display, sizeof(p_dialinginfo.display));
end_trace();
/* if blocked, release call with MT_RELEASE_COMPLETE */
switch (calling_type)
{
case -1:
+ p_callerinfo.ntype = INFO_NTYPE_NOTPRESENT;
+ break;
+ case 0x0:
p_callerinfo.ntype = INFO_NTYPE_UNKNOWN;
- p_callerinfo.present = INFO_PRESENT_NOTAVAIL;
- p_callerinfo.screen = INFO_SCREEN_NETWORK;
break;
case 0x1:
p_callerinfo.ntype = INFO_NTYPE_INTERNATIONAL;
p_callerinfo.isdn_port = p_m_portnum;
SCPY(p_callerinfo.interface, p_m_mISDNport->ifport->interface->name);
+ /* caller info2 */
+ switch (calling_present2)
+ {
+ case 1:
+ p_callerinfo.present2 = INFO_PRESENT_RESTRICTED;
+ break;
+ case 2:
+ p_callerinfo.present2 = INFO_PRESENT_NOTAVAIL;
+ break;
+ default:
+ p_callerinfo.present2 = INFO_PRESENT_ALLOWED;
+ break;
+ }
+ switch (calling_screen2)
+ {
+ case 0:
+ p_callerinfo.screen2 = INFO_SCREEN_USER;
+ break;
+ default:
+ p_callerinfo.screen2 = INFO_SCREEN_NETWORK;
+ break;
+ }
+ switch (calling_type2)
+ {
+ case -1:
+ p_callerinfo.ntype2 = INFO_NTYPE_NOTPRESENT;
+ break;
+ case 0x0:
+ p_callerinfo.ntype2 = INFO_NTYPE_UNKNOWN;
+ break;
+ case 0x1:
+ p_callerinfo.ntype2 = INFO_NTYPE_INTERNATIONAL;
+ break;
+ case 0x2:
+ p_callerinfo.ntype2 = INFO_NTYPE_NATIONAL;
+ break;
+ case 0x4:
+ p_callerinfo.ntype2 = INFO_NTYPE_SUBSCRIBER;
+ break;
+ default:
+ p_callerinfo.ntype2 = INFO_NTYPE_UNKNOWN;
+ break;
+ }
+
/* dialing information */
SCAT(p_dialinginfo.id, (char *)keypad);
switch (called_type)
switch (redir_type)
{
case -1:
+ p_redirinfo.ntype = INFO_NTYPE_NOTPRESENT;
+ break;
+ case 0x0:
p_redirinfo.ntype = INFO_NTYPE_UNKNOWN;
- p_redirinfo.present = INFO_PRESENT_NULL; /* not redirecting */
- p_redirinfo.reason = INFO_REDIR_UNKNOWN;
break;
case 0x1:
p_redirinfo.ntype = INFO_NTYPE_INTERNATIONAL;
break;
}
+ /* set bchannel mode */
+ if (p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED
+ || p_capainfo.bearer_capa==INFO_BC_DATARESTRICTED
+ || p_capainfo.bearer_capa==INFO_BC_VIDEO)
+ p_capainfo.source_mode = B_MODE_HDLC;
+ else
+ p_capainfo.source_mode = B_MODE_TRANSPARENT;
+ p_m_b_mode = p_capainfo.source_mode;
+
/* hunt channel */
ret = channel = hunt_bchannel(channel, exclusive);
if (ret < 0)
void Pdss1::information_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
{
int type, plan;
- unsigned char keypad[32] = "";
+ unsigned char keypad[32] = "", display[128] = "";
struct lcr_msg *message;
l1l2l3_trace_header(p_m_mISDNport, this, L3_INFORMATION_IND, DIRECTION_IN);
dec_ie_called_pn(l3m, &type, &plan, (unsigned char *)p_dialinginfo.id, sizeof(p_dialinginfo.id));
dec_ie_keypad(l3m, (unsigned char *)keypad, sizeof(keypad));
+ dec_ie_display(l3m, (unsigned char *)display, sizeof(display));
dec_ie_complete(l3m, &p_dialinginfo.sending_complete);
end_trace();
p_dialinginfo.ntype = INFO_NTYPE_UNKNOWN;
break;
}
+ SCAT(p_dialinginfo.display, (char *)display);
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_INFORMATION);
memcpy(&message->param.information, &p_dialinginfo, sizeof(struct dialing_info));
message_put(message);
switch (type)
{
case -1:
- message->param.notifyinfo.ntype = INFO_NTYPE_UNKNOWN;
- message->param.notifyinfo.present = INFO_PRESENT_NULL;
+ message->param.notifyinfo.ntype = INFO_NTYPE_NOTPRESENT;
break;
case 1:
message->param.notifyinfo.ntype = INFO_NTYPE_INTERNATIONAL;
switch (type)
{
case -1:
- message->param.notifyinfo.ntype = INFO_NTYPE_UNKNOWN;
- message->param.notifyinfo.present = INFO_PRESENT_NULL;
+ message->param.notifyinfo.ntype = INFO_NTYPE_NOTPRESENT;
break;
case 1:
message->param.notifyinfo.ntype = INFO_NTYPE_INTERNATIONAL;
l1l2l3_trace_header(p_m_mISDNport, this, L3_CONNECT_IND, DIRECTION_IN);
dec_ie_channel_id(l3m, &exclusive, &channel);
dec_ie_connected_pn(l3m, &type, &plan, &present, &screen, (unsigned char *)p_connectinfo.id, sizeof(p_connectinfo.id));
+ dec_ie_display(l3m, (unsigned char *)p_connectinfo.display, sizeof(p_connectinfo.display));
/* te-mode: CONP (connected name identification presentation) */
- if (!p_m_d_ntmode)
- dec_facility_centrex(l3m, (unsigned char *)p_connectinfo.name, sizeof(p_connectinfo.name));
+ dec_facility_centrex(l3m, (unsigned char *)p_connectinfo.name, sizeof(p_connectinfo.name));
end_trace();
/* select channel */
}
switch (type)
{
- case 0x0:
- p_connectinfo.present = INFO_PRESENT_NULL; /* no COLP info */
- p_connectinfo.ntype = INFO_NTYPE_UNKNOWN;
+ case -1:
+ p_connectinfo.ntype = INFO_NTYPE_NOTPRESENT;
break;
case 0x1:
p_connectinfo.ntype = INFO_NTYPE_INTERNATIONAL;
int location, cause;
int coding, proglocation, progress;
struct lcr_msg *message;
+ unsigned char display[128] = "";
l1l2l3_trace_header(p_m_mISDNport, this, L3_DISCONNECT_IND, DIRECTION_IN);
dec_ie_progress(l3m, &coding, &proglocation, &progress);
dec_ie_cause(l3m, &location, &cause);
+ dec_ie_display(l3m, (unsigned char *)display, sizeof(display));
end_trace();
if (cause < 0)
message = message_create(p_serial, p_epointlist->epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = cause;
message->param.disconnectinfo.location = location;
+ SCAT(message->param.disconnectinfo.display, (char *)display);
message_put(message);
/* remove epoint */
free_epointlist(p_epointlist);
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_DISCONNECT);
message->param.disconnectinfo.location = location;
message->param.disconnectinfo.cause = cause;
+ SCAT(message->param.disconnectinfo.display, (char *)display);
message_put(message);
}
while(INACTIVE_EPOINT(p_epointlist))
message = message_create(p_serial, INACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.location = location;
message->param.disconnectinfo.cause = cause;
+ SCAT(message->param.disconnectinfo.display, (char *)display);
message_put(message);
/* remove epoint */
free_epointid(INACTIVE_EPOINT(p_epointlist));
{
int location, cause;
struct lcr_msg *message;
+ unsigned char display[128] = "";
l1l2l3_trace_header(p_m_mISDNport, this, L3_RELEASE_IND, DIRECTION_IN);
dec_ie_cause(l3m, &location, &cause);
+ dec_ie_display(l3m, (unsigned char *)display, sizeof(display));
end_trace();
if (cause < 0)
message = message_create(p_serial, p_epointlist->epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = cause;
message->param.disconnectinfo.location = location;
+ SCAT(message->param.disconnectinfo.display, (char *)display);
message_put(message);
/* remove epoint */
free_epointlist(p_epointlist);
l1l2l3_trace_header(p_m_mISDNport, this, L3_RELEASE_COMPLETE_IND, DIRECTION_IN);
/* in case layer 2 is down during setup, we send cause 27 loc 5 */
- if (p_state == PORT_STATE_OUT_SETUP && !p_m_mISDNport->l1link)
+ if (p_state == PORT_STATE_OUT_SETUP && p_m_mISDNport->l1link == 0)
{
cause = 27;
location = 5;
} else
{
dec_ie_cause(l3m, &location, &cause);
- add_trace("layer 1", NULL, (p_m_mISDNport->l1link)?"up":"down");
+ if (p_m_mISDNport->l1link < 0)
+ add_trace("layer 1", NULL, "unknown");
+ else
+ add_trace("layer 1", NULL, (p_m_mISDNport->l1link)?"up":"down");
}
end_trace();
if (location == LOCATION_PRIVATE_LOCAL)
struct lcr_msg *message;
int notify, type, plan, present;
unsigned char notifyid[sizeof(message->param.notifyinfo.id)];
+ unsigned char display[128] = "";
l1l2l3_trace_header(p_m_mISDNport, this, L3_NOTIFY_IND, DIRECTION_IN);
dec_ie_notify(l3m, ¬ify);
dec_ie_redir_dn(l3m, &type, &plan, &present, notifyid, sizeof(notifyid));
+ dec_ie_display(l3m, (unsigned char *)display, sizeof(display));
end_trace();
if (!ACTIVE_EPOINT(p_epointlist))
switch (type)
{
case -1:
- message->param.notifyinfo.ntype = INFO_NTYPE_UNKNOWN;
- message->param.notifyinfo.present = INFO_PRESENT_NULL;
+ message->param.notifyinfo.ntype = INFO_NTYPE_NOTPRESENT;
break;
case 1:
message->param.notifyinfo.ntype = INFO_NTYPE_INTERNATIONAL;
message->param.notifyinfo.ntype = INFO_NTYPE_UNKNOWN;
break;
}
+ SCAT(message->param.notifyinfo.display, (char *)display);
message->param.notifyinfo.isdn_port = p_m_portnum;
message_put(message);
}
if (ret < 0)
goto no_channel;
+// mode (if hdlc parked) to be done. never mind, this is almost never requested
/* open channel */
ret = seize_bchannel(channel, 1);
if (ret < 0)
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_INFORMATION_REQ, DIRECTION_OUT);
enc_ie_called_pn(l3m, 0, 1, (unsigned char *)param->information.id);
+ if (p_m_d_ntmode || p_m_d_tespecial)
+ enc_ie_display(l3m, (unsigned char *)param->information.display);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_INFORMATION, p_m_d_l3id, l3m);
}
l3_msg *l3m;
int ret;
int plan, type, screen, present, reason;
+ int plan2, type2, screen2, present2;
int capability, mode, rate, coding, user, presentation, interpretation, hlc, exthlc;
int channel, exclusive;
struct epoint_list *epointlist;
// SCPY(&p_m_tones_dir, param->setup.ext.tones_dir);
/* screen outgoing caller id */
do_screen(1, p_callerinfo.id, sizeof(p_callerinfo.id), &p_callerinfo.ntype, &p_callerinfo.present, p_m_mISDNport->ifport->interface);
+ do_screen(1, p_callerinfo.id2, sizeof(p_callerinfo.id2), &p_callerinfo.ntype2, &p_callerinfo.present2, p_m_mISDNport->ifport->interface);
/* only display at connect state: this case happens if endpoint is in connected mode */
if (p_state==PORT_STATE_CONNECT)
/* sending information */
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_INFORMATION_REQ, DIRECTION_OUT);
- if (p_m_d_ntmode)
+ if (p_m_d_ntmode || p_m_d_tespecial)
enc_ie_display(l3m, (unsigned char *)p_callerinfo.display);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_INFORMATION, p_m_d_l3id, l3m);
plan = 1;
switch (p_callerinfo.ntype)
{
+ case INFO_NTYPE_UNKNOWN:
+ type = 0x0;
+ break;
case INFO_NTYPE_INTERNATIONAL:
type = 0x1;
break;
case INFO_NTYPE_SUBSCRIBER:
type = 0x4;
break;
- default: /* INFO_NTYPE_UNKNOWN */
- type = 0x0;
+ default: /* INFO_NTYPE_NOTPRESENT */
+ type = -1;
break;
}
switch (p_callerinfo.screen)
}
switch (p_callerinfo.present)
{
+ case INFO_PRESENT_ALLOWED:
+ present = 0;
+ break;
case INFO_PRESENT_RESTRICTED:
present = 1;
break;
- case INFO_PRESENT_NOTAVAIL:
+ default: /* INFO_PRESENT_NOTAVAIL */
present = 2;
break;
- default: /* INFO_PRESENT_ALLOWED */
- present = 0;
+ }
+ /* caller information 2 */
+ plan2 = 1;
+ switch (p_callerinfo.ntype2)
+ {
+ case INFO_NTYPE_UNKNOWN:
+ type2 = 0x0;
+ break;
+ case INFO_NTYPE_INTERNATIONAL:
+ type2 = 0x1;
+ break;
+ case INFO_NTYPE_NATIONAL:
+ type2 = 0x2;
+ break;
+ case INFO_NTYPE_SUBSCRIBER:
+ type2 = 0x4;
+ break;
+ default: /* INFO_NTYPE_NOTPRESENT */
+ type2 = -1;
+ break;
+ }
+ switch (p_callerinfo.screen2)
+ {
+ case INFO_SCREEN_USER:
+ screen2 = 0;
+ break;
+ default: /* INFO_SCREEN_NETWORK */
+ screen2 = 3;
+ break;
+ }
+ switch (p_callerinfo.present2)
+ {
+ case INFO_PRESENT_ALLOWED:
+ present2 = 0;
+ break;
+ case INFO_PRESENT_RESTRICTED:
+ present2 = 1;
+ break;
+ default: /* INFO_PRESENT_NOTAVAIL */
+ present2 = 2;
break;
}
if (type >= 0)
- enc_ie_calling_pn(l3m, type, plan, present, screen, (unsigned char *)p_callerinfo.id);
+ enc_ie_calling_pn(l3m, type, plan, present, screen, (unsigned char *)p_callerinfo.id, type2, plan2, present2, screen2, (unsigned char *)p_callerinfo.id2);
/* dialing information */
if (p_dialinginfo.id[0]) /* only if we have something to dial */
{
plan = 1;
switch (p_redirinfo.ntype)
{
+ case INFO_NTYPE_UNKNOWN:
+ type = 0x0;
+ break;
case INFO_NTYPE_INTERNATIONAL:
type = 0x1;
break;
case INFO_NTYPE_SUBSCRIBER:
type = 0x4;
break;
- default: /* INFO_NTYPE_UNKNOWN */
- type = 0x0;
+ default: /* INFO_NTYPE_NOTPRESENT */
+ type = -1;
break;
}
switch (p_redirinfo.screen)
}
switch (p_redirinfo.present)
{
- case INFO_PRESENT_NULL: /* no redir at all */
- present = -1;
- screen = -1;
- reason = -1;
- plan = -1;
- type = -1;
+ case INFO_PRESENT_ALLOWED:
+ present = 0;
break;
case INFO_PRESENT_RESTRICTED:
present = 1;
break;
- case INFO_PRESENT_NOTAVAIL:
+ default: /* INFO_PRESENT_NOTAVAIL */
present = 2;
break;
- default: /* INFO_PRESENT_ALLOWED */
- present = 0;
- break;
}
/* sending redirecting number only in ntmode */
- if (type >= 0 && p_m_d_ntmode)
+ if (type >= 0 && (p_m_d_ntmode || p_m_d_tespecial))
enc_ie_redir_nr(l3m, type, plan, present, screen, reason, (unsigned char *)p_redirinfo.id);
/* bearer capability */
//printf("hlc=%d\n",p_capainfo.hlc);
}
/* display */
- if (p_callerinfo.display[0] && p_m_d_ntmode)
+ if (p_callerinfo.display[0] && (p_m_d_ntmode || p_m_d_tespecial))
enc_ie_display(l3m, (unsigned char *)p_callerinfo.display);
/* nt-mode: CNIP (calling name identification presentation) */
-// if (p_callerinfo.name[0] && p_m_d_ntmode)
+// if (p_callerinfo.name[0] && (p_m_d_ntmode || p_m_d_tespecial))
// enc_facility_centrex(&setup->FACILITY, dmsg, (unsigned char *)p_callerinfo.name, 1);
end_trace();
l3_msg *l3m;
/* facility will not be sent to external lines */
- if (!p_m_d_ntmode)
+ if (!p_m_d_ntmode && !p_m_d_tespecial)
return;
/* sending facility */
{
l3_msg *l3m;
int notify;
- int plan, type = -1, present;
+ int plan = 0, type = -1, present = 0;
if (param->notifyinfo.notify>INFO_NOTIFY_NONE)
notify = param->notifyinfo.notify & 0x7f;
plan = 1;
switch (param->notifyinfo.ntype)
{
+ case INFO_NTYPE_UNKNOWN:
+ type = 0;
+ break;
case INFO_NTYPE_INTERNATIONAL:
type = 1;
break;
type = 4;
break;
default: /* INFO_NTYPE_UNKNOWN */
- type = 0;
+ type = -1;
break;
}
switch (param->notifyinfo.present)
{
- case INFO_PRESENT_NULL: /* no redir at all */
- present = -1;
- plan = -1;
- type = -1;
+ case INFO_PRESENT_ALLOWED:
+ present = 0;
break;
case INFO_PRESENT_RESTRICTED:
present = 1;
break;
- case INFO_PRESENT_NOTAVAIL:
+ default: /* INFO_PRESENT_NOTAVAIL */
present = 2;
break;
- default: /* INFO_PRESENT_ALLOWED */
- present = 0;
- break;
}
}
l1l2l3_trace_header(p_m_mISDNport, this, L3_NOTIFY_REQ, DIRECTION_OUT);
enc_ie_notify(l3m, notify);
/* sending redirection number only in ntmode */
- if (type >= 0 && p_m_d_ntmode)
+ if (type >= 0 && (p_m_d_ntmode || p_m_d_tespecial))
enc_ie_redir_dn(l3m, type, plan, present, (unsigned char *)param->notifyinfo.id);
- if (param->notifyinfo.display[0] && p_m_d_ntmode)
+ if (param->notifyinfo.display[0] && (p_m_d_ntmode || p_m_d_tespecial))
enc_ie_display(l3m, (unsigned char *)param->notifyinfo.display);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_NOTIFY, p_m_d_l3id, l3m);
}
- } else if (p_m_d_ntmode)
+ } else if (p_m_d_ntmode || p_m_d_tespecial)
{
/* sending information */
l3m = create_l3msg();
{
l3_msg *l3m;
+ /* in case of sending complete, we proceed */
+ if (p_dialinginfo.sending_complete)
+ {
+ PDEBUG(DEBUG_ISDN, "sending proceeding instead of setup_acknowledge, because address is complete.\n");
+ message_proceeding(epoint_id, message_id, param);
+ return;
+ }
+
/* sending setup_acknowledge */
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_SETUP_ACKNOWLEDGE_REQ, DIRECTION_OUT);
|| p_capainfo.bearer_capa==INFO_BC_AUDIO
|| p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED_TONES)
if (p_m_mISDNport->tones)
- enc_ie_progress(l3m, 0, p_m_d_ntmode?1:5, 8);
+ enc_ie_progress(l3m, 0, (p_m_d_ntmode)?1:5, 8);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_SETUP_ACKNOWLEDGE, p_m_d_l3id, l3m);
|| p_capainfo.bearer_capa==INFO_BC_AUDIO
|| p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED_TONES)
if (p_m_mISDNport->tones)
- enc_ie_progress(l3m, 0, p_m_d_ntmode?1:5, 8);
+ enc_ie_progress(l3m, 0, (p_m_d_ntmode)?1:5, 8);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_CALL_PROCEEDING, p_m_d_l3id, l3m);
|| p_capainfo.bearer_capa==INFO_BC_AUDIO
|| p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED_TONES)
if (p_m_mISDNport->tones)
- enc_ie_progress(l3m, 0, p_m_d_ntmode?1:5, 8);
+ enc_ie_progress(l3m, 0, (p_m_d_ntmode)?1:5, 8);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_CALL_PROCEEDING, p_m_d_l3id, l3m);
new_state(PORT_STATE_IN_PROCEEDING);
|| p_capainfo.bearer_capa==INFO_BC_AUDIO
|| p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED_TONES)
if (p_m_mISDNport->tones)
- enc_ie_progress(l3m, 0, p_m_d_ntmode?1:5, 8);
+ enc_ie_progress(l3m, 0, (p_m_d_ntmode)?1:5, 8);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_ALERTING, p_m_d_l3id, l3m);
/* sending information */
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_INFORMATION_REQ, DIRECTION_OUT);
- if (p_m_d_ntmode)
+ if (p_m_d_ntmode || p_m_d_tespecial)
enc_ie_display(l3m, (unsigned char *)p_connectinfo.display);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_INFORMATION, p_m_d_l3id, l3m);
plan = 1;
switch (p_connectinfo.ntype)
{
+ case INFO_NTYPE_UNKNOWN:
+ type = 0x0;
+ break;
case INFO_NTYPE_INTERNATIONAL:
type = 0x1;
break;
case INFO_NTYPE_SUBSCRIBER:
type = 0x4;
break;
- default: /* INFO_NTYPE_UNKNOWN */
- type = 0x0;
+ default: /* INFO_NTYPE_NOTPRESENT */
+ type = -1;
break;
}
switch (param->connectinfo.screen)
}
switch (p_connectinfo.present)
{
- case INFO_PRESENT_NULL: /* no colp at all */
- present = -1;
- screen = -1;
- plan = -1;
- type = -1;
+ case INFO_PRESENT_ALLOWED:
+ present = 0;
break;
case INFO_PRESENT_RESTRICTED:
present = 1;
break;
- case INFO_PRESENT_NOTAVAIL:
+ default: /* INFO_PRESENT_NOTAVAIL */
present = 2;
break;
- default: /* INFO_PRESENT_ALLOWED */
- present = 0;
- break;
}
if (type >= 0)
enc_ie_connected_pn(l3m, type, plan, present, screen, (unsigned char *)p_connectinfo.id);
/* display */
- if (p_connectinfo.display[0] && p_m_d_ntmode)
+ if (p_connectinfo.display[0] && (p_m_d_ntmode || p_m_d_tespecial))
enc_ie_display(l3m, (unsigned char *)p_connectinfo.display);
/* nt-mode: CONP (connected name identification presentation) */
-// if (p_connectinfo.name[0] && p_m_d_ntmode)
+// if (p_connectinfo.name[0] && (p_m_d_ntmode || p_m_d_tespecial))
// enc_facility_centrex(&connect->FACILITY, dmsg, (unsigned char *)p_connectinfo.name, 0);
/* date & time */
- if (p_m_d_ntmode)
+ if (p_m_d_ntmode || p_m_d_tespecial)
{
epoint = find_epoint_id(epoint_id);
enc_ie_date(l3m, now, p_settings.no_seconds);
|| p_capainfo.bearer_capa==INFO_BC_AUDIO
|| p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED_TONES)
if (p_m_mISDNport->tones)
- enc_ie_progress(l3m, 0, p_m_d_ntmode?1:5, 8);
+ enc_ie_progress(l3m, 0, (p_m_d_ntmode)?1:5, 8);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_CALL_PROCEEDING, p_m_d_l3id, l3m);
new_state(PORT_STATE_IN_PROCEEDING);
|| p_capainfo.bearer_capa==INFO_BC_AUDIO
|| p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED_TONES)
if (p_m_mISDNport->tones)
- enc_ie_progress(l3m, 0, p_m_d_ntmode?1:5, 8);
+ enc_ie_progress(l3m, 0, (p_m_d_ntmode)?1:5, 8);
/* send cause */
enc_ie_cause(l3m, (!p_m_mISDNport->locally && param->disconnectinfo.location==LOCATION_PRIVATE_LOCAL)?LOCATION_PRIVATE_REMOTE:param->disconnectinfo.location, param->disconnectinfo.cause);
/* send display */
if (param->disconnectinfo.display[0])
p = param->disconnectinfo.display;
- if (p) if (*p && p_m_d_ntmode)
+ if (p) if (*p && (p_m_d_ntmode || p_m_d_tespecial))
enc_ie_display(l3m, (unsigned char *)p);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_DISCONNECT, p_m_d_l3id, l3m);
|| p_capainfo.bearer_capa==INFO_BC_AUDIO
|| p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED_TONES)
if (p_m_mISDNport->tones)
- enc_ie_progress(l3m, 0, p_m_d_ntmode?1:5, 8);
+ enc_ie_progress(l3m, 0, (p_m_d_ntmode)?1:5, 8);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_CALL_PROCEEDING, p_m_d_l3id, l3m);
}
|| p_capainfo.bearer_capa==INFO_BC_AUDIO
|| p_capainfo.bearer_capa==INFO_BC_DATAUNRESTRICTED_TONES)
if (p_m_mISDNport->tones)
- enc_ie_progress(l3m, 0, p_m_d_ntmode?1:5, 8);
+ enc_ie_progress(l3m, 0, (p_m_d_ntmode)?1:5, 8);
/* send cause */
enc_ie_cause(l3m, (p_m_mISDNport->locally && param->disconnectinfo.location==LOCATION_PRIVATE_LOCAL)?LOCATION_PRIVATE_LOCAL:param->disconnectinfo.location, param->disconnectinfo.cause);
/* send display */
epoint = find_epoint_id(epoint_id);
if (param->disconnectinfo.display[0])
p = param->disconnectinfo.display;
- if (p) if (*p && p_m_d_ntmode)
+ if (p) if (*p && (p_m_d_ntmode || p_m_d_tespecial))
enc_ie_display(l3m, (unsigned char *)p);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_DISCONNECT, p_m_d_l3id, l3m);
*/
int Pdss1::message_epoint(unsigned int epoint_id, int message_id, union parameter *param)
{
- struct lcr_msg *message;
-
if (PmISDN::message_epoint(epoint_id, message_id, param))
return(1);
break;
default:
- PERROR("Pdss1(%s) isdn port with (caller id %s) received a wrong message: %d\n", p_name, p_callerinfo.id, message);
+ PERROR("Pdss1(%s) isdn port with (caller id %s) received a wrong message: %d\n", p_name, p_callerinfo.id, message_id);
}
return(1);
switch(cmd)
{
case MT_SETUP:
- /* creating port object */
+ /* creating port object, transparent until setup with hdlc */
SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
- if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0)))
+ if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0, B_MODE_TRANSPARENT)))
FATAL("Cannot create Port instance.\n");
pdss1->message_isdn(cmd, pid, l3m);
break;
case MT_RESUME:
- /* creating port object */
+ /* creating port object, transparent until setup with hdlc */
SPRINT(name, "%s-%d-in", mISDNport->ifport->interface->name, mISDNport->portnum);
- if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0)))
+ if (!(pdss1 = new Pdss1(PORT_TYPE_DSS1_NT_IN, mISDNport, name, NULL, 0, 0, B_MODE_TRANSPARENT)))
FATAL("Cannot create Port instance.\n");
pdss1->message_isdn(cmd, pid, l3m);
break;