8
8
"net/url"
9
9
"time"
10
10
11
+ "github.com/go-chi/chi"
11
12
"github.com/nyaruka/gocommon/httpx"
12
13
"github.com/nyaruka/gocommon/jsonx"
13
14
"github.com/nyaruka/gocommon/urns"
@@ -17,8 +18,6 @@ import (
17
18
"github.com/nyaruka/mailroom/core/tasks/handler"
18
19
"github.com/nyaruka/mailroom/runtime"
19
20
"github.com/nyaruka/mailroom/web"
20
-
21
- "github.com/go-chi/chi"
22
21
"github.com/pkg/errors"
23
22
"github.com/sirupsen/logrus"
24
23
)
@@ -159,21 +158,6 @@ func handleIncoming(ctx context.Context, rt *runtime.Runtime, oa *models.OrgAsse
159
158
return call , nil
160
159
}
161
160
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
-
177
161
// write our empty response
178
162
return call , svc .WriteEmptyResponse (w , "missed call handled" )
179
163
}
0 commit comments