[asterisk-bugs] [JIRA] (ASTERISK-20745) In MESSAGE received over WebSocket, the body last char is cut

Pedro Kiefer (JIRA) noreply at issues.asterisk.org
Wed Nov 28 07:56:45 CST 2012


    [ https://issues.asterisk.org/jira/browse/ASTERISK-20745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=200191#comment-200191 ] 

Pedro Kiefer edited comment on ASTERISK-20745 at 11/28/12 7:55 AM:
-------------------------------------------------------------------

I've added some debug to ast_websocket_read, and it's receiving all the bytes correctly, so it's probably something on chan_sip.

{noformat}
------
Length: 0x189, iter: 19
0000	4D 45 53 53 41 47 45 20 73 69 70 3A 31 31 31 31 MESSAGE sip:1111
0010	40 31 37 32 2E 32 30 2E 33 31 2E 31 33 34 20 53 @172.20.31.134 S
0020	49 50 2F 32 2E 30 0D 0A 52 6F 75 74 65 3A 20 3C IP/2.0..Route: <
0030	73 69 70 3A 31 37 32 2E 32 30 2E 33 31 2E 31 33 sip:172.20.31.13
0040	34 3A 38 30 38 38 3B 74 72 61 6E 73 70 6F 72 74 4:8088;transport
0050	3D 77 73 3B 6C 72 3E 0D 0A 56 69 61 3A 20 53 49 =ws;lr>..Via: SI
0060	50 2F 32 2E 30 2F 54 43 50 20 31 35 38 2E 37 32 P/2.0/TCP 158.72
0070	2E 35 33 2E 39 39 3B 62 72 61 6E 63 68 3D 7A 39 .53.99;branch=z9
0080	68 47 34 62 4B 35 31 39 38 33 34 35 0D 0A 4D 61 hG4bK5198345..Ma
0090	78 2D 46 6F 72 77 61 72 64 73 3A 20 36 39 0D 0A x-Forwards: 69..
00a0	54 6F 3A 20 73 69 70 3A 31 31 31 31 40 31 37 32 To: sip:1111 at 172
00b0	2E 32 30 2E 33 31 2E 31 33 34 0D 0A 46 72 6F 6D .20.31.134..From
00c0	3A 20 73 69 70 3A 31 32 33 36 40 31 37 32 2E 32 : sip:1236 at 172.2
00d0	30 2E 33 31 2E 31 33 34 3B 74 61 67 3D 62 63 65 0.31.134;tag=bce
00e0	34 74 6C 72 74 39 70 0D 0A 43 61 6C 6C 2D 49 44 4tlrt9p..Call-ID
00f0	3A 20 74 69 74 78 69 73 6E 71 6D 37 37 39 6B 64 : titxisnqm779kd
0100	6A 64 75 30 75 64 0D 0A 43 53 65 71 3A 20 38 35 jdu0ud..CSeq: 85
0110	37 31 20 4D 45 53 53 41 47 45 0D 0A 43 6F 6E 74 71 MESSAGE..Cont
0120	65 6E 74 2D 54 79 70 65 3A 20 74 65 78 74 2F 70 ent-Type: text/p
0130	6C 61 69 6E 0D 0A 53 75 70 70 6F 72 74 65 64 3A lain..Supported:
0140	20 70 61 74 68 2C 20 6F 75 74 62 6F 75 6E 64 2C  path, outbound,
0150	20 67 72 75 75 0D 0A 55 73 65 72 2D 41 67 65 6E  gruu..User-Agen
0160	74 3A 20 4A 73 53 49 50 20 30 2E 32 2E 31 0D 0A t: JsSIP 0.2.1..
0170	43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 Content-Length: 
0180	34 0D 0A 0D 0A 61 73 64 66                      4....asdf       
------
{noformat}
                
      was (Author: pedrokiefer):
    I've added some debug to ast_websocket_read, and it's receiving all the bytes correctly, so it's probably something on chan_sip.

------
Length: 0x189, iter: 19
0000	4D 45 53 53 41 47 45 20 73 69 70 3A 31 31 31 31 MESSAGE sip:1111
0010	40 31 37 32 2E 32 30 2E 33 31 2E 31 33 34 20 53 @172.20.31.134 S
0020	49 50 2F 32 2E 30 0D 0A 52 6F 75 74 65 3A 20 3C IP/2.0..Route: <
0030	73 69 70 3A 31 37 32 2E 32 30 2E 33 31 2E 31 33 sip:172.20.31.13
0040	34 3A 38 30 38 38 3B 74 72 61 6E 73 70 6F 72 74 4:8088;transport
0050	3D 77 73 3B 6C 72 3E 0D 0A 56 69 61 3A 20 53 49 =ws;lr>..Via: SI
0060	50 2F 32 2E 30 2F 54 43 50 20 31 35 38 2E 37 32 P/2.0/TCP 158.72
0070	2E 35 33 2E 39 39 3B 62 72 61 6E 63 68 3D 7A 39 .53.99;branch=z9
0080	68 47 34 62 4B 35 31 39 38 33 34 35 0D 0A 4D 61 hG4bK5198345..Ma
0090	78 2D 46 6F 72 77 61 72 64 73 3A 20 36 39 0D 0A x-Forwards: 69..
00a0	54 6F 3A 20 73 69 70 3A 31 31 31 31 40 31 37 32 To: sip:1111 at 172
00b0	2E 32 30 2E 33 31 2E 31 33 34 0D 0A 46 72 6F 6D .20.31.134..From
00c0	3A 20 73 69 70 3A 31 32 33 36 40 31 37 32 2E 32 : sip:1236 at 172.2
00d0	30 2E 33 31 2E 31 33 34 3B 74 61 67 3D 62 63 65 0.31.134;tag=bce
00e0	34 74 6C 72 74 39 70 0D 0A 43 61 6C 6C 2D 49 44 4tlrt9p..Call-ID
00f0	3A 20 74 69 74 78 69 73 6E 71 6D 37 37 39 6B 64 : titxisnqm779kd
0100	6A 64 75 30 75 64 0D 0A 43 53 65 71 3A 20 38 35 jdu0ud..CSeq: 85
0110	37 31 20 4D 45 53 53 41 47 45 0D 0A 43 6F 6E 74 71 MESSAGE..Cont
0120	65 6E 74 2D 54 79 70 65 3A 20 74 65 78 74 2F 70 ent-Type: text/p
0130	6C 61 69 6E 0D 0A 53 75 70 70 6F 72 74 65 64 3A lain..Supported:
0140	20 70 61 74 68 2C 20 6F 75 74 62 6F 75 6E 64 2C  path, outbound,
0150	20 67 72 75 75 0D 0A 55 73 65 72 2D 41 67 65 6E  gruu..User-Agen
0160	74 3A 20 4A 73 53 49 50 20 30 2E 32 2E 31 0D 0A t: JsSIP 0.2.1..
0170	43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 Content-Length: 
0180	34 0D 0A 0D 0A 61 73 64 66                      4....asdf       
------
                  
> In MESSAGE received over WebSocket, the body last char is cut
> -------------------------------------------------------------
>
>                 Key: ASTERISK-20745
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20745
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/WebSocket
>    Affects Versions: SVN, 11.0.1
>            Reporter: Iñaki Baz Castillo
>
> When Asterisk receives a SIP MESSAGE over WebSocket it cuts the last char of the body. So if for example the MESSAGE contains "Content-Length: 4" and a body with content "1234" (without quotes), the Asterisk debug console prints the body as "123", and then it forwards the MESSAGE with "123" as body.
> This bug seems not to occur when the SIP MESSAGE arrives via SIP over TCP or UDP, so it must be a bug in the SIP WebSocket layer/parser.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list