How can I modify the SMS output for a generic SIP trunk?

greychain

Gold Partner
Advanced Certified
Joined
Jul 13, 2018
Messages
779
Reaction score
122
3CX does a simple SMS post using the first format listed below but I need it it the second format. Can I achieve this within 3CX or will I need to write and host an app to do this?

curl -X POST
--header "Content-Type: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{
"from": "+10987654321",
"to": "+11234567890",
"text": "Hello John, how are you?",
}'

curl --location --request POST 'https://smsprovider/rest/send?private_key=Private Key' --header 'X-Secret: Secret' --header 'Content-Type: application/json' --data-raw '{ "sender": "SMS Info", "to": "855123456789", "content": "Hello from rest API"}'
 
3CX does a simple SMS post using the first format listed below but I need it it the second format. Can I achieve this within 3CX or will I need to write and host an app to do this?

curl -X POST
--header "Content-Type: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{
"from": "+10987654321",
"to": "+11234567890",
"text": "Hello John, how are you?",
}'

curl --location --request POST 'https://smsprovider/rest/send?private_key=Private Key' --header 'X-Secret: Secret' --header 'Content-Type: application/json' --data-raw '{ "sender": "SMS Info", "to": "855123456789", "content": "Hello from rest API"}'
You'll need something to convert the request data. Check out AWS Lambda for this, it's free for 1M executions per month. Have AI build a small proxy to translate the requests. You'll need to make sure to return the expected data for 3CX too (message status, ID, etc.)

The docs here can help: https://www.3cx.com/docs/supported-sip-trunk-requirements/#h.z7xet9uflkmo
 
Thanks, I'm a bit lazy so just did it in php. Was hoping there might be a way to modify the 3CX template.
 
Thanks, I'm a bit lazy so just did it in php. Was hoping there might be a way to modify the 3CX template.
Unfortunately no, the format is hardcoded.
 

Forum statistics

Threads
111,974
Messages
590,081
Members
164,899
Latest member
mazet