Solved BUG: broken URL Encoding CallerNumber Variable in Custom Contact URL

Status
Not open for further replies.

spuky

SOHO User
Basic Certified
Joined
Dec 17, 2019
Messages
22
Reaction score
21
When the %CallerNumber% Variable contains a plus sign (+) the plus sign is converted to a space or missing in the URL

Behavior:
when defining an url like:
Code:
case1: http://example.com/search/phone/%CallerNumber%
case2: http://example.com/search/phone/%2b%CallerNumber% (trying to fix it)
and the caller number is +49123456789

the resulting URL is:
Code:
case1: http://example.com/search/phone/49123456789 (not sure if the space gets cleared by the browser)
case2: http://example.com/search/phone/%2b 49123456789
Expected Behavior:
Code:
case1: http://example.com/search/phone/%2b49123456789
case2: http://example.com/search/phone/%2b%2b49123456789

Forum Thread in the German forum where the Issue came up:
https://www.3cx.de/forum/threads/action-url-parameter-funktioniert-nicht-wie-gewünscht.96655/

Thanks for looking into this
 
Last edited:
Hi spuky,

I tested the below using Chrome on V16.0.5.622 stable and on V16.0.6.639 beta and with the exact syntax you will see in my examples here.

When I use this URL and customer +1771234567 calls me:
http://example.com/search/phone/%CallerNumber%

My result is this:
http://example.com/search/phone/+17771234567

So this is functioning exactly as designed, passing the exact value that it receives and is not considered to be a bug. We would consider it a bug if it did not pass the exact value you gave it.


If you CRM requires this format (to encode the + character into an escaped character %2b):
http://example.com/search/phone/%2b17771234567

then you will either have to make changes to your CRM query to accept the + character via partial matching, or alternatively, you can create a very simple wrapper URL that converts the result to the format you want, and then passes it to the CRM query in the format the CRM likes.

The mechanism above was not designed for any specific CRM, it is for general use and will pass the exact value you give it. How you deal with this value afterwards, is purely up to you and your specific CRM to decide how to manage.

I hope I understood your question correctly, if not let me know and we can discuss further.
 
Hi John, since I was reporting that while helping another User... my trunk dos not provide a + so I could not test against that here and he was 100% not clear about the fact the + not showing up in the url or in his crm...

Provided him a php script as wrapper url and he is now happy

case closed..

Thanks for Clarification
 
  • Like
Reactions: JohnS_3CX
Status
Not open for further replies.

Forum statistics

Threads
112,025
Messages
590,367
Members
164,976
Latest member
Roman Mazur