summaryrefslogtreecommitdiffstats
path: root/joinpbx.cpp
diff options
context:
space:
mode:
authorAndreas Eversberg2009-12-25 14:38:42 +0100
committerAndreas Eversberg2009-12-25 14:38:42 +0100
commita45be9ac6fb41724b0353481e3adb0556cba5293 (patch)
tree58f64255585c6b5de13b09c4919e1330f06cb010 /joinpbx.cpp
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
Diffstat (limited to 'joinpbx.cpp')
-rw-r--r--joinpbx.cpp20
1 files changed, 15 insertions, 5 deletions
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);