Skip to content

Commit

Permalink
Remove plivobin urls in GO SDK (#222)
Browse files Browse the repository at this point in the history
* Remove plivobin urls in GO SDK

* added transcription params to MPC XML

* sdk versioning added

* corrected
  • Loading branch information
Abinaya-Shunmugavel authored Nov 19, 2024
1 parent a29aa10 commit 4e4f4e8
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [7.56.0](https://github.com/plivo/plivo-go/tree/v7.56.0) (2024-11-19)
**Feature - Transcription params added in MPC XML Element**
- Support for the `transcriptionUrl`, `transcript` parameter in MPC XML Element.

## [7.55.1](https://github.com/plivo/plivo-go/tree/v7.55.1) (2024-11-15)
**Feature - RecordParticipantTrack param added in MPC XML creation**
- Support for the `RecordParticipantTrack` parameter in MPC XML Creation.
Expand Down
2 changes: 1 addition & 1 deletion baseclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/google/go-querystring/query"
)

const sdkVersion = "7.55.1"
const sdkVersion = "7.56.0"

const lookupBaseUrl = "lookup.plivo.com"

Expand Down
42 changes: 21 additions & 21 deletions fixtures/listMaskingSessionResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"amount": 0,
"call_time_limit": 600,
"callback_method": "GET",
"callback_url": "http://plivobin.non-prod.plivops.com/12tksfd1",
"callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"created_time": "2023-07-05 10:25:40.877364 +0000 UTC",
"duration": 2863,
"expiry_time": "2023-07-05 11:13:23.895313 +0000 UTC",
Expand All @@ -26,11 +26,11 @@
"record": true,
"record_file_format": "mp3",
"recording_callback_method": "GET",
"recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"recording_callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/c2146ba4-798d-49b0-8580-53851a16e055/",
"ring_timeout": 120,
"second_party": "919976106830",
"second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"second_party_play_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"session_uuid": "c2146ba4-798d-49b0-8580-53851a16e055",
"status": "expired",
"total_call_amount": 0,
Expand All @@ -43,7 +43,7 @@
"amount": 0,
"call_time_limit": 600,
"callback_method": "GET",
"callback_url": "http://plivobin.non-prod.plivops.com/12tksfd1",
"callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"created_time": "2023-07-04 10:29:02.410778 +0000 UTC",
"duration": 2571,
"expiry_time": "2023-07-04 11:11:53.486694 +0000 UTC",
Expand All @@ -56,11 +56,11 @@
"record": true,
"record_file_format": "mp3",
"recording_callback_method": "GET",
"recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"recording_callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/61130623-ac98-4d70-8961-3b3110700e0a/",
"ring_timeout": 120,
"second_party": "919976106830",
"second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"second_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
"session_uuid": "61130623-ac98-4d70-8961-3b3110700e0a",
"status": "expired",
"total_call_amount": 0,
Expand All @@ -73,7 +73,7 @@
"amount": 0,
"call_time_limit": 600,
"callback_method": "GET",
"callback_url": "http://plivobin.non-prod.plivops.com/12tksfd1",
"callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"created_time": "2023-07-04 07:29:27.14973 +0000 UTC",
"duration": 926,
"expiry_time": "2023-07-04 07:36:50.056529 +0000 UTC",
Expand All @@ -86,11 +86,11 @@
"record": true,
"record_file_format": "mp3",
"recording_callback_method": "GET",
"recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"recording_callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/4b083bef-7b26-4116-95a4-c35f81f5c2c1/",
"ring_timeout": 120,
"second_party": "919976106830",
"second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"second_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
"session_uuid": "4b083bef-7b26-4116-95a4-c35f81f5c2c1",
"status": "expired",
"total_call_amount": 0,
Expand All @@ -103,7 +103,7 @@
"amount": 0,
"call_time_limit": 600,
"callback_method": "GET",
"callback_url": "http://plivobin.non-prod.plivops.com/12tksfd1",
"callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"created_time": "2023-07-04 06:41:19.396345 +0000 UTC",
"duration": 1244,
"expiry_time": "2023-07-04 07:02:03.635064 +0000 UTC",
Expand All @@ -116,11 +116,11 @@
"record": true,
"record_file_format": "mp3",
"recording_callback_method": "GET",
"recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"recording_callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/24d9691b-3904-488f-9ad8-f5afa6121606/",
"ring_timeout": 120,
"second_party": "919976106830",
"second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"second_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
"session_uuid": "24d9691b-3904-488f-9ad8-f5afa6121606",
"status": "expired",
"total_call_amount": 0,
Expand All @@ -133,7 +133,7 @@
"amount": 0,
"call_time_limit": 14400,
"callback_method": "GET",
"callback_url": "http://plivobin.non-prod.plivops.com/w7mf5kw7",
"callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"created_time": "2023-07-03 09:46:07.91423 +0000 UTC",
"duration": 8702,
"expiry_time": "2023-07-03 12:11:09.939161 +0000 UTC",
Expand All @@ -146,11 +146,11 @@
"record": false,
"record_file_format": "mp3",
"recording_callback_method": "GET",
"recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"recording_callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/964c20e0-9d59-40d5-90c3-7006ef5d03f4/",
"ring_timeout": 120,
"second_party": "919976106830",
"second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"second_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
"session_uuid": "964c20e0-9d59-40d5-90c3-7006ef5d03f4",
"status": "expired",
"total_call_amount": 0,
Expand All @@ -163,7 +163,7 @@
"amount": 0,
"call_time_limit": 600,
"callback_method": "GET",
"callback_url": "http://plivobin.non-prod.plivops.com/12tksfd1",
"callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"created_time": "2023-06-30 06:51:11.021617 +0000 UTC",
"duration": 6702,
"expiry_time": "2023-06-30 08:42:53.503857 +0000 UTC",
Expand All @@ -176,11 +176,11 @@
"record": true,
"record_file_format": "mp3",
"recording_callback_method": "GET",
"recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"recording_callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/c4ea0e4c-b3e7-47c3-a31c-79227ac6939c/",
"ring_timeout": 120,
"second_party": "919976106830",
"second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"second_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
"session_uuid": "c4ea0e4c-b3e7-47c3-a31c-79227ac6939c",
"status": "expired",
"total_call_amount": 0,
Expand All @@ -193,7 +193,7 @@
"amount": 0,
"call_time_limit": 14400,
"callback_method": "GET",
"callback_url": "http://plivobin.non-prod.plivops.com/w7mf5kw7",
"callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"created_time": "2023-06-30 06:39:06.742974 +0000 UTC",
"duration": 6000,
"expiry_time": "2023-06-30 06:39:16.99714 +0000 UTC",
Expand All @@ -206,11 +206,11 @@
"record": false,
"record_file_format": "mp3",
"recording_callback_method": "GET",
"recording_callback_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"recording_callback_url": "https://s3.amazonaws.com/static.plivo.com/callback.xml",
"resource_uri": "/v1/Account/MAZTQXZDYWNZBMMJAZZJ/Masking/Session/dd3bb3c2-4f18-4988-87f1-9116b00bb875/",
"ring_timeout": 120,
"second_party": "919976106830",
"second_party_play_url": "https://plivobin-prod-usw.plivops.com/api/v1/speak.xml",
"second_party_play_url": "https://s3.amazonaws.com/plivosamplexml/play_url.xml",
"session_uuid": "dd3bb3c2-4f18-4988-87f1-9116b00bb875",
"status": "expired",
"total_call_amount": 0,
Expand Down
4 changes: 2 additions & 2 deletions maskingsession_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ func TestMaskingSessionService_CreateMaskingSession_ForcePinAuthentication(t *te
SecondPartyPin: "2435",
PinRetry: 2,
PinRetryWait: 5,
PinPromptPlay: "https://plivobin-prod-usw.plivops.com/api/v1/speak.mp3",
PinPromptPlay: "https://s3.amazonaws.com/plivosamplexml/speak_url.xml",
UnknownCallerPlay: "",
IncorrectPinPlay: "https://plivobin-prod-usw.plivops.com/api/v1/speak.mp3",
IncorrectPinPlay: "https://s3.amazonaws.com/plivosamplexml/speak_url.xml",
ForcePinAuthentication: true,
})
if err != nil {
Expand Down
12 changes: 12 additions & 0 deletions xml/plivoxml.go
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,8 @@ type MultiPartyCallElement struct {
StartRecordingAudioMethod *string `xml:"StartRecordingAudioMethod,attr"`
StopRecordingAudio *string `xml:"StopRecordingAudio,attr"`
StopRecordingAudioMethod *string `xml:"StopRecordingAudioMethod,attr"`
Transcript *bool `xml:"transcript,attr"`
TranscriptionUrl *string `xml:"transcriptionUrl,attr"`
RecordParticipantTrack *bool `xml:"recordParticipantTrack,attr"`
}

Expand Down Expand Up @@ -1350,6 +1352,16 @@ func (e MultiPartyCallElement) SetStopRecordingAudioMethod(value string) MultiPa
return e
}

func (e MultiPartyCallElement) SetTranscript(value bool) MultiPartyCallElement {
e.Transcript = &value
return e
}

func (e MultiPartyCallElement) SetTranscriptionUrl(value string) MultiPartyCallElement {
e.TranscriptionUrl = &value
return e
}

func (e MultiPartyCallElement) AddContents(values ...interface{}) MultiPartyCallElement {
e.Contents = append(e.Contents, values)
return e
Expand Down
4 changes: 2 additions & 2 deletions xml/plivoxml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ func TestComplexXML(t *testing.T) {
}

func TestMPCXML(t *testing.T) {
assert.Equal(t, "<Response><MultiPartyCall role=\"agent\" maxDuration=\"14400\" maxParticipants=\"10\" recordMinMemberCount=\"1\" waitMusicMethod=\"GET\" waitTime=\"5\" agentHoldMusicMethod=\"GET\" customerHoldMusicMethod=\"GET\" record=\"false\" recordFileFormat=\"mp3\" recordingCallbackMethod=\"POST\" statusCallbackEvents=\"mpc-state-changes,participant-state-changes\" statusCallbackMethod=\"POST\" stayAlone=\"false\" coachMode=\"true\" mute=\"false\" hold=\"false\" startMpcOnEnter=\"true\" endMpcOnExit=\"false\" enterSound=\"beep:1\" enterSoundMethod=\"GET\" exitSound=\"beep:2\" exitSoundMethod=\"GET\" onExitActionMethod=\"POST\" relayDtmfInputs=\"false\" StartRecordingAudio=\"https://s3.amazonaws.com/plivocloud/music.mp3\" StartRecordingAudioMethod=\"GET\" StopRecordingAudio=\"https://s3.amazonaws.com/plivocloud/music.mp3\" StopRecordingAudioMethod=\"GET\">Nairobi</MultiPartyCall></Response>", ResponseElement{
assert.Equal(t, "<Response><MultiPartyCall role=\"agent\" maxDuration=\"14400\" maxParticipants=\"10\" recordMinMemberCount=\"1\" waitMusicMethod=\"GET\" waitTime=\"5\" agentHoldMusicMethod=\"GET\" customerHoldMusicMethod=\"GET\" record=\"false\" recordFileFormat=\"mp3\" recordingCallbackMethod=\"POST\" statusCallbackEvents=\"mpc-state-changes,participant-state-changes\" statusCallbackMethod=\"POST\" stayAlone=\"false\" coachMode=\"true\" mute=\"false\" hold=\"false\" startMpcOnEnter=\"true\" endMpcOnExit=\"false\" enterSound=\"beep:1\" enterSoundMethod=\"GET\" exitSound=\"beep:2\" exitSoundMethod=\"GET\" onExitActionMethod=\"POST\" relayDtmfInputs=\"false\" StartRecordingAudio=\"https://s3.amazonaws.com/plivocloud/music.mp3\" StartRecordingAudioMethod=\"GET\" StopRecordingAudio=\"https://s3.amazonaws.com/plivocloud/music.mp3\" StopRecordingAudioMethod=\"GET\" transcript=\"true\" transcriptionUrl=\"url\">Nairobi</MultiPartyCall></Response>", ResponseElement{
Contents: []interface{}{
new(MultiPartyCallElement).SetAgentHoldMusicMethod("GET").SetCoachMode(true).SetCustomerHoldMusicMethod("GET").SetEndMpcOnExit(false).SetEnterSound("beep:1").SetEnterSoundMethod("GET").SetExitSound("beep:2").SetExitSoundMethod("GET").SetHold(false).SetMaxDuration(14400).SetMaxParticipants(10).SetRecordMinMemberCount(1).SetMute(false).SetOnExitActionMethod("POST").SetRecord(false).SetRecordFileFormat("mp3").SetRecordingCallbackMethod("POST").SetRelayDtmfInputs(false).SetRole("agent").SetStartMpcOnEnter(true).SetStatusCallbackEvents("mpc-state-changes,participant-state-changes").SetStatusCallbackMethod("POST").SetStayAlone(false).SetWaitMusicMethod("GET").SetWaitTime(5).SetContents("Nairobi").SetStartRecordingAudio("https://s3.amazonaws.com/plivocloud/music.mp3").SetStartRecordingAudioMethod("GET").SetStopRecordingAudio("https://s3.amazonaws.com/plivocloud/music.mp3").SetStopRecordingAudioMethod("GET"),
new(MultiPartyCallElement).SetAgentHoldMusicMethod("GET").SetCoachMode(true).SetCustomerHoldMusicMethod("GET").SetEndMpcOnExit(false).SetEnterSound("beep:1").SetEnterSoundMethod("GET").SetExitSound("beep:2").SetExitSoundMethod("GET").SetHold(false).SetMaxDuration(14400).SetMaxParticipants(10).SetRecordMinMemberCount(1).SetMute(false).SetOnExitActionMethod("POST").SetRecord(false).SetRecordFileFormat("mp3").SetRecordingCallbackMethod("POST").SetRelayDtmfInputs(false).SetRole("agent").SetStartMpcOnEnter(true).SetStatusCallbackEvents("mpc-state-changes,participant-state-changes").SetStatusCallbackMethod("POST").SetStayAlone(false).SetWaitMusicMethod("GET").SetWaitTime(5).SetContents("Nairobi").SetStartRecordingAudio("https://s3.amazonaws.com/plivocloud/music.mp3").SetStartRecordingAudioMethod("GET").SetStopRecordingAudio("https://s3.amazonaws.com/plivocloud/music.mp3").SetStopRecordingAudioMethod("GET").SetTranscript(true).SetTranscriptionUrl("url"),
},
}.String())
}
Expand Down

0 comments on commit 4e4f4e8

Please sign in to comment.