diff --git a/README.rst b/README.rst index 4afc9f0..7d5a008 100644 --- a/README.rst +++ b/README.rst @@ -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, diff --git a/greenswitch/esl.py b/greenswitch/esl.py index 1e9cebd..7f29dc0 100644 --- a/greenswitch/esl.py +++ b/greenswitch/esl.py @@ -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: