summary refs log tree commit diff
path: root/synapse/util/msisdn.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2017-03-08 19:05:29 +0000
committerDavid Baker <dave@matrix.org>2017-03-08 19:05:29 +0000
commit9d0d40fc15e4bc79eee46242ae27980073cd528b (patch)
tree2cb5e3c7f9118ae18a00bd9c7ce737980347b2a0 /synapse/util/msisdn.py
parentIncorrectly copied copyright (diff)
downloadsynapse-9d0d40fc15e4bc79eee46242ae27980073cd528b.tar.xz
Docs
Diffstat (limited to 'synapse/util/msisdn.py')
-rw-r--r--synapse/util/msisdn.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/util/msisdn.py b/synapse/util/msisdn.py
index d320e411f8..607161e7f0 100644
--- a/synapse/util/msisdn.py
+++ b/synapse/util/msisdn.py
@@ -18,6 +18,19 @@ from synapse.api.errors import SynapseError
 
 
 def phone_number_to_msisdn(country, number):
+    """
+    Takes an ISO-3166-1 2 letter country code and phone number and
+    returns an msisdn representing the canonical version of that
+    phone number.
+    Args:
+        country (str): ISO-3166-1 2 letter country code
+        number (str): Phone number in a national or international format
+
+    Returns:
+        (str) The canonical form of the phone number, as an msisdn
+    Raises:
+            SynapseError if the number could not be parsed.
+    """
     try:
         phoneNumber = phonenumbers.parse(number, country)
     except phonenumbers.NumberParseException: