[asterisk-commits] pcadach: branch 1.4 r44684 - in
/branches/1.4/channels: ./ h323/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Oct 7 07:39:35 MST 2006
Author: pcadach
Date: Sat Oct 7 09:39:34 2006
New Revision: 44684
URL: http://svn.digium.com/view/asterisk?rev=44684&view=rev
Log:
Propagate caller's transfer capability too
Modified:
branches/1.4/channels/chan_h323.c
branches/1.4/channels/h323/ast_h323.cxx
branches/1.4/channels/h323/ast_h323.h
branches/1.4/channels/h323/chan_h323.h
Modified: branches/1.4/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_h323.c?rev=44684&r1=44683&r2=44684&view=diff
==============================================================================
--- branches/1.4/channels/chan_h323.c (original)
+++ branches/1.4/channels/chan_h323.c Sat Oct 7 09:39:34 2006
@@ -644,9 +644,13 @@
} else
pvt->options.redirect_reason = -1;
+ pvt->options.transfer_capability = c->transfercapability;
+
/* indicate that this is an outgoing call */
pvt->outgoing = 1;
+ if (option_verbose > 2)
+ ast_verbose(VERBOSE_PREFIX_3 "Requested transfer capability: 0x%.2x - %s\n", c->transfercapability, ast_transfercapability2str(c->transfercapability));
if (h323debug)
ast_log(LOG_DEBUG, "Placing outgoing call to %s, %d\n", called_addr, pvt->options.dtmfcodec);
ast_mutex_unlock(&pvt->lock);
@@ -1075,6 +1079,8 @@
if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) {
ch->cid.cid_dnid = strdup(pvt->exten);
}
+ if (pvt->cd.transfer_capability >= 0)
+ ch->transfercapability = pvt->cd.transfer_capability;
ast_setstate(ch, state);
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(ch)) {
@@ -1100,6 +1106,7 @@
}
memset(pvt, 0, sizeof(struct oh323_pvt));
pvt->cd.redirect_reason = -1;
+ pvt->cd.transfer_capability = -1;
/* Ensure the call token is allocated for outgoing call */
if (!callid) {
if ((pvt->cd).call_token == NULL) {
Modified: branches/1.4/channels/h323/ast_h323.cxx
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/h323/ast_h323.cxx?rev=44684&r1=44683&r2=44684&view=diff
==============================================================================
--- branches/1.4/channels/h323/ast_h323.cxx (original)
+++ branches/1.4/channels/h323/ast_h323.cxx Sat Oct 7 09:39:34 2006
@@ -544,6 +544,7 @@
dtmfMode = 0;
dtmfCodec = (RTP_DataFrame::PayloadTypes)0;
redirect_reason = -1;
+ transfer_capability = -1;
#ifdef TUNNELLING
tunnelOptions = remoteTunnelOptions = 0;
#endif
@@ -723,6 +724,9 @@
}
cid_presentation = opts->presentation;
cid_ton = opts->type_of_number;
+ if (opts->transfer_capability >= 0) {
+ transfer_capability = opts->transfer_capability;
+ }
}
tunnelOptions = opts->tunnelOptions;
}
@@ -756,6 +760,8 @@
PString redirect_number;
unsigned redirect_reason;
unsigned plan, type, screening, presentation;
+ Q931::InformationTransferCapability capability;
+ unsigned transferRate, codingStandard, userInfoLayer1;
/* Fetch presentation and type information about calling party's number */
if (setupPDU.GetQ931().GetCallingPartyNumber(sourceName, &plan, &type, &presentation, &screening, 0, 0)) {
@@ -783,13 +789,20 @@
GetSignallingChannel()->GetRemoteAddress().GetIpAndPort(Ip, sourcePort);
cd->sourceIp = strdup((const char *)Ip.AsString());
- if(setupPDU.GetQ931().GetRedirectingNumber(redirect_number, NULL, NULL, NULL, NULL, &redirect_reason, 0, 0, 0)) {
+ if (setupPDU.GetQ931().GetRedirectingNumber(redirect_number, NULL, NULL, NULL, NULL, &redirect_reason, 0, 0, 0)) {
cd->redirect_number = strdup((const char *)redirect_number);
cd->redirect_reason = redirect_reason;
}
else
cd->redirect_reason = -1;
+ /* Fetch Q.931's transfer capability */
+ if (((Q931 &)setupPDU.GetQ931()).GetBearerCapabilities(capability, transferRate, &codingStandard, &userInfoLayer1))
+ cd->transfer_capability = ((unsigned int)capability & 0x1f) | (codingStandard << 5);
+ else
+ cd->transfer_capability = 0x00; /* ITU coding of Speech */
+
+ /* Don't show local username as called party name */
SetDisplayName(cd->call_dest_e164);
}
@@ -1216,6 +1229,9 @@
setupPDU.GetQ931().SetIE(Q931::RedirectingNumberIE, IE);
}
+ if (transfer_capability)
+ setupPDU.GetQ931().SetBearerCapabilities((Q931::InformationTransferCapability)(transfer_capability & 0x1f), 1, ((transfer_capability >> 5) & 3));
+
SetCallDetails(&cd, setupPDU, FALSE);
int res = on_outgoing_call(&cd);
Modified: branches/1.4/channels/h323/ast_h323.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/h323/ast_h323.h?rev=44684&r1=44683&r2=44684&view=diff
==============================================================================
--- branches/1.4/channels/h323/ast_h323.h (original)
+++ branches/1.4/channels/h323/ast_h323.h Sat Oct 7 09:39:34 2006
@@ -104,6 +104,7 @@
int cid_ton;
PString rdnis;
int redirect_reason;
+ int transfer_capability;
WORD sessionId;
BOOL bridging;
Modified: branches/1.4/channels/h323/chan_h323.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/h323/chan_h323.h?rev=44684&r1=44683&r2=44684&view=diff
==============================================================================
--- branches/1.4/channels/h323/chan_h323.h (original)
+++ branches/1.4/channels/h323/chan_h323.h Sat Oct 7 09:39:34 2006
@@ -48,6 +48,7 @@
int redirect_reason;
int presentation;
int type_of_number;
+ int transfer_capability;
int fastStart;
int h245Tunneling;
int silenceSuppression;
@@ -113,6 +114,7 @@
int redirect_reason;
int presentation;
int type_of_number;
+ int transfer_capability;
char *sourceIp;
} call_details_t;
More information about the asterisk-commits
mailing list