From c83d9ea3154b0fab0e7b2c6c874aea8d3f61768d Mon Sep 17 00:00:00 2001 From: Jan Willamowius Date: Thu, 14 Dec 2017 14:17:06 +0100 Subject: [PATCH] display calling/called party Number IE in PrintCallInfo (CallerID) --- ProxyChannel.cxx | 18 ++++++++++++++++++ RasTbl.cxx | 2 ++ RasTbl.h | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/ProxyChannel.cxx b/ProxyChannel.cxx index ddd71372..1a66536e 100644 --- a/ProxyChannel.cxx +++ b/ProxyChannel.cxx @@ -5283,6 +5283,24 @@ void CallSignalSocket::OnSetup(SignalingMsg * msg) } SetCallTypePlan(&q931); + // store (rewritten) CallingPartyNumberIE, eg. for PrintCallInfo + if (q931.HasIE(Q931::CallingPartyNumberIE)) { + unsigned planIgnored = Q931::ISDNPlan, typeIgnored = Q931::InternationalType; + unsigned presentationIgnored = (unsigned)-1, screeningIgnored = (unsigned)-1; + PString callingPartyNumberIE; + q931.GetCallingPartyNumber(callingPartyNumberIE, &planIgnored, &typeIgnored, &presentationIgnored, &screeningIgnored, (unsigned)-1, (unsigned)-1); + m_call->SetCallingPartyNumberIE(callingPartyNumberIE); + } + + // store (rewritten) CalledPartyNumberIE, eg. for PrintCallInfo + if (q931.HasIE(Q931::CalledPartyNumberIE)) { + unsigned planIgnored = Q931::ISDNPlan, typeIgnored = Q931::InternationalType; + unsigned presentationIgnored = (unsigned)-1, screeningIgnored = (unsigned)-1; + PString calledPartyNumberIE; + q931.GetCalledPartyNumber(calledPartyNumberIE, &planIgnored, &typeIgnored); + m_call->SetCalledPartyNumberIE(calledPartyNumberIE); + } + // add destination alias (for Swyx trunk) if (m_call->GetCalledParty()) { PString addAlias = m_call->GetCalledParty()->GetAdditionalDestinationAlias(); diff --git a/RasTbl.cxx b/RasTbl.cxx index d53a592a..689a07d3 100644 --- a/RasTbl.cxx +++ b/RasTbl.cxx @@ -3619,6 +3619,8 @@ PString CallRec::PrintFullInfo() const result += "CallerAlias: " + GetCallingStationId() + "\r\n"; result += "CalledAlias: " + GetCalledStationId() + "\r\n"; result += "DialedNumber: " + m_dialedNumber + "\r\n"; + result += "CallingPartyNumberIE: " + GetCallingPartyNumberIE() + "\r\n"; + result += "CalledPartyNumberIE: " + GetCalledPartyNumberIE() + "\r\n"; PString vendorStr = "unknown"; PString vendor, version; if (GetCallingVendor(vendor, version)) diff --git a/RasTbl.h b/RasTbl.h index b0f3fea7..c1d247ac 100644 --- a/RasTbl.h +++ b/RasTbl.h @@ -1394,9 +1394,17 @@ class CallRec { void SetBindHint(const PString & ip) { m_bindHint = ip; } PString GetBindHint() const { return m_bindHint; } + // if set, the callerID to put into calling party number IE void SetCallerID(const PString & id) { m_callerID = id; } PString GetCallerID() const { return m_callerID; } + // calling/called party number IE (after rewriting) + void SetCallingPartyNumberIE(const PString & ie) { m_callingPartyNumberIE = ie; } + PString GetCallingPartyNumberIE() const { return m_callingPartyNumberIE; } + void SetCalledPartyNumberIE(const PString & ie) { m_calledPartyNumberIE = ie; } + PString GetCalledPartyNumberIE() const { return m_calledPartyNumberIE; } + + // if set, the display IE to set for the caller/called party void SetCallerDisplayIE(const PString & display) { m_callerDisplayIE = display; } PString GetCallerDisplayIE() const { return m_callerDisplayIE; } void SetCalledDisplayIE(const PString & display) { m_calledDisplayIE = display; } @@ -1665,6 +1673,10 @@ class CallRec { WORD m_callerH239Port; WORD m_calledH239Port; WORD m_H239SessionID; + + PString m_callingPartyNumberIE; + PString m_calledPartyNumberIE; + PBYTEArray m_radiusClass; bool m_proceedingSent; #ifdef HAS_H46018