Skip to content

Commit f6889cc

Browse files
committed
Remove legacy functionality to look for missed call trigger if there's no incoming call trigger
1 parent 81865e0 commit f6889cc

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

web/ivr/ivr.go

+1-17
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"net/url"
99
"time"
1010

11+
"github.com/go-chi/chi"
1112
"github.com/nyaruka/gocommon/httpx"
1213
"github.com/nyaruka/gocommon/jsonx"
1314
"github.com/nyaruka/gocommon/urns"
@@ -17,8 +18,6 @@ import (
1718
"github.com/nyaruka/mailroom/core/tasks/handler"
1819
"github.com/nyaruka/mailroom/runtime"
1920
"github.com/nyaruka/mailroom/web"
20-
21-
"github.com/go-chi/chi"
2221
"github.com/pkg/errors"
2322
"github.com/sirupsen/logrus"
2423
)
@@ -159,21 +158,6 @@ func handleIncoming(ctx context.Context, rt *runtime.Runtime, oa *models.OrgAsse
159158
return call, nil
160159
}
161160

162-
// no session means no trigger, create a missed call event instead
163-
// we first create an incoming call channel event and see if that matches
164-
event = models.NewChannelEvent(models.MOMissEventType, oa.OrgID(), ch.ID(), contact.ID(), urnID, nil, false)
165-
err = event.Insert(ctx, rt.DB)
166-
if err != nil {
167-
return call, svc.WriteErrorResponse(w, errors.Wrapf(err, "error inserting channel event"))
168-
}
169-
170-
// try to handle it, this time looking for a missed call event
171-
_, err = handler.HandleChannelEvent(ctx, rt, models.MOMissEventType, event, nil)
172-
if err != nil {
173-
logrus.WithError(err).WithField("http_request", r).Error("error handling missed call")
174-
return call, svc.WriteErrorResponse(w, errors.Wrapf(err, "error handling missed call"))
175-
}
176-
177161
// write our empty response
178162
return call, svc.WriteEmptyResponse(w, "missed call handled")
179163
}

0 commit comments

Comments
 (0)