Fixed some minor bug. Also fixed problem with double setup for internal extensions.
modified: gsm.cpp modified: joinpbx.cpp modified: ss5.cpp
This commit is contained in:
parent
bf2fefbfd5
commit
a45be9ac6f
2
gsm.cpp
2
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);
|
PERROR_RUNTIME("GSM port %d does not support TE PRI or TE BRI.\n", gsm->gsm_port);
|
||||||
}
|
}
|
||||||
/* open socket */
|
/* 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);
|
PERROR_RUNTIME("GSM port %d failed to open socket.\n", gsm->gsm_port);
|
||||||
gsm_sock_close();
|
gsm_sock_close();
|
||||||
return gsm->gsm_sock;
|
return gsm->gsm_sock;
|
||||||
|
|
20
joinpbx.cpp
20
joinpbx.cpp
|
@ -853,16 +853,22 @@ void JoinPBX::message_epoint(unsigned int epoint_id, int message_type, union par
|
||||||
switch(message_type) {
|
switch(message_type) {
|
||||||
case MESSAGE_SETUP:
|
case MESSAGE_SETUP:
|
||||||
if (param->setup.dialinginfo.itype == INFO_ITYPE_ISDN_EXTENSION) {
|
if (param->setup.dialinginfo.itype == INFO_ITYPE_ISDN_EXTENSION) {
|
||||||
|
/* 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;
|
numbers = param->setup.dialinginfo.id;
|
||||||
while((number = strsep(&numbers, ","))) {
|
while((number = strsep(&numbers, ","))) {
|
||||||
if (out_setup(epoint_id, message_type, param, number, NULL))
|
if (out_setup(epoint_id, message_type, param, number, NULL))
|
||||||
return; // join destroyed
|
return; // join destroyed
|
||||||
}
|
}
|
||||||
numbers = param->setup.dialinginfo.id;
|
|
||||||
while((number = strsep(&numbers, ","))) {
|
|
||||||
if (out_setup(epoint_id, message_type, param, NULL, number))
|
|
||||||
return; // join destroyed
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (out_setup(epoint_id, message_type, param, NULL, NULL))
|
if (out_setup(epoint_id, message_type, param, NULL, NULL))
|
||||||
|
@ -979,8 +985,12 @@ int JoinPBX::out_setup(unsigned int epoint_id, int message_type, union parameter
|
||||||
memcpy(&message->param, param, sizeof(union parameter));
|
memcpy(&message->param, param, sizeof(union parameter));
|
||||||
if (newnumber)
|
if (newnumber)
|
||||||
SCPY(message->param.setup.dialinginfo.id, newnumber);
|
SCPY(message->param.setup.dialinginfo.id, newnumber);
|
||||||
|
else
|
||||||
|
message->param.setup.dialinginfo.id[0] = '\0';
|
||||||
if (newkeypad)
|
if (newkeypad)
|
||||||
SCPY(message->param.setup.dialinginfo.keypad, 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);
|
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);
|
message_put(message);
|
||||||
return(0);
|
return(0);
|
||||||
|
|
4
ss5.cpp
4
ss5.cpp
|
@ -959,7 +959,7 @@ int Pss5::inband_send(unsigned char *buffer, int len)
|
||||||
if (duration > 0 && p_m_s_sample_nr >= duration) {
|
if (duration > 0 && p_m_s_sample_nr >= duration) {
|
||||||
PDEBUG(DEBUG_SS5, "%s: sending tone '%c' complete, starting delay\n", p_name, digit);
|
PDEBUG(DEBUG_SS5, "%s: sending tone '%c' complete, starting delay\n", p_name, digit);
|
||||||
if (p_m_s_state == SS5_STATE_DOUBLE_SEIZE) {
|
if (p_m_s_state == SS5_STATE_DOUBLE_SEIZE) {
|
||||||
do_release(CAUSE_NOCHANNEL, LOCATION_BEYOND);
|
do_release(CAUSE_NOCHANNEL, LOCATION_PRIVATE_LOCAL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
new_ss5_state(SS5_STATE_DELAY);
|
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)
|
void Pss5::register_timeout(void)
|
||||||
{
|
{
|
||||||
do_release(CAUSE_NORMAL, LOCATION_BEYOND);
|
do_release(CAUSE_UNSPECIFIED, LOCATION_PRIVATE_LOCAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue