SOLVED Unable to make video calls and SIP SIMPLE support

Status
Not open for further replies.

alexcc

New Member
May 15, 2020
8
1
3
54
Just installed FusionPBX on a VPS - migrating from FreePBX. Its completely cloud instadd all my SIP clients are coming from the internet - there is no local LAN traffic.

Two of the features that I am struggling with are video calls and SIP SIMPLE archiving

1. Unable to make video calls: I reviewed the post https://www.pbxforums.com/threads/solved-video-calls-arent-working.3268/#post-10484 and added H264 in my global codec. but video calls still fail. Extract of displayed from fs_cli below

1589817184481.png

2020-05-18 11:41:49.312115 [DEBUG] sofia.c:7325 Channel sofia/internal/3001@box10.mydomain.net:5060 entering state [received][100]
2020-05-18 11:41:49.312115 [DEBUG] sofia.c:7335 Remote SDP:
v=0
o=- 4543661351 52263 IN IP4 89.211.168.41
s=extuliz
c=IN IP4 89.211.168.41
t=0 0
m=audio 32996 RTP/AVP 0 8 18 101
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
m=video 27446 RTP/AVP 108 99
a=rtpmap:108 VP8/90000
a=fmtp:108 max-fr=30;max-fs=3600
a=rtpmap:99 H264/90000
a=fmtp:99 profile-level-id=42800d;packetization-mode=1;level-asymmetry-allowed=1


2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[G722:9:8000:20:64000:1]
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5647 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[G722:9:8000:20:64000:1]
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5647 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [G729:18:8000:20:8000:1]/[G722:9:8000:20:64000:1]
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [G729:18:8000:20:8000:1]/[PCMU:0:8000:20:64000:1]
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5592 Audio Codec Compare [G729:18:8000:20:8000:1]/[PCMA:8:8000:20:64000:1]




2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5508 Set telephone-event payload to 101@8000
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5851 Set telephone-event payload to 101@8000
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:5909 sofia/internal/3001@box10.mydomain.net:5060 Set 2833 dtmf send payload to 101 recv payload to 101
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:6237 No matches with FTMP, fallback to ignoring FMTP
2020-05-18 11:41:49.312115 [DEBUG] switch_core_media.c:6245 No matches with inherit_codec, fallback to ignoring PT


2. SIP SIMPLE archiving: SIP SImple messaging is working fine between extensions, but the v_messages table in the freeswitch database is blank. The only messages that it is storing are messages send from the FusionPBX GUI (FUSION PBX -> Applications -> Messages)

Is there any way to store the messages between the extensions in the Postgress database?
 
Last edited:

alexcc

New Member
May 15, 2020
8
1
3
54
2. SIP SIMPLE archiving:

I managed to do this also for text messages. There is already a table in the freeswitch database called v_messages

Step 1: edit /etc/freeswitch/chatplan/default.xml. Make sure that the context name matched the correct SIP profile. In my case 'public'. Add the name of the new lua script to be executed


<context name="public">
<extension name="demo">
<condition field="to" expression="^(.*)$">
<action application="lua" data="simple-sms.lua"/>
</condition>
</extension>


Step 2: create a new lua script


--include the database class
local Database = require "resources.functions.database";

--include json library
local json = require "resources.functions.lunajson";

from_user = message:getHeader("from_user");
to_user = message:getHeader("to_user");
message_text = message:getBody();

--create a new uuid and add it to the uuid list
message_uuid = api:executeString("create_uuid");

if (from_user_exists == 'true') then
--set the direction
message_direction = 'send';
else
message_direction = 'receive';
end


dbh = Database.new('system');
--sql statement
sql = "INSERT INTO v_messages ";
sql = sql .."( ";
sql = sql .."message_uuid, ";
sql = sql .."message_direction, ";
sql = sql .."message_date, ";
sql = sql .."message_from, ";
sql = sql .."message_to, ";
sql = sql .."message_text ";
sql = sql ..") ";
sql = sql .."VALUES ( ";

sql = sql ..":message_uuid, ";
sql = sql ..":message_direction, ";
sql = sql .."now(), ";
sql = sql ..":message_from, ";
sql = sql ..":message_to, ";
sql = sql ..":message_text ";
sql = sql ..") ";

local params= {}
params['message_uuid'] = message_uuid;
params['message_direction'] = message_direction;
params['message_from'] = message_from;
params['message_to'] = message_to;
params['message_text'] = message_text;

--show debug info
if (debug["sql"]) then
freeswitch.consoleLog("notice", "[call_center] SQL: " .. sql .. "; params:" .. json.encode(params) .. "\n");
end

dbh:query(sql, params);
 
Status
Not open for further replies.