Skip to content

Commit

Permalink
Merge pull request #406 from communityconnectlabs/feat/vonage-machine…
Browse files Browse the repository at this point in the history
…-detection

Add answered_by field on channels connections for IVR
  • Loading branch information
teehamaral authored May 31, 2024
2 parents 7b1fc4f + c158429 commit 1cae5f7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Binary file modified mailroom_test.dump
Binary file not shown.
18 changes: 18 additions & 0 deletions temba/channels/migrations/0141_channelconnection_answered_by.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.10 on 2024-05-16 16:16

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("channels", "0140_smpplog"),
]

operations = [
migrations.AddField(
model_name="channelconnection",
name="answered_by",
field=models.CharField(choices=[("H", "Human"), ("M", "Machine")], max_length=1, null=True),
),
]
8 changes: 8 additions & 0 deletions temba/channels/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1671,10 +1671,18 @@ class ChannelConnection(models.Model):
(ERROR_MACHINE, _("Answering Machine")), # the call went to an answering machine
)

ANSWERED_BY_HUMAN = "H"
ANSWERED_BY_MACHINE = "M"
ANSWERED_BY_CHOICES = (
(ANSWERED_BY_HUMAN, _("Human")),
(ANSWERED_BY_MACHINE, _("Machine")),
)

org = models.ForeignKey(Org, on_delete=models.PROTECT)
connection_type = models.CharField(max_length=1, choices=TYPE_CHOICES)
direction = models.CharField(max_length=1, choices=DIRECTION_CHOICES)
status = models.CharField(max_length=1, choices=STATUS_CHOICES)
answered_by = models.CharField(max_length=1, choices=ANSWERED_BY_CHOICES, null=True)

channel = models.ForeignKey("Channel", on_delete=models.PROTECT, related_name="connections")
contact = models.ForeignKey("contacts.Contact", on_delete=models.PROTECT, related_name="connections")
Expand Down

0 comments on commit 1cae5f7

Please sign in to comment.