The Caller-ID and connected-line ID are just roles the local and remote party
play while a call is being established. Which roll depends upon the direction
of the call.
Outgoing party info is to identify the local party to the other end.
(Caller-ID for originated or connected-line for answered calls.)
Incoming party info is to identify the remote party to us.
(Caller-ID for answered or connected-line for originated calls.)
if (pri->switchtype == PRI_SWITCH_QSIG) {
@@ -590,13 +590,13 @@
case Q931_CALL_STATE_OVERLAP_RECEIVING:
case Q931_CALL_STATE_INCOMING_CALL_PROCEEDING:
/* queue updates for next ALERTING */
- if (call->connected_line.name.str[0]) {
+ if (call->local_id.name.str[0]) {
/* queue connectedName to be send with next Q931_ALERTING */
rose_called_name_encode(pri, call, Q931_ALERTING);
}
if ((call->redirecting.state == DIVERTEDSTATE_DIVERTED) && call->redirecting.to.number.str[0]) {
/* queue divertingLegInformation1 to be send with next Q931_FACILITY */
Modified: team/group/issue14068/pri_facility.c
URL: http://svn.asterisk.org/svn-view/libpri/team/group/issue14068/pri_facility.c?view=diff&rev=828&r1=827&r2=828
==============================================================================
--- team/group/issue14068/pri_facility.c (original)
+++ team/group/issue14068/pri_facility.c Fri May 29 16:27:31 2009
@@ -918,13 +918,13 @@
* \param ctrl D channel controller for diagnostic messages or global options.
* \param pos Starting position to encode the facility ie contents.
* \param end End of facility ie contents encoding data buffer.
- * \param call Call leg from which to encode name.
+ * \param name Name data which to encode name.
*
* \retval Start of the next ASN.1 component to encode on success.
* \retval NULL on error.
*/
static unsigned char *enc_qsig_calling_name(struct pri *ctrl, unsigned char *pos,
- unsigned char *end, q931_call *call)
+ unsigned char *end, const struct q931_party_name *name)
{
struct fac_extension_header header;
struct rose_msg_invoke msg;
@@ -946,13 +946,13 @@
msg.operation = ROSE_QSIG_CallingName;
msg.invoke_id = get_invokeid(ctrl);
- if (call->caller_id.name.status == Q931_PARTY_DATA_STATUS_INVALID) {
+ if (call->local_id.name.status == Q931_PARTY_DATA_STATUS_INVALID) {
return 0;
}
@@ -999,8 +999,10 @@
*/
}
- call->caller_id.name.status = Q931_PARTY_DATA_STATUS_VALID;
- end = enc_qsig_calling_name(ctrl, buffer, buffer + sizeof(buffer), call);
+ /* CallingName is the local_id.name */
+ call->local_id.name.status = Q931_PARTY_DATA_STATUS_VALID;
+ end = enc_qsig_calling_name(ctrl, buffer, buffer + sizeof(buffer),
+ &call->local_id.name);
if (!end) {
return -1;
}
@@ -1340,9 +1342,13 @@
unsigned char *end;
int res;
+ /*
+ * We are deflecting an incoming call back to the network.
+ * Therefore, the Caller-ID is the remote party.
+ */
end =
enc_qsig_call_rerouting(ctrl, buffer, buffer + sizeof(buffer),
- call->caller_id.number.str, dest, original ? original :
+ call->remote_id.number.str, dest, original ? original :
call->called_number.str, reason);
if (!end) {
return -1;
@@ -1622,36 +1628,36 @@
msg.invoke_id = get_invokeid(ctrl);
msg.args.qsig.CallTransferComplete.end_designation = 0; /* primaryEnd */
- end = enc_qsig_called_name(ctrl, buffer, buffer + sizeof(buffer), call);
+ /* CalledName is the local_id.name */
+ end = enc_qsig_called_name(ctrl, buffer, buffer + sizeof(buffer),
+ &call->local_id.name);
if (!end) {
return -1;
}
@@ -1772,13 +1780,13 @@
* \param ctrl D channel controller for diagnostic messages or global options.
* \param pos Starting position to encode the facility ie contents.
* \param end End of facility ie contents encoding data buffer.
- * \param call Call leg from which to encode name.
+ * \param name Name data which to encode name.
*
* \retval Start of the next ASN.1 component to encode on success.
* \retval NULL on error.
*/
static unsigned char *enc_qsig_connected_name(struct pri *ctrl, unsigned char *pos,
- unsigned char *end, q931_call *call)
+ unsigned char *end, const struct q931_party_name *name)
{
struct fac_extension_header header;
struct rose_msg_invoke msg;
@@ -1798,12 +1806,12 @@
msg.operation = ROSE_QSIG_ConnectedName;
msg.invoke_id = get_invokeid(ctrl);
- end = enc_qsig_connected_name(ctrl, buffer, buffer + sizeof(buffer), call);
+ /* ConnectedName is the local_id.name */
+ end = enc_qsig_connected_name(ctrl, buffer, buffer + sizeof(buffer),
+ &call->local_id.name);
if (!end) {
return -1;
}
@@ -2262,35 +2272,35 @@
break;
#endif /* Not handled yet */
case ROSE_QSIG_CallingName:
- /* CallingName is put in caller_id.name */
- call->caller_id.name.status = Q931_PARTY_DATA_STATUS_CHANGED;
- call->caller_id.name.presentation = qsig_name_presentation_for_q931(ctrl,
+ /* CallingName is put in remote_id.name */
+ call->remote_id.name.status = Q931_PARTY_DATA_STATUS_CHANGED;
+ call->remote_id.name.presentation = qsig_name_presentation_for_q931(ctrl,
invoke->args.qsig.CallingName.name.presentation);
- call->caller_id.name.char_set = invoke->args.qsig.CallingName.name.char_set;
- libpri_copy_string(call->caller_id.name.str,
+ call->remote_id.name.char_set = invoke->args.qsig.CallingName.name.char_set;
+ libpri_copy_string(call->remote_id.name.str,
(char *) invoke->args.qsig.CallingName.name.data,
- sizeof(call->caller_id.name.str));
+ sizeof(call->remote_id.name.str));
break;
case ROSE_QSIG_CalledName:
- /* CalledName is put in called.name */
- call->called_name.status = Q931_PARTY_DATA_STATUS_CHANGED;
- call->called_name.presentation = qsig_name_presentation_for_q931(ctrl,
+ /* CalledName is put in remote_id.name */
+ call->remote_id.name.status = Q931_PARTY_DATA_STATUS_CHANGED;
+ call->remote_id.name.presentation = qsig_name_presentation_for_q931(ctrl,
invoke->args.qsig.CalledName.name.presentation);
- call->called_name.char_set = invoke->args.qsig.CalledName.name.char_set;
- libpri_copy_string(call->called_name.str,
+ call->remote_id.name.char_set = invoke->args.qsig.CalledName.name.char_set;
+ libpri_copy_string(call->remote_id.name.str,
(char *) invoke->args.qsig.CalledName.name.data,
- sizeof(call->called_name.str));
+ sizeof(call->remote_id.name.str));
break;
case ROSE_QSIG_ConnectedName:
- /* ConnectedName is put in connected_line.name */
- call->connected_line.name.status = Q931_PARTY_DATA_STATUS_CHANGED;
- call->connected_line.name.presentation = qsig_name_presentation_for_q931(ctrl,
+ /* ConnectedName is put in remote_id.name */
+ call->remote_id.name.status = Q931_PARTY_DATA_STATUS_CHANGED;
+ call->remote_id.name.presentation = qsig_name_presentation_for_q931(ctrl,
invoke->args.qsig.ConnectedName.name.presentation);
- call->connected_line.name.char_set =
+ call->remote_id.name.char_set =
invoke->args.qsig.ConnectedName.name.char_set;
- libpri_copy_string(call->connected_line.name.str,
+ libpri_copy_string(call->remote_id.name.str,
(char *) invoke->args.qsig.ConnectedName.name.data,
- sizeof(call->connected_line.name.str));
+ sizeof(call->remote_id.name.str));
break;
#if 0 /* Not handled yet */
case ROSE_QSIG_BusyName:
@@ -2414,22 +2424,22 @@
switch (invoke->args.qsig.CallTransferUpdate.redirection.presentation) {
case 0: /* presentationAllowedNumber */
case 3: /* presentationRestrictedNumber */
- libpri_copy_string(call->caller_id.number.str, (char *)
+ libpri_copy_string(call->remote_id.number.str, (char *)
invoke->args.qsig.CallTransferUpdate.redirection.screened.number.str,
- sizeof(call->caller_id.number.str));
+ sizeof(call->remote_id.number.str));
break;
default:
- call->caller_id.number.str[0] = '\0';
- break;
- }
- call->caller_id.name.str[0] = '\0';
+ call->remote_id.number.str[0] = '\0';
+ break;
+ }
+ call->remote_id.name.str[0] = '\0';
if (invoke->args.qsig.CallTransferUpdate.redirection_name_present) {
switch (invoke->args.qsig.CallTransferUpdate.redirection_name.presentation) {
case 1: /* presentation_allowed */
case 2: /* presentation_restricted */
- libpri_copy_string(call->caller_id.name.str,
+ libpri_copy_string(call->remote_id.name.str,
(char *) invoke->args.qsig.CallTransferUpdate.redirection_name.data,
- sizeof(call->caller_id.name.str));
+ sizeof(call->remote_id.name.str));
break;
default:
break;
Modified: team/group/issue14068/pri_internal.h
URL: http://svn.asterisk.org/svn-view/libpri/team/group/issue14068/pri_internal.h?view=diff&rev=828&r1=827&r2=828
==============================================================================
--- team/group/issue14068/pri_internal.h (original)
+++ team/group/issue14068/pri_internal.h Fri May 29 16:27:31 2009
@@ -333,11 +333,32 @@
/*! Current dialed digits to be sent or just received. */
char overlap_digits[PRI_MAX_NUMBER_LEN];
-/* BUGBUG need to check usage of elements in caller_id */
- struct q931_party_id caller_id;
-
-/* BUGBUG need to check usage of elements in called_name */
- struct q931_party_name called_name;
+ /*!
+ * \brief Local party ID
+ * \details
+ * The Caller-ID and connected-line ID are just roles the local and remote party
+ * play while a call is being established. Which roll depends upon the direction
+ * of the call.
+ * Outgoing party info is to identify the local party to the other end.
+ * (Caller-ID for originated or connected-line for answered calls.)
+ * Incoming party info is to identify the remote party to us.
+ * (Caller-ID for answered or connected-line for originated calls.)
+ */
+/* BUGBUG need to check usage of elements in local_id */
+ struct q931_party_id local_id;
+ /*!
+ * \brief Remote party ID
+ * \details
+ * The Caller-ID and connected-line ID are just roles the local and remote party
+ * play while a call is being established. Which roll depends upon the direction
+ * of the call.
+ * Outgoing party info is to identify the local party to the other end.
+ * (Caller-ID for originated or connected-line for answered calls.)
+ * Incoming party info is to identify the remote party to us.
+ * (Caller-ID for answered or connected-line for originated calls.)
+ */
+/* BUGBUG need to check usage of elements in remote_id */
+ struct q931_party_id remote_id;
/*!
* \brief Called party number.
@@ -364,11 +385,11 @@
/* BUGBUG need to check usage of elements in orig_called */
struct q931_party_id orig_called;
-/* BUGBUG need to check usage of elements in connected_line */
- struct q931_party_id connected_line;
/* BUGBUG need to check usage of elements in ct_complete */
+/* BUGBUG This will also become part of local/remote party id behaviour. */
struct q931_party_id ct_complete;
/* BUGBUG need to check usage of elements in ct_active */
+/* BUGBUG This will also become part of local/remote party id behaviour. */
struct q931_party_id ct_active;
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum