summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg2009-12-25 14:38:42 +0100
committerAndreas Eversberg2009-12-25 14:38:42 +0100
commita45be9ac6fb41724b0353481e3adb0556cba5293 (patch)
tree58f64255585c6b5de13b09c4919e1330f06cb010
parentMake LCR run with OpenBSC main branch. (diff)
downloadlcr-a45be9ac6fb41724b0353481e3adb0556cba5293.tar.gz
lcr-a45be9ac6fb41724b0353481e3adb0556cba5293.tar.xz
lcr-a45be9ac6fb41724b0353481e3adb0556cba5293.zip
Fixed some minor bug. Also fixed problem with double setup for internal extensions.
modified: gsm.cpp modified: joinpbx.cpp modified: ss5.cpp
-rw-r--r--gsm.cpp2
-rw-r--r--joinpbx.cpp20
-rw-r--r--ss5.cpp4
3 files changed, 18 insertions, 8 deletions
diff --git a/gsm.cpp b/gsm.cpp
index cd3aa8f..63ba5e5 100644
--- a/gsm.cpp
+++ b/gsm.cpp
@@ -1539,7 +1539,7 @@ static int gsm_sock_open(char *portname)
PERROR_RUNTIME("GSM port %d does not support TE PRI or TE BRI.\n", gsm->gsm_port);
}
/* open socket */
- if ((gsm->gsm_sock = socket(PF_ISDN, SOCK_DGRAM, ISDN_P_TE_S0)) < 0) {
+ if ((gsm->gsm_sock = socket(PF_ISDN, SOCK_DGRAM, (pri)?ISDN_P_TE_E1:ISDN_P_TE_S0)) < 0) {
PERROR_RUNTIME("GSM port %d failed to open socket.\n", gsm->gsm_port);
gsm_sock_close();
return gsm->gsm_sock;
diff --git a/joinpbx.cpp b/joinpbx.cpp
index d21daf3..5bad026 100644
--- a/joinpbx.cpp
+++ b/joinpbx.cpp
@@ -853,14 +853,20 @@ void JoinPBX::message_epoint(unsigned int epoint_id, int message_type, union par
switch(message_type) {
case MESSAGE_SETUP:
if (param->setup.dialinginfo.itype == INFO_ITYPE_ISDN_EXTENSION) {
- numbers = param->setup.dialinginfo.id;
- while((number = strsep(&numbers, ","))) {
- if (out_setup(epoint_id, message_type, param, number, NULL))
- return; // join destroyed
+ /* in case of keypad */
+ numbers = param->setup.dialinginfo.keypad;
+ if (numbers[0]) {
+ while((number = strsep(&numbers, ","))) {
+ if (out_setup(epoint_id, message_type, param, NULL, number))
+ return; // join destroyed
+ }
+ /* after keypad finish dialing */
+ break;
}
+ /* dialed number */
numbers = param->setup.dialinginfo.id;
while((number = strsep(&numbers, ","))) {
- if (out_setup(epoint_id, message_type, param, NULL, number))
+ if (out_setup(epoint_id, message_type, param, number, NULL))
return; // join destroyed
}
break;
@@ -979,8 +985,12 @@ int JoinPBX::out_setup(unsigned int epoint_id, int message_type, union parameter
memcpy(&message->param, param, sizeof(union parameter));
if (newnumber)
SCPY(message->param.setup.dialinginfo.id, newnumber);
+ else
+ message->param.setup.dialinginfo.id[0] = '\0';
if (newkeypad)
SCPY(message->param.setup.dialinginfo.keypad, newkeypad);
+ else
+ message->param.setup.dialinginfo.keypad[0] = '\0';
PDEBUG(DEBUG_JOIN, "setup message sent to ep %d with number='%s' keypad='%s'.\n", relation->epoint_id, message->param.setup.dialinginfo.id, message->param.setup.dialinginfo.keypad);
message_put(message);
return(0);
diff --git a/ss5.cpp b/ss5.cpp
index 5f4d706..259b647 100644
--- a/ss5.cpp
+++ b/ss5.cpp
@@ -959,7 +959,7 @@ int Pss5::inband_send(unsigned char *buffer, int len)
if (duration > 0 && p_m_s_sample_nr >= duration) {
PDEBUG(DEBUG_SS5, "%s: sending tone '%c' complete, starting delay\n", p_name, digit);
if (p_m_s_state == SS5_STATE_DOUBLE_SEIZE) {
- do_release(CAUSE_NOCHANNEL, LOCATION_BEYOND);
+ do_release(CAUSE_NOCHANNEL, LOCATION_PRIVATE_LOCAL);
break;
}
new_ss5_state(SS5_STATE_DELAY);
@@ -1949,7 +1949,7 @@ void Pss5::message_release(unsigned int epoint_id, int message_id, union paramet
void Pss5::register_timeout(void)
{
- do_release(CAUSE_NORMAL, LOCATION_BEYOND);
+ do_release(CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL);
}
/*