SMS through Generic trunk sip

consuelo.iglesias@alhambr

Platinum Partner
Joined
Feb 4, 2025
Messages
24
Reaction score
4
Hello everyone.

Has anyone managed to send and confirm the status of SMS messages via a generic SIP trunk?
The most critical case is the confirmation of the status of the delivery.
When preparing the JWT for the webhook to confirm the status of the delivery, What is the issuer, audience and scope of the claim for a generic SIP trunk?

Kind Regards.
 
Hi YiannisH.

Yes, I've been following the document. The problem is when I return the sms status. I'm trying to create the jwt token but the problem I think is the values of the claims. I'm not sure what are they.
 
Particularly issuer of the generic trunk sip. I don't know the value.
 
Hello,

Just to clarify, this is a delivery report
for an outbound SMS that is 3CX->User (DLR Trunk->3CX)
or an inbound SMS, User->3CX (DLR 3CX->Trunk)?

Perhaps some of the information in this older thread, combined with our document linked above will help.
 
  • Like
Reactions: Evolute IT
This is for outbound sms , the error is this

Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10500: Signature validation failed. No security keys were provided to validate the signature.

The jwt is not correct. And I'm not sure if the problem is the issuer.
 
The body of the response of the delivery status is this :

{"data":{"event_type":"message.finalized","id":null,"ocurred_at":null,"payload":{"complement_at":null,"cost":0.0,"direction":"outbound","enconding":"GSM-7","errors":[],"from":{"carrier":null,"line_type":null,"phone_number":"349XXXXXXX","status":null},"id":"8849d20c-2322-4ee5-9bbd-a16defb40620","media":null,"messaging_profile_id":null,"organization_id":null,"parts":1,"received_at":null,"record_type":"message","sent_at":null,"tags":[],"text":null,"to":[{"carrier":null,"line_type":null,"phone_number":"63XXXXXXX","status":"delivered"}],"type":"SMS","valid_until":null,"webhook_failover_url":null,"webhook_url":null},"record_type":"event"},"meta":{"attempt":1,"delivered_to":null}}
 
The API JSON does not include a JWT for validation, just the Token in Auth.
 
  • Like
Reactions: Evolute IT
How do you prepare the token?
 
If I send the api key as bearer authentication I get this error :

Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenMalformedException: IDX14100: JWT is not well formed, there are no dots (.).
 
Can you set your system not to expect a JWT? Or use an intermediary system that does not need it, then creates one before submission to your core.
 
  • Like
Reactions: Evolute IT
I can not.
Is the 3cx error when we sent the delivery response to the webhook.
We need to use the latest versions of 3cx in our customers.
 
The required field for a delivery report are:
  • data.event_type
  • data.payload.id
  • data.payload.to.status
 
  • Like
Reactions: Evolute IT
Yes there are these fields with value, and I send the complete response as 3cx requires.

{"data":
{
"event_type":"message.finalized",
"id":null,
"ocurred_at":null,
"payload":{
"complement_at":null,
"cost":0.0,
"direction":"outbound",
"enconding":"GSM-7",
"errors":[],
"from":{
"carrier":null,
"line_type":null,
"phone_number":"349XXXXXXX",
"status":null},
"id":"8849d20c-2322-4ee5-9bbd16defb40620",
"media":null,
"messaging_profile_id":null,
"organization_id":null,
"parts":1,
"received_at":null,
"record_type":"message",
"sent_at":null,
"tags":[],
"text":null,
"to":[{
"carrier":null,
"line_type":null,
"phone_number":"63XXXXXXX",
"status":"delivered"}],
"type":"SMS",
"valid_until":null,
"webhook_failover_url":null,
"webhook_url":null},
"record_type":"event"
},
"meta":
{
"attempt":1,
"delivered_to":null
}}
 
1. You will need a proxy script if you require authentication. Period.

2. There's a long-running issue with generic trunks where the Delivered (two checkmarks) doesn't work at all, even if the webhook is received. We've seen this with many generic providers. It was never fixed unfortunately. It seems the delivered hook is just ignored.
 
  • Like
Reactions: mmeier
Ok, but as far as I know , twilio and other providers can send the webhook correctly and it seems the double check works.
Is that true?

Kind regards.
 
2. There's a long-running issue with generic trunks where the Delivered (two checkmarks) doesn't work at all, even if the webhook is received. We've seen this with many generic providers. It was never fixed unfortunately. It seems the delivered hook is just ignored.
That is not true. We have supported providers using the Generic SMS API which have the delivery checkmarks working. VoIP.MS is a good example of this. There have been cases where people were not able to get it working but the functionality is there.
 
Hi Yanish. Ok, thank you, what am I missing in my response on the webhook to get the correct delivery checkmarks?

Kind regards.
 
The main issue is the error provided by the 3cx when it tries to validate the bearer with the jwt token, which I create on my script to send it to 3cx with the data of the delivery status.
This is the error in 3cx when I send the delivery status to the webhook in 3cx.

Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10500: Signature validation failed. No security keys were provided to validate the signature.

The jwt is not correct. And I'm not sure if the problem is the issuer.

If I send the api key as bearer authentication without formating to jwt, the error in 3cx is this:

Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenMalformedException: IDX14100: JWT is not well formed, there are no dots (.).
 
Hi again.

How the sms platform shoud respond to the https://api.generic.com/v2/messages call?

I've seen how we should interacts with the webhook on the documents but I don't see the response the 3cx is waiting from the sms provider when 3cx is sending an sms.

I suppose the common response is 200 OK , but I don't see the content to identify the posterior status delivery. Is the same as the content sent on the webhook?

Kind regards.
 

Forum statistics

Threads
112,064
Messages
590,575
Members
165,019
Latest member
rsaldin@advancedbrainspin