Git Product home page Git Product logo

nksip's Introduction

Introduction

NkSIP is an Erlang SIP framework or application server, which greatly facilitates the development of robust and scalable server-side SIP applications like proxy, registrar, redirect or outbound servers, B2BUAs, SBCs or load generators. NkSIP takes care of much of the SIP complexity, while allowing full access to requests and responses.

A single NkSIP instance can start any number of SIP Services, each one listening on a specific set of transports (udp, tcp, tls, sctp, ws or wss), ip addresses and ports. A Service can provide a callback module where it can implement a number of callback functions. All of them are optional, having sane defaults in case they are not implemented. For outgoing-only SIP applications, a callback module is not necessary.

NkSIP also includes a powerful plugin mechanism, that can be used to modify its behaviour without having to fully understand or modify the core engine, and with virtually zero overhead, even if the Service uses a large number of plugins.

NkSIP is very stable and robust. Thanks to its Erlang roots it can perform many actions while running: starting and stopping Services, hot code upgrades, configuration changes and even updating your application behavior, used plugins and function callbacks on the fly.

NkSIP scales automatically using all of the available cores on the machine. Using common hardware (4-core i7 MacMini), it is easy to get more than 3.000 call cycles (INVITE-ACK-BYE) or 10.000 registrations per second. A disributed, highly available version of NkSIP will be a service of the upcoming NetComposer platform.

Features

  • Full support for all curently defined SIP methods: INVITE, ACK, REGISTER, OPTIONS, INFO, UPDATE, PRACK, SUBSCRIBE, NOTIFY, REFER, PUBLISH and MESSAGE, as an UAC, an UAS or a Proxy.
  • Can be used to develop very easily any possible SIP application: endpoints, stateful proxies with serial and parallel forking, stateless proxies, B2BUAs, application servers, registrars, SBCs, load generators, etc.
  • Transports UDP, TCP, TLS, SCTP, WS and WSS (websockets) are available, all of them capable of handling thousands of simultaneous sessions.
  • Full SIP Event support.
  • A written from scratch, fully typed 100% Erlang code with few external dependencies.
  • Robust and highly scalable, using all available processor cores automatically.
  • More than 140 tests covering nearly all of the functionality.
  • Sophisticated plugin mechanism, that adds very low overhead to the core.
  • Hot, on-the-fly core and application configuration and code upgrades.
  • IPv6 support and IPv4 <-> IPv6 bridge.
  • Full support for NAPTR and SRV location, including priority and weights.
  • Dialog and SDP processing utility functions, including media start and stop detection.

Standard plugins

  • Digest Authentication.
  • Registrar Server and Automatic Registrations.
  • Event State Compositor.
  • Reliable provisional responses.
  • Session Timers
  • SIP REFER.
  • Outbound and GRUU.
  • Trace and Statistics.

Documentation

1. User Guide
2. Reference Guide
3. API Guide
4. Standard Plugins
5. Cookbook
6. Advanced Concepts
7. Roadmap
8. Changelog

Quick Start

NkSIP has been tested on OSX and Linux, using Erlang 21. It should work from Erlang 17, but it tested only on 21.

> git clone https://github.com/kalta/nksip
> cd nksip
> make
> make tests

Now you can start a simple Service using the included default callback module:

> make shell
1> nksip:start(test, #{sip_listen=>"sip:all, sips:all"}).
{ok,b746wle}
2> nksip_uac:options(test1, "sip:sip2sip.info", []).
{ok,200,[]}

You can check now the tutorial and sample applications on nksip_samples.

Contributing

Please contribute with code, bug fixes, documentation fixes, testing with SIP devices or any other form. Use GitHub Issues and Pull Requests, forking this repository.

nksip's People

Contributors

2b-as avatar altrg avatar benlangfeld avatar danielwhite avatar fjoanis avatar jbgledy avatar kalta avatar leokudrik avatar philipstears avatar rumataestor avatar schlagert avatar surik avatar toharish avatar ttlr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nksip's Issues

Create a DNS manager server

  • Avoid DNS lookups. After resolving the first time, store the value and return it next time. After a time, mark it as invalid, if it is necessary again return the stored one but request it agin
  • Be able to load balance in case of multiple records, SRVs and NAPTRs

Calling using the pbx service

When i register two clients and try to make a call, the call doesnt go through and is put on hold. The SDP packets dont seem to be right either. Do I need to setup a B2BUA to make the call? SHouldnt a peer to peer call be possible using only the registrar and proxy?

B2BUA Support?

Does NkSIP support B2BUA?
If no, any ideas about implementation or even any example?

Would love to read more in the Cookbook

Hi,

I've been playing with nksip, working through the tutorial, and pbx. I would like to know more, especially what is referenced under the 'cookbook'. Are you planning to update this?

Thanks.

nksip as proxy for webrtc will route

there are two webrtc clients ,nksip used as registrator and also proxy.
the registration to nksip server is ok.
the register message's contact field is just like
Contact: sip:[email protected];transport=ws
;reg-id=1
;+sip.instance="urn:uuid:f81-7dec-14a06cf1"

when A invite B, the nk_register:find will return the registered contact address that can't work (host will be XXXX.invalid). we can use reg_contact record 's nkport to patch this. but when the Invite message‘s ACK message returns, the ACK's request line's UserName and Domain will be Contact's record,and nk_resigter:find will return empty.

the tricky solution is to use nk_register:get_all and search for the right tcp address and port.
the get_all will return an array like below:

    % {armejl7,{sip,<<"aliceQ8wdGvtPgwPDjwFMPyfv8QnzMMZrJIur">>,<<"dev.com.cn">>},
    %     [{reg_contact,
    %          {sip,ws,<<"o4qjt1bm">>,<<"kscovdpk9644.invalid">>,80},
    %          {uri,sip,<<"o4qjt1bm">>,<<>>,
    %              <<"kscovdpk9644.invalid">>,0,<<>>,
    %              [{<<"transport">>,<<"ws">>}],
    %              [],
    %              [<<"+sip.ice">>,
    %               {<<"reg-id">>,<<"1">>},
    %               {<<"+sip.instance">>,
    %                <<"\"<urn:uuid:8d880923-9185-44d1-acdd-76447fd590b4>\"">>},
    %               {<<"expires">>,<<"600">>}],
    %              [],<<>>},
    %          1466146473713000,1466147073,1.0,
    %          <<"0g88hb601851ghie72q9k8">>,1,
    %          {nkport,
    %              {nksip,armejl7},
    %              nksip_protocol,wss,
    %              {0,0,0,0},
    %              10001,
    %              {10,17,41,13},
    %              56987,
    %              {0,0,0,0},
    %              10001,<0.413.0>,<0.412.0>,
    %              #{ws_proto => <<"sip">>}},
    %          [],[]}]}

the real port and wss will be used to fill the uri ,{proxy,uri} will make the message to be routed correctly,but the whole step is ugly,isn't it?
is there any formal solution to solve this webrtc client's bad contact address question?

sip_route(Scheme, User, Domain, Req, _Call) ->
    {ok,SrvId}=nksip_request:srv_id(Req),
    {ok,Method}=nksip_request:meta(method,Req),
    io:format("sip_route scheme ~p user ~p domain ~p method ~p~n",
        [Scheme, User, Domain,Method]),
    %io:format("sip_route Req:[~p]~n",[Req]),
    if
        Method =:= 'REGISTER' ->
            process;
        true ->
            io:format("not register, find ~p ~p ~p~n",[Scheme, User,Domain]),
            Trans=lists:foldr(
                fun( X ,Acc)->
                    { _ ,{XScheme,XUser,XDomain},[#reg_contact{
                        contact=#uri{scheme=YScheme,user=YUser,domain=YDomain}
                        ,nkport=NkPort}|_]} = X,
                    if
                        XScheme=:=Scheme andalso XUser=:=User andalso XDomain=:=Domain->
                            Acc++[ { {XScheme,XUser,XDomain},NkPort}];
                        Scheme=:=YScheme andalso YUser=:=User andalso YDomain=:=Domain->
                            Acc++[{ {XScheme,XUser,XDomain},NkPort}];
                        true->
                            Acc
                    end
                end,[],nksip_registrar_util:get_all()),
            if
                length(Trans)>0 ->
                    { {ZScheme,ZUser,ZDomain},
                        #nkport{remote_ip=RemoteIp,remote_port=RemotePort,transp=Transp}}=
                            lists:nth(1,Trans),
                    Uri=#uri{ scheme=ZScheme ,user=ZUser,
                        domain =ZDomain , port = RemotePort,
                        opts = [{<<"transport">>,
                            list_to_binary(atom_to_list(Transp))}]  },
                    %list_to_binary(inet:ntoa(RemoteIp))
                    io:format("last Uri  ~p~n",[Uri]),
                    {proxy,Uri};
                true ->{reply, temporarily_unavailable}
            end
    end.

Remove 'data' field from '#sipmsg{}'

This is currently used only for two things:

  • storing the 'to tag candidate' when a new request arrives without to tag
  • storing the reason phrase for responses.

It makes sense to remove this parameters, and add a new one called 'to_tag_candidate'. Reason phrase should be stored in the 'class' parameter.

Call server processes not under supervision

Hi,

I was just wondering why call processes are not showing up in the nksip supervision tree e.g. when using observer. After browsing the source I found out that nksip_call_srv processes are started unsupervised using gen_server:start/3. Is there any special reason for that?

If there is a reason for that (and I'm assuming there is), this could be worth mentioning in the otherwise great documentation. Besides not showing up in monitoring tools having unsupervised processes has the disadvantage that these processes will not be shutdown when the nksip application or the respective sipapp gets stopped.

Regards
Tobias

nksip:update/2 doesn't work

when I start
$make shell
then
nksip:start(server, #{sip_local_host => "172.21.252.31", sip_from => "sip:172.21.252.31", plugins => [nksip_uac_auto_auth, nksip_uac_auto_register, nksip_registrar, nksip_100rel], transports => "sip:172.21.252.31:5060"}).

after that in the other console I change src/nksip_callbacks.erl
$make

In previous console
nksip:update(server, []).
But callback functions don't change.

Is it normal?

Tutorial seems broken

Hello Carlos González,

Thank you for your project.

I have installed nksip from scratch.
Ubuntu 16.04 LTS
Branch develop
commit b20f161

I go through the https://github.com/NetComposer/nksip/blob/master/doc/guide/tutorial.md

ogo@ubuntu64:~/src/nksip$ make tutorial
...
erl -config samples/nksip_tutorial/priv/app.config
-args_file samples/nksip_tutorial/priv/vm.args
Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]

Eshell V6.4 (abort with ^G)
([email protected])1> nksip:start(server, #{
([email protected])1> sip_local_host => "localhost",
([email protected])1> callback => nksip_tutorial_server_callbacks,
([email protected])1> plugins => [nksip_registrar],
([email protected])1> transports => "sip:all:5060, sip:all:5061;transport=tls"
([email protected])1> }).
{ok,armejl7}
([email protected])2> nksip:start(client1, #{
([email protected])2> sip_local_host => "localhost",
([email protected])2> sip_from => "sip:client1@nksip",
([email protected])2> callback => nksip_tutorial_client_callbacks,
([email protected])2> plugins => [nksip_uac_auto_auth],
([email protected])2> transports => "sip:127.0.0.1:5070, sips:127.0.0.1:5071"
([email protected])2> }).
14:22:20.502 [warning] lager_error_logger_h dropped 49 messages in the last second that exceeded the limit of 50 messages/sec
14:22:20.502 [notice] gen_tcp port 5060 is in use, waiting (5)
14:22:21.503 [notice] gen_tcp port 5060 is in use, waiting (4)
14:22:22.504 [notice] gen_tcp port 5060 is in use, waiting (3)
14:22:23.505 [notice] gen_tcp port 5060 is in use, waiting (2)
14:22:24.506 [notice] gen_tcp port 5060 is in use, waiting (1)
{error,{transport_error,{could_not_start,{udp,could_not_open_tcp}}}}
([email protected])3> 14:22:25.507 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
14:22:25.507 [warning] UDP transport could not open TCP port 5060: eaddrinuse
14:22:25.507 [error] could not start UDP transport on {0,0,0,0}:0 (could_not_open_tcp)
14:22:25.507 [error] CRASH REPORT Process <0.286.0> with 0 neighbours exited with reason: eaddrinuse in gen_server:init_it/6 line 322
14:22:25.508 [error] CRASH REPORT Process <0.285.0> with 0 neighbours exited with reason: could_not_open_tcp in gen_server:init_it/6 line 322
14:22:25.508 [error] CRASH REPORT Process <0.284.0> with 0 neighbours exited with reason: {transport_error,{could_not_start,{udp,could_not_open_tcp}}} in gen_server:init_it/6 line 322
14:22:25.509 [error] Supervisor {<0.282.0>,nkservice_srv_sup} had child server started with nkservice_srv:start_link(#{callback => nksip_tutorial_client_callbacks,class => nksip,config => #{sip_from => {uri,sip,...},...},...}) at undefined exit with reason {transport_error,{could_not_start,{udp,could_not_open_tcp}}} in context start_error

Why client starts on 5060, instead 5070?

How to send BYE from callback function

Hello,

Not an issue, just a question:

I use the following code to perform INVITE request:

nksip_uac:invite(Instance, To, [{callback, F}, {add, <<"Session-Expires">>, <<"1800;refresher=uac">>}, {body, nksip_sdp:new(<<"auto.nksip">>, Codecs)}])

Where F in callback option is

 F = fun
        ({resp, 180, Resp, _Call}) -> %% 180: Ringing
        %% Here I need send BYE request
 end,

I tried to use the following inside F function

{ok, Id} = nksip_response:meta(dialog_handle, Resp),
nksip_uac:bye(Id, []);

But got

error sending work {send_dialog,<<"1gnl6P">>,'BYE',[]}: looped_process

Should I extract the dialog_handle from _Call ? Or how to do that in correct way?

Thank you.

uuid_* files are not removed after nksip:stop/1

I use nksip as a SIP client, for each outgoing call I start separate instance via nksip:start/4, after that do an INVITE request and stop this instance using nksip:stop/1.

During nksip:start/4 nksip creates the uuid_* file and after stopping do not delete it.

Is it normal?

need better control of proxy flow

Hi,
i've been testing nksip to work as a proxy in front of some freeswitch servers and make it round-robin the request to these servers.
i can route the calls from phones to freeswitch and back. i used a association table to properly deal with authorization asked by freeswitch.

i now have a situation where A calls B and C wants to pickup the call.
A -> NKSIP -> FS1 -> NKSIP -> B
the problem is that the call that C makes goes into a different freeswitch (as it should ) and freeswitch replies with 302 Moved Temporarely and a header X-Redirect-Server
C -> NKSIP -> FS2 -> NKSIP (302 X-Redirect-Server).

follow_redirects option doesn't work because FS2 doesn't touch the headers (only adds X-Redirect-Server)
AFAIK, i don't have a way to control this, redirect or fork the call.
i need to receive the 302 message, remove the X-Redirect-Server header, associate the call with the new server and tell nksip to retry to the new server.
any hints ?

it would be great to have nksip_sipapp extend to support these flows.

thanks

Is this project still alive ?

Hello,

Is this project still alive ? I saw some PR's without any feedback and not too much activity in the last year here.

Silviu

A way to distinguish between invalid digest and expired nonce

I've stuck trying to implement my_sipapp:sip_authorize/3 callback. I need to return 403 code if there are invalid digest/credentials and 407 code it there is expired nonce in the request. But there are {digest, Realm} = false for both cases and no chances to determine why nksip_auth:get_authentication/2 has rejected the digest. Could you please point me to the right direction?
Thank you.

error calling send_work_sync (send)

Got the following error during INVITE request:

 error calling send_work_sync (send): {timeout,{gen_server,call,[nksip_call_router_4...

I've checked the nksip_call_router.erl and found what SYNC_TIMEOUT has value 10 seconds. Is it possible to make this option configurable?

exit with 'noproc' when call nksip_tutorial:launch()

Hello everyone:

I just want to try a erlang sip client and found this one, its good. But when i tried this with nksip_tutorial.erl in '/path/to/nksip/samples/nksip_tutorial', i got this error:

2> nksip_tutorial:launch().
** exception exit: {noproc,{gen_server,call,
[nksip_sipapp_sup,
{start_child,{server,{nksip_sipapp_sup,start_link,
[server,nksip_tutorial_sipapp_server,
[server],
[{from,{uri,<<""NkSIP App" ">>,sip,<<"user">>,<<>>,
<<"nksip">>,0,[],...}},
{transports,[{udp,{0,0,0,0},5060},{tls,{0,0,0,...},5061}]},
{certfile,"/root/erlproj/nksip/priv/cert.pem"},
{keyfile,"/root/erlproj/nksip/priv/key.pem"},
registrar]]},
permanent,infinity,supervisor,
[nksip_sipapp_sup]}},
infinity]}}
in function gen_server:call/3 (gen_server.erl, line 188)
in call from nksip_sup:start_core/4 (src/nksip_sup.erl, line 40)
in call from nksip:start/4 (src/nksip.erl, line 460)
in call from nksip_tutorial:launch/0 (src/nksip_tutorial.erl, line 31)


What i need to do? any help would be apprecciated.

extend the life of nonce when register succeeds

most sip phones when register succeeds keep the authorization header and callid and send it again when they re-register. the problem is that the nonce has expired and the phone gets a new proxy-authorization.

i managed to extend the life of nonce by manipulating nksip_store directly on successful registers to avoid extra bonces.

what are the risks that i'm taking here ? (IP/Port/callid) are identical

thanks

Update Cowboy to 1.0

Hi, any plans to update Cowboy to 1.0? This would make nksip compatible as a dep with erlang.mk.

make tests warning and failure on Ubuntu

While make tests, there is a Waring as:
==> nksip (eunit)
src/nksip_protocol.erl:24: Warning: behaviour nkpacket_protocol undefined

And got Error as following:
=INFO REPORT==== 24-Dec-2015::18:02:45 ===
application: nkpacket
exited: {bad_return,
{{nkpacket_app,start,[normal,[]]},
{'EXIT',
{undef,
[{maps,get,
[included_applications,
#{connect_timeout => nat_integer,
dns_cache_ttl => {integer,0,none},
http_timeout => nat_integer,
max_connections => {integer,1,1000000},
sctp_in_streams => nat_integer,
sctp_out_streams => nat_integer,
sctp_timeout => nat_integer,
tcp_timeout => nat_integer,
tls_cacertfile => string,
tls_certfile => string,
tls_depth => {integer,0,16},
tls_keyfile => string,
tls_password => string,
tls_verify => boolean,
tls_versions => {list,atom},
udp_timeout => nat_integer,
ws_timeout => nat_integer},
not_found],
[]},
{nklib_config,find_config,7,
[{file,"src/nklib_config.erl"},{line,376}]},
{nklib_config,parse_config,3,
[{file,"src/nklib_config.erl"},{line,190}]},
{nklib_config,load_env,3,
[{file,"src/nklib_config.erl"},{line,206}]},
{nkpacket_app,start,2,
[{file,"src/nkpacket_app.erl"},{line,58}]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},
{line,272}]}]}}}}
type: permanent
{error_logger,{{2015,12,24},{18,2,46}},"sn",["Error in process <0.3979.0> with exit value: {terminated,[{io,format,[<0.24.0>,"Internal error: ~P.\n",[{error,terminated,[{io,format,[<0.24.0>,"~s\n",[<<20 bytes>>]],[]},{eunit_tty,handle_cancel,3,[{file,"eunit_tty.erl"},{line,159}]},{eunit_listener,call,3,[{file,"eunit_listener.erl"},{line,131}]},{eunit_listener... \n"]}
{"Kernel pid terminated",application_controller,"{application_start_failure,nkpacket,{bad_return,{{nkpacket_app,start,[normal,[]]},{'EXIT',{undef,[{maps,get,[included_applications,#{connect_timeout => nat_integer,dns_cache_ttl => {integer,0,none},http_timeout => nat_integer,max_connections => {integer,1,1000000},sctp_in_streams => nat_integer,sctp_out_streams => nat_integer,sctp_timeout => nat_integer,tcp_timeout => nat_integer,tls_cacertfile => string,tls_certfile => string,tls_depth => {integer,0,16},tls_keyfile => string,tls_password => string,tls_verify => boolean,tls_versions => {list,atom},udp_timeout => nat_integer,ws_timeout => nat_integer},not_found],[]},{nklib_config,find_config,7,[{file,"src/nklib_config.erl"},{line,376}]},{nklib_config,parse_config,3,[{file,"src/nklib_config.erl"},{line,190}]},{nklib_config,load_env,3,[{file,"src/nklib_config.erl"},{line,206}]},{nkpacket_app,start,2,[{file,"src/nkpacket_app.erl"},{line,58}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,272}]}]}}}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,nkpacket,{bad_return,{{nkpacket_app,start,[normal,[]]},{'EXIT',{undef,[{maps,get,[included_applications,#{connect_timeout =
make: *** [eunit] Error 1

make tests on centos6.4 failed,and I don't know why the port 5060 is in use. ( I use 'netstat -ano|grep 5060' to view before the test).

test/torture1_test.erl:34:<0.3982.0>: Starting torture1_test
test/refer_test.erl:66:<0.3982.0>: Starting refer_test
10:17:16.630 [notice] gen_tcp port 5060 is in use, waiting (5)
10:17:17.631 [notice] gen_tcp port 5060 is in use, waiting (4)
10:17:18.632 [notice] gen_tcp port 5060 is in use, waiting (3)
10:17:19.633 [notice] gen_tcp port 5060 is in use, waiting (2)
10:17:20.634 [notice] gen_tcp port 5060 is in use, waiting (1)
10:17:21.635 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:17:21.635 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:17:21.635 [error] could not start UDP transport on {0,0,0,0}:0 (could_not_open_tcp)
module 'path_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from path_test:start/0 (test/path_test.erl, line 66)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,bjtrl8g,
{nkservice_service_sup,start_link,
[#{cache => #{log_level => 6},
callback => path_test,
class => nksip,
id => bjtrl8g,
log_level => 6,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

10:17:21.845 [notice] gen_tcp port 5060 is in use, waiting (5)
10:17:22.846 [notice] gen_tcp port 5060 is in use, waiting (4)
10:17:23.847 [notice] gen_tcp port 5060 is in use, waiting (3)
10:17:24.848 [notice] gen_tcp port 5060 is in use, waiting (2)
10:17:25.849 [notice] gen_tcp port 5060 is in use, waiting (1)
10:17:26.850 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:17:26.850 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:17:26.850 [error] could not start UDP transport on {0,0,0,0}:5060 (could_not_open_tcp)
module 'invite_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from invite_test:start/0 (test/invite_test.erl, line 48)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,b3finlv,
{nkservice_service_sup,start_link,
[#{cache => #{log_level => 6},
callback => invite_test,
class => nksip,
id => b3finlv,
log_level => 6,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

module 'outbound_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from outbound_test:start/0 (test/outbound_test.erl, line 50)
*_error:{badmatch,{error,already_started}}

10:17:27.055 [notice] gen_tcp port 5060 is in use, waiting (5)
10:17:28.056 [notice] gen_tcp port 5060 is in use, waiting (4)
10:17:29.057 [notice] gen_tcp port 5060 is in use, waiting (3)
10:17:30.058 [notice] gen_tcp port 5060 is in use, waiting (2)
10:17:31.059 [notice] gen_tcp port 5060 is in use, waiting (1)
10:17:32.060 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:17:32.060 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:17:32.060 [error] could not start UDP transport on {0,0,0,0}:5060 (could_not_open_tcp)
module 'gruu_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from gruu_test:start/0 (test/gruu_test.erl, line 45)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,a2ucfiu,
{nkservice_service_sup,start_link,
[#{cache => #{log_level => 6},
callback => gruu_test,
class => nksip,
id => a2ucfiu,
log_level => 6,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

10:17:32.312 [notice] gen_tcp port 5060 is in use, waiting (5)
10:17:33.313 [notice] gen_tcp port 5060 is in use, waiting (4)
10:17:34.314 [notice] gen_tcp port 5060 is in use, waiting (3)
10:17:35.315 [notice] gen_tcp port 5060 is in use, waiting (2)
10:17:36.316 [notice] gen_tcp port 5060 is in use, waiting (1)
10:17:37.317 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:17:37.317 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:17:37.317 [error] could not start UDP transport on {0,0,0,0}:5060 (could_not_open_tcp)
module 'publish_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from publish_test:start/0 (test/publish_test.erl, line 44)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,b3finlv,
{nkservice_service_sup,start_link,
[#{cache => #{log_level => 6},
callback => publish_test,
class => nksip,
id => b3finlv,
log_level => 6,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

10:17:37.574 [notice] gen_tcp port 5060 is in use, waiting (5)
10:17:38.575 [notice] gen_tcp port 5060 is in use, waiting (4)
10:17:39.576 [notice] gen_tcp port 5060 is in use, waiting (3)
10:17:40.577 [notice] gen_tcp port 5060 is in use, waiting (2)
10:17:41.578 [notice] gen_tcp port 5060 is in use, waiting (1)
10:17:42.579 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:17:42.579 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:17:42.579 [error] could not start UDP transport on {0,0,0,0}:5060 (could_not_open_tcp)
module 'prack_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from prack_test:start/0 (test/prack_test.erl, line 51)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,b3finlv,
{nkservice_service_sup,start_link,
[#{cache => #{log_level => 6},
callback => prack_test,
class => nksip,
id => b3finlv,
log_level => 6,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

10:17:42.742 [notice] gen_tcp port 5060 is in use, waiting (5)
10:17:43.743 [notice] gen_tcp port 5060 is in use, waiting (4)
10:17:44.744 [notice] gen_tcp port 5060 is in use, waiting (3)
10:17:45.745 [notice] gen_tcp port 5060 is in use, waiting (2)
10:17:46.746 [notice] gen_tcp port 5060 is in use, waiting (1)
10:17:47.747 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:17:47.747 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:17:47.747 [error] could not start UDP transport on {0,0,0,0}:5060 (could_not_open_tcp)
module 'uas_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from uas_test:start/0 (test/uas_test.erl, line 47)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,a2ucfiu,
{nkservice_service_sup,start_link,
[#{cache => #{log_level => 6},
callback => uas_test,
class => nksip,
id => a2ucfiu,
log_level => 6,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

10:17:48.862 [notice] gen_tcp port 5060 is in use, waiting (5)
10:17:49.863 [notice] gen_tcp port 5060 is in use, waiting (4)
10:17:50.864 [notice] gen_tcp port 5060 is in use, waiting (3)
10:17:51.865 [notice] gen_tcp port 5060 is in use, waiting (2)
10:17:52.866 [notice] gen_tcp port 5060 is in use, waiting (1)
10:17:53.867 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:17:53.867 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:17:53.867 [error] could not start UDP transport on {0,0,0,0}:0 (could_not_open_tcp)
module 'basic_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from basic_test:start/0 (test/basic_test.erl, line 76)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,ayr8ncm,
{nkservice_service_sup,start_link,
[#{arg => client2,
cache => #{log_level => 6},
callback => basic_test,
class => nksip,
id => ayr8ncm,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

module 'ipv6_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from ipv6_test:start/0 (test/ipv6_test.erl, line 65)
*_error:{badmatch,{error,already_started}}

module 'basic2_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from basic2_test:start/0 (test/basic2_test.erl, line 46)
*_error:{badmatch,{error,already_started}}

undefined
*** context setup failed ***
*in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from proxy_test:start/1 (test/proxy_test.erl, line 74)
in call from proxy_test:'-stateless_test
/0-fun-0-'/0 (test/proxy_test.erl, line 35)
*_error:{badmatch,{error,already_started}}

undefined
*** context setup failed ***
*in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from proxy_test:start/1 (test/proxy_test.erl, line 74)
in call from proxy_test:'-stateful_test
/0-fun-0-'/0 (test/proxy_test.erl, line 54)
*_error:{badmatch,{error,already_started}}

module 'register_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from register_test:start/0 (test/register_test.erl, line 48)
*_error:{badmatch,{error,already_started}}

module 'uac_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from uac_test:start/0 (test/uac_test.erl, line 47)
*_error:{badmatch,{error,already_started}}

module 'websocket_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from websocket_test:start/0 (test/websocket_test.erl, line 64)
*_error:{badmatch,{error,already_started}}

module 'torture2_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from torture2_test:start/0 (test/torture2_test.erl, line 64)
*_error:{badmatch,{error,already_started}}

module 'update_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from update_test:start/0 (test/update_test.erl, line 44)
*_error:{badmatch,{error,already_started}}

test/sctp_test.erl:44:<0.3982.0>: Skipping SCTP test (no Erlang support)
test/sctp_test.erl:44:<0.3982.0>: Skipping SCTP test (no Erlang support)
10:17:54.944 [notice] gen_tcp port 5060 is in use, waiting (5)
10:17:55.945 [notice] gen_tcp port 5060 is in use, waiting (4)
10:17:56.946 [notice] gen_tcp port 5060 is in use, waiting (3)
10:17:57.947 [notice] gen_tcp port 5060 is in use, waiting (2)
10:17:58.948 [notice] gen_tcp port 5060 is in use, waiting (1)
10:17:59.949 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:17:59.949 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:17:59.949 [error] could not start UDP transport on {0,0,0,0}:5060 (could_not_open_tcp)
module 'timer_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from timer_test:start/0 (test/timer_test.erl, line 43)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,bwrqsly,
{nkservice_service_sup,start_link,
[#{cache => #{log_level => 6},
callback => timer_test,
class => nksip,
id => bwrqsly,
log_level => 6,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

10:18:00.247 [notice] gen_tcp port 5060 is in use, waiting (5)
10:18:01.248 [notice] gen_tcp port 5060 is in use, waiting (4)
10:18:02.249 [notice] gen_tcp port 5060 is in use, waiting (3)
10:18:03.250 [notice] gen_tcp port 5060 is in use, waiting (2)
10:18:04.251 [notice] gen_tcp port 5060 is in use, waiting (1)
10:18:05.252 [error] could not start tcp transport on {0,0,0,0}:5060 (eaddrinuse)
10:18:05.252 [warning] UDP transport could not open TCP port 5060: eaddrinuse
10:18:05.252 [error] could not start UDP transport on {0,0,0,0}:5060 (could_not_open_tcp)
module 'fork_test'
*** context setup failed ***
*_in function fork_test:start/0 (test/fork_test.erl, line 51)
*_error:{badmatch,
{error,
{{shutdown,
{failed_to_start_child,transports,
{could_not_start,{udp,could_not_open_tcp}}}},
{child,undefined,b0qvimk,
{nkservice_service_sup,start_link,
[#{cache => #{log_level => 6},
callback => fork_test,
class => nksip,
id => b0qvimk,
log_level => 6,...}]},
permanent,infinity,supervisor,
[nkservice_service_sup]}}}}

module 'event_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from event_test:start/0 (test/event_test.erl, line 48)
*_error:{badmatch,{error,already_started}}

module 'torture3_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from torture3_test:start/0 (test/torture3_test.erl, line 62)
*_error:{badmatch,{error,already_started}}

module 'auth_test'
*** context setup failed ***
*_in function tests_util:start/3 (test/tests_util.erl, line 46)
in call from auth_test:start/0 (test/auth_test.erl, line 45)
*_error:{badmatch,{error,already_started}}

Failed: 0. Skipped: 0. Passed: 24.
One or more tests were cancelled.
Cover analysis: /opt/nksip/.eunit/index.html
Coverdata export: /opt/nksip/.eunit/eunit.coverdata

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: gun
exited: stopped
type: permanent
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,b3finlv},nksip_protocol,udp,{0,0,0,0},5070,undefined,undefined,{0,0,0,0},5070,<0.5712.0>,#Port<0.157746>,#{}}]
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,a2ucfiu},nksip_protocol,tcp,{0,0,0,0},5060,undefined,undefined,{0,0,0,0},5060,<0.5588.0>,#Port<0.156263>,#{}}]
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,a2ucfiu},nksip_protocol,udp,{0,0,0,0},5060,undefined,undefined,{0,0,0,0},5060,<0.5587.0>,#Port<0.156262>,#{}}]
10:18:24.370 [notice] Module nkservice_callbacks received unexpected info {'EXIT',<0.4068.0>,shutdown}
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,b3finlv},nksip_protocol,tcp,{0,0,0,0},5070,undefined,undefined,{0,0,0,0},5070,<0.5713.0>,#Port<0.157747>,#{}}]

=ERROR REPORT==== 28-Mar-2016::10:18:24 ===
** Generic server b3finlv terminating
** Last message in was {'EXIT',<0.4068.0>,shutdown}
** When Server state == {state,b3finlv,#{id => b3finlv,my_name => client1}}
** Reason for termination ==
** {function_clause,
[{basic_test,handle_info,
[{'EXIT',<0.4068.0>,shutdown},#{id => b3finlv,my_name => client1}],
[{file,"test/basic_test.erl"},{line,289}]},
{b3finlv,handle_info,2,[]},
{nklib_gen_server,handle_info,4,
[{file,"src/nklib_gen_server.erl"},{line,108}]},
{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,593}]},
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,659}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,afrj6f1},nksip_protocol,ws,{0,0,0,0},8090,undefined,undefined,{0,0,0,0},8090,<0.5960.0>,<0.5961.0>,#{ws_proto => <<"sip">>}}]
10:18:24.370 [warning] Module nkpacket_cowboy received unexpected info: {'EXIT',<0.4068.0>,shutdown}
10:18:24.370 [warning] Module nkpacket_cowboy received unexpected info: {'EXIT',<0.4068.0>,shutdown}
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,afrj6f1},nksip_protocol,wss,{0,0,0,0},8091,undefined,undefined,{0,0,0,0},8091,<0.6065.0>,<0.6066.0>,#{ws_proto => <<"sip">>}}]
10:18:24.370 [warning] Module nkpacket_cowboy received unexpected info: {'EXIT',<0.4068.0>,shutdown}
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,afrj6f1},nksip_protocol,ws,{0,0,0,0},32781,undefined,undefined,{0,0,0,0},32781,<0.6171.0>,<0.6172.0>,#{path => <<"/ws">>,ws_proto => <<"sip">>}}]
10:18:24.370 [warning] Module nkpacket_cowboy received unexpected info: {'EXIT',<0.4068.0>,shutdown}
10:18:24.370 [notice] Module nkservice_callbacks received unexpected info {'EXIT',<0.4068.0>,shutdown}
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,ax81sua},nksip_protocol,wss,{0,0,0,0},8092,undefined,undefined,{0,0,0,0},8092,<0.6282.0>,<0.6283.0>,#{path => <<"/ws">>,ws_proto => <<"sip">>}}]
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,ax81sua},nksip_protocol,ws,{0,0,0,0},8090,undefined,undefined,{0,0,0,0},8090,<0.6281.0>,<0.5961.0>,#{ws_proto => <<"sip">>}}]
10:18:24.370 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,a2ucfiu},nksip_protocol,tls,{0,0,0,0},5061,undefined,undefined,{0,0,0,0},5061,<0.5602.0>,{sslsocket,nil,{#Port<0.156264>,{config,{ssl_options,tls,[{3,3},{3,2},{3,1}],verify_none,{#Fun<ssl.7.125280099>,[]},#Fun<ssl.8.125280099>,false,false,undefined,1,<<"/opt/nksip/deps/nkpacket/priv/cert.pem">>,undefined,<<"/opt/nksip/deps/nkpacket/priv/key.pem">>,undefined,[],undefined,<<>>,undefined,undefined,undefined,undefined,undefined,[<<"ᄂ">>,<<"ᄄ">>,<<"ᆭ">>,<<"ᆰ">>,<<0,107>>,<<0,106>>,<<0,61>>,<<"ᆪ">>,<<"ᄃ">>,<<"ᆬ">>,<<"ᄅ">>,<<0,103>>,<<0,64>>,<<0,60>>,<<"ᅵn">>,<<192,20>>,<<0,57>>,<<0,56>>,<<192,5>>,<<192,15>>,<<0,53>>,<<"ᅵb">>,<<192,18>>,<<0,22>>,<<0,19>>,<<192,3>>,<<"ᅵr">>,<<0,10>>,<<"ᅵt">>,<<192,19>>,<<0,51>>,<<0,50>>,<<192,4>>,<<192,14>>,<<0,47>>,<<192,7>>,<<192,17>>,<<0,5>>,<<0,4>>,<<0,21>>,<<192,2>>,<<"ᅵf">>,<<0,9>>],#Fun<ssl.1.125280099>,true,268435456,false,undefined,false,undefined,undefined,true,undefined,false,true,false},[{packet,raw},{ip,{0,0,0,0}},{active,once},{mode,binary},{nodelay,true},{keepalive,true},{reuseaddr,true},{backlog,1024}],<0.5603.0>,[{backlog,1024},{reuseaddr,true},{keepalive,true},{nodelay,true},{ip,{0,0,0,0}},{packet_size,0},{packet,0},{header,0},{active,false},{mode,binary}],{gen_tcp,tcp,tcp_closed,tcp_error},tls_connection}}},#{}}]
10:18:24.371 [error] Module nkpacket_util received unexpected listen_handle_info: [{'EXIT',<0.4068.0>,shutdown},{nkport,{nksip,b3finlv},nksip_protocol,tls,{0,0,0,0},5071,undefined,undefined,{0,0,0,0},5071,<0.5817.0>,{sslsocket,nil,{#Port<0.157748>,{config,{ssl_options,tls,[{3,3},{3,2},{3,1}],verify_none,{#Fun<ssl.7.125280099>,[]},#Fun<ssl.8.125280099>,false,false,undefined,1,<<"/opt/nksip/deps/nkpacket/priv/cert.pem">>,undefined,<<"/opt/nksip/deps/nkpacket/priv/key.pem">>,undefined,[],undefined,<<>>,undefined,undefined,undefined,undefined,undefined,[<<"ᄂ">>,<<"ᄄ">>,<<"ᆭ">>,<<"ᆰ">>,<<0,107>>,<<0,106>>,<<0,61>>,<<"ᆪ">>,<<"ᄃ">>,<<"ᆬ">>,<<"ᄅ">>,<<0,103>>,<<0,64>>,<<0,60>>,<<"ᅵn">>,<<192,20>>,<<0,57>>,<<0,56>>,<<192,5>>,<<192,15>>,<<0,53>>,<<"ᅵb">>,<<192,18>>,<<0,22>>,<<0,19>>,<<192,3>>,<<"ᅵr">>,<<0,10>>,<<"ᅵt">>,<<192,19>>,<<0,51>>,<<0,50>>,<<192,4>>,<<192,14>>,<<0,47>>,<<192,7>>,<<192,17>>,<<0,5>>,<<0,4>>,<<0,21>>,<<192,2>>,<<"ᅵf">>,<<0,9>>],#Fun<ssl.1.125280099>,true,268435456,false,undefined,false,undefined,undefined,true,undefined,false,true,false},[{packet,raw},{ip,{0,0,0,0}},{active,once},{mode,binary},{nodelay,true},{keepalive,true},{reuseaddr,true},{backlog,1024}],<0.5818.0>,[{backlog,1024},{reuseaddr,true},{keepalive,true},{nodelay,true},{ip,{0,0,0,0}},{packet_size,0},{packet,0},{header,0},{active,false},{mode,binary}],{gen_tcp,tcp,tcp_closed,tcp_error},tls_connection}}},#{}}]

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: nklib
exited: stopped
type: permanent
10:18:24.399 [warning] Exception calling nksip_registrar:plugin_stop: error:undef
[{undefined,nks_sip_debug,[undefined,undefined,{error,"Error calling callback ~p/~p: ~p",[sip_registrar_store,2,{badarg,[{ets,safe_fixtable,[nklib_store,true],[]},{ets,foldl,3,[{file,"ets.erl"},{line,526}]},{nksip_callbacks,nks_sip_call,3,[{file,"src/nksip_callbacks.erl"},{line,243}]},{nksip_registrar_lib,callback,2,[{file,"src/nksip_registrar_lib.erl"},{line,417}]},{nksip_registrar,clear,1,[{file,"src/nksip_registrar.erl"},{line,231}]},{nksip_registrar,plugin_stop,1,[{file,"src/nksip_registrar.erl"},{line,84}]},{nkservice_util,safe_call,3,[{file,"src/nkservice_util.erl"},{line,74}]},{nkservice_server,do_stop_plugins,2,[{file,"src/nkservice_server.erl"},{line,475}]}]}]}],[]},{nksip_callbacks,nks_sip_call,3,[{file,"src/nksip_callbacks.erl"},{line,245}]},{nksip_registrar_lib,callback,2,[{file,"src/nksip_registrar_lib.erl"},{line,417}]},{nksip_registrar,clear,1,[{file,"src/nksip_registrar.erl"},{line,231}]},{nksip_registrar,plugin_stop,1,[{file,"src/nksip_registrar.erl"},{line,84}]},{nkservice_util,safe_call,3,[{file,"src/nkservice_util.erl"},{line,74}]},{nkservice_server,do_stop_plugins,2,[{file,"src/nkservice_server.erl"},{line,475}]},{nkservice_server,terminate,2,[{file,"src/nkservice_server.erl"},{line,414}]}]

=ERROR REPORT==== 28-Mar-2016::10:18:24 ===
** Generic server a2ucfiu terminating
** Last message in was {'EXIT',<0.4068.0>,shutdown}
** When Server state == {state,a2ucfiu,#{id => a2ucfiu,my_name => server1}}
** Reason for termination ==
** {function_clause,
[{basic_test,handle_info,
[{'EXIT',<0.4068.0>,shutdown},#{id => a2ucfiu,my_name => server1}],
[{file,"test/basic_test.erl"},{line,289}]},
{a2ucfiu,handle_info,2,[]},
{nklib_gen_server,handle_info,4,
[{file,"src/nklib_gen_server.erl"},{line,108}]},
{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,593}]},
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,659}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: goldrush
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: ranch
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: nksip
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: nkservice
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: cowlib
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: asn1
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: public_key
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: ssh
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: lager
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: syntax_tools
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: cowboy
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: compiler
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: nkpacket
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: ssl
exited: stopped
type: permanent

=INFO REPORT==== 28-Mar-2016::10:18:24 ===
application: sasl
exited: stopped
type: permanent
ERROR: One or more eunit tests failed.
ERROR: eunit failed while processing /opt/nksip: rebar_abort
make: *** [eunit] 错误 1

Register timeout when using TCP

Hi thank you for the awesome project!

I'm starting a sip registrar service in my Elixir project, it works fine with UDP but it returns timeout when trying with TCP!

{:error, {:exit, :timeout}}

Here is my simple project https://github.com/phanmn/ex-pbx

We can start with Iex and using this command to register with TCP

:nksip_uac.register(:client, "<sip:127.0.0.1;transport=tcp>", [{:sip_pass, "1234"}, :contact, {:get_meta, [<<"contact">>]}])

This is a command to register with UDP

:nksip_uac.register(:client, "sip:127.0.0.1", [{:sip_pass, "1234"}, :contact, {:get_meta, [<<"contact">>]}])

Please give me some hints, many thanks!

Is it supposed to be serial? But it always did parallel forking.

I'm using v0.5.0.

When I only put one URI in the array, it worked fine.
I'd like to put a couple routes for SIP trunking failover. But it always did parallel forking.

My UriSet is a simple Erlang array of binaries representing uris. According to the doc, serial forking is expected. Not sure what's missing.

02:15:17.996 [debug] server (de43d655-1f32-1235-fa83-0401c20ee801) UAS 5335593001 'INVITE' route reply: {proxy,[<<"sip:[email protected]">>,<<"sip:+1647xxxxxxx@toronto5
.voip.ms">>],[record_route,follow_redirects]}

02:15:18.005 [debug] server (de43d655-1f32-1235-fa83-0401c20ee801) Fork 5335593001 'INVITE' started from UAS ([record_route,follow_redirects])
02:15:18.005 [debug] server (de43d655-1f32-1235-fa83-0401c20ee801) Fork 5335593001 'INVITE' launching next group

Great project! I really like the concept.

Unable to connect to sip2sip

austin@aviela:~/nksip$ make shell
erl -config priv/app.config -args_file priv/vm.args
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [async-threads:10] [kernel-poll:false]

Eshell V7.0 (abort with ^G)
([email protected])1> 23:41:04.738 [notice] NkSIP v0.4.0 has started. Main IP is 10.0.2.15 (::1)

([email protected])1> nksip:start(c1, nksip_sipapp, [], []).
{ok,abx7wd8}
([email protected])2> nksip_uac:options(c1, "sip:sip2sip.info", []).
23:42:24.296 [notice] c1 (XKsSdLPICUojjGyzx8jLKdODjjk) error connecting to {81,23,228,150}:443 (tls): no_listening_transport
23:42:24.296 [notice] c1 (XKsSdLPICUojjGyzx8jLKdODjjk) error connecting to {81,23,228,129}:443 (tls): no_listening_transport
23:42:24.296 [notice] c1 (XKsSdLPICUojjGyzx8jLKdODjjk) error connecting to {85,17,186,7}:443 (tls): no_listening_transport
23:42:53.034 [warning] c1 (XKsSdLPICUojjGyzx8jLKdODjjk) error calling send_work_sync (send): {timeout,{gen_server,call,[nksip_router_12,{send_work_sync,abx7wd8,<<"XKsSdLPICUojjGyzx8jLKdODjjk">>,{send,'OPTIONS',"sip:sip2sip.info",[supported,allow,allow_event]},<0.43.0>},30000]}}
{error,timeout}
([email protected])3>

Tutorial compilation fails with error

When I follow the steps to compile the tutorial, I get the following error on the last make step:

$  make tutorial
erl -config samples/nksip_tutorial/priv/app.config \
                -args_file samples/nksip_tutorial/priv/vm.args 
Erlang/OTP 17 [erts-6.4.1] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]

Eshell V6.4.1  (abort with ^G)
([email protected])1> 09:59:54.670 [error] CRASH REPORT Process <0.104.0> with 0 neighbours exited with reason: no match of right hand value {error,enoent} in nksip_config:make_cache/1 line 312 in application_master:init/4 line 133
{"Kernel pid terminated",application_controller,"{application_start_failure,nksip,{bad_return,{{nksip_app,start,[normal,[]]},{'EXIT',{{badmatch,{error,enoent}},[{nksip_config,make_cache,1,[{file,\"src/nksip_config.erl\"},{line,312}]},{nksip_config,make_cache,0,[{file,\"src/nksip_config.erl\"},{line,149}]},{nksip_app,start,2,[{file,\"src/nksip_app.erl\"},{line,60}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,272}]}]}}}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,nksip,{bad_return,{{nksip_app,start,[normal,[]]},{'EXIT',{{badmatch,{error,enoent}},[{nksip_config,make_cache,1,[{file,"src
make: *** [tutorial] Error 1

empty SDP in invite request

we have problem with SDP information
when we send invite request , the SDP information is empty and not in invite request !


Edit :

problem solved 👍

Do not convert to atoms known parameters in urls and vias

NkSIP currently converts any parameters it recognizes in url and vias to atoms.
For example, <<"lr">> is changed to 'lr'.

There are some problems with this approach:

  • the SipApp's developer does not know if a specific parameter is going to be in atom or binary form without looking at the code.
  • there is no clear policy for future supported parameters
  • it is not clear what to do if a parameter is recognizes as uri and not as via ("tag" for example)

So I think the best solutions is to keep all parameters as binaries.
Any comment?

MAX_UDP

Hi !

I have a question: why do you limit max udp message size in nksip_connection module ?
-define(MAX_UDP, 1500).

When we send SIP INVITE with big sdp nksip force to use tcp connection. Why?
We've removed the limitation and the udp message was fragmented , which was expected situation due tu Ethernet MTU. It worked.

parser error

please check the case where a cisco ip phone sends this header
To: ""unknown"" <sip:[email protected]

that's two times " (double quote)

this happens after we send a 302 Moved Temporarily with
Contact : "unknown" sip:[email protected]

the result is, cannot parse To header

thanks

What happened to samples ?

Hi, this framework seems very interesting. I am curious, what happened to samples from 0.5.0 ? What's the reason they were removed ? Are you interested having them back ?

Change class in #sipmsg

  • Change it to {request, Method} or {response, Code}. This way is consistent, the next of the record is common to requests and responses

Wrong ACK RUri

ACK has wrong request Uri
The reason - different format for Record route options: <<"lr">> or {<<"lr">>,<<"on">>}
NKSIP Version v0.4.0

Quick fix -
-            case lists:member(<<"lr">>, RouteOpts) of
-                true ->     
-                    DestUri = TopRoute#uri{
+            Lr = lists:member(<<"lr">>, RouteOpts) or lists:member({<<"lr">>,<<"on">>}, RouteOpts),
+            case Lr of
+                true ->
+                  DestUri = TopRoute#uri{

Support tuple IP in URIs

If you pass an #uri{} as a 'to'/'from'/'ruri' meta to nksip_uac functions, you get a cryptic error message like this one:
[error] gen_server <0.374.0> terminated with reason: bad argument in call to erlang:list_to_binary([<<>>,60,<<"sip">>,58,[<<"xxx">>,64],{172,31,0,18},[58,"5060"],<<>>,[],[],62,[[59,<<"tag">>,...]],...]) in nklib_unparse:header/1 line 89

The reason is that domain part of the URI is assumed to be a binary or a string and is used as is. Now I'm forced to use nklib_util:to_host/1 before passing the IP address to a sending function, while it looks like it's better to allow tuple typed IPs as an input and pass them through nklib_util:to_host/1 internally.

PS I'm using the current master branch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.