SIMPLE messaging

Status
Not open for further replies.

cemotyz09

Member
Apr 23, 2020
83
7
8
I'm trying to get SIMPLE messaging working between 2 extensions that are on local lan no firewall in between them but when I send from 1 client it has the ip address rather than the domain as the host but from the other client it sends it correctly.
Clients are both linphone, the problem one is android version the desktop sends it's correctly.
Fusionpbx version is 4.5.20. I believe it's just a freeswitch issue though. Anyone know what needs to be set to correct this?
*edit. I've found my issue to be
Code:
from_full: [<sip:1102@192.168.1.5>;tag=s7UQGAjN9]
and I've edited the dialplan to set that to the user@to_host but now messages don't work at all. I'm pretty sure its that "tag" at the end. How would I be able to keep the tag the same while setting the sip user?
Code:
                <extension name="other">
                        <condition field="to" expression="^(.*)$">
                        <!-- <condition field="from" expression="^(?!${from_user}@${to_host}$)" -->
                                <action application="set" data="from=${from_user}@${to_host}"/>
                                <action application="set" data="from_host=${from_user}@${to_host}"/>
                                <action application="set" data="from_full=${from_user}@${to_host}"/>
                                <action application="set" data="final_delivery=true"/>
                                <action application="info"/>
                                <action application="send"/>
                        </condition>
Code:
Dvdhs

Content-Length: 5
final_destination: [true]
from_full: [<sip:1102@192.168.1.5>]
final_delivery: [true]
from: [1102]
skip_global_process: [true]
chat_proto: [sip]
dest_proto: [sip]
to: [1103@voice.domain.lan]
DP_MATCH: [1103@voice.domain.lan]
max_forwards: [70]
sip_profile: [internal]
type: [text/plain]
context: [public]
subject: [SIMPLE MESSAGE]
from_sip_port: [43170]
from_sip_ip: [192.168.1.5]
to_host: [voice.domain.lan]
to_user: [1103]
from_host: [192.168.1.5]
from_user: [1102]
to_proto: [sip]
proto: [sip]
login: [sip:mod_sofia@192.168.1.17:5060]
Event-Sequence: [10590]
Event-Calling-Line-Number: [4884]
Event-Calling-Function: [sofia_presence_handle_sip_i_message]
Event-Calling-File: [sofia_presence.c]
Event-Date-Timestamp: [1608837382893783]
Event-Date-GMT: [Thu, 24 Dec 2020 19:16:22 GMT]
Event-Date-Local: [2020-12-24 13:16:22]
FreeSWITCH-IPv6: [::1]
FreeSWITCH-IPv4: [192.168.1.17]
FreeSWITCH-Switchname: [voice.domain.lan]
FreeSWITCH-Hostname: [voice.domain.lan]
Core-UUID: [6c278807-2c62-42b2-9135-48784d40e27b]
Event-Name: [MESSAGE]
2020-12-24 13:16:22.893783 [INFO] mod_sms.c:495 CHANNEL_DATA:
Dvdhs

Content-Length: 5
final_delivery: [true]
DP_MATCH: [1103@voice.domain.lan]
max_forwards: [70]
dest_proto: [sip]
sip_profile: [internal]
from_full: [<sip:1102@192.168.1.5>;tag=s7UQGAjN9]
type: [text/plain]
context: [public]
subject: [SIMPLE MESSAGE]
to: [1103@voice.domain.lan]
from_sip_port: [43170]
from_sip_ip: [192.168.1.5]
to_host: [voice.domain.lan]
to_user: [1103]
from_host: [192.168.1.5]
from_user: [1102]
from: [1102@192.168.1.5]
to_proto: [sip]
proto: [sip]
login: [sip:mod_sofia@192.168.1.17:5060]
Event-Sequence: [10590]
Event-Calling-Line-Number: [4884]
Event-Calling-Function: [sofia_presence_handle_sip_i_message]
Event-Calling-File: [sofia_presence.c]
Event-Date-Timestamp: [1608837382893783]
Event-Date-GMT: [Thu, 24 Dec 2020 19:16:22 GMT]
Event-Date-Local: [2020-12-24 13:16:22]
FreeSWITCH-IPv6: [::1]
FreeSWITCH-IPv4: [192.168.1.17]
FreeSWITCH-Switchname: [voice.domain.lan]
FreeSWITCH-Hostname: [voice.domain.lan]
Core-UUID: [6c278807-2c62-42b2-9135-48784d40e27b
 
Last edited:

mydigitalself

Member
Oct 20, 2019
71
7
8
Try adding this to the chat plan.

<extension name="allowed-local">
<condition field="from_host" expression="<replace with allowed domain>" >
<action application="set" data="final_delivery=true"/>
<action application="info"/>
<action application="send"/>
</condition>
</extension>

There is a chatplan for SMS in this addon that allows for internal and/or external messaging:
 

cemotyz09

Member
Apr 23, 2020
83
7
8
Thanks but that evaluates as false since something is causing my from_host to be the ip address. I can set the variable to change that but the issue stays since from_full isn't correct, I believe. The problem is the messages don't show as 'threaded' , ie. in the same chat window, I send it in one window and receive in another window if that helps
 
Last edited:

cemotyz09

Member
Apr 23, 2020
83
7
8
I'm using the blink sip phone and it seems to use html tags for the simple messaging which microsip doesn't seem to understand. Is there a way to strip that and only pass the messsage?
Code:
2022-06-18 07:33:58.235471 97.87% [INFO] mod_sms.c:368 Processing text message dad->1100 in context public
Chatplan: 1100 parsing [public->ten-digit] continue=false
Chatplan: 1100@www.example.com Regex (FAIL) [ten-digit] to(1100@www.example.com) =~ /^(\d{10}.*)$/ break=on-false
Chatplan: 1100 parsing [public->unreg] continue=false
Chatplan: 1100@www.example.com Regex (PASS) [unreg] ${sofia_contact(profile/${to})}(error/user_not_registered) =~ /error\/user_not_registered/ break=on-false
Chatplan: 1100@www.example.com Action set(final_delivery=true)
2022-06-18 07:34:03.255475 95.43% [WARNING] sofia_reg.c:1861 SIP auth challenge (INVITE) on sofia profile 'internal' for [test@www.example.com] from ip 76.186.11.137
2022-06-18 07:34:08.375463 94.97% [WARNING] sofia_reg.c:1861 SIP auth challenge (INVITE) on sofia profile 'internal' for [test@www.example.com] from ip 76.186.11.137
2022-06-18 07:34:13.475467 95.07% [WARNING] sofia_reg.c:1861 SIP auth challenge (INVITE) on sofia profile 'internal' for [test@www.example.com] from ip 76.186.11.137
2022-06-18 07:34:18.575463 95.23% [WARNING] sofia_reg.c:1861 SIP auth challenge (INVITE) on sofia profile 'internal' for [test@www.example.com] from ip 76.186.11.137
2022-06-18 07:34:23.735464 95.73% [WARNING] sofia_reg.c:1861 SIP auth challenge (INVITE) on sofia profile 'internal' for [test@www.example.com] from ip 76.186.11.137
2022-06-18 07:34:25.375463 95.73% [WARNING] sofia_reg.c:1861 SIP auth challenge (INVITE) on sofia profile 'internal' for [dad@www.example.com] from ip 76.186.11.137
2022-06-18 07:34:25.435469 95.73% [INFO] mod_sms.c:368 Processing text message test->dad in context public
Chatplan: dad parsing [public->ten-digit] continue=false
Chatplan: dad@www.example.com Regex (FAIL) [ten-digit] to(dad@www.example.com) =~ /^(\d{10}.*)$/ break=on-false
Chatplan: dad parsing [public->unreg] continue=false
Chatplan: dad@www.example.com Regex (FAIL) [unreg] ${sofia_contact(profile/${to})}(sofia/internal/sip:dad@192.168.1.107:58996;transport=TLS;ob;fs_nat=yes;fs_path=sip%3Adad%4076.186.11.137%3A58996%3Btransport%3DTLS%3Bob) =~ /error\/user_not_registered/ break=on-false
Chatplan: dad parsing [public->allowed-local] continue=false
Chatplan: dad@www.example.com Regex (PASS) [allowed-local] from_host(www.example.com) =~ /www.example.com/ break=on-false
Chatplan: dad@www.example.com Action set(final_delivery=true)
Chatplan: dad@www.example.com Action info()
Chatplan: dad@www.example.com Action send()
2022-06-18 07:34:25.435469 95.73% [INFO] mod_sms.c:495 CHANNEL_DATA:
Event-Name: [MESSAGE]
Core-UUID: [61005d26-db0b-49a9-a26f-572aa6b791de]
FreeSWITCH-Hostname: [fpbx]
FreeSWITCH-Switchname: [fpbx]
FreeSWITCH-IPv4: [10.0.0.73]
FreeSWITCH-IPv6: [::1]
Event-Date-Local: [2022-06-18 07:34:25]
Event-Date-GMT: [Sat, 18 Jun 2022 12:34:25 GMT]
Event-Date-Timestamp: [1655555665435469]
Event-Calling-File: [sofia_presence.c]
Event-Calling-Function: [sofia_presence_handle_sip_i_message]
Event-Calling-Line-Number: [4891]
Event-Sequence: [80584]
login: [sip:mod_sofia@100.100.100.100:5060]
proto: [sip]
to_proto: [sip]
from: [test@www.example.com]
from_user: [test]
from_host: [www.example.com]
to_user: [dad]
to_host: [www.example.com]
from_sip_ip: [76.186.11.137]
from_sip_port: [39725]
to: [dad@www.example.com]
subject: [SIMPLE MESSAGE]
context: [public]
type: [text/html]
from_full: ["Carlos E" <sip:test@www.example.com>;tag=e15f6eb5-80a0-4649-ae5b-ebd08c3a5137]
sip_profile: [internal]
dest_proto: [sip]
max_forwards: [70]
final_delivery: [true]
Content-Length: 450

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Cantarell'; font-size:11pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">test</p></body></html>
 
Status
Not open for further replies.