from corehq.apps.sms.models import ForwardingRule


def get_forwarding_rules_for_domain(domain):
    return ForwardingRule.view(
        "sms/forwarding_rule",
        key=[domain],
        include_docs=True,
    ).all()

@@ -135,13 +135,50 @@
    %22
-sms/f
+domain/docs%22,%0A        startkey=%5Bdomain, 'F
 orwa
@@ -186,14 +186,14 @@
 ding
-_rule%22
+Rule'%5D
 ,%0A  
@@ -198,16 +198,19 @@
         
+end
 key=%5Bdom
@@ -212,16 +212,38 @@
 =%5Bdomain
+, 'ForwardingRule', %7B%7D
 %5D,%0A     
@@ -264,16 +264,38 @@
 s=True,%0A
+        reduce=False,%0A
     ).al

remove calls to sms/forwarding_rule