# Func\_odbc readsql result changes within string a , to \\,

**URL:** <https://community.asterisk.org/t/func-odbc-readsql-result-changes-within-string-a-to/104232>\
**Category:** Asterisk Support\
**Created:** [September 2, 2024, 5:25pm UTC](https://community.asterisk.org/t/func-odbc-readsql-result-changes-within-string-a-to/104232 "2024-09-02T17:25:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msdwena](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/msdwena/32/1582_2.png) [@msdwena](https://community.asterisk.org/u/msdwena)\
**Post date:** [September 2, 2024, 5:25pm UTC](https://community.asterisk.org/t/func-odbc-readsql-result-changes-within-string-a-to/104232/1 "2024-09-02T17:25:24Z")

</div>

Asterisk 20.8.1

With func\_odbc I make an enquiry in a MariaDB and it returns a JSON string.  
But the result in the dialplan the JSON is unusable because the " , " as a divider in the elements of the JSON is altered to " backslash, ". and thus not directly usable with JSON\_DECODE.  
I have found a workaround with the function REPLACE to get rid of the unwanted backslashes.  
But I was wondering if there is away of avoiding as the JSON should be just a string and not been touched in the sql select.

```
-- Executing [+31850201827@testing:3] Set("PJSIP/kamtrunkpublic-00000010", "did_info={"companyID": 9000012\, "trunkname": "siptest"\, "IPaddress": "37.97.234.xx"\, "send2ip": true}") in new stack
-- Executing [+31850201827@testing:4] Set("PJSIP/kamtrunkpublic-00000010", "did_info={"companyID": 9000012, "trunkname": "siptest", "IPaddress": "37.97.234.xx", "send2ip": true}") in new stack

```

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [October 2, 2024, 5:25pm UTC](https://community.asterisk.org/t/func-odbc-readsql-result-changes-within-string-a-to/104232/2 "2024-10-02T17:25:36Z")

</div>

Closed on October 2, 2024, 5:25pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
