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

WAZO-4044: Queue destination details #254

Conversation

alikazemkhanloo
Copy link

@alikazemkhanloo alikazemkhanloo commented Feb 2, 2025

Add queue name and id to CDR.
Depends on: wazo-platform/xivo-config#137

Copy link
Contributor

Build failed.
https://zuul.wazo.community/zuul/t/local/buildset/214132cabbf2498595bfe767b85068a6

tox-linters FAILURE in 6m 32s
✔️ wazo-tox-py39 SUCCESS in 7m 04s
✔️ debian-packaging-bullseye SUCCESS in 2m 16s
✔️ wazo-tox-integration-call-logd SUCCESS in 15m 18s

Copy link

sonarqubecloud bot commented Feb 2, 2025

Copy link
Contributor

Build succeeded.
https://zuul.wazo.community/zuul/t/local/buildset/e5eaa5b05abd446988091764b9face59

✔️ tox-linters SUCCESS in 6m 51s
✔️ wazo-tox-py39 SUCCESS in 7m 35s
✔️ debian-packaging-bullseye SUCCESS in 2m 14s
✔️ wazo-tox-integration-call-logd SUCCESS in 15m 11s

@alikazemkhanloo alikazemkhanloo changed the title Queue destination details WAZO-4044: Queue destination details Feb 2, 2025
@DrPyser
Copy link
Contributor

DrPyser commented Feb 5, 2025

@alikazemkhanloo Thank you for your contribution. Please update the AUTHORS file in this repository with your name and email, or the name of the organisation in the name of which you are submitting this contribution.

@DrPyser
Copy link
Contributor

DrPyser commented Feb 5, 2025

My E2E testing confirms this works well under these scenarios:

  • Incall to queue to agent (answer)
  • Incall to queue to agent (no answer)
  • incall to queue to user (answer)
  • incall to queue to user (no answer)

the queue destination type with queue_id and queue_name info is properly registered in call_logd_call_log_destination table, and the information is available from the /cdr wazo-call-logd API.

Comment on lines +981 to +992
expected_properties = dict(
source_name='John Conner',
source_exten='0012345678910',
requested_exten='8083339999',
destination_exten='8083339999',
destination_name='SUPPORT',
direction='inbound',
)

assert {
prop: getattr(call_logs[0], prop) for prop in expected_properties
} == expected_properties
Copy link
Contributor

@DrPyser DrPyser Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't check the destination_details.

Suggested change
expected_properties = dict(
source_name='John Conner',
source_exten='0012345678910',
requested_exten='8083339999',
destination_exten='8083339999',
destination_name='SUPPORT',
direction='inbound',
)
assert {
prop: getattr(call_logs[0], prop) for prop in expected_properties
} == expected_properties
call_log, = call_logs
expected_properties = dict(
source_name='John Conner',
source_exten='0012345678910',
requested_exten='8083339999',
destination_exten='8083339999',
destination_name='SUPPORT',
direction='inbound',
destination_details={
'type': 'queue',
'queue_id': 1,
'queue_name': 'SUPPORT'
}
)
assert all(getattr(call_log, 'destination_details_dict' if expected_prop == 'destination_details' else prop) == expected_value for expected_prop, expected_value in expected_properties)

Note also my suggested reformulation of the assertion.
destination_details_dict is a "property" method on CallLog class to expose destination_details table rows as a dictionary.

@DrPyser
Copy link
Contributor

DrPyser commented Feb 5, 2025

See https://mm.wazo.community/wazo-platform/pl/ouz57cb75frjue7xiqmguqcnta.

Our company's policy make us unable to accept contributions from organisations affiliated with Iran or serving the Iranian market, in part to avoid any potential legal risk due to sanctions and in part due to inability to properly investigate the legal implications without financial cost.

Sorry about that, the contribution was otherwise perfectly fine and I would have been happy to accept it after some minor improvements on test scenarios.

I won't be able to accept any future contribution from you to integrate them into wazo-platform directly unfortunately, but nothing prevents you from presenting your contributions as part of your own fork and providing them as independent patches to the community.

@DrPyser DrPyser closed this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants