diff --git a/core/models/contacts.go b/core/models/contacts.go index 1822856cc..a84a47afb 100644 --- a/core/models/contacts.go +++ b/core/models/contacts.go @@ -151,22 +151,20 @@ func (c *Contact) UpdatePreferredURN(ctx context.Context, db DBorTx, oa *OrgAsse topURN := urns.NilURN newURNs := make([]urns.URN, 0, len(c.urns)) - priority := topURNPriority - 1 for _, urn := range c.urns { id := URNID(GetURNInt(urn, "id")) if id == urnID { - updated, err := updateURNChannelPriority(urn, channel, topURNPriority) + updated, err := updateURNChannel(urn, channel) if err != nil { return errors.Wrapf(err, "error updating channel on urn") } topURN = updated } else { - updated, err := updateURNChannelPriority(urn, nil, priority) + updated, err := updateURNChannel(urn, nil) if err != nil { return errors.Wrapf(err, "error updating priority on urn") } newURNs = append(newURNs, updated) - priority-- } } @@ -422,7 +420,7 @@ type ContactURN struct { ID URNID `json:"id" db:"id"` OrgID OrgID ` db:"org_id"` ContactID ContactID ` db:"contact_id"` - Priority int `json:"priority" db:"priority"` + Priority int ` db:"priority"` Identity urns.URN `json:"identity" db:"identity"` Scheme string `json:"scheme" db:"scheme"` Path string `json:"path" db:"path"` @@ -434,10 +432,7 @@ type ContactURN struct { // AsURN returns a full URN representation including the query parameters needed by goflow and mailroom func (u *ContactURN) AsURN(oa *OrgAssets) (urns.URN, error) { // id needed to turn msg_created events into database messages - query := url.Values{ - "id": []string{fmt.Sprintf("%d", u.ID)}, - "priority": []string{fmt.Sprintf("%d", u.Priority)}, - } + query := url.Values{"id": []string{fmt.Sprintf("%d", u.ID)}} // channel needed by goflow URN/channel selection if u.ChannelID != NilChannelID { @@ -447,7 +442,7 @@ func (u *ContactURN) AsURN(oa *OrgAssets) (urns.URN, error) { } } - // create our URN + // re-encode our URN urn, err := urns.NewURNFromParts(u.Scheme, u.Path, query.Encode(), string(u.Display)) if err != nil { return urns.NilURN, errors.Wrapf(err, "invalid URN %s:%s", u.Scheme, u.Path) @@ -521,15 +516,7 @@ LEFT JOIN ( SELECT contact_id, array_agg( - json_build_object( - 'id', u.id, - 'scheme', u.scheme, - 'path', path, - 'display', display, - 'auth', auth, - 'channel_id', channel_id, - 'priority', priority - ) ORDER BY priority DESC, id ASC + json_build_object('id', u.id, 'scheme', u.scheme, 'path', path, 'display', display, 'channel_id', channel_id) ORDER BY priority DESC, id ASC ) as urns FROM contacts_contacturn u @@ -1170,7 +1157,7 @@ func GetURNID(urn urns.URN) URNID { return URNID(urnID) } -func updateURNChannelPriority(urn urns.URN, channel *Channel, priority int) (urns.URN, error) { +func updateURNChannel(urn urns.URN, channel *Channel) (urns.URN, error) { query, err := urn.Query() if err != nil { return urns.NilURN, errors.Errorf("error parsing query from URN: %s", urn) @@ -1178,8 +1165,6 @@ func updateURNChannelPriority(urn urns.URN, channel *Channel, priority int) (urn if channel != nil { query["channel"] = []string{string(channel.UUID())} } - query["priority"] = []string{strconv.FormatInt(int64(priority), 10)} - urn, err = urns.NewURNFromParts(urn.Scheme(), urn.Path(), query.Encode(), urn.Display()) if err != nil { return urns.NilURN, errors.Wrap(err, "unable to create new urn") diff --git a/core/models/contacts_test.go b/core/models/contacts_test.go index d49ce67c4..00706cf27 100644 --- a/core/models/contacts_test.go +++ b/core/models/contacts_test.go @@ -63,7 +63,7 @@ func TestContacts(t *testing.T) { assert.Equal(t, "Cathy", cathy.Name()) assert.Equal(t, len(cathy.URNs()), 1) - assert.Equal(t, cathy.URNs()[0].String(), "tel:+16055741111?id=10000&priority=1000") + assert.Equal(t, cathy.URNs()[0].String(), "tel:+16055741111?id=10000") assert.Equal(t, 1, cathy.Groups().Count()) assert.NotNil(t, cathy.Ticket()) @@ -79,8 +79,8 @@ func TestContacts(t *testing.T) { assert.Equal(t, "Bob", bob.Name()) assert.NotNil(t, bob.Fields()["joined"].QueryValue()) assert.Equal(t, 2, len(bob.URNs())) - assert.Equal(t, "tel:+16055742222?id=10001&priority=1000", bob.URNs()[0].String()) - assert.Equal(t, "whatsapp:250788373373?id=30000&priority=999", bob.URNs()[1].String()) + assert.Equal(t, "tel:+16055742222?id=10001", bob.URNs()[0].String()) + assert.Equal(t, "whatsapp:250788373373?id=30000", bob.URNs()[1].String()) assert.Equal(t, 0, bob.Groups().Count()) assert.Nil(t, bob.Ticket()) // because ticketer no longer exists @@ -97,8 +97,8 @@ func TestContacts(t *testing.T) { bob, err = modelContacts[1].FlowContact(org) assert.NoError(t, err) - assert.Equal(t, "tel:+16055742222?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=10001&priority=1000", bob.URNs()[0].String()) - assert.Equal(t, "whatsapp:250788373373?id=30000&priority=999", bob.URNs()[1].String()) + assert.Equal(t, "tel:+16055742222?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=10001", bob.URNs()[0].String()) + assert.Equal(t, "whatsapp:250788373373?id=30000", bob.URNs()[1].String()) // add another tel urn to bob testdata.InsertContactURN(rt, testdata.Org1, testdata.Bob, urns.URN("tel:+250788373373"), 10) @@ -113,9 +113,9 @@ func TestContacts(t *testing.T) { bob, err = modelContacts[0].FlowContact(org) assert.NoError(t, err) - assert.Equal(t, "tel:+250788373373?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30001&priority=1000", bob.URNs()[0].String()) - assert.Equal(t, "tel:+16055742222?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=10001&priority=999", bob.URNs()[1].String()) - assert.Equal(t, "whatsapp:250788373373?id=30000&priority=998", bob.URNs()[2].String()) + assert.Equal(t, "tel:+250788373373?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30001", bob.URNs()[0].String()) + assert.Equal(t, "tel:+16055742222?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=10001", bob.URNs()[1].String()) + assert.Equal(t, "whatsapp:250788373373?id=30000", bob.URNs()[2].String()) // no op this time err = modelContacts[0].UpdatePreferredURN(ctx, rt.DB, org, models.URNID(30001), channel) @@ -123,9 +123,9 @@ func TestContacts(t *testing.T) { bob, err = modelContacts[0].FlowContact(org) assert.NoError(t, err) - assert.Equal(t, "tel:+250788373373?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30001&priority=1000", bob.URNs()[0].String()) - assert.Equal(t, "tel:+16055742222?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=10001&priority=999", bob.URNs()[1].String()) - assert.Equal(t, "whatsapp:250788373373?id=30000&priority=998", bob.URNs()[2].String()) + assert.Equal(t, "tel:+250788373373?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30001", bob.URNs()[0].String()) + assert.Equal(t, "tel:+16055742222?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=10001", bob.URNs()[1].String()) + assert.Equal(t, "whatsapp:250788373373?id=30000", bob.URNs()[2].String()) // calling with no channel is a noop on the channel err = modelContacts[0].UpdatePreferredURN(ctx, rt.DB, org, models.URNID(30001), nil) @@ -133,9 +133,9 @@ func TestContacts(t *testing.T) { bob, err = modelContacts[0].FlowContact(org) assert.NoError(t, err) - assert.Equal(t, "tel:+250788373373?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30001&priority=1000", bob.URNs()[0].String()) - assert.Equal(t, "tel:+16055742222?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=10001&priority=999", bob.URNs()[1].String()) - assert.Equal(t, "whatsapp:250788373373?id=30000&priority=998", bob.URNs()[2].String()) + assert.Equal(t, "tel:+250788373373?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30001", bob.URNs()[0].String()) + assert.Equal(t, "tel:+16055742222?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=10001", bob.URNs()[1].String()) + assert.Equal(t, "whatsapp:250788373373?id=30000", bob.URNs()[2].String()) } func TestCreateContact(t *testing.T) { @@ -156,11 +156,11 @@ func TestCreateContact(t *testing.T) { assert.Equal(t, "Rich", contact.Name()) assert.Equal(t, i18n.Language(`kin`), contact.Language()) - assert.Equal(t, []urns.URN{"telegram:200001?id=30001&priority=1000", "telegram:200002?id=30000&priority=999"}, contact.URNs()) + assert.Equal(t, []urns.URN{"telegram:200001?id=30001", "telegram:200002?id=30000"}, contact.URNs()) assert.Equal(t, "Rich", flowContact.Name()) assert.Equal(t, i18n.Language(`kin`), flowContact.Language()) - assert.Equal(t, []urns.URN{"telegram:200001?id=30001&priority=1000", "telegram:200002?id=30000&priority=999"}, flowContact.URNs().RawURNs()) + assert.Equal(t, []urns.URN{"telegram:200001?id=30001", "telegram:200002?id=30000"}, flowContact.URNs().RawURNs()) assert.Len(t, flowContact.Groups().All(), 1) assert.Equal(t, assets.GroupUUID("d636c966-79c1-4417-9f1c-82ad629773a2"), flowContact.Groups().All()[0].UUID()) @@ -229,7 +229,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{testdata.Cathy.URN}, testdata.Cathy.ID, false, - []urns.URN{"tel:+16055741111?id=10000&priority=1000"}, + []urns.URN{"tel:+16055741111?id=10000"}, models.NilChannelID, []assets.GroupUUID{testdata.DoctorsGroup.UUID}, }, @@ -238,7 +238,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{urns.URN(testdata.Cathy.URN.String() + "?foo=bar")}, testdata.Cathy.ID, // only URN identity is considered false, - []urns.URN{"tel:+16055741111?id=10000&priority=1000"}, + []urns.URN{"tel:+16055741111?id=10000"}, models.NilChannelID, []assets.GroupUUID{testdata.DoctorsGroup.UUID}, }, @@ -247,7 +247,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{urns.URN("telegram:100001")}, newContact(), // creates new contact true, - []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002&priority=1000"}, + []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002"}, testdata.TwilioChannel.ID, []assets.GroupUUID{"dcc16d85-8274-4d19-a3c2-152d4ee99380"}, }, @@ -256,7 +256,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{urns.URN("telegram:100001")}, prevContact(), // returns the same created contact false, - []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002&priority=1000"}, + []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002"}, models.NilChannelID, []assets.GroupUUID{"dcc16d85-8274-4d19-a3c2-152d4ee99380"}, }, @@ -265,7 +265,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{urns.URN("telegram:100001"), urns.URN("telegram:100002")}, prevContact(), // same again as other URNs don't exist false, - []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002&priority=1000"}, + []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002"}, models.NilChannelID, []assets.GroupUUID{"dcc16d85-8274-4d19-a3c2-152d4ee99380"}, }, @@ -274,7 +274,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{urns.URN("telegram:100002"), urns.URN("telegram:100001")}, prevContact(), // same again as other URNs don't exist false, - []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002&priority=1000"}, + []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002"}, models.NilChannelID, []assets.GroupUUID{"dcc16d85-8274-4d19-a3c2-152d4ee99380"}, }, @@ -283,7 +283,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{urns.URN("telegram:200001"), urns.URN("telegram:100001")}, prevContact(), // same again as other URNs are orphaned false, - []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002&priority=1000"}, + []urns.URN{"telegram:100001?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30002"}, models.NilChannelID, []assets.GroupUUID{"dcc16d85-8274-4d19-a3c2-152d4ee99380"}, }, @@ -292,7 +292,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{urns.URN("telegram:100003"), urns.URN("telegram:100004")}, // 2 new URNs newContact(), true, - []urns.URN{"telegram:100003?id=30003&priority=1000", "telegram:100004?id=30004&priority=999"}, + []urns.URN{"telegram:100003?id=30003", "telegram:100004?id=30004"}, models.NilChannelID, []assets.GroupUUID{}, }, @@ -301,7 +301,7 @@ func TestGetOrCreateContact(t *testing.T) { []urns.URN{urns.URN("telegram:100005"), urns.URN("telegram:200002")}, // 1 new, 1 orphaned newContact(), true, - []urns.URN{"telegram:100005?id=30005&priority=1000", "telegram:200002?id=30001&priority=999"}, + []urns.URN{"telegram:100005?id=30005", "telegram:200002?id=30001"}, models.NilChannelID, []assets.GroupUUID{}, }, diff --git a/core/models/msgs_test.go b/core/models/msgs_test.go index d4bc0e00d..e1fa549e4 100644 --- a/core/models/msgs_test.go +++ b/core/models/msgs_test.go @@ -513,7 +513,7 @@ func TestNewMsgOut(t *testing.T) { out, ch := models.NewMsgOut(oa, cathy, "hello", nil, nil, `eng-US`) assert.Equal(t, "hello", out.Text()) - assert.Equal(t, urns.URN("tel:+16055741111?id=10000&priority=1000"), out.URN()) + assert.Equal(t, urns.URN("tel:+16055741111?id=10000"), out.URN()) assert.Equal(t, assets.NewChannelReference("74729f45-7f29-4868-9dc4-90e491e3c7d8", "Twilio"), out.Channel()) assert.Equal(t, i18n.Locale(`eng-US`), out.Locale()) assert.Equal(t, "Twilio", ch.Name()) @@ -521,7 +521,7 @@ func TestNewMsgOut(t *testing.T) { cathy.SetStatus(flows.ContactStatusBlocked) out, ch = models.NewMsgOut(oa, cathy, "hello", nil, nil, `eng-US`) - assert.Equal(t, urns.URN("tel:+16055741111?id=10000&priority=1000"), out.URN()) + assert.Equal(t, urns.URN("tel:+16055741111?id=10000"), out.URN()) assert.Equal(t, assets.NewChannelReference("74729f45-7f29-4868-9dc4-90e491e3c7d8", "Twilio"), out.Channel()) assert.Equal(t, "Twilio", ch.Name()) assert.Equal(t, flows.UnsendableReasonContactStatus, out.UnsendableReason()) diff --git a/core/models/testdata/imports.json b/core/models/testdata/imports.json index c52a7e5e6..30b7593bf 100644 --- a/core/models/testdata/imports.json +++ b/core/models/testdata/imports.json @@ -28,7 +28,7 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700001?id=10000&priority=1000" + "tel:+16055700001?id=10000" ], "fields": {}, "groups": [] @@ -39,7 +39,7 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700002?id=10001&priority=1000" + "tel:+16055700002?id=10001" ], "fields": {}, "groups": [] @@ -77,7 +77,7 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700001?id=10000&priority=1000" + "tel:+16055700001?id=10000" ], "fields": {}, "groups": [] @@ -88,7 +88,7 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700002?id=10001&priority=1000" + "tel:+16055700002?id=10001" ], "fields": {}, "groups": [] @@ -99,8 +99,8 @@ "language": "spa", "status": "active", "urns": [ - "tel:+16055700003?id=10002&priority=1000", - "tel:+593979000001?id=10003&priority=999" + "tel:+16055700003?id=10002", + "tel:+593979000001?id=10003" ], "fields": { "age": "40" @@ -149,7 +149,7 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700001?id=10000&priority=1000" + "tel:+16055700001?id=10000" ], "fields": {}, "groups": [] @@ -160,8 +160,8 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700002?id=10001&priority=1000", - "tel:+593979000002?id=10004&priority=999" + "tel:+16055700002?id=10001", + "tel:+593979000002?id=10004" ], "fields": { "age": "28" @@ -174,8 +174,8 @@ "language": "spa", "status": "active", "urns": [ - "tel:+16055700003?id=10002&priority=1000", - "tel:+593979000001?id=10003&priority=999" + "tel:+16055700003?id=10002", + "tel:+593979000001?id=10003" ], "fields": { "age": "39" @@ -241,7 +241,7 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700001?id=10000&priority=1000" + "tel:+16055700001?id=10000" ], "fields": {}, "groups": [] @@ -252,8 +252,8 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700002?id=10001&priority=1000", - "tel:+593979000002?id=10004&priority=999" + "tel:+16055700002?id=10001", + "tel:+593979000002?id=10004" ], "fields": { "age": "28", @@ -267,8 +267,8 @@ "language": "spa", "status": "active", "urns": [ - "tel:+16055700003?id=10002&priority=1000", - "tel:+593979000001?id=10003&priority=999" + "tel:+16055700003?id=10002", + "tel:+593979000001?id=10003" ], "fields": { "age": "39", @@ -320,7 +320,7 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700001?id=10000&priority=1000" + "tel:+16055700001?id=10000" ], "fields": {}, "groups": [] @@ -331,8 +331,8 @@ "language": "kin", "status": "active", "urns": [ - "tel:+16055700002?id=10001&priority=1000", - "tel:+593979000002?id=10004&priority=999" + "tel:+16055700002?id=10001", + "tel:+593979000002?id=10004" ], "fields": { "age": "28", @@ -346,8 +346,8 @@ "language": "spa", "status": "active", "urns": [ - "tel:+16055700003?id=10002&priority=1000", - "tel:+593979000001?id=10003&priority=999" + "tel:+16055700003?id=10002", + "tel:+593979000001?id=10003" ], "fields": { "age": "39", @@ -383,8 +383,8 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700001?id=10000&priority=1000", - "tel:+16055700002?id=10001&priority=999" + "tel:+16055700001?id=10000", + "tel:+16055700002?id=10001" ], "fields": {}, "groups": [] @@ -395,7 +395,7 @@ "language": "kin", "status": "active", "urns": [ - "tel:+593979000002?id=10004&priority=999" + "tel:+593979000002?id=10004" ], "fields": { "age": "28", @@ -409,8 +409,8 @@ "language": "spa", "status": "active", "urns": [ - "tel:+16055700003?id=10002&priority=1000", - "tel:+593979000001?id=10003&priority=999" + "tel:+16055700003?id=10002", + "tel:+593979000001?id=10003" ], "fields": { "age": "39", @@ -450,8 +450,8 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700001?id=10000&priority=1000", - "tel:+16055700002?id=10001&priority=999" + "tel:+16055700001?id=10000", + "tel:+16055700002?id=10001" ], "fields": {}, "groups": [] @@ -462,7 +462,7 @@ "language": "kin", "status": "active", "urns": [ - "tel:+593979000002?id=10004&priority=999" + "tel:+593979000002?id=10004" ], "fields": { "age": "28", @@ -476,8 +476,8 @@ "language": "spa", "status": "active", "urns": [ - "tel:+16055700003?id=10002&priority=1000", - "tel:+593979000001?id=10003&priority=999" + "tel:+16055700003?id=10002", + "tel:+593979000001?id=10003" ], "fields": { "age": "39", @@ -526,9 +526,9 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700001?id=10000&priority=1000", - "tel:+16055700002?id=10001&priority=999", - "tel:+16055700005?id=10006&priority=998" + "tel:+16055700001?id=10000", + "tel:+16055700002?id=10001", + "tel:+16055700005?id=10006" ], "fields": {}, "groups": [] @@ -539,7 +539,7 @@ "language": "kin", "status": "active", "urns": [ - "tel:+593979000002?id=10004&priority=999" + "tel:+593979000002?id=10004" ], "fields": { "age": "28", @@ -553,8 +553,8 @@ "language": "spa", "status": "active", "urns": [ - "tel:+16055700003?id=10002&priority=1000", - "tel:+593979000001?id=10003&priority=999" + "tel:+16055700003?id=10002", + "tel:+593979000001?id=10003" ], "fields": { "age": "39", @@ -610,9 +610,9 @@ "language": "", "status": "archived", "urns": [ - "tel:+16055700001?id=10000&priority=1000", - "tel:+16055700002?id=10001&priority=999", - "tel:+16055700005?id=10006&priority=998" + "tel:+16055700001?id=10000", + "tel:+16055700002?id=10001", + "tel:+16055700005?id=10006" ], "fields": {}, "groups": [] @@ -623,7 +623,7 @@ "language": "kin", "status": "active", "urns": [ - "tel:+593979000002?id=10004&priority=999" + "tel:+593979000002?id=10004" ], "fields": { "age": "28", @@ -637,8 +637,8 @@ "language": "spa", "status": "active", "urns": [ - "tel:+16055700003?id=10002&priority=1000", - "tel:+593979000001?id=10003&priority=999" + "tel:+16055700003?id=10002", + "tel:+593979000001?id=10003" ], "fields": { "age": "39", @@ -655,7 +655,7 @@ "language": "", "status": "blocked", "urns": [ - "tel:+16055700007?id=10007&priority=1000" + "tel:+16055700007?id=10007" ], "fields": {}, "groups": [] @@ -666,7 +666,7 @@ "language": "", "status": "active", "urns": [ - "tel:+16055700008?id=10008&priority=1000" + "tel:+16055700008?id=10008" ], "fields": {}, "groups": [] diff --git a/web/contact/testdata/bulk_create.json b/web/contact/testdata/bulk_create.json index 1555f0b78..956c1c1ba 100644 --- a/web/contact/testdata/bulk_create.json +++ b/web/contact/testdata/bulk_create.json @@ -93,7 +93,7 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+16055700001?id=30000&priority=1000" + "tel:+16055700001?id=30000" ], "groups": [ { diff --git a/web/contact/testdata/create.json b/web/contact/testdata/create.json index e11b8c29f..0afe4053a 100644 --- a/web/contact/testdata/create.json +++ b/web/contact/testdata/create.json @@ -77,7 +77,7 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+16055700001?id=30000&priority=1000" + "tel:+16055700001?id=30000" ], "groups": [ { @@ -157,7 +157,7 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+16055741111?id=10000&priority=1000" + "tel:+16055741111?id=10000" ] } } diff --git a/web/contact/testdata/modify.json b/web/contact/testdata/modify.json index 7da19cc0a..9c3125267 100644 --- a/web/contact/testdata/modify.json +++ b/web/contact/testdata/modify.json @@ -1083,7 +1083,7 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+255788555111?id=30000&priority=1000" + "tel:+255788555111?id=30000" ] }, "events": [ @@ -1134,7 +1134,7 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+255788555111?id=30000&priority=1000", + "tel:+255788555111?id=30000", "tel:+255788555222" ] }, @@ -1143,7 +1143,7 @@ "type": "contact_urns_changed", "created_on": "2018-07-06T12:30:00.123456789Z", "urns": [ - "tel:+255788555111?id=30000&priority=1000", + "tel:+255788555111?id=30000", "tel:+255788555222" ] } @@ -1191,8 +1191,8 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+255788555111?id=30000&priority=1000", - "tel:+255788555222?id=30001&priority=999" + "tel:+255788555111?id=30000", + "tel:+255788555222?id=30001" ] }, "events": [] @@ -1239,7 +1239,7 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+255788555111?id=30000&priority=1000" + "tel:+255788555111?id=30000" ] }, "events": [ @@ -1247,7 +1247,7 @@ "type": "contact_urns_changed", "created_on": "2018-07-06T12:30:00.123456789Z", "urns": [ - "tel:+255788555111?id=30000&priority=1000" + "tel:+255788555111?id=30000" ] } ] @@ -1641,7 +1641,7 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+255788555111?id=30000&priority=1000" + "tel:+255788555111?id=30000" ], "groups": [ { diff --git a/web/contact/testdata/resolve.json b/web/contact/testdata/resolve.json index 8191a5f19..e07ee59f0 100644 --- a/web/contact/testdata/resolve.json +++ b/web/contact/testdata/resolve.json @@ -57,7 +57,7 @@ "timezone": "America/Los_Angeles", "created_on": "2020-12-31T16:45:30Z", "urns": [ - "tel:+16055742222?id=10001&priority=1000" + "tel:+16055742222?id=10001" ], "fields": { "joined": { @@ -97,7 +97,7 @@ "timezone": "America/Los_Angeles", "created_on": "2018-07-06T12:30:00.123457Z", "urns": [ - "tel:+16055747777?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30000&priority=1000" + "tel:+16055747777?channel=74729f45-7f29-4868-9dc4-90e491e3c7d8&id=30000" ] }, "created": true, diff --git a/web/ivr/ivr_test.go b/web/ivr/ivr_test.go index 1a53efb3a..5c11c92f0 100644 --- a/web/ivr/ivr_test.go +++ b/web/ivr/ivr_test.go @@ -85,7 +85,7 @@ func TestTwilioIVR(t *testing.T) { "contact": { "id": 10000, "name": "Cathy", - "urns": ["tel:+16055741111?id=10000&priority=50"], + "urns": ["tel:+16055741111?id=10000"], "uuid": "6393abc0-283d-4c9b-a1b3-641a035c34bf", "fields": {"gender": {"text": "F"}}, "groups": [{"name": "Doctors", "uuid": "c153e265-f7c9-4539-9dbc-9b358714b638"}], @@ -441,7 +441,7 @@ func TestVonageIVR(t *testing.T) { "action": "input", "eventMethod": "POST", "eventUrl": [ - "https://localhost:8090/mr/ivr/c/19012bfd-3ce3-4cae-9bb9-76cf92c73d49/handle?action=resume&connection=1&urn=tel%3A%2B16055741111%3Fid%3D10000%26priority%3D1000&wait_type=gather&sig=O9Lq3OdBw1EoZ1KD6XSjIaKvuRg%3D" + "https://localhost:8090/mr/ivr/c/19012bfd-3ce3-4cae-9bb9-76cf92c73d49/handle?action=resume&connection=1&urn=tel%3A%2B16055741111%3Fid%3D10000&wait_type=gather&sig=0znh%2FxV9L0OD0ITKr6%2FDfpbNbXE%3D" ], "maxDigits": 1, "submitOnHash": true, @@ -533,7 +533,7 @@ func TestVonageIVR(t *testing.T) { "action": "input", "eventMethod": "POST", "eventUrl": [ - "https://localhost:8090/mr/ivr/c/19012bfd-3ce3-4cae-9bb9-76cf92c73d49/handle?action=resume&connection=2&urn=tel%3A%2B16055743333%3Fid%3D10002%26priority%3D1000&wait_type=gather&sig=uY7YwwGJn79IhdQUaKpQ932Fbss%3D" + "https://localhost:8090/mr/ivr/c/19012bfd-3ce3-4cae-9bb9-76cf92c73d49/handle?action=resume&connection=2&urn=tel%3A%2B16055743333%3Fid%3D10002&wait_type=gather&sig=5t5yQU0hZ8%2BWz1qNBDNT%2BRggYJM%3D" ], "maxDigits": 1, "submitOnHash": true, @@ -556,7 +556,7 @@ func TestVonageIVR(t *testing.T) { "action": "input", "eventMethod": "POST", "eventUrl": [ - "https://localhost:8090/mr/ivr/c/19012bfd-3ce3-4cae-9bb9-76cf92c73d49/handle?action=resume&connection=2&urn=tel%3A%2B16055743333%3Fid%3D10002%26priority%3D1000&wait_type=gather&sig=uY7YwwGJn79IhdQUaKpQ932Fbss%3D" + "https://localhost:8090/mr/ivr/c/19012bfd-3ce3-4cae-9bb9-76cf92c73d49/handle?action=resume&connection=2&urn=tel%3A%2B16055743333%3Fid%3D10002&wait_type=gather&sig=5t5yQU0hZ8%2BWz1qNBDNT%2BRggYJM%3D" ], "maxDigits": 20, "submitOnHash": true, diff --git a/web/msg/testdata/send.json b/web/msg/testdata/send.json index ee56ce97c..ddb0fe464 100644 --- a/web/msg/testdata/send.json +++ b/web/msg/testdata/send.json @@ -59,7 +59,7 @@ "name": "Twilio", "uuid": "74729f45-7f29-4868-9dc4-90e491e3c7d8" }, - "urn": "tel:+16055741111?id=10000&priority=1000", + "urn": "tel:+16055741111?id=10000", "text": "hello", "attachments": [], "status": "Q", @@ -97,7 +97,7 @@ "name": "Twilio", "uuid": "74729f45-7f29-4868-9dc4-90e491e3c7d8" }, - "urn": "tel:+16055741111?id=10000&priority=1000", + "urn": "tel:+16055741111?id=10000", "text": "", "attachments": [ "image/jpeg:https://aws.com/test/test.jpg", @@ -130,7 +130,7 @@ "name": "Twilio", "uuid": "74729f45-7f29-4868-9dc4-90e491e3c7d8" }, - "urn": "tel:+16055741111?id=10000&priority=1000", + "urn": "tel:+16055741111?id=10000", "text": "we can help", "attachments": [], "status": "Q",