Problem with SPA3102 passing invalid caller ID names

Discussion in '3CX Phone System - General' started by scruffybob, Jan 3, 2009.

Thread Status:
Not open for further replies.
  1. scruffybob

    Joined:
    Jan 3, 2009
    Messages:
    11
    Likes Received:
    0
    I'm using 3CX 7.9.4249.0.

    I'm using some Linksys SPA-3102's (5.1.7(GW) and 3.3.6(GW) firmware) and am getting "Error 400: BAD REQUEST (multiple values in single-value header) FROM" responses from my PBX.

    According to packets grabbed by Wireshark, the INVITE from the SPA3102 goes out with the following FROM field:

    From: MACKEY, RON E <sip:6303578135@192.168.2.132>;tag=b9c8ff5d2616dc03o1

    The ASCII version:
    0000 46 72 6f 6d 3a 20 4d 41 43 4b 45 59 2c 20 52 4f From: MACKEY, RO
    0010 4e 20 45 20 3c 73 69 70 3a 36 33 30 33 35 37 38 N E <sip:6303578
    0020 31 33 35 40 31 39 32 2e 31 36 38 2e 32 2e 31 33 135@192.168.2.13
    0030 32 3e 3b 74 61 67 3d 62 39 63 38 66 66 35 64 32 2>;tag=b9c8ff5d2
    0040 36 31 36 64 63 30 33 6f 31 0d 0a 616dc03o1..

    My reading of the SIP RFC (and it's been a long time since I read an RFC) says that a display-name containing a comma must be enclosed in quotes (""). This would seem to be confirmed by the bad request response from the IP-PBX.

    Some questions:

    1. Is this an error in the SPA3102?
    2. If so, is there any way to prevent the SPA3102 from sending the display-name without disabling caller id altogether?
    3. Is this an incorrect interpretation of the RFC by me and 3CX? In other words is the SPA3102 okay in passing an unquoted caller ID display name?
    4. I've always ascribed to the theory that you should be liberal in what you accept and conservative in what you send. Even if this is an error by the SPA3102, would the 3CX be best in accepting the packet since it's pretty clear what the correct behavior should be?

    I'm running firmware 5.1.7(GW), but the problem also occurs with the 3.3.6(GW) firmware.

    Additional information...

    The SPA3102 has a field called "Escape Display Name" under the SIP parameters that I would guess should quote the display name, but setting it to "Yes" does nothing.

    If I disable passing the PSTN caller-ID, then the SPA3102 uses the Display Name out of the Subscriber information as the Display info it passes on the INVITE. In this case, the "Escape Display Name" will quote the display name if the field is set to "Yes" and will not quote the display name if the field is set to "No", so I'm absolutely sure I'm getting the field set appropriately. However, quoting the field that I statically entered in another place isn't overly interesting. I need it to quote the incoming caller id name as passed in from the telephone company.

    In fact, as I tried to figure this out, I tried to use the PSTN CID Name Prefix (under the PSTN tab) as a way to get it to quote the CID Name. What I found is that you can enter any special characters you'd like (commas, quotes, etc.) and it will happily generate an illegally formatted INVITE packet on it's own by pre-pending these characters to the passed name. I'm actually a little shocked that you can get it to generate illegal frames so easily.

    This is killing me, as my only recourse seems to be to disable incoming Caller-ID altogether. Since incoming call flow is a big reason I want to convert to an IP-PBX, it makes the SPA3102's worthless if I can't resolve this issue. I didn't have much luck on the Linksys forum (the only suggestion there was to not use commas)

    I used Wireshark to sniff the network to verify that the SIP packet generated by the SPA3102 is improperly formatted.

    According to packets grabbed by wireshark, the INVITE from the SPA3102 goes out with the following FROM field:

    From: MACKEY, RON E <sip:6303578135@192.168.2.132>;tag=b9c8ff5d2616dc0 3o1

    The ASCII version:
    0000 46 72 6f 6d 3a 20 4d 41 43 4b 45 59 2c 20 52 4f From: MACKEY, RO
    0010 4e 20 45 20 3c 73 69 70 3a 36 33 30 33 35 37 38 N E <sip:6303578
    0020 31 33 35 40 31 39 32 2e 31 36 38 2e 32 2e 31 33 135@192.168.2.13
    0030 32 3e 3b 74 61 67 3d 62 39 63 38 66 66 35 64 32 2>;tag=b9c8ff5d2
    0040 36 31 36 64 63 30 33 6f 31 0d 0a 616dc03o1..

    Does anyone know how to get the Caller ID NAME quoted properly as it's passed from the PSTN to the VOIP gateway, or at least is there any way to pass the incoming Caller ID from the PSTN but NOT pass the Caller ID Name? As long as I can get the ID, I can work around not getting the name.

    Best regards,
    scruffy-bob
     
  2. ess

    ess New Member

    Joined:
    Jun 8, 2007
    Messages:
    133
    Likes Received:
    0
    Hey,

    I admire your depth of research into a solution for this problem. I hope the devs can see this as a problem now.

    What I can tell you is, it used to not be a problem in previous versions of 3cx. I believe commas used to be stripped by the 3cx software. I don't know what happened, but at the very least, myself and dyntech, another 3102 user have run into this problem.

    I took the easy way out and bought a new gateway. However, I had the exact same problem and went over a month without caller ID because I was missing calls. The comma thing explains it I believe. I thought it was so weird because I would miss certain calls from people every single time. One of our field technicians John could never dial in to the phone system from his cell phone when we had the spa passing caller ID.

    In the meantime, there are some inbound parameters in the pstn device configuration tab of 3cx for your spa3102. See if perhaps there is something there where you can have the pbx look for CalledNum, vs. CalledName.

    Good Luck and let me know how it goes!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. xu1688

    Joined:
    Jan 6, 2009
    Messages:
    13
    Likes Received:
    0
    Does anyone know if this issue fixed in new release (build v7.4744)?

    Derrick
     
  4. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,855
    Likes Received:
    301
    I'm using the latest download and once i solved the problem of getting no caller ID everything works just fine. I do get the name and number and they are separated by a comma.
     
  5. robertlink

    Joined:
    Jan 22, 2009
    Messages:
    1
    Likes Received:
    0
    Can you please tell me what Firmware you are talking about?
    Tbanks
    Robert
     
  6. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,855
    Likes Received:
    301
    I'm using the latest download of 3CX (downloaded a couple of days ago). SPA-3102 is 5.1.7(GW).
     
  7. unitedictgroup

    Joined:
    Jan 26, 2009
    Messages:
    1
    Likes Received:
    0
    I just downloaded 3CX version 7.0.4744.0 and am using SPA3102 v. 5.1.7(GW) now, and after the download it seemed to have taken care of the CID problem.
     
  8. xu1688

    Joined:
    Jan 6, 2009
    Messages:
    13
    Likes Received:
    0
    Do you mean that the Caller ID Name like FirstN,LastN is passing through 3CX ok now?

    Thanks,

    Derrick
     
  9. scruffybob

    Joined:
    Jan 3, 2009
    Messages:
    11
    Likes Received:
    0
    As of the February 16, 2009, the problem still exists. An incoming INVITE packet that has a comma in the Caller-ID Name will be rejected by 3CX as a badly formatted packet and the call will not complete.

    I've been completely unable to get anyone from Linksys to even acknowledge they know what an SPA-3102 is.... sad.

    I think I'll switch to Asterisk, where I'll have access to the source code to make the necessary adjustments. I think that's the only way I'm going to get past this.

    Ron
     
  10. Vali_3CX

    Vali_3CX Well-Known Member
    Staff Member 3CX Support

    Joined:
    Dec 12, 2008
    Messages:
    1,499
    Likes Received:
    67
    Hi, Ron

    Ron, a standard is a standard. As you already said on January 3, SIP RFC (and it's been a long time since I read an RFC) says that a display-name containing a comma must be enclosed in quotes (""). 3CX PBX it IS compliant with this standard, and you may check this as follows:

    - in the 3CX Configuration panel, open an extension configuration page, and select the "Other" tab. There, in the "Outbound Caller ID", please type "MACKEY, RON E" WITHOUT quotes. Click Apply, then OK and then from that extension make a call and check the SIP message with Wireshark or logs. You will see
    From: "MACKEY, RON E"<sip:xxx@xxx.xxx.xxx.xxx>

    Therefore, 3CX PBX also expects standard-compliant requests. If we will change its behavior to accomodate with a non-standard not-quoted-display-name request, then tomorrow we will have to change also to accomodate with multi-line-CRLF-display-name request, and later to accomodate with binary-field-display-name request. I repeat, a standard is a standard. This also applies to the changes you plan to made into Asterisk's sources: once you done such kind of change, your Asterisk will no longer be Asterisk-compliant.

    Regards
    vali
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. scruffybob

    Joined:
    Jan 3, 2009
    Messages:
    11
    Likes Received:
    0
    Vali,

    I appreciate the response. My comment about switching to Asterisk was not meant to be a dig against 3CX, it's just that I have the ability to fix a problem there that can't or won't be fixed here as far as I can tell. I like everything I've seen with 3CX, except that I can't use it with the ATAs that I have. I hope you understand that that is kind of a problem for me.

    You can take the moral high ground all you want, but Cisco/Linksys/Septura's problem is costing YOU customers, not the other way around.

    I'll go back to my original comment that I learned in my first computer class over 25 years ago:
    - Be liberal in what you accept and conservative in what you send. If you can parse an incoming packet, you should do so (ESPECIALLY if you know that there is a well-known implementation that sends out BAD packets), but you should never send a bad packet out yourself.

    I purchased the SPA-3102's SPECIFICALLY to use with 3CX because this ATA is listed as one that YOU support and provide a configuration guide for: http: //www.3cx.com/voip-gateways/linksys-3102/ - NO LONGER AVAILABLE

    At the very least, you should have a great big disclaimer on that page that says, "The SPA-3102 has a great big fat error that Cisco is unwilling to fix, so anyone buying these adapters is an idiot and won't get the expected results, so while we technically 'support' this ATA, anyone using one is going to see half of their calls silently rejected and they will have absolutely no way of figuring out which calls are going to be rejected, so don't blame us."

    Best regards,
    Ron
     
  12. Henk

    Henk Member

    Joined:
    Nov 13, 2007
    Messages:
    250
    Likes Received:
    0
    I have not read the whole post, and yes the 3102 provides some challenges. Myself I been using one for the last 4yrs and once set you forget. Simple.


    There are a few people who had troubles with them, but most got them resolve. Perhaps 3CX can add that the spa 3102 is limited supported.... As the VoIP public is maturing i see the 3102 either facing out or replaced. The unit is cheap that is why most people go for it. Myself, I probably upgrade to a patton soon.

    H.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. scruffybob

    Joined:
    Jan 3, 2009
    Messages:
    11
    Likes Received:
    0
    This is more than a little inconvenience. For anyone using an SPA-3102 in the United States, they must disable caller-id completely (not an option for most businesses today), or risk silently rejecting some or all calls. The trigger is that if the phone company sends a caller-id with name that contains a comma (as in "lastname, firstname"), the SPA-3102 will generate what appears to be an illegal packet since the comma is interpreted as a separator. The 3CX flags it as illegal, so rejects the initial INVITE, so there is no ring and no indication that the call even came in. The 3CX responds with an error "mulitple parameters found where single parameter expected" and it would be trivial to strip the "," or just truncate the name, but it chooses to silently throw away the entire call.

    I'd love for someone to suggest a workaround, but simply shutting off caller-id completely isn't an option for us (since the whole point of moving to a system like 3CX was to get control over the incoming call so we can do call routing based on CID).

    I would also argue that since there is no documentation of the problem with either the SPA-3102 or in the 3CX documentation, there are probably a lot more people than me that are either losing calls unintentionally, or they're banging their heads on the wall, trying to figure out why "3CX doesn't work right". It doesn't show up in the 3CX server logs, so I had to actually use a network sniffer to see the packet interaction and decode the packets to find out what the problem was.

    Best regards,
    Ron
     
  14. leejor

    leejor Well-Known Member

    Joined:
    Jan 22, 2008
    Messages:
    10,855
    Likes Received:
    301
    I think that one of the problems is that the phone companies do not send caller-id in a "standard" format in NA. I don't recall seeing a comma or any other non letter or number in a caller ID name. First and last names are simply separated by a space. This, of course, is up to your PSTN provider, unfortunately.
     
  15. archie

    archie Well-Known Member
    3CX Support

    Joined:
    Aug 18, 2006
    Messages:
    1,299
    Likes Received:
    0
    Just a note from the guy who also has access to sources :)

    We're making patches to our code in cases when some device has a bug which leads to minor deviations from standards. But the fact is - sometimes it is not possible to absorb deviation. This is the case. If we change SIP parser to accept Display name field without double quotes -- it will automatically break a lot of other parsing cases. How to find out where display name ends and URI portion starts? Left-angle bracket? What if your telco will send you Caller-Name with '<' inside?

    Surely, nobody can prohibit you from patching SIP parser of Asterisk, but be warned that such patch will break other functionality for sure.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. Henk

    Henk Member

    Joined:
    Nov 13, 2007
    Messages:
    250
    Likes Received:
    0
    I do not like you chances, but Ill have a look at this later today or tonight.

    My config is very basic :) I set it up a few yrs back and actually have not changed a thing (do not fix what ain't broken, right )

    Interesting ....... you got my attention :).

    H.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. matictec

    matictec New Member

    Joined:
    Mar 31, 2008
    Messages:
    188
    Likes Received:
    0
    in the german forum we have the same problem.

    it should help to set the fxo timer on the spa3102 to 2 sec.

    but than the problem is, that not the correct number appears, but perhaps the newest firmware will help.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. William400

    William400 Well-Known Member

    Joined:
    Aug 21, 2006
    Messages:
    1,005
    Likes Received:
    0
    Hi

    We are currently looking into templating the SPA3102 amongst other devices. If anyone has identified any changes that are country / telco specific please fell free to email them to we@3cx.com and we shall put them on record for review.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  19. Henk

    Henk Member

    Joined:
    Nov 13, 2007
    Messages:
    250
    Likes Received:
    0
    Setting the times is to assist the DTMF to come through, not sure if that helps with the "," issue.


    H.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. Bob Denny

    Bob Denny New Member

    Joined:
    Feb 21, 2009
    Messages:
    131
    Likes Received:
    2
    I am bumping this in the hopes that 3CX will make an accommodation for the unquoted CID coming from the SPA-3102.
     
Thread Status:
Not open for further replies.