sip_ua 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 66

dart-sip-ua #

A dart-lang version of the SIP UA stack, ported from JsSIP.

Overview #

  • Use pure dart-lang
  • SIP over WebSocket (use real SIP in your flutter/web apps)
  • Audio/video calls (flutter-webrtc) and instant messaging
  • Support with standard SIP servers such as OpenSIPS, Kamailio, Asterisk and FreeSWITCH.

Currently supported platforms #

  • [X] iOS
  • [X] Android
  • [X] Web
  • [X] macOS
  • [ ] Linux
  • [ ] Windows
  • [ ] Fuchsia

NOTE #

Thanks to the original authors of JsSIP for providing the JS version, which makes it possible to port the dart-lang.

Sponsors #

The first version was sponsored by Suretec Systems Ltd. T/A SureVoIP.

Contributing #

The project is inseparable from the contributors of the community.

License #

dart-sip-ua is released under the MIT license.

Changelog #

[0.1.0] - 2019.12.13

  • Initial release.

example/lib/main.dart

import 'dart:io';
import 'package:flutter/foundation.dart'
    show debugDefaultTargetPlatformOverride;

import 'package:flutter/material.dart';
import 'package:sip_ua/sip_ua.dart';
import 'package:flutter_webrtc/webrtc.dart';
import 'src/register.dart';
import 'src/dialpad.dart';
import 'src/callscreen.dart';
import 'src/about.dart';

void main() {
  if (WebRTC.platformIsDesktop)
    debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  final SIPUAHelper _helper = SIPUAHelper();
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        fontFamily: 'Roboto',
      ),
      initialRoute: '/',
      routes: {
        '/': (context) => DialPadWidget(_helper),
        '/register': (context) => RegisterWidget(_helper),
        '/callscreen': (context) => CallScreenWidget(_helper),
        '/about': (context) => AboutWidget(),
      },
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sip_ua: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sip_ua/sip_ua.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
66
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Mar 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-0.46 points)

108 out of 110 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/grammar_parser.dart. (-25 points)

Analysis of lib/src/grammar_parser.dart reported 689 hints, including:

line 60 col 38: Unnecessary new keyword.

line 60 col 76: Unnecessary new keyword.

line 336 col 27: The value of the field '_lookahead' isn't used.

line 734 col 13: Unnecessary new keyword.

line 764 col 21: Unnecessary new keyword.

Fix lib/src/rtc_session.dart. (-25 points)

Analysis of lib/src/rtc_session.dart reported 115 hints, including:

line 6 col 8: Unused import: '../sip_ua.dart'.

line 8 col 28: Use lowercase_with_underscores when specifying a library prefix.

line 10 col 29: Use lowercase_with_underscores when specifying a library prefix.

line 12 col 35: Use lowercase_with_underscores when specifying a library prefix.

line 14 col 35: Use lowercase_with_underscores when specifying a library prefix.

Fix lib/src/ua.dart. (-24.47 points)

Analysis of lib/src/ua.dart reported 56 hints, including:

line 1 col 8: Unused import: '../sip_ua.dart'.

line 4 col 28: Use lowercase_with_underscores when specifying a library prefix.

line 7 col 29: Use lowercase_with_underscores when specifying a library prefix.

line 9 col 25: Use lowercase_with_underscores when specifying a library prefix.

line 16 col 24: Use lowercase_with_underscores when specifying a library prefix.

Fix additional 35 files with analysis or formatting issues. (-136.94 points)

Additional issues in the following files:

  • lib/src/config.dart (46 hints)
  • lib/src/sip_message.dart (36 hints)
  • lib/src/utils.dart (21 hints)
  • lib/src/message.dart (17 hints)
  • lib/src/dialog.dart (13 hints)
  • lib/src/rtc_session/dtmf.dart (11 hints)
  • lib/src/transport.dart (11 hints)
  • lib/src/registrator.dart (10 hints)
  • lib/src/websocket_interface.dart (10 hints)
  • lib/src/parser.dart (9 hints)
  • lib/src/request_sender.dart (9 hints)
  • lib/src/uri.dart (9 hints)
  • lib/src/digest_authentication.dart (7 hints)
  • lib/src/event_manager/event_manager.dart (6 hints)
  • lib/src/name_addr_header.dart (6 hints)
  • lib/src/socket.dart (6 hints)
  • lib/src/transactions/invite_client.dart (6 hints)
  • lib/src/event_manager/internal_events.dart (5 hints)
  • lib/src/rtc_session/info.dart (5 hints)
  • lib/src/rtc_session/refer_subscriber.dart (5 hints)
  • lib/src/sanity_check.dart (5 hints)
  • lib/src/dialog/request_sender.dart (4 hints)
  • lib/src/timers.dart (4 hints)
  • lib/src/websocket_dart_impl.dart (4 hints)
  • lib/src/grammar.dart (3 hints)
  • lib/src/transactions/ack_client.dart (3 hints)
  • lib/src/transactions/invite_server.dart (3 hints)
  • lib/src/transactions/non_invite_server.dart (3 hints)
  • lib/src/sip_ua_helper.dart (2 hints)
  • lib/src/transactions/non_invite_client.dart (2 hints)
  • lib/src/exceptions.dart (1 hint)
  • lib/src/rtc_session/refer_notifier.dart (1 hint)
  • lib/src/transactions/transaction_base.dart (1 hint)
  • lib/src/transactions/transactions.dart (1 hint)
  • lib/src/websocket_web_impl.dart (1 hint)

Maintenance issues and suggestions

Support latest dependencies. (-30 points)

The version constraint in pubspec.yaml does not support the latest published versions for 3 dependencies (logger, random_string, recase).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
crypto ^2.1.2 2.1.4
flutter_webrtc ^0.2.2 0.2.7
intl ^0.16.0 0.16.1
logger ^0.7.0+2 0.7.0+2 0.8.3
parser_error ^0.1.1 0.1.1
path ^1.6.4 1.6.4
random_string ^1.1.0 1.1.0 2.0.1
recase ^2.0.1 2.0.1 3.0.0
sdp_transform ^0.2.0 0.2.0
uuid ^2.0.2 2.0.4
Transitive dependencies
charcode 1.1.3
collection 1.14.11 1.14.12
convert 2.1.1
flutter 0.0.0
lists 0.1.3
meta 1.1.8
sky_engine 0.0.99
text 0.1.1
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
test ^1.6.7