Tropo is part of CiscoLearn More

currentCall

The aptly names currentCall object returns information about the current call. These values will vary depending on whether the call is inbound or outbound and whether the call is voice or SMS. A complete list of possible properties:

  • methods - this returns the complete list of available properties.
  • isActive() - this allows you determine whether the call is active or not. If the call is still connected, it will return true. If the call has disconnected but the session is still active, it will return false.

    Note
    Unlike all other properties of currentCall, isActive() is a function. Using it as a property will not give the results you expect, but some languages, like Python, may not return an error.
  • callerID - the Caller ID for the session's origin. For example, if the number (407) 555-0100 called (386) 555-1000, the 407 number would be the callerID.
  • calledID - the Caller ID for the session's destination. For example, if the number (407) 555-0100 called (386) 555-1000, the 386 number would be the calledID.
  • network - the name of the network being used for this session. For text, this will only be "SMS"; for voice, this can be 'PSTN", "SIP", or "INUM".
  • channel - the channel for this session. For phone calls, it's "VOICE"; for SMS it's "TEXT".
  • sessionId - this identifies the session as a whole, as opposed to one of the calls within the session.
  • state - this identifies the state of the call, such as ANSWERED and DISCONNECTED. Like isActive and isIncoming, this is also a function. In addition, this will only populate for an outbound call.
  • callerName - the Caller Name for the session's origin. For example, if Mozart called Napoleon, Mozart would be the callerName. This is primarily only used with SIP calls and is populated from the user portion of the SIP header.
  • calledName - the Caller Name for the session's destination. For example, if Mozart called Napoleon, Napoleon would be the calledName. This is primarily only used with SIP calls and is populated from the user portion of the SIP header.
  • initialText - when the channel is "TEXT", this field is populated with the text of the message.
  • answeredTime - defines when the outbound call was picked up - this is blank if the call is inbound.
  • id - each session can have multiple calls; this identifies a particular call.

Examples

  say("Logging call values!");
log("*******************all of the methods =>" + currentCall.methods);
log("*******************isActive => " + currentCall.isActive());
log("*******************isIncoming => " + currentCall.isIncoming());
log("*******************callerID => " + currentCall.callerID);
log("*******************network => " + currentCall.network);
log("*******************sessionId => " + currentCall.sessionId);
log("*******************state => " + currentCall.state());
log("*******************callerName => " + currentCall.callerName);
log("*******************initialText => " + currentCall.initialText);
log("*******************answeredTime => " + currentCall.answeredTime);
log("*******************calledID => " + currentCall.calledID);
log("*******************channel => " + currentCall.channel);
log("*******************calledName => " + currentCall.calledName);
log("*******************id => " + currentCall.id);
say("Logging is done, man.");  
say "Logging call values!"
log "*******************all of the methods => #{$currentCall.methods}"
log "*******************isActive => #{$currentCall.isActive}"
log "*******************isIncoming => #{$currentCall.isIncoming}"
log "*******************callerID => #{$currentCall.callerID}"
log "*******************network => #{$currentCall.network}"
log "*******************sessionId => #{$currentCall.sessionId}"
log "*******************state => #{$currentCall.state}"
log "*******************callerName => #{$currentCall.callerName}"
log "*******************initialText => #{$currentCall.initialText}"
log "*******************answeredTime => #{$currentCall.answeredTime}"
log "*******************calledID => #{$currentCall.calledID}"
log "*******************channel => #{$currentCall.channel}"
log "*******************calledName => #{$currentCall.calledName}"
log "*******************id => #{$currentCall.id}"
say "Logging is done, man."
<?php
say("Logging call values!");
_log("*******************all of the methods =>".$currentCall->methods);
_log("*******************isActive => ".$currentCall->isActive());
_log("*******************isIncoming => ".$currentCall->isIncoming());
_log("*******************callerID => ".$currentCall->callerID);
_log("*******************network => ".$currentCall->network);
_log("*******************sessionId => ".$currentCall->sessionId);
_log("*******************state => ".$currentCall->state());
_log("*******************callerName => ".$currentCall->callerName);
_log("*******************initialText => ".$currentCall->initialText);
_log("*******************answeredTime => ".$currentCall->answeredTime);
_log("*******************calledID => ".$currentCall->calledID);
_log("*******************channel => ".$currentCall->channel);
_log("*******************calledName => ".$currentCall->calledName);
_log("*******************id => ".$currentCall->id);
say("Logging is done, man.");
?>
say("Logging call values!");
log("*******************all of the methods =>" + str(currentCall.methods));
log("*******************isActive => " + str(currentCall.isActive()));
log("*******************isIncoming => " + str(currentCall.isIncoming()));
log("*******************callerID => " + str(currentCall.callerID));
log("*******************network => " + str(currentCall.network));
log("*******************sessionId => " + str(currentCall.sessionId));
log("*******************state => " + str(currentCall.state()));
log("*******************callerName => " + str(currentCall.callerName));
log("*******************initialText => " + str(currentCall.initialText));
log("*******************answeredTime => " + str(currentCall.answeredTime));
log("*******************calledID => " + str(currentCall.calledID));
log("*******************channel => " + str(currentCall.channel));
log("*******************calledName => " + str(currentCall.calledName));
log("*******************id => " + str(currentCall.id));
say("Logging is done, man.");
say("Logging call values!");
log("*******************all of the methods =>" + currentCall.methods);
log("*******************isActive => " + currentCall.isActive());
log("*******************isIncoming => " + currentCall.isIncoming());
log("*******************callerID => " + currentCall.callerID);
log("*******************network => " + currentCall.network);
log("*******************sessionId => " + currentCall.sessionId);
log("*******************state => " + currentCall.state());
log("*******************callerName => " + currentCall.callerName);
log("*******************initialText => " + currentCall.initialText);
log("*******************answeredTime => " + currentCall.answeredTime);
log("*******************calledID => " + currentCall.calledID);
log("*******************channel => " + currentCall.channel);
log("*******************calledName => " + currentCall.calledName);
log("*******************id => " + currentCall.id);
say("Logging is done, man.");