SIP not working.

wyvasi

Member
Hello,
I am trying to integrate Asterisk pjsip with flashphoner.
I am going to page SIP -> Phone I register successfully, but I don't receive calls in that page and if I call from that page to zoiper call goes on hold.
I sent logs to support mail and also used report button.
 
Last edited:

Max

Administrator
Staff member
Hello

Please gather dump and logs following the instructions:

1. Launch dump process (strictly before starting the test call)

Code:
tcpdump udp -s 4096 -w log.pcap
options (if you know network interface where SIP and RTP traffic is going)

Code:
tcpdump -i eth0 udp -s 4096 -w log.pcap
2. Make a test call.

3. Stop dump. Press CTRL+C to stop the dump process.

4. Open your log.pcap file in Wireshark and make sure SIP traffic has been captured successfully

5. Zip
- log.pcap
- /usr/local/FlashphonerWebCallServer/logs/server/flashphoner.log

6. Send us using the report form

We will analyze SIP traffic and provide a report with recommendations.
 

Max

Administrator
Staff member
We found report related this thread.

See log message
Code:
11:55:15,198 DEBUG          sipMessages - UDPMessageChannelThread-30001-81
This message says that Asterisks sends SDP in 200 OK response:

Code:
v=0
o=- 0 3975673212 IN IP4 ...
s=Asterisk
c=IN IP4 ...
t=0 0
m=audio 10090 RTP/AVP 111 101
a=rtpmap:111 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:20
a=recvonly
As you can see the 200 OK response has "a=recvonly" in section m=audio.
This means the call is put on hold by Asterisk.

Expected: a=sendrecv
Actual: a=recvonly

Please configure Asterisk extension properly to return sendrecv instead of recvonly
 

wyvasi

Member
I can't find a solution. Only configuration I found that is related to sendrecv is moh_passthrough=yes and I added it to pjsip endpoints.
I can make calls from flashphoner phone to flasphoner phone, but I still can't make calls from flashphoner (phone or REST call) to any softphones(microsip, zoopier, bria) because call goes on HOLD.
And I need to restart flashphoner server sometimes because even if it was SIP REGISTERED there is no incoming calls.
I reported new logs.
Thank you.
 

Max

Administrator
Staff member
can't find a solution. Only configuration I found that is related to sendrecv is moh_passthrough=yes and I added it to pjsip endpoints.
I can make calls from flashphoner phone to flasphoner phone, but I still can't make calls from flashphoner (phone or REST call) to any softphones(microsip, zoopier, bria) because call goes on HOLD.
You've provided log and dump from a different calls.
Seems like a possible issue can be in SIP UDP signaling usage: in log we see that SDP received from far end seems to be cut. So you should either use the following parameter in flashphoner.properties file
Code:
sip_force_tcp=true
or exclude codecs which never used in SIP calls, for examlpe
Code:
allow_outside_codecs=false 
codecs_exclude_sip=mpeg4-generic,flv,mpv,speex16,h264,vp8
If this does not help, please provide us SSH access to WCS server and two SIP accounts to test using this form.
 

wyvasi

Member
None of parameters worked.
I can't give SSH access.
You can please try to test on https://demo.flashphoner.com/ ? using my sip server/accounts or yours. I reported my sip details.
Our end goal is to call from 'SIP as RTMP" page (first account) to "SIP Phone" page (second account) and listen but it always put on HOLD as I specified before. If I register with 2 accounts on SIP Phone it works calling each other.
Problem is using the "rest-api/call/startup" endpoint and never works calling from flashphoner to any softphone, only other way around.

Thank you!
 
Last edited:

Max

Administrator
Staff member
We tried to establish a call using credentials you've provided.
Unfortunately, it cannot be established neither from WCS to Bria (or vice versa), nor from Bria to PortGo/MicroSIP/etc. We do not receive any response on INVITE from your SIP PBX:
1628476371172.png

Also, seems like your PBX does not support SIP TCP signaling: when enabled, we cannot even register. The only way to bypass INVITE SDP cutting is to exclude codecs.
We recommend to check the PBX configuration to allow SIP calls from external IPs, or to provide SSH access to WCS server which is allowed to establish a call to test.
 

wyvasi

Member
I enabled tcp on PBX, added sip_force_tcp=true and now calls can be established from WCS to Bria. But it still goes on hold(Bria saying that call is on hold by other party). I added a new report if you could please take a look.

Is there some asterisk/pjsip configuration to enforce a=sendrecv? because I couldn't find anything related except moh_passthrough=yes.
Also both application( pbx and wcs) run on same server, can it be the cause? I made sure all ports are open and not overlapping.
Thanks!
 

Max

Administrator
Staff member
We still cannot establish a call from our test server using SIP credentials provided. After enabling SIP TCP signaling, the call is started, but we do not receive any message after Ringing, then cancelled.
1628562452955.png

We shecked log and dump provided. But this is different log and dump (timestamps and messages content does not match.
So please provide full report as decribed here with traffic dump collected during the same call, or provide SSH access to the server using the report form.
 

Max

Administrator
Staff member
Try also to exclude Opus codec:
Code:
codecs_exclude_sip=opus,mpeg4-generic,flv,mpv,speex16,h264,vp8
 

wyvasi

Member
Endpoints were still using UDP, now they should work on TCP. And again I don't receive calls on bria. I uploaded all logs this time.

I received the call on MicroSIP but goes on HOLD again. I also sent clean logs from this test.
 
Last edited:

Max

Administrator
Staff member
We still cannot establish a call from our test server using SIP credentials provided. After Trying, SIP PBX sends INVITE to WCS, then after 30 seconds rejects the call with 503 Service unavailable
1628651421759.png

PBX should not send INVITE in this sequence.
Also, we checked the report. It was not collected with report tool so it contains no information about WCS version and configuration.
The dump contains no SIP traffic at all. According to logs, WCS receives Trying, then OK and then sends CANCEL. It seems like the call was cancelled manually.
We found some misconfiguration in server log:
1. Opus codec is excluded only for SIP as RTMP calls, but not for browser SIP calls as we recommended above. Note that codecs_exclude_sip and codecs_exclude_sip_rtmp are different parameters for different cases.
2. Browser codecs are not excluded as we recommended here with allow_outside_codecs=false
3. Local IP is set to 0.0.0.0. It should be set properly.
4. There's no such parameter webrtc_cc_local_k_treshold, please remove it.
Also please clarify, what WCS version do you test? The latest WCS build is 5.2.1010.
 

wyvasi

Member
After I changed Local IP and updated wcs to latest version I can use the REST Method 'rest-api/call/startup' which is good. But when I try to '/call/inject_stream/startup' there is no sound.
This is what I am trying to achieve now. https://docs.flashphoner.com/pages/viewpage.action?pageId=9242392
I added report as suggested, not sure is full because I got sudo error in docker container.
Thanks!

I can't upload logs I get an error at the moment, I will send them via email.
 
Last edited:

Max

Administrator
Staff member
Good day.
We cannot reproduce the issue using SIP as RTMP example. Try to test as follows:
1. Publish a stream test using Media Devices example:
1629255516746.png

2. Open SIP as RTMP 4 example https://wcs:8444/client2/examples/demo/sip/sip-as-rtmp-4/sip-as-rtmp-4.html (SIP as RTMP 3 in dashboard):
- Enter your SIP credentials (1)
- Enter stream name test to Stream field of Stream injection to SIP call box (2)
- Enter callee and press Call (3)
- When call becomes established, press Inject (4)
1629255902400.png

This test works for us on build 5.2.1016 with the following parameters from your report
Code:
sip_force_tcp=true
allow_outside_codecs=false
codecs_exclude_sip=opus,mpeg4-generic,flv,mpv,speex16,h264,vp8
codecs                   =opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
We tried to set PCMA (alaw), PCMU (ulaw), G722 on callees' side.
Please try to reproduce the issue as recommended.
Also note that you've set
Code:
codecs_exclude_sip_rtmp  =opus,g729,g722,mpeg4-generic,vp8,mpv
As we see from logs, you're using G722 on callees' side. In this case it's not recomended to be excluded to prevent an excessive audio transcoding. Or you can switch to PCMA or PCMU.
Your settings contain another issue which affects broadcasting. Seems like you've enabled a pacer feature
Code:
# Traffic encryption in a separate thread for each client session
rtp_paced_sender=true
rtp_paced_sender_initial_rate=200000
rtp_paced_sender_increase_interval=50
rtp_paced_sender_k_up=0.9
This is strongly not recommended. Please use Stream distribution optimization feature instead:
Code:
streaming_distributor_subgroup_enabled=true
streaming_distributor_subgroup_size=50
streaming_distributor_audio_subgroup_size=500
streaming_distributor_subgroup_queue_size=300
streaming_distributor_subgroup_queue_max_waiting_time=5000
streaming_distributor_audio_subgroup_queue_size=300
streaming_distributor_audio_subgroup_queue_max_waiting_time=5000
in combination with WebRTC traffic encryption hardware acceleration
 

wyvasi

Member
Good day!

I tried to use PCMU, PCMA but still no sound. I sent logs to support@flashphoner.com, because report page doesn't work. I keep getting this error:
для support@flashphoner.com не было доставлено через ApMailer\Smtp. Ошибка: 104: Не удалось считать данные из сокета. Ошибка: Undefined index: cert_private_key

Thanks for help!
 
Last edited:

Max

Administrator
Staff member
We received both reports.
You have a couple of configuration problems:
1. Media ports range
Code:
media_port_from        =30000
media_port_to          =40000
intersects with SIP PBX ports on the same host (30011). This may cause a call failure. We recommend either change SIP PBX ports or move media port range, for example
Code:
media_port_from        =31000
media_port_to          =40000
2. We do not see in logs /rest-api/call/inject_stream/startup query, but only /rest-api/call/inject_stream/terminate. Please check your flow.
3. The following parameter should be added to flashphoner.properties
Code:
generate_av_for_ua=all
to prevent call interruption due to RTP activity if you are calling from WCS to WCS (according to logs).
 
Last edited:

wyvasi

Member
After changes I tried to test it using SIP as RTMP 3 and SIP as Phone UI and it works but I can't get it to work with any softphone. On bria and zoiper5 I don't even receive calls anymore and on MicroSIP after injecting audio I still don't hear it. Maybe I need to change configuration on softphones? Do you use any softphones to test?
Thank you!
 

Max

Administrator
Staff member
Maybe I need to change configuration on softphones? Do you use any softphones to test?
Yes, we use Bria to test.
Thre is a problem with SIP PBX setup again. When we trying to test a call with it, we cannot make a call from Bria to WCS (or from one Bria instance to another). Also, if we trying to call from WCS to Bria, Bria successfully receive the call, but WCS stuck in RING state. The reason is Contact field which Asterisk sends in OK after Ringing:
Code:
Contact: <sip:10.90.0.2:30011;transport=TCP>
And our test server tries to send ACK to this local address and fails.
So we cannot reproduce a problem on our test server.
Please check audio codecs setup on the softphone you use, it should be equal to WCS codecs setup.
If this does not help, we need an SSH access to your server to test with it. You can also deploy the same WCS configuration and Asterisk configuration on public server for testing purposes if you cannot provide SSH access to the server directly. Please use this form for credentials.
Another option is to configure Asterisk to send contact Id correctly, in this case we make a test on our test server with your Asterisk.
 
Top