fix: capturar subid de LabsMobile como MsgID en logs de SMS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-24 18:36:14 -05:00
co-authored by Claude Sonnet 4.6
parent 8a9235631c
commit cb9d984ee8
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -28,6 +28,14 @@ type WebSmsResponse struct {
Code string `json:"code"`
Message string `json:"message"`
ID string `json:"id"`
SubID string `json:"subid"`
}
func (r *WebSmsResponse) MsgID() string {
if r.ID != "" {
return r.ID
}
return r.SubID
}
type WebSmsAckPayload struct {
+2 -2
View File
@@ -92,7 +92,7 @@ func TestWebSms(c *fiber.Ctx) error {
Para: b.Para,
Mensaje: b.Mensaje,
Status: resp.Code,
MsgID: resp.ID,
MsgID: resp.MsgID(),
})
return c.JSON(fiber.Map{"ok": true, "response": resp})
@@ -189,7 +189,7 @@ func ApiSendSms(c *fiber.Ctx) error {
Para: b.Numero,
Mensaje: b.Mensaje,
Status: status,
MsgID: func() string { if resp != nil { return resp.ID }; return "" }(),
MsgID: func() string { if resp != nil { return resp.MsgID() }; return "" }(),
Error: errStr,
})