Skip to content

Commit 28b9762

Browse files
committed
Changes done for v2.3.0.
1 parent 863e59e commit 28b9762

File tree

20 files changed

+177
-65
lines changed

20 files changed

+177
-65
lines changed

com.ibm.streamsx.sttgateway/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changes
22

3+
## v2.3.0
4+
* Aug/23/2021
5+
* Made changes in the IBMVoiceGatewaySource operator to parse the SIP invite custom header fields such as Cisco-Guid and include it in the output stream.
6+
* Made changes in the VgwDataRouter, VgwDataRouterToWatsonSTT and VoiceGatewayToStreamsToWatsonSTT applications to propagate the ciscoGuid value received as part of the speech metadata.
7+
* Changed the default speech model to the next gen model i.e. from en-US_NarrowbandModel to en-US_Telephony.
8+
* Changed the STT result schema to include call start date time and utterance result reception time which will help the users to see the time it took for the STT engine to return a given utterance.
9+
* Added ciscoGuid attribute to the call metadata schema to be useful in call recording and call replay.
10+
311
## v2.2.9
412
* Feb/11/2021
513
* Removed the EndOfCallSignal (EOCS) output stream completely to avoid port locks and out of order processing between the binary speech data (BSD) and the EOCS tuples. Now, a single output stream will deliver both the BSD and EOCS tuples in the correct sequence for downstream processing.

com.ibm.streamsx.sttgateway/com.ibm.streamsx.sttgateway.watson/IBMVoiceGatewaySource/IBMVoiceGatewaySource.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@
145145
<description>Returns an rstring value with the call start date time i.e. system clock time.</description>
146146
<prototype><![CDATA[rstring getCallStartDateTime()]]></prototype>
147147
</function>
148+
<function>
149+
<description>Returns an rstring value for the SIP invite custom header Cisco-Guid.</description>
150+
<prototype><![CDATA[rstring getCiscoGuid()]]></prototype>
151+
</function>
148152
</customOutputFunction>
149153
</customOutputFunctions>
150154

com.ibm.streamsx.sttgateway/com.ibm.streamsx.sttgateway.watson/IBMVoiceGatewaySource/IBMVoiceGatewaySource_cpp.cgt

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/*
99
============================================================
1010
First created on: Sep/20/2019
11-
Last modified on: Feb/09/2021
11+
Last modified on: Aug/23/2021
1212

1313
Please refer to the sttgateway-tech-brief.txt file in the
1414
top-level directory of this toolkit to read about
@@ -690,6 +690,7 @@ void MY_OPERATOR::on_open(websocketpp::connection_hdl hdl, bool isTlsConnection)
690690
con_metadata.vgwParticipantURI = "";
691691
con_metadata.vgwTenantID = "";
692692
con_metadata.vgwSIPToURI = "";
693+
con_metadata.ciscoGuid = "";
693694
con_metadata.vgwIsCaller = false;
694695
con_metadata.vgwVoiceChannelNumber = 0;
695696
client_connections_map[hdl] = con_metadata;
@@ -812,13 +813,18 @@ void MY_OPERATOR::on_message(EndpointType* s, websocketpp::connection_hdl hdl,
812813
// ===========================================================
813814
{
814815
"action": "start",
815-
"siprecMetadata": {
816-
"vgwSessionID" : "8443572187904004@192.168.208.5",
817-
"vgwSIPCallID" : "8443572187904004@192.168.208.5",
818-
"vgwParticipantURI" : "sip:alice@10.10.10.7",
819-
"vgwIsCaller" : true
820-
}
821-
}
816+
"siprecMetadata": {
817+
"vgwTenantID": "siprec-tenant",
818+
"vgwSIPToURI": "sip:10.145.203.161:5060;transport=udp",
819+
"vgwIsCaller": true,
820+
"vgwSessionID": "fccd47f1-a44e-4060-b713-4f19c5baebcf",
821+
"vgwSIPCallID": "f75e487831ff12e517ee10159b31e0d9020@10.145.203.161",
822+
"vgwParticipantURI": "sip:9737046347@143.91.19.6",
823+
"vgwSIPCustomInviteHeaders": {
824+
"Cisco-Guid": "3502874379-4113371627-2730858090-1212179876"
825+
}
826+
}
827+
}
822828
// ===========================================================
823829
*/
824830
if (action == "start") {
@@ -828,7 +834,7 @@ void MY_OPERATOR::on_message(EndpointType* s, websocketpp::connection_hdl hdl,
828834
//
829835
// Look for vgwSessionId
830836
try {
831-
// This is an important metadata that identiies
837+
// This is an important metadata that identifies
832838
// every unique voice call. It must be present.
833839
con_metadata.vgwSessionId = query(root,
834840
"siprecMetadata.vgwSessionID").get_value<std::string>();
@@ -924,7 +930,24 @@ void MY_OPERATOR::on_message(EndpointType* s, websocketpp::connection_hdl hdl,
924930
", IBM Voice Gateway sent this message: " << msg->get_payload(), "on_message");
925931
}
926932
}
927-
933+
934+
// Look for Cisco-Guid
935+
try {
936+
// It is fine even if this field is not present in the JSON message.
937+
// Because, it is a SIP invite custom header. Depending on the
938+
// underlying voice infrastructure and the configuration done in
939+
// the IBM Voice Gateway product, this header may or may not be there.
940+
con_metadata.ciscoGuid = query(root,
941+
"siprecMetadata.vgwSIPCustomInviteHeaders.Cisco-Guid").get_value<std::string>();
942+
} catch (std::exception const& e) {
943+
if (vgwSessionLoggingNeeded == true) {
944+
SPLAPPTRC(L_ERROR, "Operator " << operatorPhysicalName <<
945+
"-->Channel " << boost::to_string(udpChannelNumber) <<
946+
"-->X1 JSON parsing error when reading the field : " << e.what() <<
947+
", IBM Voice Gateway sent this message: " << msg->get_payload(), "on_message");
948+
}
949+
}
950+
928951
// If we reached this far, then we can give an
929952
// affirmative response back to the IBM Voice Gateway for
930953
// its session start message.
@@ -973,7 +996,9 @@ void MY_OPERATOR::on_message(EndpointType* s, websocketpp::connection_hdl hdl,
973996
", vgwParticipantURI=" << con_metadata.vgwParticipantURI <<
974997
", vgwTenantID=" << con_metadata.vgwTenantID <<
975998
", vgwSIPToURI=" << con_metadata.vgwSIPToURI <<
976-
".", "on_message");
999+
", Cisco-Guid=" << con_metadata.ciscoGuid <<
1000+
". Full JSON message=" << msg->get_payload(),
1001+
"on_message");
9771002
}
9781003

9791004
return;
@@ -1430,6 +1455,10 @@ void MY_OPERATOR::on_message(EndpointType* s, websocketpp::connection_hdl hdl,
14301455
%>
14311456
oTuple.set_<%=$name%>(
14321457
<%=$operation%>(con_metadata.callStartDateTime));
1458+
<%} elsif ($operation eq "getCiscoGuid") {
1459+
%>
1460+
oTuple.set_<%=$name%>(
1461+
<%=$operation%>(con_metadata.ciscoGuid));
14331462
<%}
14341463
}%>
14351464

@@ -1934,4 +1963,8 @@ SPL::rstring MY_OPERATOR::getCallStartDateTime(SPL::rstring const & callStartDat
19341963
return(callStartDateTime);
19351964
}
19361965

1966+
SPL::rstring MY_OPERATOR::getCiscoGuid(SPL::rstring const & ciscoGuid) {
1967+
return(ciscoGuid);
1968+
}
1969+
19371970
<%SPL::CodeGen::implementationEpilogue($model);%>

com.ibm.streamsx.sttgateway/com.ibm.streamsx.sttgateway.watson/IBMVoiceGatewaySource/IBMVoiceGatewaySource_h.cgt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/*
99
============================================================
1010
First created on: Sep/17/2019
11-
Last modified on: Feb/07/2021
11+
Last modified on: Aug/21/2021
1212
============================================================
1313
*/
1414

@@ -112,6 +112,11 @@ public:
112112
std::string vgwSIPToURI;
113113
// This tells if this connection carries caller's or agent's speech data.
114114
bool vgwIsCaller;
115+
// This field indicates the SIP invite custom header named Ciso-Guid.
116+
// This field will be sent in the SIPREC metadata only if the IBM Voice Gateway
117+
// product is configured to parse this field from the SIP headers.
118+
std::string ciscoGuid;
119+
//
115120
// This indicates the voice channel number i.e. 1 or 2.
116121
// Whoever (caller or agent) sends the first round of speech data bytes will
117122
// get assigned a voice channel of 1. The next one to follow will get
@@ -207,6 +212,7 @@ private:
207212
int32_t getVoiceChannelNumber(int32_t const & voiceChannelNumber);
208213
std::string getAgentOrCallerPhoneNumber(std::string const & vgwSessionId, bool const & vgwIsCaller);
209214
SPL::rstring getCallStartDateTime(SPL::rstring const & callStartDateTime);
215+
SPL::rstring getCiscoGuid(SPL::rstring const & ciscoGuid);
210216
};
211217

212218
<%SPL::CodeGen::headerEpilogue($model);%>

com.ibm.streamsx.sttgateway/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
**Note:** This toolkit requires c++11 support.
1616
</description>
17-
<version>2.2.9</version>
17+
<version>2.3.0</version>
1818
<requiredProductVersion>4.2.1.6</requiredProductVersion>
1919
</identity>
2020
<dependencies>

samples/STTGatewayUtils/com.ibm.streamsx.sttgateway.utils/STTGatewayUtils.spl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/*
99
==============================================
1010
First created on: Nov/24/2020
11-
Last modified on: Feb/09/2021
11+
Last modified on: Aug/21/2021
1212

1313
This is a utility composite that will get used in the following applications.
1414

@@ -20,7 +20,7 @@ This is a utility composite that will get used in the following applications.
2020

2121
namespace com.ibm.streamsx.sttgateway.utils;
2222

23-
// It is a dummpy Main composite.
23+
// It is a dummy Main composite.
2424
// Major goal of this project is to have reusable SPL, C++ and Java functions snd types.
2525
// Code for the C++ native functions can be found in the impl/include directory of this project.
2626
//
@@ -44,6 +44,7 @@ namespace com.ibm.streamsx.sttgateway.utils;
4444
// rstring callStartDateTime --> Call start date time i.e. system clock time.
4545
// rstring callerPhoneNumber --> Details about the caller's phone number.
4646
// rstring agentPhoneNumber --> Details about the agent's phone number.
47+
// rstring ciscoGuid --> Value of the SIP invite custom header Cisco-Guid if present.
4748
// int32 speechDataFragmentCnt --> Number of fragments (tuples) emitted so far on a given channel (customer or agent) for a given vgwSessionId.
4849
// int32 totalSpeechDataBytesReceived --> Number of speech bytes received so far on a given channel (customer or agent) for a given vgwSessionId.
4950
// int32 int32 speechProcessorId --> Id of the speech processor job that is analyzing the speech data.
@@ -53,8 +54,9 @@ type BinarySpeech_t = blob speech, rstring vgwSessionId, boolean isCustomerSpeec
5354
int32 vgwVoiceChannelNumber, boolean endOfCallSignal,
5455
rstring id, rstring callStartDateTime,
5556
rstring callerPhoneNumber, rstring agentPhoneNumber,
56-
int32 speechDataFragmentCnt, int32 totalSpeechDataBytesReceived,
57-
int32 speechProcessorId, int32 speechEngineId, int32 speechResultProcessorId;
57+
rstring ciscoGuid, int32 speechDataFragmentCnt,
58+
int32 totalSpeechDataBytesReceived, int32 speechProcessorId,
59+
int32 speechEngineId, int32 speechResultProcessorId;
5860

5961
// The following schema will be for the data being sent here by the
6062
// VgwDataRouter application. It sends us raw binary data which
@@ -68,7 +70,7 @@ type DataFromVgwRouter_t = int32 msgType, blob payload;
6870
// voice call.
6971
type CallMetaData_t = rstring vgwSessionId, boolean isCustomerSpeechData,
7072
int32 vgwVoiceChannelNumber, rstring callerPhoneNumber,
71-
rstring agentPhoneNumber;
73+
rstring agentPhoneNumber, rstring ciscoGuid;
7274

7375
// The following schema is for the call recording feature where we will
7476
// store the call speech data for a specific voice channel of a given

samples/STTGatewayUtils/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<info:identity>
55
<info:name>STTGatewayUtils</info:name>
66
<info:description>A utility composite used by the VgwDataRouter and the speech processor applications.</info:description>
7-
<info:version>1.0.1</info:version>
7+
<info:version>1.0.2</info:version>
88
<info:requiredProductVersion>4.2.1.6</info:requiredProductVersion>
99
</info:identity>
1010
<info:dependencies/>

samples/VgwDataRouter/com.ibm.streamsx.sttgateway.sample/VgwDataRouter.spl

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/*
99
==============================================
1010
First created on: Nov/24/2020
11-
Last modified on: Feb/10/2021
11+
Last modified on: Aug/21/2021
1212

1313
A) What does this example application do?
1414
--------------------------------------
@@ -83,7 +83,7 @@ deploying them. Please refer to the streamsx.sttgateway documentation section ti
8383
2) Once you are sure that the IBM Voice Gateway can send the speech data to this
8484
application, then you can give the following command to deploy this application in distributed mode.
8585

86-
There are certain importat submisstion time parameters that are required while
86+
There are certain important submission time parameters that are required while
8787
launching this application.
8888

8989
Mandatory submission time parameter(s) for the VgwDataRouter application:
@@ -249,7 +249,7 @@ public composite VgwDataRouter {
249249
// Is a password needed for the private key in the certificate file?
250250
expression<rstring> $certificatePassword :
251251
getSubmissionTimeValue("certificatePassword", "");
252-
// Do you want to specifiy a file name that contains the public certificates of
252+
// Do you want to specify a file name that contains the public certificates of
253253
// the trusted client(s). If this file name is not empty, then the
254254
// WebSocketSink operator will perform a client (mutual) authentication.
255255
expression<rstring> $trustedClientCertificateFileName :
@@ -285,7 +285,7 @@ public composite VgwDataRouter {
285285
// We will allow different speech processor jobs with their own
286286
// unique ids to connect to this application for getting the
287287
// speech data to get routed for processing. Such speech processor jobs will
288-
// use their respectivce unique speech processor id at the end end of the
288+
// use their respective unique speech processor id at the end end of the
289289
// URL as context path. Hence, we will prepare the WebSocketSink operator
290290
// invoked in this application to allow a set of context paths.
291291
// e-g: wss://MyHostName:8444/14 This URL must be used by a
@@ -331,8 +331,8 @@ public composite VgwDataRouter {
331331
// Is IBM Voice Gateway message exchange logging needed for debugging?
332332
expression<boolean> $vgwSessionLoggingNeeded :
333333
(boolean)getSubmissionTimeValue("vgwSessionLoggingNeeded", "false");
334-
// Under some cicumstances, if the IBMVoiceGatewaySource operator sends
335-
// only one EOCS (End Of Call Sigmal) tuple instead of two as required for
334+
// Under some circumstances, if the IBMVoiceGatewaySource operator sends
335+
// only one EOCS (End Of Call Signal) tuple instead of two as required for
336336
// the two voice channels, that may eventually cause the application logic
337337
// below not be able to release the speech processor jobs properly at the end of
338338
// a voice call for a given VGW session id. We have seen it in certain
@@ -450,7 +450,7 @@ public composite VgwDataRouter {
450450
// Initial delay before generating the very first tuple.
451451
// This is a one time delay when this operator starts up.
452452
// This delay should give sufficient time for the
453-
// speech processor jpbs to come up and be ready to
453+
// speech processor jobs to come up and be ready to
454454
// receive the speech data tuples sent by this operator.
455455
initDelay: $initDelayBeforeSendingDataToSpeechProcessors;
456456
vgwLiveMetricsUpdateNeeded: $vgwLiveMetricsUpdateNeeded;
@@ -467,6 +467,7 @@ public composite VgwDataRouter {
467467
vgwVoiceChannelNumber = getVoiceChannelNumber(),
468468
callerPhoneNumber = getCallerPhoneNumber(),
469469
agentPhoneNumber = getAgentPhoneNumber(),
470+
ciscoGuid = getCiscoGuid(),
470471
speechDataFragmentCnt = getTupleCnt(),
471472
totalSpeechDataBytesReceived = getTotalSpeechDataBytesReceived();
472473

@@ -749,7 +750,7 @@ public composite VgwDataRouter {
749750
} else {
750751
// Flag an error only when the user configured for two
751752
// EOCS tuples to be received for considering a voice call
752-
// as complted.
753+
// as completed.
753754
if ($numberOfEocsNeededForVoiceCallCompletion == 2) {
754755
appTrc(Trace.error,
755756
"_YYYYY No speech processor id is available at this time for the " +
@@ -767,10 +768,10 @@ public composite VgwDataRouter {
767768

768769
// Invoke one or more instances of the WebSocketSink operator.
769770
// This operator listens on a TLS port and is configured with
770-
// multiple URL context paths to aceept connections from the
771+
// multiple URL context paths to accept connections from the
771772
// remote speech processor jobs that will each connect to a
772-
// particular context path expresded by their speech processor id.
773-
// It then routes the voice cslls' speech data and EOCS to the
773+
// particular context path expressed by their speech processor id.
774+
// It then routes the voice calls' speech data and EOCS to the
774775
// corresponding speech processor job.
775776
// For now, we will have a parallel width of 1.
776777
// If it doesn't perform well, we can think of increasing the
Binary file not shown.

samples/VgwDataRouter/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<info:identity>
55
<info:name>VgwDataRouter</info:name>
66
<info:description>Example that shows how to route VGW speech data to different Speech processor jobs</info:description>
7-
<info:version>1.0.2</info:version>
7+
<info:version>1.0.3</info:version>
88
<info:requiredProductVersion>4.2.1.6</info:requiredProductVersion>
99
</info:identity>
1010
<info:dependencies>
1111
<info:toolkit>
1212
<common:name>com.ibm.streamsx.sttgateway</common:name>
13-
<common:version>[2.2.9,7.0.0]</common:version>
13+
<common:version>[2.3.0,7.0.0]</common:version>
1414
</info:toolkit>
1515
<info:toolkit>
1616
<common:name>com.ibm.streamsx.websocket</common:name>
Binary file not shown.

0 commit comments

Comments
 (0)