I've just confirmed the same thing.
I'm new to the detail of SIP messages, but it looks to me that
the messages passed back and forth contain the route for that
message to follow.
It should be Client -> Flexisip -> Asterisk -> Flexisip
-> Client but Asterisk seems to be missing from that list.
Therefore, the Flexisip skips Asterisk and tries to send the
message to itself on a different port.
This doesn't happen with INVITEs but does happen with ACKs and
BYEs.
Extract from Flexisip below showing an incoming ACK which it
tries to send to itself:
2019-08-26 19:01:05:464 flexisip-debug-tport(0x55b7f2e889a0):
found 0x55b7f2ea28a0 by name TCP/151.228.65.62:48708
2019-08-26 19:01:05:464 flexisip-debug-tport(0x55b7f2ea28a0):
found from primary TCP/151.228.65.62:48708
2019-08-26 19:01:05:464 flexisip-debug-tport_tsend(0x55b7f2ea28a0)
tpn = TCP/151.228.65.62:48708
2019-08-26 19:01:05:465 flexisip-debug-tport_vsend returned 1026
2019-08-26 19:01:05:465 flexisip-debug-tport(0x55b7f2ea28a0): set
timer at 1800000 ms because keepalive
2019-08-26 19:01:05:465 flexisip-debug-nta_msg_tsend(response)
2019-08-26 19:01:05:465 flexisip-debug-Terminate SipEvent
0x55b7f2eab190
2019-08-26 19:01:05:465 flexisip-debug-tport(0x55b7f2eb4260): set
timer at 1784895 ms because keepalive
2019-08-26 19:01:05:465 flexisip-debug-tport(0x55b7f2eb4260): set
timer at 1784895 ms because keepalive
2019-08-26 19:01:05:509
flexisip-debug-tport_wakeup(0x55b7f2ea28a0): events IN
2019-08-26 19:01:05:510
flexisip-debug-tport_recv_event(0x55b7f2ea28a0)
2019-08-26 19:01:05:510
flexisip-debug-tport_recv_iovec(0x55b7f2ea28a0) msg 0x55b7f2eb1cf0
from (tcp/151.228.65.62:48708) has 812 bytes, veclen = 1
2019-08-26 19:01:05:510
flexisip-debug-tport_deliver(0x55b7f2ea28a0): msg 0x55b7f2eb1cf0
(812 bytes) from tcp/151.228.65.62:48708 next=(nil)
2019-08-26 19:01:05:511 flexisip-debug-nta: received ACK
sip:37.187.101.138:5060;transport=tcp;verified SIP/2.0 (CSeq 21)
2019-08-26 19:01:05:511 flexisip-debug-nta: Via check:
received=151.228.65.62
2019-08-26 19:01:05:511 flexisip-debug-nta: ACK (21) to message
callback
2019-08-26 19:01:05:511 flexisip-debug-New SipEvent 0x55b7f2ee0810
- msg 0x55b7f2eb1cf0
2019-08-26 19:01:05:512 flexisip-debug-Receiving new Request SIP
message ACK from sip:address@hidden :
ACK sip:37.187.101.138:5060;transport=tcp;verified SIP/2.0
Via: SIP/2.0/TCP
192.168.0.73:48708;branch=z9hG4bK.cDoiwu3KQ;rport=48708;received=151.228.65.62
From: <sip:address@hidden>;tag=tX3SiY2Qt
To:
<sip:address@hidden>;tag=b63ddbe4-1bc1-4680-b943-f1a9cf00ebae
CSeq: 21 ACK
Call-ID: xXz0w~rUoq
Max-Forwards: 70
Route: <sip:37.187.101.138:6060;transport=tcp;lr>
Route: <sip:37.187.101.138:37831;transport=TCP;lr>
Authorization: Digest realm="asterisk",
nonce="1566842450/4a96096cf32ed021af4012039e815a5b",
algorithm=md5, opaque="36a9cba70bc0b5ba", username="101",
uri="sip:address@hidden",
response="51d1d32c2ad950159190ef0c068ccc31",
cnonce="NU76q9Yj5Mu0qNMX", nc=00000001, qop=auth
User-Agent: LinphoneAndroid/4.1.1 (Galaxy S9)
LinphoneSDK/4.2-8-g96666b3 (release/4.2)
Content-Length: 0
2019-08-26 19:01:05:512 flexisip-debug-Invoking onRequest() on
module DoSProtection
2019-08-26 19:01:05:512 flexisip-debug-Invoking onRequest() on
module SanityChecker
2019-08-26 19:01:05:513 flexisip-debug-Skipping onRequest() on
module GarbageIn
2019-08-26 19:01:05:513 flexisip-debug-Invoking onRequest() on
module NatHelper
2019-08-26 19:01:05:513 flexisip-debug-Skipping onRequest() on
module Authentication
2019-08-26 19:01:05:513 flexisip-debug-Skipping onRequest() on
module Redirect
2019-08-26 19:01:05:513 flexisip-debug-Skipping onRequest() on
module GatewayAdapter
2019-08-26 19:01:05:513 flexisip-debug-Skipping onRequest() on
module Presence
2019-08-26 19:01:05:514 flexisip-debug-Invoking onRequest() on
module Registrar
2019-08-26 19:01:05:514 flexisip-debug-Skipping onRequest() on
module StatisticsCollector
2019-08-26 19:01:05:514 flexisip-debug-Invoking onRequest() on
module ContactRouteInserter
2019-08-26 19:01:05:514 flexisip-debug-No countact route parameter
found
2019-08-26 19:01:05:514 flexisip-debug-Skipping onRequest() on
module Router
2019-08-26 19:01:05:515 flexisip-debug-Invoking onRequest() on
module PushNotification
2019-08-26 19:01:05:515 flexisip-debug-Skipping onRequest() on
module LoadBalancer
2019-08-26 19:01:05:515 flexisip-debug-Skipping onRequest() on
module MediaRelay
2019-08-26 19:01:05:515 flexisip-debug-Skipping onRequest() on
module Transcoder
2019-08-26 19:01:05:515 flexisip-debug-Invoking onRequest() on
module Forward
2019-08-26 19:01:05:516 flexisip-debug-Removing top route
sip:37.187.101.138:6060;transport=tcp;lr
2019-08-26 19:01:05:516 flexisip-debug-tport: not found from
primary 0x55b7f2e889a0, trying another
one...TCP/37.187.101.138:37831
2019-08-26 19:01:05:516 flexisip-debug-tport: not found from
primary 0x55b7f2e89f00, trying another
one...TCP/37.187.101.138:37831
2019-08-26 19:01:05:516 flexisip-debug-Sending Request SIP message
to sip:37.187.101.138:37831;transport=TCP;lr
ACK sip:37.187.101.138:5060;transport=tcp;verified SIP/2.0
Via: SIP/2.0/TCP
192.168.0.73:48708;branch=z9hG4bK.cDoiwu3KQ;rport=48708;received=151.228.65.62
From: <sip:address@hidden>;tag=tX3SiY2Qt
To:
<sip:address@hidden>;tag=b63ddbe4-1bc1-4680-b943-f1a9cf00ebae
CSeq: 21 ACK
Call-ID: xXz0w~rUoq
Max-Forwards: 69
Route: <sip:37.187.101.138:37831;transport=TCP;lr>
Authorization: Digest realm="asterisk",
nonce="1566842450/4a96096cf32ed021af4012039e815a5b",
algorithm=md5, opaque="36a9cba70bc0b5ba", username="101",
uri="sip:address@hidden",
response="51d1d32c2ad950159190ef0c068ccc31",
cnonce="NU76q9Yj5Mu0qNMX", nc=00000001, qop=auth
User-Agent: LinphoneAndroid/4.1.1 (Galaxy S9)
LinphoneSDK/4.2-8-g96666b3 (release/4.2)
Content-Length: 0
I think the next step is to dig into the code to find out how the
Route headers are managed but I think I'm going to look elsewhere
for a solution to my push notification problem for now.
Thanks for your help so far and I'll swing back round on to this
when I've got a couple of days free to really get into it.
Kind regards,
|
Gary
Steinert
Ascend
Design
T:
01743 387378
|
|
On 26/08/2019 18:05, Joel Linn wrote:
Using debug=true I determined flexisip sends the
messages to itself, resulting in al loop.
So, some progress I think with the hangup issue.
Using ngrep and sngrep I can see most of the SIP messages
passing:
Caller -> Flexisip -> Asterisk -> Flexisip ->
Callee
and back again.
EXCEPT for the BYE message when I end the call. This goes
from the caller/callee, through Flexisip and in to Asterisk
(which replies with an OK) but doesn't pass the BYE on to
the other end of the chain.
Googling has so far yeilded nothing useful, so I'm going to
go dig through some config files to see what I can find.
If anyone else strikes gold while I'm gone please let me
know!
Kind regards,
|
Gary
Steinert
Ascend
Design
T:
01743 387378
|
|
On 26/08/2019 15:39, Gary
Steinert wrote:
Hi Joel,
I was afraid you'd say that!
I'll try to get the proxy working properly first then. If
I can get to that point I'll brush off my Java skills!
I assume the same would apply to push notifications to an
iOS app? That's where I've got the main issue - I'm just
trying to get Android working first as I don't have access
to a Mac at the moment.
I'll report back if I have any joy.
Kind regards,
|
Gary
Steinert
Ascend
Design
T:
01743 387378
|
|
On 26/08/2019 15:14, Joel Linn
wrote:
On
2019-08-26 12:21, Gary Steinert wrote:
Morning all,
I'm trying to get Flexisip set up in from of my Asterisk
install to function as a push proxy.
I've got Flexisip installed, running on port 6060 and
accepting registrations. There's no call sound yet, but
that's the next rabbit hole I'm going to dive down.
My issue at the moment is getting push notifications out
to an Android device running the Linphone app. I get a
MismatchSenderId response from flexisip_pusher.
I believe I've got the right combination of --appid and
--key as I've moved on from the 401 Unauthorized
responses and the --pntok was taken directly from a
tcpdump capture of the registration.
From an afternoon of Googling, most of the info I've
found has been to do with people developing their own
apps using liblinphone. In those cases this error was
caused by the app config not matching the push
notification config. The app config being something I
don't have control over.
Is the Server Key a push notification is sent from tied
to the app that will receive it?
Do I therefore need to publish my own clone of Linphone
in order to get this to work?
Or have I missed something else along the way?
You indeed need to publish your own App or install the apk
manually to the users.
Generate a new Google Project and api keys and change the
fields in app/google-services.json
https://gitlab.linphone.org/BC/public/linphone-android/blob/master/app/google-services.json
While at it I would recommend changing the package name
and displayed name to distinguish your version,
customization is pretty easy.
That being said rolling your own Version of the app seems
to be the easiest part.
I wasn't able to get flexisip to proxy sip connection
properly in the first place.
Concerning call sound, try disabling the MediaRelay module
if you do not need it.
Please report back if you get it to work, as I hit some
problems with calls not getting terminated at that point.