projects
/
lcr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor cosmetic fix of logging output
[lcr.git]
/
dss1.cpp
diff --git
a/dss1.cpp
b/dss1.cpp
index
13fa85f
..
c819835
100644
(file)
--- a/
dss1.cpp
+++ b/
dss1.cpp
@@
-15,11
+15,13
@@
//#include <sys/socket.h>
extern "C" {
}
//#include <sys/socket.h>
extern "C" {
}
-#include <q931.h>
+#include <
mISDN/
q931.h>
extern unsigned int mt_assign_pid;
#include "ie.cpp"
extern unsigned int mt_assign_pid;
#include "ie.cpp"
+static int delete_event(struct lcr_work *work, void *instance, int index);
+
/*
* constructor
*/
/*
* constructor
*/
@@
-29,6
+31,8
@@
Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_
p_m_d_ntmode = mISDNport->ntmode;
p_m_d_tespecial = mISDNport->tespecial;
p_m_d_l3id = 0;
p_m_d_ntmode = mISDNport->ntmode;
p_m_d_tespecial = mISDNport->tespecial;
p_m_d_l3id = 0;
+ memset(&p_m_d_delete, 0, sizeof(p_m_d_delete));
+ add_work(&p_m_d_delete, delete_event, this, 0);
p_m_d_ces = -1;
p_m_d_queue[0] = '\0';
p_m_d_notify_pending = NULL;
p_m_d_ces = -1;
p_m_d_queue[0] = '\0';
p_m_d_notify_pending = NULL;
@@
-44,6
+48,8
@@
Pdss1::Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_
*/
Pdss1::~Pdss1()
{
*/
Pdss1::~Pdss1()
{
+ del_work(&p_m_d_delete);
+
/* remove queued message */
if (p_m_d_notify_pending)
message_free(p_m_d_notify_pending);
/* remove queued message */
if (p_m_d_notify_pending)
message_free(p_m_d_notify_pending);
@@
-255,7
+261,7
@@
int Pdss1::received_first_reply_to_setup(unsigned int cmd, int channel, int excl
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return(-34); /* to epoint: no channel available */
}
return(-34); /* to epoint: no channel available */
}
@@
-402,7
+408,7
@@
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
int bearer_coding, bearer_capability, bearer_mode, bearer_rate, bearer_multi, bearer_user;
int exclusive, channel;
int ret;
int bearer_coding, bearer_capability, bearer_mode, bearer_rate, bearer_multi, bearer_user;
int exclusive, channel;
int ret;
- unsigned char keypad[3
2
] = "";
+ unsigned char keypad[3
3
] = "";
unsigned char useruser[128];
int useruser_len = 0, useruser_protocol;
class Endpoint *epoint;
unsigned char useruser[128];
int useruser_len = 0, useruser_protocol;
class Endpoint *epoint;
@@
-422,7
+428,7
@@
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, pid, l3m);
new_state(PORT_STATE_RELEASE);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, pid, l3m);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
p_m_d_l3id = pid;
return;
}
p_m_d_l3id = pid;
@@
-453,7
+459,7
@@
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
return;
}
@@
-473,6
+479,12
@@
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
case 0:
p_callerinfo.screen = INFO_SCREEN_USER;
break;
case 0:
p_callerinfo.screen = INFO_SCREEN_USER;
break;
+ case 1:
+ p_callerinfo.screen = INFO_SCREEN_USER_VERIFIED_PASSED;
+ break;
+ case 2:
+ p_callerinfo.screen = INFO_SCREEN_USER_VERIFIED_FAILED;
+ break;
default:
p_callerinfo.screen = INFO_SCREEN_NETWORK;
break;
default:
p_callerinfo.screen = INFO_SCREEN_NETWORK;
break;
@@
-516,6
+528,12
@@
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
case 0:
p_callerinfo.screen2 = INFO_SCREEN_USER;
break;
case 0:
p_callerinfo.screen2 = INFO_SCREEN_USER;
break;
+ case 1:
+ p_callerinfo.screen2 = INFO_SCREEN_USER_VERIFIED_PASSED;
+ break;
+ case 2:
+ p_callerinfo.screen2 = INFO_SCREEN_USER_VERIFIED_FAILED;
+ break;
default:
p_callerinfo.screen2 = INFO_SCREEN_NETWORK;
break;
default:
p_callerinfo.screen2 = INFO_SCREEN_NETWORK;
break;
@@
-574,6
+592,12
@@
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
case 0:
p_redirinfo.screen = INFO_SCREEN_USER;
break;
case 0:
p_redirinfo.screen = INFO_SCREEN_USER;
break;
+ case 1:
+ p_redirinfo.screen = INFO_SCREEN_USER_VERIFIED_PASSED;
+ break;
+ case 2:
+ p_redirinfo.screen = INFO_SCREEN_USER_VERIFIED_FAILED;
+ break;
default:
p_redirinfo.screen = INFO_SCREEN_NETWORK;
break;
default:
p_redirinfo.screen = INFO_SCREEN_NETWORK;
break;
@@
-693,7
+717,7
@@
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE);
return;
}
bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE);
@@
-728,7
+752,7
@@
void Pdss1::setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
void Pdss1::information_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
{
int type, plan;
void Pdss1::information_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
{
int type, plan;
- unsigned char keypad[3
2
] = "", display[128] = "";
+ unsigned char keypad[3
3
] = "", display[128] = "";
struct lcr_msg *message;
l1l2l3_trace_header(p_m_mISDNport, this, L3_INFORMATION_IND, DIRECTION_IN);
struct lcr_msg *message;
l1l2l3_trace_header(p_m_mISDNport, this, L3_INFORMATION_IND, DIRECTION_IN);
@@
-753,7
+777,7
@@
void Pdss1::information_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l
p_dialinginfo.ntype = INFO_NTYPE_UNKNOWN;
break;
}
p_dialinginfo.ntype = INFO_NTYPE_UNKNOWN;
break;
}
- SC
AT
(p_dialinginfo.display, (char *)display);
+ SC
PY
(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);
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);
@@
-777,6
+801,13
@@
void Pdss1::setup_acknowledge_ind(unsigned int cmd, unsigned int pid, struct l3_
dec_ie_progress(l3m, &coding, &location, &progress);
end_trace();
dec_ie_progress(l3m, &coding, &location, &progress);
end_trace();
+ if (progress >= 0) {
+ message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROGRESS);
+ message->param.progressinfo.progress = progress;
+ message->param.progressinfo.location = location;
+ message_put(message);
+ }
+
/* process channel */
ret = received_first_reply_to_setup(cmd, channel, exclusive);
if (ret < 0) {
/* process channel */
ret = received_first_reply_to_setup(cmd, channel, exclusive);
if (ret < 0) {
@@
-785,7
+816,7
@@
void Pdss1::setup_acknowledge_ind(unsigned int cmd, unsigned int pid, struct l3_
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
return;
}
@@
-826,6
+857,13
@@
void Pdss1::proceeding_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3
dec_ie_redir_dn(l3m, &type, &plan, &present, (unsigned char *)redir, sizeof(redir));
end_trace();
dec_ie_redir_dn(l3m, &type, &plan, &present, (unsigned char *)redir, sizeof(redir));
end_trace();
+ if (progress >= 0) {
+ message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROGRESS);
+ message->param.progressinfo.progress = progress;
+ message->param.progressinfo.location = location;
+ message_put(message);
+ }
+
ret = received_first_reply_to_setup(cmd, channel, exclusive);
if (ret < 0) {
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE);
ret = received_first_reply_to_setup(cmd, channel, exclusive);
if (ret < 0) {
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE);
@@
-833,7
+871,7
@@
void Pdss1::proceeding_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROCEEDING);
return;
}
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROCEEDING);
@@
-902,6
+940,13
@@
void Pdss1::alerting_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
dec_ie_redir_dn(l3m, &type, &plan, &present, (unsigned char *)redir, sizeof(redir));
end_trace();
dec_ie_redir_dn(l3m, &type, &plan, &present, (unsigned char *)redir, sizeof(redir));
end_trace();
+ if (progress >= 0) {
+ message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROGRESS);
+ message->param.progressinfo.progress = progress;
+ message->param.progressinfo.location = location;
+ message_put(message);
+ }
+
/* process channel */
ret = received_first_reply_to_setup(cmd, channel, exclusive);
if (ret < 0) {
/* process channel */
ret = received_first_reply_to_setup(cmd, channel, exclusive);
if (ret < 0) {
@@
-910,7
+955,7
@@
void Pdss1::alerting_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_ALERTING);
return;
}
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_ALERTING);
@@
-987,7
+1032,7
@@
void Pdss1::connect_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
return;
}
@@
-1007,6
+1052,12
@@
void Pdss1::connect_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
case 0:
p_connectinfo.screen = INFO_SCREEN_USER;
break;
case 0:
p_connectinfo.screen = INFO_SCREEN_USER;
break;
+ case 1:
+ p_connectinfo.screen = INFO_SCREEN_USER_VERIFIED_PASSED;
+ break;
+ case 2:
+ p_connectinfo.screen = INFO_SCREEN_USER_VERIFIED_FAILED;
+ break;
default:
p_connectinfo.screen = INFO_SCREEN_NETWORK;
break;
default:
p_connectinfo.screen = INFO_SCREEN_NETWORK;
break;
@@
-1064,8
+1115,17
@@
void Pdss1::disconnect_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3
dec_ie_display(l3m, (unsigned char *)display, sizeof(display));
end_trace();
dec_ie_display(l3m, (unsigned char *)display, sizeof(display));
end_trace();
- if (cause < 0)
+ if (cause < 0)
{
cause = 16;
cause = 16;
+ location = LOCATION_PRIVATE_LOCAL;
+ }
+
+ if (progress >= 0) {
+ message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROGRESS);
+ message->param.progressinfo.progress = progress;
+ message->param.progressinfo.location = proglocation;
+ message_put(message);
+ }
/* release if remote sends us no tones */
if (!p_m_mISDNport->earlyb) {
/* release if remote sends us no tones */
if (!p_m_mISDNport->earlyb) {
@@
-1091,7
+1151,7
@@
void Pdss1::disconnect_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3
free_epointlist(p_epointlist);
}
new_state(PORT_STATE_RELEASE);
free_epointlist(p_epointlist);
}
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
return;
}
@@
-1152,8
+1212,10
@@
void Pdss1::release_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
dec_ie_display(l3m, (unsigned char *)display, sizeof(display));
end_trace();
dec_ie_display(l3m, (unsigned char *)display, sizeof(display));
end_trace();
- if (cause < 0)
+ if (cause < 0)
{
cause = 16;
cause = 16;
+ location = LOCATION_PRIVATE_LOCAL;
+ }
/* sending release to endpoint */
if (location == LOCATION_PRIVATE_LOCAL)
/* sending release to endpoint */
if (location == LOCATION_PRIVATE_LOCAL)
@@
-1169,7
+1231,7
@@
void Pdss1::release_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
}
new_state(PORT_STATE_RELEASE);
}
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
}
/* CC_RESTART INDICATION */
}
/* CC_RESTART INDICATION */
@@
-1203,8
+1265,10
@@
void Pdss1::release_complete_ind(unsigned int cmd, unsigned int pid, struct l3_m
if (location == LOCATION_PRIVATE_LOCAL)
location = LOCATION_PRIVATE_REMOTE;
if (location == LOCATION_PRIVATE_LOCAL)
location = LOCATION_PRIVATE_REMOTE;
- if (cause < 0)
+ if (cause < 0)
{
cause = 16;
cause = 16;
+ location = LOCATION_PRIVATE_LOCAL;
+ }
/* sending release to endpoint */
while(p_epointlist) {
/* sending release to endpoint */
while(p_epointlist) {
@@
-1217,7
+1281,7
@@
void Pdss1::release_complete_ind(unsigned int cmd, unsigned int pid, struct l3_m
}
new_state(PORT_STATE_RELEASE);
}
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
}
/* T312 timeout */
}
/* T312 timeout */
@@
-1321,8
+1385,8
@@
void Pdss1::hold_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
#if 0
epoint = find_epoint_id(ACTIVE_EPOINT(p_epointlist));
if (epoint && p_m_d_ntmode) {
#if 0
epoint = find_epoint_id(ACTIVE_EPOINT(p_epointlist));
if (epoint && p_m_d_ntmode) {
- p_m_timeout = p_settings.tout_hold;
-
time(&p_m_timer
);
+ if (p_settings.tout_hold)
+
schedule_timer(&p_m_timeout, p_settings.tout_hold, 0
);
}
#endif
}
#endif
@@
-1380,7
+1444,7
@@
void Pdss1::retrieve_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
/* set hold state */
p_m_hold = 0;
/* set hold state */
p_m_hold = 0;
-
p_m_timeout = 0
;
+
unsched_timer(&p_m_timeout)
;
/* acknowledge retrieve */
l3m = create_l3msg();
/* acknowledge retrieve */
l3m = create_l3msg();
@@
-1458,7
+1522,7
@@
void Pdss1::suspend_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_SUSPEND_ACKNOWLEDGE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_SUSPEND_ACKNOWLEDGE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
}
/* CC_RESUME INDICATION */
}
/* CC_RESUME INDICATION */
@@
-1485,7
+1549,7
@@
void Pdss1::resume_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RESUME_REJECT, pid, l3m);
new_state(PORT_STATE_RELEASE);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RESUME_REJECT, pid, l3m);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
p_m_d_l3id = pid;
return;
}
p_m_d_l3id = pid;
@@
-1528,7
+1592,7
@@
void Pdss1::resume_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RESUME_REJECT, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RESUME_REJECT, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE);
return;
}
bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE);
@@
-1603,6
+1667,13
@@
void Pdss1::progress_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
l1l2l3_trace_header(p_m_mISDNport, this, L3_PROGRESS_IND, DIRECTION_IN);
dec_ie_progress(l3m, &coding, &location, &progress);
end_trace();
l1l2l3_trace_header(p_m_mISDNport, this, L3_PROGRESS_IND, DIRECTION_IN);
dec_ie_progress(l3m, &coding, &location, &progress);
end_trace();
+
+ if (progress >= 0) {
+ message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_PROGRESS);
+ message->param.progressinfo.progress = progress;
+ message->param.progressinfo.location = location;
+ message_put(message);
+ }
}
}
@@
-1748,8
+1819,8
@@
void Pdss1::message_isdn(unsigned int cmd, unsigned int pid, struct l3_msg *l3m)
add_trace("callref", NULL, "0x%x", p_m_d_l3id);
end_trace();
p_m_d_l3id = 0;
add_trace("callref", NULL, "0x%x", p_m_d_l3id);
end_trace();
p_m_d_l3id = 0;
+ trigger_work(&p_m_d_delete);
p_m_d_ces = -1;
p_m_d_ces = -1;
- p_m_delete = 1;
/* sending release to endpoint in case we still have an endpoint
* this is because we don't get any response if a release_complete is received (or a release in release state)
*/
/* sending release to endpoint in case we still have an endpoint
* this is because we don't get any response if a release_complete is received (or a release in release state)
*/
@@
-1784,35
+1855,39
@@
void Pdss1::new_state(int state)
/* set timeout */
if (state == PORT_STATE_IN_OVERLAP) {
/* set timeout */
if (state == PORT_STATE_IN_OVERLAP) {
- p_m_timeout = p_m_mISDNport->ifport->tout_dialing;
-
time(&p_m_timer
);
+ if (p_m_mISDNport->ifport->tout_dialing)
+
schedule_timer(&p_m_timeout, p_m_mISDNport->ifport->tout_dialing, 0
);
}
if (state != p_state) {
}
if (state != p_state) {
+ unsched_timer(&p_m_timeout);
if (state == PORT_STATE_IN_SETUP
|| state == PORT_STATE_OUT_SETUP
|| state == PORT_STATE_IN_OVERLAP
|| state == PORT_STATE_OUT_OVERLAP) {
if (state == PORT_STATE_IN_SETUP
|| state == PORT_STATE_OUT_SETUP
|| state == PORT_STATE_IN_OVERLAP
|| state == PORT_STATE_OUT_OVERLAP) {
- p_m_timeout = p_m_mISDNport->ifport->tout_setup;
-
time(&p_m_timer
);
+ if (p_m_mISDNport->ifport->tout_setup)
+
schedule_timer(&p_m_timeout, p_m_mISDNport->ifport->tout_setup, 0
);
}
if (state == PORT_STATE_IN_PROCEEDING
|| state == PORT_STATE_OUT_PROCEEDING) {
}
if (state == PORT_STATE_IN_PROCEEDING
|| state == PORT_STATE_OUT_PROCEEDING) {
- p_m_timeout = p_m_mISDNport->ifport->tout_proceeding;
-
time(&p_m_timer
);
+ if (p_m_mISDNport->ifport->tout_proceeding)
+
schedule_timer(&p_m_timeout, p_m_mISDNport->ifport->tout_proceeding, 0
);
}
if (state == PORT_STATE_IN_ALERTING
|| state == PORT_STATE_OUT_ALERTING) {
}
if (state == PORT_STATE_IN_ALERTING
|| state == PORT_STATE_OUT_ALERTING) {
- p_m_timeout = p_m_mISDNport->ifport->tout_alerting;
-
time(&p_m_timer
);
+ if (p_m_mISDNport->ifport->tout_alerting)
+
schedule_timer(&p_m_timeout, p_m_mISDNport->ifport->tout_alerting, 0
);
}
}
+#if 0
if (state == PORT_STATE_CONNECT
|| state == PORT_STATE_CONNECT_WAITING) {
if (state == PORT_STATE_CONNECT
|| state == PORT_STATE_CONNECT_WAITING) {
- p_m_timeout = 0;
+ if (p_m_mISDNport->ifport->tout_connect)
+ schedule_timer(&p_m_timeout, p_m_mISDNport->ifport->tout_connect, 0);
}
}
+#endif
if (state == PORT_STATE_IN_DISCONNECT
|| state == PORT_STATE_OUT_DISCONNECT) {
if (state == PORT_STATE_IN_DISCONNECT
|| state == PORT_STATE_OUT_DISCONNECT) {
- p_m_timeout = p_m_mISDNport->ifport->tout_disconnect;
-
time(&p_m_timer
);
+ if (p_m_mISDNport->ifport->tout_disconnect)
+
schedule_timer(&p_m_timeout, p_m_mISDNport->ifport->tout_disconnect, 0
);
}
}
}
}
@@
-1820,23
+1895,15
@@
void Pdss1::new_state(int state)
}
}
-/*
- * handler
- */
-int Pdss1::handler(void)
+/* deletes only if l3id is release, otherwhise it will be triggered then */
+static int delete_event(struct lcr_work *work, void *instance, int index)
{
{
-
int ret
;
+
class Pdss1 *isdnport = (class Pdss1 *)instance
;
- if ((ret = PmISDN::handler()))
- return(ret);
-
- /* handle destruction */
- if (p_m_delete && p_m_d_l3id==0) {
- delete this;
- return(-1);
- }
+ if (!isdnport->p_m_d_l3id)
+ delete isdnport;
- return
(0)
;
+ return
0
;
}
}
@@
-1860,7
+1927,7
@@
void Pdss1::message_information(unsigned int epoint_id, int message_id, union pa
enc_ie_called_pn(l3m, 0, 1, (unsigned char *)number, max);
if ((p_m_d_ntmode || p_m_d_tespecial) && display[0]) {
enc_ie_display(l3m, (unsigned char *)display);
enc_ie_called_pn(l3m, 0, 1, (unsigned char *)number, max);
if ((p_m_d_ntmode || p_m_d_tespecial) && display[0]) {
enc_ie_display(l3m, (unsigned char *)display);
- display = "";
+ display =
(char *)
"";
}
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_INFORMATION, p_m_d_l3id, l3m);
}
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_INFORMATION, p_m_d_l3id, l3m);
@@
-1870,8
+1937,6
@@
void Pdss1::message_information(unsigned int epoint_id, int message_id, union pa
}
}
-int newteid = 0;
-
/* MESSAGE_SETUP */
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union parameter *param)
{
/* MESSAGE_SETUP */
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union parameter *param)
{
@@
-1893,7
+1958,7
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
return;
}
@@
-1959,7
+2024,7
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message_put(message);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
p_m_d_l3id = mt_assign_pid;
return;
}
p_m_d_l3id = mt_assign_pid;
@@
-1996,6
+2061,12
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
case INFO_SCREEN_USER:
screen = 0;
break;
case INFO_SCREEN_USER:
screen = 0;
break;
+ case INFO_SCREEN_USER_VERIFIED_PASSED:
+ screen = 1;
+ break;
+ case INFO_SCREEN_USER_VERIFIED_FAILED:
+ screen = 2;
+ break;
default: /* INFO_SCREEN_NETWORK */
screen = 3;
break;
default: /* INFO_SCREEN_NETWORK */
screen = 3;
break;
@@
-2034,6
+2105,12
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
case INFO_SCREEN_USER:
screen2 = 0;
break;
case INFO_SCREEN_USER:
screen2 = 0;
break;
+ case INFO_SCREEN_USER_VERIFIED_PASSED:
+ screen2 = 1;
+ break;
+ case INFO_SCREEN_USER_VERIFIED_FAILED:
+ screen2 = 2;
+ break;
default: /* INFO_SCREEN_NETWORK */
screen2 = 3;
break;
default: /* INFO_SCREEN_NETWORK */
screen2 = 3;
break;
@@
-2058,6
+2135,9
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
enc_ie_called_pn(l3m, 0, 1, (unsigned char *)p_dialinginfo.id, max);
SCPY(p_m_d_queue, p_dialinginfo.id + max);
}
enc_ie_called_pn(l3m, 0, 1, (unsigned char *)p_dialinginfo.id, max);
SCPY(p_m_d_queue, p_dialinginfo.id + max);
}
+ /* keypad */
+ if (p_dialinginfo.keypad[0])
+ enc_ie_keypad(l3m, (unsigned char *)p_dialinginfo.keypad);
/* sending complete */
if (p_dialinginfo.sending_complete)
enc_ie_complete(l3m, 1);
/* sending complete */
if (p_dialinginfo.sending_complete)
enc_ie_complete(l3m, 1);
@@
-2088,6
+2168,12
@@
void Pdss1::message_setup(unsigned int epoint_id, int message_id, union paramete
case INFO_SCREEN_USER:
screen = 0;
break;
case INFO_SCREEN_USER:
screen = 0;
break;
+ case INFO_SCREEN_USER_VERIFIED_PASSED:
+ screen = 1;
+ break;
+ case INFO_SCREEN_USER_VERIFIED_FAILED:
+ screen = 2;
+ break;
default: /* INFO_SCREE_NETWORK */
screen = 3;
break;
default: /* INFO_SCREE_NETWORK */
screen = 3;
break;
@@
-2191,7
+2277,14
@@
void Pdss1::message_notify(unsigned int epoint_id, int message_id, union paramet
int notify;
int plan = 0, type = -1, present = 0;
int notify;
int plan = 0, type = -1, present = 0;
- printf("if = %d\n", param->notifyinfo.notify);
+ if (p_m_mISDNport->ifport->nonotify) {
+ l1l2l3_trace_header(p_m_mISDNport, this, L3_NOTIFY_REQ, DIRECTION_OUT);
+ add_trace("info", NULL, "blocked by config");
+ end_trace();
+ return;
+ }
+
+// printf("if = %d\n", param->notifyinfo.notify);
if (param->notifyinfo.notify>INFO_NOTIFY_NONE)
notify = param->notifyinfo.notify & 0x7f;
else
if (param->notifyinfo.notify>INFO_NOTIFY_NONE)
notify = param->notifyinfo.notify & 0x7f;
else
@@
-2363,6
+2456,7
@@
void Pdss1::message_connect(unsigned int epoint_id, int message_id, union parame
l3_msg *l3m;
int type, plan, present, screen;
class Endpoint *epoint;
l3_msg *l3m;
int type, plan, present, screen;
class Endpoint *epoint;
+ time_t current_time;
/* NT-MODE in setup state we must send PROCEEDING first */
if (p_m_d_ntmode && p_state==PORT_STATE_IN_SETUP) {
/* NT-MODE in setup state we must send PROCEEDING first */
if (p_m_d_ntmode && p_state==PORT_STATE_IN_SETUP) {
@@
-2425,6
+2519,12
@@
void Pdss1::message_connect(unsigned int epoint_id, int message_id, union parame
case INFO_SCREEN_USER:
screen = 0;
break;
case INFO_SCREEN_USER:
screen = 0;
break;
+ case INFO_SCREEN_USER_VERIFIED_PASSED:
+ screen = 1;
+ break;
+ case INFO_SCREEN_USER_VERIFIED_FAILED:
+ screen = 2;
+ break;
default: /* INFO_SCREE_NETWORK */
screen = 3;
break;
default: /* INFO_SCREE_NETWORK */
screen = 3;
break;
@@
-2451,7
+2551,8
@@
void Pdss1::message_connect(unsigned int epoint_id, int message_id, union parame
/* date & time */
if (p_m_d_ntmode || p_m_d_tespecial) {
epoint = find_epoint_id(epoint_id);
/* date & time */
if (p_m_d_ntmode || p_m_d_tespecial) {
epoint = find_epoint_id(epoint_id);
- enc_ie_date(l3m, now, p_settings.no_seconds);
+ time(¤t_time);
+ enc_ie_date(l3m, current_time, p_settings.no_seconds);
}
end_trace();
/* finally send message */
}
end_trace();
/* finally send message */
@@
-2490,7
+2591,7
@@
if (/* ||*/ p_state==PORT_STATE_OUT_SETUP) {
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
end_trace();
p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE_COMPLETE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
-
p_m_delete = 1
;
+
trigger_work(&p_m_d_delete)
;
return;
}
return;
}
@@
-2541,45
+2642,46
@@
void Pdss1::message_release(unsigned int epoint_id, int message_id, union parame
char *p = NULL;
/*
char *p = NULL;
/*
- *
we may only release during incoming disconnect state.
- *
this means that the endpoint doesnt require audio anymore
+ *
if we are on incoming call setup, we may reject by sending a release_complete
+ *
also on outgoing call setup, we send a release complete, BUT this is not conform. (i don't know any other way)
*/
*/
- if (p_state == PORT_STATE_IN_DISCONNECT
- || p_state == PORT_STATE_OUT_DISCONNECT) {
- /* sending release */
+ if (p_state==PORT_STATE_IN_SETUP
+ || p_state==PORT_STATE_OUT_SETUP) {
+//#warning remove me
+//PDEBUG(DEBUG_LOG, "JOLLY sending release complete %d\n", p_serial);
+ /* sending release complete */
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_RELEASE_REQ, DIRECTION_OUT);
/* 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);
end_trace();
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_RELEASE_REQ, DIRECTION_OUT);
/* 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);
end_trace();
- p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE, p_m_d_l3id, l3m);
+ p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE
_COMPLETE
, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
/* remove epoint */
free_epointid(epoint_id);
// wait for callref to be released
return;
new_state(PORT_STATE_RELEASE);
/* remove epoint */
free_epointid(epoint_id);
// wait for callref to be released
return;
-
}
/*
}
/*
- *
if we are on incoming call setup, we may reject by sending a release_complete
- *
also on outgoing call setup, we send a release complete, BUT this is not conform. (i don't know any other way)
+ *
we may only release during incoming disconnect state.
+ *
this means that the endpoint doesnt require audio anymore
*/
*/
- if (p_state==PORT_STATE_IN_SETUP
- || p_state==PORT_STATE_OUT_SETUP) {
-//#warning remove me
-//PDEBUG(DEBUG_LOG, "JOLLY sending release complete %d\n", p_serial);
- /* sending release complete */
+ if (p_state == PORT_STATE_IN_DISCONNECT
+ || p_state == PORT_STATE_OUT_DISCONNECT
+ || param->disconnectinfo.force) {
+ /* sending release */
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_RELEASE_REQ, DIRECTION_OUT);
/* 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);
end_trace();
l3m = create_l3msg();
l1l2l3_trace_header(p_m_mISDNport, this, L3_RELEASE_REQ, DIRECTION_OUT);
/* 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);
end_trace();
- p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE
_COMPLETE
, p_m_d_l3id, l3m);
+ p_m_mISDNport->ml3->to_layer3(p_m_mISDNport->ml3, MT_RELEASE, p_m_d_l3id, l3m);
new_state(PORT_STATE_RELEASE);
/* remove epoint */
free_epointid(epoint_id);
// wait for callref to be released
return;
new_state(PORT_STATE_RELEASE);
/* remove epoint */
free_epointid(epoint_id);
// wait for callref to be released
return;
+
}
#if 0
}
#if 0
@@
-2795,7
+2897,7
@@
int stack2manager(struct mISDNport *mISDNport, unsigned int cmd, unsigned int pi
port = port_first;
while(port) {
/* are we ISDN ? */
port = port_first;
while(port) {
/* are we ISDN ? */
- if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_
mISDN_
DSS1) {
+ if ((port->p_type & PORT_CLASS_mISDN_MASK) == PORT_CLASS_DSS1) {
pdss1 = (class Pdss1 *)port;
/* check out correct stack and id */
if (pdss1->p_m_mISDNport == mISDNport) {
pdss1 = (class Pdss1 *)port;
/* check out correct stack and id */
if (pdss1->p_m_mISDNport == mISDNport) {