Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_pgsql.c:552 Error executing query: value too long for type character varying(255) on INVITE from LinphoneAndroid/4.6.14 #1866

Open
dilyanpalauzov opened this issue Nov 20, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@dilyanpalauzov
Copy link
Contributor

upon receiving from Linphone this packet:

recv 1548 bytes from udp/[192.168.0.146]:60979 at 13:18:42.024773:                                                                      
------------------------------------------------------------------------                                                                
INVITE sip:[13@192.168.0.199](mailto:13@192.168.0.199) SIP/2.0                                                                                                     
Via: SIP/2.0/UDP 192.168.0.146:60979;branch=z9hG4bK.8Jt0a~Mrl;rport                                                                     
From: "17" <sip:[17@192.168.0.199](mailto:17@192.168.0.199)>;tag=4gQEL2Gnu                                                                                         
To: sip:[13@192.168.0.199](mailto:13@192.168.0.199)                                                                                                                
CSeq: 21 INVITE                                                                                                                         
Call-ID: JjCHrXlix2                                                                                                                     
Max-Forwards: 70                                                                                                                        
Supported: replaces, outbound, gruu                                                                                                     
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, PRACK, UPDATE                                        
Content-Type: application/sdp                                                                                                           
Content-Length: 425                                                                                                                     
Contact: <sip:[17@192.168.0.146](mailto:17@192.168.0.146):60979;pn-prid=cYbkaRFUTAKJlPRczanb5L:APA91bG-OBwFYa6vlrpuDFSqFW9pV_EdbrfU-vAMMOdbvoKQFf_8N5iummtpMPsFU7jb
jFMiooS9jYqM2-3COnSngw9eoL-xckOKsNcmX6VzxVIoNSdG1ds9oOeq2dyXCngCsobMmwCl;pn-provider=fcm;pn-param=929724111839;pn-silent=1;pn-timeout=0;
transport=udp>;expires=600;+sip.instance="<urn:uuid:f2f5a3cf-a0fb-0047-be50-740fb9bdc562>"                                              
User-Agent: LinphoneAndroid/4.6.14 (CLT-L09) LinphoneSDK/5.1.62 (tags/5.1.62^0)                                                         
Proxy-Authorization:  Digest realm="192.168.0.199", nonce="23e41321-96a8-46a0-aae3-9a4d35e55b66", algorithm=MD5, username="17",  uri="si
p:[13@192.168.0.199](mailto:13@192.168.0.199)", response="b0d38675f5541fd7e8bd4f2e15ad141d", cnonce="mqgfEEfiJeT~XLy7", nc=00000001, qop=auth                      
                                                                                                                                        
v=0                                                                                                                                     
o=17 743 229 IN IP4 192.168.0.146                                                                                                       
s=Talk
c=IN IP4 192.168.0.146
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7078 RTP/AVP 96 97 0 8 3 9 18 98 101
a=rtpmap:96 speex/16000
a=fmtp:96 vbr=on
a=rtpmap:97 speex/8000
a=fmtp:97 vbr=on
a=fmtp:18 annexb=yes
a=rtpmap:98 telephone-event/16000
a=rtpmap:101 telephone-event/8000
a=rtcp-fb:* trr-int 1000
a=rtcp-fb:* ccm tmmbr


2022-11-20 13:18:42.030423 95.90% [ERR] mod_pgsql.c:552 Error executing query:
ERROR:  value too long for type character varying(255)

The system logs the above two lines. Or rather, when “sofia profile internal siptrace on” is active, fs_cli prints the above text in a row.

I am using the latest FreeSwitch (commit bb682fc).

See also https://lists.freeswitch.org/pipermail/freeswitch-users/2022-November/136041.html.

@dilyanpalauzov dilyanpalauzov added the bug Something isn't working label Nov 20, 2022
@greenbea
Copy link
Contributor

Change your column data type to text

@dilyanpalauzov
Copy link
Contributor Author

I agree some column data type shall be changed to text. But I do not know which column. Moreover I have not created the tables manually by reading the source code.

In order to fix this error not to happen to other users, the source code of FreeSWITCH shall be changed somehow.

@dilyanpalauzov
Copy link
Contributor Author

When I run freeSWITCH under strace it prints:

[pid 84702] sendto(42, "Q\0\0\3\202insert into sip_dialogs (call_id,uuid,sip_to_user,sip_to_host,sip_to_tag,sip_from_user,sip_from_host,
sip_from_tag,contact_user,contact_host,state,direction,user_agent,profile_name,hostname,contact,presence_id,presence_data,call_info,rcd,
call_info_state) values('OgQbJfQIl-','7aa8f029-9094-4727-a53e-b2e1a0cc0aa5','13','192.168.0.199','','17','192.168.0.199','-1l6slefi','17
','192.168.0.146','confirmed','inbound','LinphoneAndroid/4.6.14 (CLT-L09) LinphoneSDK/5.1.62 (tags/5.1.62^0)','internal','d','<sip:17@19
2.168.0.146:58882;pn-prid=cYbkaRFUTAKJlPRczanb5L:APA91bG-OBwFYa6vlrpuDFSqFW9pV_EdbrfU-vAMMOdbvoKQFf_8N5iummtpMPsFU7jbjFMiooS9jYqM2-3COnS
ngw9eoL-xckOKsNcmX6VzxVIoNSdG1ds9oOeq2dyXCngCsobMmwCl;pn-provider=fcm;pn-param=929724111839;pn-silent=1;pn-timeout=0;transport=udp>;expi
res=600;+sip.instance=\"<urn:uuid:f2f5a3cf-a0fb-0047-be50-740fb9bdc562>\"','17@192.168.0.199','','',1669041504,'')\0", 899, MSG_NOSIGNAL
, NULL, 0 <unfinished ...>
[pid 84702] <... sendto resumed>)       = 899
[pid 81942] <... clock_gettime resumed>{tv_sec=7522, tv_nsec=214678884}) = 0
[pid 84702] recvfrom(42,  <unfinished ...>
[pid 81942] read(35,  <unfinished ...>
[pid 84702] <... recvfrom resumed>0x7f7c7c00f0e0, 16384, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
[pid 84702] poll([{fd=42, events=POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL|POLLRDNORM|POLLRDBAND}], 1, 10000) = 1 ([{fd=42, revents=POLLIN
|POLLRDNORM}])
[pid 84702] recvfrom(42, "E\0\0\0cSERROR\0VERROR\0C22001\0Mvalue too long for type character varying(255)\0Fvarchar.c\0L632\0Rvarchar\0\
0Z\0\0\0\5I", 16384, 0, NULL, NULL) = 106

In the sip_dialogs table in Postgresql all columns are character varying(255), except the columns expires of type bigint and rcd of type int. In

INSERT INTO sip_dialogs (call_id,uuid,sip_to_user,sip_to_host,sip_to_tag,sip_from_user,sip_from_host,sip_from_tag,contact_user,contact_host,state,direction,user_agent,profile_name,hostname,contact,presence_id,presence_data,call_info,rcd,call_info_state)
VALUES('OgQbJfQIl-','7aa8f029-9094-4727-a53e-b2e1a0cc0aa5','13','192.168.0.199','','17','192.168.0.199','-1l6slefi','17','192.168.0.146','confirmed','inbound','LinphoneAndroid/4.6.14 (CLT-L09) LinphoneSDK/5.1.62 (tags/5.1.62^0)','internal','d',
'<sip:17@192.168.0.146:58882;pn-prid=cYbkaRFUTAKJlPRczanb5L:APA91bG-OBwFYa6vlrpuDFSqFW9pV_EdbrfU-vAMMOdbvoKQFf_8N5iummtpMPsFU7jbjFMiooS9jYqM2-3COnSngw9eoL-xckOKsNcmX6VzxVIoNSdG1ds9oOeq2dyXCngCsobMmwCl;pn-provider=fcm;pn-param=929724111839;pn-silent=1;pn-timeout=0;transport=udp>;expires=600;+sip.instance=\"<urn:uuid:f2f5a3cf-a0fb-0047-be50-740fb9bdc562>\"',
'17@192.168.0.199','','',1669041504,'')

The string

<sip:17@192.168.0.146:58882;pn-prid=cYbkaRFUTAKJlPRczanb5L:APA91bG-OBwFYa6vlrpuDFSqFW9pV_EdbrfU-vAMMOdbvoKQFf_8N5iummtpMPsFU7jbjFMiooS9jYqM2-3COnSngw9eoL-xckOKsNcmX6VzxVIoNSdG1ds9oOeq2dyXCngCsobMmwCl;pn-provider=fcm;pn-param=929724111839;pn-silent=1;pn-timeout=0;transport=udp>;expires=600;+sip.instance=\"<urn:uuid:f2f5a3cf-a0fb-0047-be50-740fb9bdc562>\"

is 355 bytes and is inserted into column contact. The sip_dialogs table is created in src/mod/endpoints/mod_sofia/sofia_glue.c:2486

I think the right fix would be changing CREATE TABLE sip_dialgo in src/mod/endpoints/mod_sofia/sofia_glue.c:2486,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants