Skip to content

Commit f77f741

Browse files
committed
Add UnHandledResponse for registrationFailed.
1 parent b5a6ab1 commit f77f741

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/src/registrator.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ import 'logger.dart';
1414

1515
const MIN_REGISTER_EXPIRES = 10; // In seconds.
1616

17+
class UnHandledResponse {
18+
var status_code;
19+
var reason_phrase;
20+
UnHandledResponse(this.status_code, this.reason_phrase);
21+
}
22+
1723
class Registrator {
1824
UA _ua;
1925
Transport _transport;
@@ -127,11 +133,11 @@ class Registrator {
127133
EventManager localEventHandlers = EventManager();
128134
localEventHandlers.on(EventOnRequestTimeout(),
129135
(EventOnRequestTimeout value) {
130-
this._registrationFailure(null, DartSIP_C.causes.REQUEST_TIMEOUT);
136+
this._registrationFailure(UnHandledResponse(408, DartSIP_C.causes.REQUEST_TIMEOUT), DartSIP_C.causes.REQUEST_TIMEOUT);
131137
});
132138
localEventHandlers.on(EventOnTransportError(),
133139
(EventOnTransportError value) {
134-
this._registrationFailure(null, DartSIP_C.causes.CONNECTION_ERROR);
140+
this._registrationFailure(UnHandledResponse(500, DartSIP_C.causes.CONNECTION_ERROR), DartSIP_C.causes.CONNECTION_ERROR);
135141
});
136142
localEventHandlers.on(EventOnAuthenticated(), (EventOnAuthenticated value) {
137143
this._cseq += 1;

0 commit comments

Comments
 (0)