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

Added function to return specified channel variable #58

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Basic functions are implemented already:
- uuid_kill
- answer
- sleep
- return channel variable

With current api, it's easy to mix sync and async actions, for example:
play_and_get_digits method will return the pressed DTMF digits in a block mode,
Expand Down
7 changes: 7 additions & 0 deletions greenswitch/esl.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ def call_uuid(self):
@property
def caller_id_number(self):
return self.session_data.get('Caller-Caller-ID-Number')

def get_channel_variable(self, variable_name):
return self.session_data.get(str(variable_name))

@property
def caller_destination_number(self):
return self.session_data.get('Caller-Destination-Number')

def on_disconnect(self, event):
if self._lingering:
Expand Down