@@ -4,6 +4,7 @@ import { Info } from "./info";
4
4
import { Message } from "./message" ;
5
5
import { Notification } from "./notification" ;
6
6
import { Referral } from "./referral" ;
7
+ import { SessionDescriptionHandler } from "./session-description-handler" ;
7
8
8
9
/**
9
10
* Delegate for {@link Session}.
@@ -49,4 +50,31 @@ export interface SessionDelegate {
49
50
* @param referral - The referral.
50
51
*/
51
52
onRefer ?( referral : Referral ) : void ;
53
+
54
+ /**
55
+ * Called upon creating a SessionDescriptionHandler.
56
+ *
57
+ * @remarks
58
+ * It's recommended that the SessionDescriptionHandler be accessed via the `Session.sessionDescriptionHandler` property.
59
+ * However there are use cases where one needs access immediately after it is constructed and before it is utilized.
60
+ * Thus this callback.
61
+ *
62
+ * In most scenarios a single SessionDescriptionHandler will be created per Session
63
+ * in which case this callback will be called at most once and `provisional` will be `false`.
64
+ *
65
+ * However if reliable provisional responses are being supported and an INVITE is sent without SDP,
66
+ * one or more session description handlers will be created if remote offers are received in reliable provisional responses.
67
+ * When remote offers are received in reliable provisional responses, the `provisional` parameter will be `true`.
68
+ * When the `provisional` paramter is `true`, this callback may (or may not) be called again.
69
+ * If the session is ultimately established using a SessionDescriptionHandler which was not created provisionally,
70
+ * this callback will be called again and the `provisional` parameter will be `false`.
71
+ * If the session is ultimately established using a SessionDescriptionHandler which was created provisionally,
72
+ * this callback will not be called again.
73
+ * Note that if the session is ultimately established using a SessionDescriptionHandler which was created provisionally,
74
+ * the provisional SessionDescriptionHandler being utilized will be available via the `Session.sessionDescriptionHandler` property.
75
+ *
76
+ * @param sessionDescriptionHandler - The handler.
77
+ * @param provisional - True if created provisionally.
78
+ */
79
+ onSessionDescriptionHandler ?( sessionDescriptionHandler : SessionDescriptionHandler , provisional : boolean ) : void ;
52
80
}
0 commit comments