|
| 1 | +""" |
| 2 | +forward.py |
| 3 | +
|
| 4 | +Bandwidth's Forward BXML verb |
| 5 | +
|
| 6 | +@copyright Bandwidth INC |
| 7 | +""" |
| 8 | +from ..terminal_verb import TerminalVerb |
| 9 | + |
| 10 | + |
| 11 | +class Forward(TerminalVerb): |
| 12 | + |
| 13 | + def __init__( |
| 14 | + self, to: str=None, from_: str=None, |
| 15 | + call_timeout: str=None, diversion_treatment: str=None, |
| 16 | + diversion_reason: str=None, uui: str=None |
| 17 | + ): |
| 18 | + """Initialize a <Forward> verb |
| 19 | +
|
| 20 | + Args: |
| 21 | + to (str): The phone number destination of the call. |
| 22 | + from_ (str, optional): The phone number that the recipient will receive the call from. |
| 23 | + call_timeout (str, optional): The number of seconds to wait before timing out the call. |
| 24 | + diversion_treatment (str, optional): Can be any of the following: |
| 25 | + none: No diversion headers are sent on the outbound leg of the transferred call. |
| 26 | + propagate: Copy the Diversion header from the inbound leg to the outbound leg. Ignored if there is no Diversion header present on the inbound leg. |
| 27 | + stack: After propagating any Diversion header from the inbound leg to the outbound leg, stack on top another Diversion header based on the Request-URI of the inbound call. |
| 28 | +
|
| 29 | + Defaults to none. If diversionTreatment is not specified, no diversion header will be included for the transfer even if one came with the inbound call. Defaults to None. |
| 30 | + diversion_reason (str, optional): Can be any of the following values: |
| 31 | + unknown |
| 32 | + user-busy |
| 33 | + no-answer |
| 34 | + unavailable |
| 35 | + unconditional |
| 36 | + time-of-day |
| 37 | + do-not-disturb |
| 38 | + deflection |
| 39 | + follow-me |
| 40 | + out-of-service |
| 41 | + away |
| 42 | +
|
| 43 | + This parameter is considered only when diversionTreatment is set to stack. Defaults is unknown. |
| 44 | + Defaults to None. |
| 45 | + uui (str, optional): The value of the User-To-User header to send within the outbound INVITE when forwarding to a SIP URI. |
| 46 | + Must include the encoding parameter as specified in RFC 7433. Only base64 and jwt encoding are currently allowed. |
| 47 | + This value, including the encoding specifier, may not exceed 256 characters. |
| 48 | + """ |
| 49 | + self.to = to |
| 50 | + self.from_ = from_ |
| 51 | + self.call_timeout = call_timeout |
| 52 | + self.diversion_treatment = diversion_treatment |
| 53 | + self.diversion_reason = diversion_reason |
| 54 | + self.uui = uui |
| 55 | + |
| 56 | + super().__init__(tag="Forward", content=None) |
| 57 | + @property |
| 58 | + def _attributes(self): |
| 59 | + return { |
| 60 | + "to": self.to, |
| 61 | + "from_": self.from_, |
| 62 | + "callTimeout": self.call_timeout, |
| 63 | + "diversionTreatment": self.diversion_treatment, |
| 64 | + "diversionReason": self.diversion_reason, |
| 65 | + "uui": self.uui, |
| 66 | + } |
0 commit comments