Skip to content

Commit 4b26059

Browse files
committed
use call type enum on gate requests, fix manualDialResult to parse string call_sid
1 parent a4e2b98 commit 4b26059

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

core/src/main/java/com/tcn/exile/models/ManualDialResult.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ public static ManualDialResult fromProto(DialResponse result) {
5959
default:
6060
throw new IllegalArgumentException("Invalid call type: " + result.getCallType());
6161
}
62-
return new ManualDialResult(result.getPhoneNumber(), result.getCallerId(), result.getCallSid(),
63-
callType, result.getOrgId(), result.getPartnerAgentId());
62+
try {
63+
return new ManualDialResult(result.getPhoneNumber(), result.getCallerId(), Long.parseLong(result.getCallSid()),
64+
callType, result.getOrgId(), result.getPartnerAgentId());
65+
} catch (NumberFormatException e) {
66+
throw new IllegalArgumentException("Invalid call_sid format: " + result.getCallSid(), e);
67+
}
6468
}
6569
}

protos/src/main/proto/tcnapi/exile/gate/v2/public.proto

+3-3
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ message StreamJobsResponse {
257257
string pool_id = 2; // ID of the pool containing the record
258258
string record_id = 3; // ID of the record to pop
259259
string call_sid = 4; // Session ID of the call
260-
string call_type = 5; // Type of call (inbound, outbound)
260+
CallType call_type = 5; // Type of call (inbound, outbound)
261261
// AlternateID (usually the caller_id)
262262
repeated tcnapi.exile.core.v2.Filter filters = 6;
263263
}
@@ -680,7 +680,7 @@ message DialRequest {
680680
message DialResponse {
681681
string phone_number = 1; // Phone number that was dialed
682682
string caller_id = 2; // Caller ID that was used
683-
int64 call_sid = 3; // Session ID for the call
683+
string call_sid = 3; // Session ID for the call
684684
CallType call_type = 4; // Type of call (inbound, outbound)
685685
string org_id = 5; // Organization ID making the call
686686
string partner_agent_id = 6; // Partner agent ID making the call
@@ -707,7 +707,7 @@ message GetAgentStatusResponse {
707707
* Message representing a party connected to an agent.
708708
*/
709709
message ConnectedParty {
710-
int64 call_sid = 1; // Session ID of the call
710+
string call_sid = 1; // Session ID of the call
711711
CallType call_type = 2; // Type of call (inbound, outbound)
712712
bool is_inbound = 3; // Whether this is an inbound call
713713
}

0 commit comments

Comments
 (0)