Skip to content

Commit 3129fae

Browse files
authored
Allow customisation of the call descriptor when transferring calls (#1161)
1 parent 4964200 commit 3129fae

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/app/SIPUserAgents/SIPUserAgent.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//-----------------------------------------------------------------------------
1+
//-----------------------------------------------------------------------------
22
// Filename: SIPUserAgent.cs
33
//
44
// Description: A "full" SIP user agent that encompasses both client and server
@@ -325,6 +325,15 @@ public SIPURI ContactURI
325325
/// </remarks>
326326
public event Func<SIPUserField, string, bool> OnTransferRequested;
327327

328+
/// <summary>
329+
/// Allows the call descriptor for the new call to be customised before a transfer.
330+
/// </summary>
331+
/// <remarks>
332+
/// SIPCallDescriptor: The call descriptor to be customised
333+
/// SIPRequest: The refer request that initialised the transfer
334+
/// </remarks>
335+
public event Action<SIPCallDescriptor, SIPRequest> OnTransferCallDescriptorCreated;
336+
328337
/// <summary>
329338
/// Fires when the call placed as a result of a transfer request is successfully answered.
330339
/// The SIPUserField contains the destination that was called for the transfer.
@@ -1218,6 +1227,8 @@ private void ProcessTransferRequest(SIPRequest referRequest)
12181227
null,
12191228
null);
12201229

1230+
OnTransferCallDescriptorCreated?.Invoke(callDescriptor, referRequest);
1231+
12211232
var transferResult = await Call(callDescriptor, MediaSession).ConfigureAwait(false);
12221233

12231234
logger.LogDebug($"Result of calling transfer destination {transferResult}.");

0 commit comments

Comments
 (0)