# vim: tabstop=4 shiftwidth=4 softtabstop=4

# Copyright (C) 2014 PolyBeacon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


def answer(delay=0):
    """Answer the channel.

    :param delay: The number of milliseconds to wait before moving to the next
                  priority.
    :type delay: int
    """
    res = 'same => n,Answer(%d)' % delay

    return res


def goto(context, exten='s', priority=1):
    res = 'same => n,Goto(%s,%s,%d)' % (context, exten, priority)

    return res


def hangup(cause=''):
    """Hangup the calling channel.

    :param cause: Hangup cause code to use for the channel.
    :type cause: str
    """
    res = 'same => n,Hangup(%s)' % cause

    return res

# vim: tabstop=4 shiftwidth=4 softtabstop=4

# Copyright (C) 2014 PolyBeacon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


def answer(delay=0):
    """Answer the channel.

    :param delay: The number of milliseconds to wait before moving to the next
                  priority.
    :type delay: int
    """
    res = 'same => n,Answer(%d)' % delay

    return res


def goto(context, exten='s', priority=1):
    """Goto another point in the dialplan

    :param context: The context or label to jump to
    :type context: string
    :param exten: The extension within that context to goto (default: s)
    :type exten: string
    :param priority: The line within the extension (default: 1)
    :type priority: int
    """
    res = 'same => n,Goto(%s,%s,%d)' % (context, exten, priority)

    return res


def hangup(cause=''):
    """Hangup the calling channel.

    :param cause: Hangup cause code to use for the channel.
    :type cause: str
    """
    res = 'same => n,Hangup(%s)' % cause

    return res

Add documentation for goto command
Add documentation for goto command

Change-Id: I94e280eef509abe65f552b6e78f21eabfe4192e3
Signed-off-by: Sarah Liske <e262b8a15d521183e33ead305fd79e90e1942cdd@polybeacon.com>
