Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dca4921d2 | ||
|
|
b14525f475 | ||
|
|
5feca71b83 | ||
|
|
8d5be5281a | ||
|
|
ef3a4f1b5a | ||
|
|
969b121c9b | ||
|
|
b32ccb3fdd | ||
|
|
9b04f86bf6 | ||
|
|
2d986a8567 |
30
ChangeLog
30
ChangeLog
@@ -1,3 +1,33 @@
|
||||
2010-06-29 Leif Madsen <lmadsen@digium.com>
|
||||
|
||||
* libpri 1.4.11.3 released.
|
||||
|
||||
2010-06-29 11:17 +0000 [r1824] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* pri_internal.h, q931.c: [regression] Calling Number assignment
|
||||
logic change in libpri 1.4.11. Restored the old behaviour if
|
||||
there is more than one calling number in the incoming SETUP
|
||||
message. A network provided number is reported as ANI. (closes
|
||||
issue #17495) Reported by: ibercom Patches:
|
||||
issue_17495_v1.4.11.2.patch uploaded by rmudgett (license 664)
|
||||
issue_17495_v1.4.patch uploaded by rmudgett (license 664) Tested
|
||||
by: ibercom
|
||||
|
||||
2010-06-02 Leif Madsen <lmadsen@digium.com>
|
||||
|
||||
* libpri 1.4.11.2 released.
|
||||
|
||||
2010-06-04 17:45 +0000 [r1810] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* pri_facility.c: Q.SIG calling name in FACILITY message not
|
||||
reported to the upper layer. Q.SIG can send the CallingName,
|
||||
CalledName, and ConnectedName in stand alone FACILITY messages.
|
||||
If the CallingName was not sent in the SETUP message, the caller
|
||||
id name was not reported to the upper layer. (closes issue #17458)
|
||||
Reported by: jsmith Patches: issue17458_post_qsig_name.patch uploaded
|
||||
by rmudgett (license 664) issue17458_post_qsig_name_v1.4.11.1.patch
|
||||
uploaded by rmudgett (license 664) Tested by: rmudgett, jsmith
|
||||
|
||||
2010-06-02 Leif Madsen <lmadsen@digium.com>
|
||||
|
||||
* libpri 1.4.11.1 released.
|
||||
|
||||
@@ -3745,25 +3745,65 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
/* CallingName is put in remote_id.name */
|
||||
rose_copy_name_to_q931(ctrl, &call->remote_id.name,
|
||||
&invoke->args.qsig.CallingName.name);
|
||||
|
||||
switch (msgtype) {
|
||||
case Q931_SETUP:
|
||||
case Q931_CONNECT:
|
||||
/* The caller name will automatically be reported. */
|
||||
break;
|
||||
default:
|
||||
/* Setup connected line subcommand */
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
if (!subcmd) {
|
||||
break;
|
||||
}
|
||||
subcmd->cmd = PRI_SUBCMD_CONNECTED_LINE;
|
||||
q931_party_id_copy_to_pri(&subcmd->u.connected_line.id, &call->remote_id);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ROSE_QSIG_CalledName:
|
||||
/* CalledName is put in remote_id.name */
|
||||
rose_copy_name_to_q931(ctrl, &call->remote_id.name,
|
||||
&invoke->args.qsig.CalledName.name);
|
||||
|
||||
/* Setup connected line subcommand */
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
if (!subcmd) {
|
||||
switch (msgtype) {
|
||||
case Q931_SETUP:
|
||||
case Q931_CONNECT:
|
||||
/* The called name will automatically be reported. */
|
||||
pri_error(ctrl, "ERROR: Too many facility subcommands\n");
|
||||
break;
|
||||
default:
|
||||
/* Setup connected line subcommand */
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
if (!subcmd) {
|
||||
break;
|
||||
}
|
||||
subcmd->cmd = PRI_SUBCMD_CONNECTED_LINE;
|
||||
q931_party_id_copy_to_pri(&subcmd->u.connected_line.id, &call->remote_id);
|
||||
break;
|
||||
}
|
||||
subcmd->cmd = PRI_SUBCMD_CONNECTED_LINE;
|
||||
q931_party_id_copy_to_pri(&subcmd->u.connected_line.id, &call->remote_id);
|
||||
break;
|
||||
case ROSE_QSIG_ConnectedName:
|
||||
/* ConnectedName is put in remote_id.name */
|
||||
rose_copy_name_to_q931(ctrl, &call->remote_id.name,
|
||||
&invoke->args.qsig.ConnectedName.name);
|
||||
|
||||
switch (msgtype) {
|
||||
case Q931_SETUP:
|
||||
case Q931_CONNECT:
|
||||
/* The connected line name will automatically be reported. */
|
||||
break;
|
||||
default:
|
||||
/* Setup connected line subcommand */
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
if (!subcmd) {
|
||||
break;
|
||||
}
|
||||
subcmd->cmd = PRI_SUBCMD_CONNECTED_LINE;
|
||||
q931_party_id_copy_to_pri(&subcmd->u.connected_line.id, &call->remote_id);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#if 0 /* Not handled yet */
|
||||
case ROSE_QSIG_BusyName:
|
||||
|
||||
@@ -458,6 +458,8 @@ struct q931_call {
|
||||
* (Caller-ID for answered or connected-line for originated calls.)
|
||||
*/
|
||||
struct q931_party_id remote_id;
|
||||
/*! \brief Automatic Number Identification (ANI) */
|
||||
struct q931_party_number ani;
|
||||
|
||||
/*!
|
||||
* \brief Staging place for the Q.931 redirection number ie.
|
||||
|
||||
39
q931.c
39
q931.c
@@ -1994,26 +1994,41 @@ static int transmit_called_party_number(int full_ie, struct pri *ctrl, q931_call
|
||||
static int receive_calling_party_number(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
|
||||
{
|
||||
int i = 0;
|
||||
struct q931_party_number number;
|
||||
|
||||
q931_party_number_init(&number);
|
||||
number.valid = 1;
|
||||
number.presentation = PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_UNSCREENED;
|
||||
|
||||
call->remote_id.number.valid = 1;
|
||||
call->remote_id.number.presentation =
|
||||
PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_UNSCREENED;
|
||||
/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
|
||||
walking through all bytes until one with ext bit (8) set to 1 */
|
||||
do {
|
||||
switch (i) {
|
||||
case 0:
|
||||
call->remote_id.number.plan = ie->data[i] & 0x7f;
|
||||
number.plan = ie->data[i] & 0x7f;
|
||||
break;
|
||||
case 1:
|
||||
/* Keep only the presentation and screening fields */
|
||||
call->remote_id.number.presentation =
|
||||
number.presentation =
|
||||
ie->data[i] & (PRI_PRES_RESTRICTION | PRI_PRES_NUMBER_TYPE);
|
||||
break;
|
||||
}
|
||||
} while (!(ie->data[i++] & 0x80));
|
||||
q931_get_number((unsigned char *) call->remote_id.number.str,
|
||||
sizeof(call->remote_id.number.str), ie->data + i, ie->len - i);
|
||||
q931_get_number((unsigned char *) number.str, sizeof(number.str), ie->data + i,
|
||||
ie->len - i);
|
||||
|
||||
/* There can be more than one calling party number ie in the SETUP message. */
|
||||
if (number.presentation == (PRI_PRES_ALLOWED | PRI_PRES_NETWORK_NUMBER)
|
||||
|| number.presentation == (PRI_PRES_RESTRICTED | PRI_PRES_NETWORK_NUMBER)) {
|
||||
/* The number is network provided so it is an ANI number. */
|
||||
call->ani = number;
|
||||
if (!call->remote_id.number.valid) {
|
||||
/* Copy ANI to CallerID if CallerID is not already set. */
|
||||
call->remote_id.number = number;
|
||||
}
|
||||
} else {
|
||||
call->remote_id.number = number;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3514,6 +3529,7 @@ void q931_init_call_record(struct pri *ctrl, struct q931_call *call, int cr)
|
||||
q931_party_address_init(&call->called);
|
||||
q931_party_id_init(&call->local_id);
|
||||
q931_party_id_init(&call->remote_id);
|
||||
q931_party_number_init(&call->ani);
|
||||
q931_party_redirecting_init(&call->redirecting);
|
||||
|
||||
/* PRI is set to whoever called us */
|
||||
@@ -5673,6 +5689,7 @@ static int prepare_to_handle_q931_message(struct pri *ctrl, q931_mh *mh, q931_ca
|
||||
q931_party_address_init(&c->called);
|
||||
q931_party_id_init(&c->local_id);
|
||||
q931_party_id_init(&c->remote_id);
|
||||
q931_party_number_init(&c->ani);
|
||||
q931_party_redirecting_init(&c->redirecting);
|
||||
|
||||
/*
|
||||
@@ -6477,11 +6494,9 @@ static void q931_fill_ring_event(struct pri *ctrl, struct q931_call *call)
|
||||
/* Calling party information */
|
||||
ctrl->ev.ring.callingpres = q931_party_id_presentation(&call->remote_id);
|
||||
ctrl->ev.ring.callingplan = call->remote_id.number.plan;
|
||||
if (call->remote_id.number.valid
|
||||
&& (call->remote_id.number.presentation == PRES_ALLOWED_NETWORK_NUMBER
|
||||
|| call->remote_id.number.presentation == PRES_PROHIB_NETWORK_NUMBER)) {
|
||||
ctrl->ev.ring.callingplanani = call->remote_id.number.plan;
|
||||
libpri_copy_string(ctrl->ev.ring.callingani, call->remote_id.number.str,
|
||||
if (call->ani.valid) {
|
||||
ctrl->ev.ring.callingplanani = call->ani.plan;
|
||||
libpri_copy_string(ctrl->ev.ring.callingani, call->ani.str,
|
||||
sizeof(ctrl->ev.ring.callingani));
|
||||
} else {
|
||||
ctrl->ev.ring.callingplanani = -1;
|
||||
|
||||
Reference in New Issue
Block a user