Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait for register status for incall #79

Merged
merged 4 commits into from Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/daily/call_transfer.feature
Expand Up @@ -78,7 +78,7 @@ Feature: Call transfer

When "User B" answers
Then "User A" is talking
Then "incall" is holding
# Then "incall" is holding # issue WAZO-1470
Then "User B" is talking

When "User B" hangs up
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -24,4 +24,4 @@ python-consul==0.7.1
pyyaml==3.13
requests==2.21.0
stevedore==1.29.0
websocket-client==0.53.0
websocket-client==0.57.0
5 changes: 4 additions & 1 deletion wazo_acceptance/helpers/sip_phone.py
Expand Up @@ -11,7 +11,7 @@
LinphoneException,
Session,
)
from linphonelib.commands import CallStatus
from linphonelib.commands import CallStatus, RegisterStatus

logger = logging.getLogger('linphone')

Expand Down Expand Up @@ -117,6 +117,9 @@ def is_ringing(self):
def is_hungup(self):
return self._session.call_status() == CallStatus.OFF

def is_registered(self):
return self._session.register_status() == RegisterStatus.REGISTERED

def is_holding(self, context):
response = context.amid_client.action('DeviceStateList')
device_name = 'PJSIP/{}'.format(self._name)
Expand Down
7 changes: 3 additions & 4 deletions wazo_acceptance/steps/application.py
@@ -1,4 +1,4 @@
# Copyright 2019 The Wazo Authors (see the AUTHORS file)
# Copyright 2019-2020 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later

from behave import (
Expand Down Expand Up @@ -39,11 +39,10 @@ def step_impl(context, user_name, app_name):
user = context.helpers.confd_user.get_by(firstname=user_name)
user_exten = user['lines'][0]['extensions'][0]['exten']
user_context = user['lines'][0]['extensions'][0]['context']
context.calld_client.applications.join_node(
context.calld_client.applications.make_call_to_node(
application['uuid'],
node['uuid'],
user_exten,
user_context,
{'exten': user_exten, 'context': user_context},
)

phone = context.phone_register.get_phone(user_name)
Expand Down
1 change: 1 addition & 0 deletions wazo_acceptance/steps/phone_call.py
Expand Up @@ -131,6 +131,7 @@ def when_incoming_call_received_from_name_to_exten(context, incall_name, exten,
sip = context.helpers.endpoint_sip.create(body)
context.helpers.trunk.add_endpoint_sip(trunk, sip)
phone = context.helpers.sip_phone.register_and_track_phone(incall_name, sip)
until.true(phone.is_registered, tries=3)
phone.call(exten)


Expand Down