RestComm SIpServlet - Sip Servlet as Application Server in IMS network - restcomm

I'm trying to develop an IMS application server using a RestComm SipServlet.
Initially my aim is just to insert the AS in the call flow without doing anything special.
The application Server has just to doStuff and forward initial invite.
The problem is that the sip stack by RestComm does not remove the Route from the Invite addind it to the route header therefor the invite is routed to the AS again generating a loop.
When I try to edit the SipRequest removing Route Header the AS answer with a 500 due to the fact that I can't modify system header.
Here a snippet of the code
#Override
protected final void doInvite(SipServletRequest request)
throws ServletException, IOException {
//DO STUFF
System.out.println("RECEIVED AN INVITE");
// These lines generate a 500
// request.removeHeader("route");
// request.removeHeader("route");
ProxyImpl p = (ProxyImpl) request.getProxy(true);
p.setRecordRoute(false);
p.setSupervised(true);
p.setParallel(true);
p.proxyTo(request.getRequestURI());
p.startProxy();
}
I'm going crazy :/
Hope someone can give me some suggestions...

I am also new to Sip Servlets but when I was reading documentation I encountered on this info:
"A route modifier, which consists of one of the following strings: ROUTE, ROUTE_BACK or NO_ROUTE. The route modifier is used in conjunction with the route information to route a request externally." related to mobicents-dar.properties.
Maybe it helps.

Unlikely I am still struggling with the original problem. I have been inspecting on the hint Bartek gave to me. Unluckly the documentation is very poor and, probably I'm not understanding it completely.
Anyway I will share my results manipulating dar properties file.
Definitions are taken from the SipServlet Specification v1.1
ROUTE modifier indicates that SipApplicationRouterInfo.getRoutes() returns valid routes. It is up to the container to decide whether they are external or if an internal route was returned. All of the routes returned MUST be of the same type, so the container can make the determination by examining the first route only.
2017-10-10 15:55:01,372 ERROR [SipApplicationDispatcherImpl] (pool-AffinityJAIN-thread-1) Unexpected exception while processing request
INVITE sip:test2#mydomain.net SIP/2.0
Via: SIP/2.0/TCP 10.39.117.121:50302;rport=50302;branch=z9hG4bKPj921L-Q-IghWuH.rSX.uNoNMh9T7gZilB;received=10.39.117.121
Via: SIP/2.0/TCP 10.39.117.93:6560;received=10.39.117.93;branch=z9hG4bK+aa78dad05a4a559d9e4635f37906172a1+sip+5+a64ded2b
Route: <sip:moby#moby.dev.mydomain.sys;lr>
Route: <sip:odi_6fWaVvB68v#10.39.117.121:5054;lr;orig>
Record-Route: <sip:sprout.dev.mydomain.sys:5054;transport=TCP;lr;service=scscf;billing-role=charge-orig>
Record-Route: <sip:10.39.117.93:6560;lr>
From: "itsme" <sip:test_1#mydomain.net>;tag=10.39.117.93+5+2cdeefc2+8fc7709c
To: <sip:test2#mydomain.net>
CSeq: 1 INVITE
Expires: 180
Call-Info: <sip:10.39.117.93:6560>;method="NOTIFY;Event=telephone-event;Duration=2000"
P-Charging-Function-Addresses: ccf=pri_ccf_address
Supported: outbound,path,replaces
P-Charging-Vector: icid-value="0be3bd9333dd5089baf80bf17225e3d6";orig-ioi=mydomain.net
Contact: <sip:test_1#195.130.246.72:46973;transport=tcp;rinstance=e637627c20b12d87;ob>;+sip.instance="<urn:uuid:968fdfa1-95d3-59cb-acb3-403d721daeee>"
P-Asserted-Identity: <sip:test_1#mydomain.net>
Max-Forwards: 68
Call-ID: 0gQAAC8WAAACBAAALxYAAOYHyDdZmVO7ntMtj/uEnAYHN75Z51iTlNo7aI6WHcJ6VqorSJqCC0eLxClj9KOJnw--#10.39.117.93
Allow: SUBSCRIBE,NOTIFY,INVITE,ACK,CANCEL,BYE,REFER,INFO,OPTIONS
User-Agent: X-Lite release 5.0.1 stamp 86895
P-Visited-Network-ID: perim.dev.ims.ext1.net
Accept: application/sdp,application/dtmf-relay
Session-Expires: 600
P-Served-User: <sip:test_1#mydomain.net>;regstate=reg;sescase=orig
Content-Type: application/sdp
Content-Length: 281
v=0
o=- 14048926850737 14048926850737 IN IP4 10.39.117.93
s=-
c=IN IP4 10.39.117.93
t=0 0
m=audio 45234 RTP/AVP 120 0 101
a=sendrecv
a=rtpmap:120 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:120 useinbandfec=1; usedtx=1; maxaveragebitrate=64000
a=fmtp:101 0-15
org.mobicents.servlet.sip.core.DispatcherException: Impossible to parse the route returned by the application router into a compliant address
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.checkRouteModifier(InitialRequestDispatcher.java:575)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchMessage(InitialRequestDispatcher.java:299)
at org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl.processRequest(SipApplicationDispatcherImpl.java:927)
at gov.nist.javax.sip.EventScanner.deliverRequestEvent(EventScanner.java:250)
at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:146)
at gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:185)
at gov.nist.javax.sip.DialogFilter.processRequest(DialogFilter.java:1328)
at gov.nist.javax.sip.stack.SIPServerTransactionImpl.processRequest(SIPServerTransactionImpl.java:851)
at gov.nist.javax.sip.stack.ConnectionOrientedMessageChannel.processMessage(ConnectionOrientedMessageChannel.java:473)
at gov.nist.javax.sip.parser.NioPipelineParser$Dispatch.run(NioPipelineParser.java:132)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at gov.nist.javax.sip.MDCScheduledTHExecutor$MDCFuture.run(MDCScheduledTHExecutor.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.text.ParseException: :Bad address spec
at gov.nist.javax.sip.parser.Parser.createParseException(Parser.java:45)
at gov.nist.javax.sip.parser.AddressParser.address(AddressParser.java:120)
at gov.nist.javax.sip.parser.StringMsgParser.parseAddress(StringMsgParser.java:328)
at gov.nist.javax.sip.address.AddressFactoryImpl.createAddress(AddressFactoryImpl.java:124)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.checkRouteModifier(InitialRequestDispatcher.java:537)
... 17 more
I tryied also using the route field to point to the IMS node in order to forward back the SIP message. It works but I think that in this way the AS is not added in a Record-Route header and it cause a loop.
ROUTE_BACK directs the container to push its own route before pushing the external routes obtained from SipApplicationRouterInfo.getRoutes().
Application Router Behavior
In this case I have the following error and the AS answer with a 500.
2017-10-10 15:52:57,276 ERROR [SipApplicationDispatcherImpl] (pool-AffinityJAIN-thread-14) Unexpected exception while processing request
INVITE sip:test2#mydomain.net SIP/2.0
Via: SIP/2.0/TCP 10.39.117.121:43312;rport=43312;branch=z9hG4bKPj5IBDrImFUbO1J.J1LrwUcUQ-rsT28TRh;received=10.39.117.121
Via: SIP/2.0/TCP 10.39.117.93:6560;received=10.39.117.93;branch=z9hG4bK+84bf75e3c2c4ccae314be5e5849bd4961+sip+3+a64ded21
Route: <sip:moby#moby.dev.mydomain.sys;lr>
Route: <sip:odi_kMFF/TQSEV#10.39.117.121:5054;lr;orig>
Record-Route: <sip:sprout.dev.mydomain.sys:5054;transport=TCP;lr;service=scscf;billing-role=charge-orig>
Record-Route: <sip:10.39.117.93:6560;lr>
From: "Gennaro" <sip:test_1#mydomain.net>;tag=10.39.117.93+3+7334eef2+84ee6a06
To: <sip:test2#mydomain.net>
CSeq: 1 INVITE
Expires: 180
Call-Info: <sip:10.39.117.93:6560>;method="NOTIFY;Event=telephone-event;Duration=2000"
P-Charging-Function-Addresses: ccf=pri_ccf_address
Supported: outbound,path,replaces
P-Charging-Vector: icid-value="4167d34dd3fb232bb1f5fcf458dc1a9e";orig-ioi=mydomain.net
Contact: <sip:test_1#195.130.246.72:46973;transport=tcp;rinstance=e637627c20b12d87;ob>;+sip.instance="<urn:uuid:968fdfa1-95d3-59cb-acb3-403d721daeee>"
P-Asserted-Identity: <sip:test_1#mydomain.net>
Max-Forwards: 68
Call-ID: 0gQAAC8WAAACBAAALxYAAK2OW7qCKhw2LAbw9q+UyCfK2Js5PtCkUUpQsljED2+H/KOnkWSV97W3n9Uqpa3r4w--#10.39.117.93
Allow: SUBSCRIBE,NOTIFY,INVITE,ACK,CANCEL,BYE,REFER,INFO,OPTIONS
User-Agent: X-Lite release 5.0.1 stamp 86895
P-Visited-Network-ID: perim.dev.ims.ext1.net
Accept: application/sdp,application/dtmf-relay
Session-Expires: 600
P-Served-User: <sip:test_1#mydomain.net>;regstate=reg;sescase=orig
Content-Type: application/sdp
Content-Length: 281
v=0
o=- 76884298267467 76884298267467 IN IP4 10.39.117.93
s=-
c=IN IP4 10.39.117.93
t=0 0
m=audio 45230 RTP/AVP 120 0 101
a=sendrecv
a=rtpmap:120 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:120 useinbandfec=1; usedtx=1; maxaveragebitrate=64000
a=fmtp:101 0-15
java.lang.IllegalArgumentException: not allowed to set parameter, the URI is not modifiable
at org.mobicents.servlet.sip.address.SipURIImpl.setParameter(SipURIImpl.java:401)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.checkRouteModifier(InitialRequestDispatcher.java:591)
at org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher.dispatchMessage(InitialRequestDispatcher.java:299)
at org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl.processRequest(SipApplicationDispatcherImpl.java:927)
at gov.nist.javax.sip.EventScanner.deliverRequestEvent(EventScanner.java:250)
at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:146)
at gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:185)
at gov.nist.javax.sip.DialogFilter.processRequest(DialogFilter.java:1328)
at gov.nist.javax.sip.stack.SIPServerTransactionImpl.processRequest(SIPServerTransactionImpl.java:851)
at gov.nist.javax.sip.stack.ConnectionOrientedMessageChannel.processMessage(ConnectionOrientedMessageChannel.java:473)
at gov.nist.javax.sip.parser.NioPipelineParser$Dispatch.run(NioPipelineParser.java:132)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at gov.nist.javax.sip.MDCScheduledTHExecutor$MDCFuture.run(MDCScheduledTHExecutor.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
NO_ROUTE indicates that Application Router is not returning any routes and the SipApplicationRouterInfo.getRoutes() value, if any, should be disregarded.
In this case the request seems to stuck in the AS with no way to forward the request to the IMS node.
Hope this explain the situation.
Thanks

The problem is that the application router does not recognize that the route is to itself, so it doesn't remove it. If you turn-on DEBUG level logging, you will see something like:
DEBUG [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (Mobicents-SIP-Servlets-UDPMessageChannelThread-1) the triplet host/port/transport : tas.core.ims1.test/-1/UDP is external : true
Notice that it get resolves to external. Try adding a hostnames attribute to the SIP connector:
<subsystem xmlns="urn:org.mobicents:sip-servlets-as8:1.0" application-router="configuration/dars/mobicents-dar.properties" stack-properties="configuration/mss-sip-stack.properties" path-name="org.mobicents.ext" app-dispatcher-class="org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl" concurrency-control-mode="SipApplicationSession" congestion-control-interval="-1">
<connector name="sip-udp" protocol="SIP/2.0" scheme="sip" socket-binding="sip-udp" use-static-address="true" static-server-address="2345:470:eb88:150::23" hostnames="tas.core.ims1.test"/>
<connector name="sip-tcp" protocol="SIP/2.0" scheme="sip" socket-binding="sip-tcp" use-static-address="true" static-server-address="2345:470:eb88:150::23" hostnames="tas.core.ims1.test"/>
...
</subsystem>
Another option would be to use the hostname rather than the IP address in the static-server-address attribute:
<subsystem xmlns="urn:org.mobicents:sip-servlets-as8:1.0" application-router="configuration/dars/mobicents-dar.properties" stack-properties="configuration/mss-sip-stack.properties" path-name="org.mobicents.ext" app-dispatcher-class="org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl" concurrency-control-mode="SipApplicationSession" congestion-control-interval="-1">
<connector name="sip-udp" protocol="SIP/2.0" scheme="sip" socket-binding="sip-udp" use-static-address="true" static-server-address="tas.core.ims1.test"/>
<connector name="sip-tcp" protocol="SIP/2.0" scheme="sip" socket-binding="sip-tcp" use-static-address="true" static-server-address="tas.core.ims1.test"/>
...
</subsystem>
Checking the log again, you will notice that it now resolves to internal:
DEBUG [org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl] (Mobicents-SIP-Servlets-UDPMessageChannelThread-1) the triplet host/port/transport : tas.core.ims1.test/-1/UDP is external : false
It will also now pop-off the route to itself. In my case, if I print-out the popped route by calling SipServletRequest::getPoppedRoute(), I see:
Route: <sip:defaultapp#tas.core.ims1.test;lr>

Related

Error 488 Not acceptable here

Hello I know there are already lot of topics about this error (or perhaps I don't have the same problem) but none of them answered my question, I am in a local network with blink on my PC and my asterisk server is on an external server hosted by ovh (so there is nat to do). I control the server via encrypted ssh session ofc.
As long as the call is not encrypted, everything is fine, I can call any user I want. But when I started to encrypt my traffic everything went wrong and I can't find why.I've generated certficate for both client and server, the traffic is encrypted because I can't see anything in wireshark(I can't see encrypted traffic but I see non-encrypted traffic). Blink is configured correctly with SDES mandatory, .pem file, car.crt , proxy on port 5061 tls, but I think the error is somewhere else.
Myconig for sip.conf is like this:
[general]
udpbindaddr=0.0.0.0
tcpenable=yes ; Enable server for incoming TCP connections (default is no)
tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces) ; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
tlsenable=yes ; Enable server for incoming TLS (secure) connections (default is no)
tlsbindaddr=0.0.0.0
transport=udp
disallow=all
allow=ulaw ; Allow codecs in order of preference
allow=alaw
dtmfmode = rfc2833
tlscertfile=/etc/asterisk/keys/asterisk.pem
tlscafile=/etc/asterisk/keys/ca.crt
tlscipher=ALL
tlsclientmethod=tlsv1
[201](can't communicate instant 488 error)
type=friend
username=vincent
context=from-sip
host=dynamic
secret=not4usry
callerid=vincent<201>
mailbox=201#default
nat=comedia
transport=tls
encryption=yes
[203](no tls user and can communicate with the ones who don't use tls)
type=friend
username=antoine
context=from-sip
host=dynamic
secret=not4usry
callerid=antoine<203>
mailbox=203#default
nat=comedia
Certificates have been generated using ./ast_tls_cert....
RTP logs
== Using SIP RTP CoS mark 5 [May 11 15:34:33]
WARNING[21893][C-00000d0e]: chan_sip.c:10803 process_sdp: Rejecting
secure audio stream without encryption details: audio 50026 RTP/SAVP
113 9 0 8 101
SIP LOGS
INVITE sip:203#vps466556.ovh.net SIP/2.0
Via: SIP/2.0/TLS
192.168.1.35:53076;rport;branch=z9hG4bKPj275105fe6a304b89b2b18ee5186b5085;alias
Max-Forwards: 70
From: "Vincent"
;tag=523fe49e3a8646608481fbac0801b605
To:
Contact:
Call-ID: 0fb841de523e4ff0a74514247bb3445a
CSeq: 4966 INVITE
Allow: SUBSCRIBE, NOTIFY, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE,
REFER
Supported: replaces, norefersub, gruu
User-Agent: Blink 3.0.0 (Windows)
Content-Type: application/sdp
Content-Length: 425
v=0
o=- 3735043210 3735043210 IN IP4 192.168.1.35
s=Blink 3.0.0 (Windows)
t=0 0
m=audio 50004 RTP/AVP 113 9 0 8 101
c=IN IP4 192.168.1.35
a=rtcp:50005
a=rtpmap:113 opus/48000/2
a=fmtp:113 useinbandfec=1
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=zrtp-hash:1.10
af10bf32a78e03147ffbf2859f96cc8d401048ee46a1f2cb961c20139b219913
a=sendrecv
-- 2018-05-11 16:00:11.003276 [blink.exe 3320]: RECEIVED: Packet 136, +0:06:21.266013
54.37.8.124:5061 -(SIP over TLS)-> 192.168.1.35:53076 SIP/2.0 401 Unauthorized
Via: SIP/2.0/TLS
192.168.1.35:53076;branch=z9hG4bKPj275105fe6a304b89b2b18ee5186b5085;alias;received=90.112.223.194;rport=53076
From: "Vincent"
;tag=523fe49e3a8646608481fbac0801b605
To: ;tag=as50eb1885
Call-ID: 0fb841de523e4ff0a74514247bb3445a
CSeq: 4966 INVITE
Server: Asterisk PBX 13.21.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE
Supported: replaces, timer
-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6650a402"
Content-Length: 0
-- 2018-05-11 16:00:11.004276 [blink.exe 3320]: SENDING: Packet 137, +0:06:21.267013
192.168.1.35:53076 -(SIP over TLS)-> 54.37.8.124:5061 ACK sip:203#vps466556.ovh.net SIP/2.0
Via: SIP/2.0/TLS
192.168.1.35:53076;rport;branch=z9hG4bKPj275105fe6a304b89b2b18ee5186b5085;alias
Max-Forwards: 70
From: "Vincent"
;tag=523fe49e3a8646608481fbac0801b605
To: ;tag=as50eb1885
Call-ID: 0fb841de523e4ff0a74514247bb3445a
CSeq: 4966 ACK
User-Agent: Blink 3.0.0 (Windows)
Content-Length: 0
-- 2018-05-11 16:00:11.005276 [blink.exe 3320]: SENDING: Packet 138, +0:06:21.268013
192.168.1.35:53076 -(SIP over TLS)-> 54.37.8.124:5061 INVITE sip:203#vps466556.ovh.net SIP/2.0
Via: SIP/2.0/TLS
192.168.1.35:53076;rport;branch=z9hG4bKPj3e8da342afaa41a385d9989648fd069f;alias
Max-Forwards: 70
From: "Vincent"
;tag=523fe49e3a8646608481fbac0801b605
To:
Contact:
Call-ID: 0fb841de523e4ff0a74514247bb3445a
CSeq: 4967 INVITE
Allow: SUBSCRIBE, NOTIFY, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE,
REFER
Supported: replaces, norefersub, gruu
User-Agent: Blink 3.0.0 (Windows)
Authorization: Digest username="201", realm="asterisk",
nonce="6650a402", uri="sip:203#vps466556.ovh.net",
response="dcd6fcd9d8b7381f86f07e1326aa9134", algorithm=MD5
Content-Type: application/sdp
Content-Length: 425
v=0
o=- 3735043210 3735043210 IN IP4 192.168.1.35
s=Blink 3.0.0 (Windows)
t=0 0
m=audio 50004 RTP/AVP 113 9 0 8 101
c=IN IP4 192.168.1.35
a=rtcp:50005
a=rtpmap:113 opus/48000/2
a=fmtp:113 useinbandfec=1
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=zrtp-hash:1.10
af10bf32a78e03147ffbf2859f96cc8d401048ee46a1f2cb961c20139b219913
a=sendrecv
-- 2018-05-11 16:00:11.087226 [blink.exe 3320]: RECEIVED: Packet 139, +0:06:21.349963
54.37.8.124:5061 -(SIP over TLS)-> 192.168.1.35:53076 SIP/2.0 488 Not acceptable here
Via: SIP/2.0/TLS
192.168.1.35:53076;branch=z9hG4bKPj3e8da342afaa41a385d9989648fd069f;alias;received=90.112.223.194;rport=53076
From: "Vincent"
;tag=523fe49e3a8646608481fbac0801b605
To: ;tag=as50eb1885
Call-ID: 0fb841de523e4ff0a74514247bb3445a
CSeq: 4967 INVITE
Server: Asterisk PBX 13.21.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
-- 2018-05-11 16:00:11.088227 [blink.exe 3320]: SENDING: Packet 140, +0:06:21.350964
192.168.1.35:53076 -(SIP over TLS)-> 54.37.8.124:5061 ACK sip:203#vps466556.ovh.net SIP/2.0
Via: SIP/2.0/TLS
192.168.1.35:53076;rport;branch=z9hG4bKPj3e8da342afaa41a385d9989648fd069f;alias
Max-Forwards: 70
From: "Vincent"
;tag=523fe49e3a8646608481fbac0801b605
To: ;tag=as50eb1885
Call-ID: 0fb841de523e4ff0a74514247bb3445a
CSeq: 4967 ACK
User-Agent: Blink 3.0.0 (Windows)
Content-Length: 0
Thanks for your help, Vince
Your SIP endpoint specifies encryption=yes, but the INVITE from your client specifies RTP/AVP, not RTP/SAVP. iirc, Blink has an option for optimistic or mandatory encryption; you'll need to change it to mandatory.
If you have the same problem as me, reinstall the Srtp library and asterisk, also log sip request because I had a bug where Blink didn't send register request anymore (even when pushing that register button 1000times) so I downloaded PhonerLite and everything worked perfectly

WebRtc peerConnection failed while setting local description

While setting localdescription on sending offer to peer i'm facing such as error:
"Failed to set local offer sdp: Session error code: ERROR_CONTENT.
Session error description:
Failed to set local video description recv parameters"
It occurs in Chrome only rather than in Firefox where there is nothing in console. Obviously the connection between peers is not established.
I just want to update an audio sectin with following settings:
m=audio 54312 RTP/AVP 101 a=rtpmap:101 opus/48000/2 a=fmtp:101 stereo=1;
sprop-stereo=1
Therefore look for m=audio and replace payload values only. There is nothing to do with video which retains as it is.
Any idea would be appreciated.
Thanks

Rescomm Call fails due to: "Media path is lost due to connectivity issues" error

I am using RestComm Connect installed on a cloud VPS.
When making a basic test call to verify setup and connectivity (use default RestComm accounts Bob & Alice; in this case Bob called Alice) the callee side reports the following error:
Media path is lost due to connectivity issues; call has been hung up
and then then call fails after a SIP '480 Temporarily Unavailable' is sent from callee to caller.
The browser console output looks as follows:
WebRTComm.js:4925 2017-10-10 17:06:31.370 WebRTCommCall:onRtcPeerConnectionIceChangeEvent(): Media path is lost due to connectivity issues; call has been hung up
Stack trace:
at commonLog (https://api-test.click2callme.pl/olympus/resources/js/mobicents-libs/WebRTComm.js:4884:10)
at console.error (https://api-test.click2callme.pl/olympus/resources/js/mobicents-libs/WebRTComm.js:4957:4)
at WebRTCommCall.onRtcPeerConnectionIceChangeEvent (https://api-test.click2callme.pl/olympus/resources/js/mobicents-libs/WebRTComm.js:3871:12)
at RTCPeerConnection.peerConnection.oniceconnectionstatechange (https://api-test.click2callme.pl/olympus/resources/js/mobicents-libs/WebRTComm.js:3047:9)
commonLog # WebRTComm.js:4925
console.error # WebRTComm.js:4957
WebRTCommCall.onRtcPeerConnectionIceChangeEvent # WebRTComm.js:3871
peerConnection.oniceconnectionstatechange # WebRTComm.js:3047
WebRTComm.js:4925 2017-10-10 17:06:31.399 WebRTCommCall:close(), received media stats
[Arguments.<anonymous> (https://api-test.click2callme.pl/olympus/resources/js/mobicents-libs/WebRTComm.js:2354:13)]
WebRTComm.js:4925 2017-10-10 17:06:31.400 WebRTCommCall:hangup()
[WebRTCommCall.hangup (https://api-test.click2callme.pl/olympus/resources/js/mobicents-libs/WebRTComm.js:2186:10)]
WebRTComm.js:4925 2017-10-10 17:06:31.401 PrivateJainSipCallConnector:close(): this.sipCallState=INVITED_INITIAL_STATE
[PrivateJainSipCallConnector.close (https://api-test.click2callme.pl/olympus/resources/js/mobicents-libs/WebRTComm.js:484:10)]
WebRTComm.js:4925 2017-10-10 17:06:31.402 SIP message sent: SIP/2.0 480 Temporarily Unavailable
Call-ID: 9b591496fb3bc5aac39075c5ea227d8b#213.32.22.60
CSeq: 1 INVITE
From: <sip:bob#77.255.251.128:57765>;tag=80839608_220982c6_57a5b08a_2ccbc3df
To: <sip:alice#178.43.83.112:63131>;tag=1507647967531
Max-Forwards: 70
Via: SIP/2.0/WSS 213.32.22.60:5083;branch=z9hG4bK2ccbc3df_57a5b08a_b9a9c4de-4268-4b16-a02b-4f8795cb4c2c;rport
Contact: <sip:alice#SpUEEE9qhnZn.invalid;transport=wss>
Content-Length: 0
The excerpt from RestComm's server.log is as follows:
17:04:22,641 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (pool-AffinityJAIN-thread-47) <message
from="178.43.83.112:63131"
to="213.32.22.60:5083"
time="1507647862640"
isSender="false"
transactionId="z9hg4bk2ccbc3df_57a5b08a_b9a9c4de-4268-4b16-a02b-4f8795cb4c2c"
callId="9b591496fb3bc5aac39075c5ea227d8b#213.32.22.60"
firstLine="SIP/2.0 480 Temporarily Unavailable"
>
<![CDATA[SIP/2.0 480 Temporarily Unavailable
Call-ID: 9b591496fb3bc5aac39075c5ea227d8b#213.32.22.60
CSeq: 1 INVITE
From: <sip:bob#77.255.251.128:57765>;tag=80839608_220982c6_57a5b08a_2ccbc3df
To: <sip:alice#178.43.83.112:63131>;tag=1507647967531
Max-Forwards: 70
Via: SIP/2.0/WSS 213.32.22.60:5083;branch=z9hG4bK2ccbc3df_57a5b08a_b9a9c4de-4268-4b16-a02b-4f8795cb4c2c;rport
Contact: <sip:alice#178.43.83.112:63131;transport=wss>
Content-Length: 0
]]>
</message>
This looks like some kind of NAT traversal issue related to ICE/STUN.
I am using a custom STUN server and checked that is works using the below command:
vps404561:/$ stun 213.32.22.60:3478
STUN client version 0.96
Primary: Open
Return value is 0x000001
Any ideas what might be the exact cause of this problem?
I'm also looking for some hints / tips how to further troubleshoot this issue.
Thanks,
Dominik

"Remotely closed" when I try to send REST with HTTPS in Mule

I have a simple REST HTTPS GET, the uri of it is like that:
https://mytest.test:443/nccpointshop/REST/giftcard/giftcards/list/currency/SEK
which works perfectly to run in a browser, Postman, etc. With Mule 3.8 HTTP I select the uri from the RAML generataed specification, set uri-param and still I am getting an exception :
DEBUG 2016-06-28 16:38:35,321 [[svc0014_loyalty].http.requester.ODP_Request_Configuration(1) SelectorRunner] com.ning.http.client.providers.grizzly.AsyncHttpClientFilter: REQUEST: HttpRequestPacket (
method=GET
url=/nccpointshop/REST/giftcard/giftcards/list/currency/SEK
query=null
protocol=HTTP/1.1
content-length=-1
headers=[
Host=correct.host:443
User-Agent=AHC/1.0
Connection=keep-alive
Accept=*/*]
)
DEBUG 2016-06-28 16:38:35,322 [[svc0014_loyalty].http.requester.ODP_Request_Configuration(1) SelectorRunner] org.mule.module.http.internal.HttpMessageLogger: REQUESTER
GET /nccpointshop/REST/giftcard/giftcards/list/currency/SEK HTTP/1.1
Host: correct.host:443
User-Agent: AHC/1.0
Connection: keep-alive
Accept: */*
DEBUG 2016-06-28 16:38:35,498 [[svc0014_loyalty].http.requester.ODP_Request_Configuration.worker(8)] com.ning.http.client.AsyncCompletionHandlerBase: Remotely closed
java.io.IOException: Remotely closed
DEBUG 2016-06-28 16:38:35,520 [[svc0014_loyalty].svc0014_loyalty-httpListenerConfig.worker.02] com.mulesoft.mule.debugger.server.DebuggerMuleNotificationHandlerImpl: MESSAGE_PROCESSOR_POST_INVOKE -> Path /get:\/giftcards:svc0014_loyalty-config/processors/2
DEBUG 2016-06-28 16:38:37,327 [[svc0014_loyalty].Mule.01] com.mulesoft.mule.debugger.server.DebuggerMuleNotificationHandlerImpl: Notification 2001 was received ef4625b0-3d3d-11e6-998f-448500a727fa
ERROR 2016-06-28 16:38:37,329 [[svc0014_loyalty].svc0014_loyalty-httpListenerConfig.worker.02] org.mule.module.apikit.MappingExceptionListener:
********************************************************************************
Message : Error sending HTTP request. Message payload is of type: NullPayload
Type : org.mule.api.MessagingException
Code : MULE_ERROR-29999
Payload : {NullPayload}
JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html
********************************************************************************
Exception stack is:
1. Remotely closed (java.io.IOException)
2. java.io.IOException: Remotely closed (java.util.concurrent.ExecutionException)
org.glassfish.grizzly.impl.SafeFutureImpl$Sync:349 (null)
3. java.util.concurrent.ExecutionException: java.io.IOException: Remotely closed (java.io.IOException)
org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:245 (null)
4. Error sending HTTP request. Message payload is of type: NullPayload (org.mule.api.MessagingException)
org.mule.module.http.internal.request.DefaultHttpRequester:287 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
********************************************************************************
Root Exception stack trace:
java.io.IOException: Remotely closed
********************************************************************************
I am attaching a picture of how my configuration looks like
The thing with Mule HTTP connector is that it adds host and port from the associated configuration always as a header:
headers=[
Host=correct.host:443
Some systems do not allow that, they do not accept adding the port (in our case the port is dynamically allocated in the backend system).
So, this request: https://correct.host:443/nccpointshop/REST/giftcard/giftcards/list/currency/SEK
is invalid, but this one is valid:
https://correct.host/nccpointshop/REST/giftcard/giftcards/list/currency/SEK
This is hard to notice and catch, as Postman and Chrome will both send correct requests. I recommend using some other tool like SoapUI (I noticed it with it).
However, there is a way to overwrite the value for the "Host" in the headers like this:
<http:request config-ref="HTTP_Request_Configuration1" path="/nccpointshop/REST/giftcard/giftcards/list/currency/SEK" method="GET" doc:name="Copy_of_HTTP">
<http:request-builder>
<http:header headerName="Host" value="correct.host"/>
</http:request-builder>
</http:request>

SIP REGISTER failed

I'm attempting to create a small VoIP Client in Visual Studio 2012.
i'm trying to send a REGISTER SIP message from a pc to an AsteriskNOW PBX via UDP. The devices are the following:
IP PBX AsteriskNOW: 192.168.1.37
PC that sends REGISTER message: 192.168.1.104
SIP account username: 117
SIP account password: abcd1234
so, the REGISTER message i'm trying to send is the following:
REGISTER sip:192.168.1.37 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.104:5060;branch=z9hG4bK213760691;rport
From: <sip:117#192.168.1.37>;tag=1270517038
To: <sip:117#192.168.1.37>
Call-ID: 1808066864-5060-1#BJC.BGI.B.D
CSeq: 2001 REGISTER
Contact: <sip:117#192.168.1.104:5060>;reg-id=1;
+sip.instance="<urn:uuid:00000000-0000-1000-8000-AABBCCDDEEFF>"
Max-Forwards: 70
User-Agent: Grandstream GXP1165 1.0.6.7
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER,
UPDATE, MESSAGE
Content-Length: 0
of course, at the line
+sip.instance="<urn:uuid:00000000-0000-1000-8000-AABBCCDDEEFF>"
there's the PC,s Network adapter MAC, instead of "AABBCCDDEEFF".
However, when I try to send the message, i get the following response from the server:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.1.104:5060;rport=5060;received=192.168.1.104;branch=z9hG4bK213760691
Call-ID: 1808066864-5060-1#BJC.BGI.B.D
From: <sip:117#192.168.1.37>;tag=1270517038
To: <sip:117#192.168.1.37>;tag=z9hG4bK2137606914
CSeq: 2001 REGISTER
WWW-Authenticate: Digest
realm="asterisk",nonce="1428402653/99967d603c38695f1c328332db91a43b",
opaque="416e7e1767513798",algorithm=md5,qop="auth"
Server: FPBX-AsteriskNOW-12.0.43(13.0.1)
Content-Length: 0
what can be the problem? Thank you!
I solved by using the ozeki library to manage SIP messages
I found the library here
http://www.voip-sip-sdk.com/p_179-windows-forms-softphone-vb-net-voip.html
Thank you!