Internal Server Error Caused by Some Numbers in Calling SDK

While using the calling-extension SDK, some numbers cause a “500 internal server error” to occur on incoming calls when they are set in the ‘toNumber’ field.
This is different from a “400 bad request” error which occurs if the number itself is invalid. Also this only occurs on the ‘toNumber’, but not the ‘fromNumber’ field.
An example of the numbers I’m using that cause this are “+6909602” and “+690222”.
My use case is that I’m using “+690” as a placeholder with 4-digit or shorter IP extension numbers, as a workaround to country code validation being enforced by HS.

Sadat_0-1733120902232.png

This happens in both `incomingCall()` and `outgoingCall()`, only in the `fromNumber` field of both.

@BérangèreL As you’ve kindly replied to related posts before, could you do the same with this one, please? :folded_hands:
And do let me know if there are better ways to get a reply on similar issues.

Hi @Sadat,
Thanks for asking the Community and thanks for tagging me :hugs:
I’d love to put you in touch with some of our Top Experts and Community Members:
Hi @HubSpot_Corey, @zach_threadint, @DDajac, @TDev_, @JeroenCloudCTI, @JSilva66, @myera and @Bortami do you have suggestions to help @Sadat, please?
Thanks so much :heart: and have a great day!

Best,
Bérangère

Turns out that besides country code validation, HubSpot also enforces area code validation. If the area code is invalid, a 500 error is thrown.
This should probably be fixed to throw 400, indicating that the input number was invalid for the above reason.