Skip to content

Commit

Permalink
Merge pull request #116 from thomasvargiu/feature/events-compatibility
Browse files Browse the repository at this point in the history
Events compatibility with Asterisk v12-14
  • Loading branch information
marcelog authored Nov 9, 2016
2 parents 4bbc95b + dff91b7 commit 61e5860
Show file tree
Hide file tree
Showing 4 changed files with 688 additions and 39 deletions.
15 changes: 12 additions & 3 deletions src/PAMI/Message/Event/NewextenEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
*/
namespace PAMI\Message\Event;

use PAMI\Message\Event\EventMessage;

/**
* Event triggered when a new extension is accessed.
*
Expand Down Expand Up @@ -66,7 +64,8 @@ public function getChannel()
}

/**
* Returns key: 'Exten'.
* Returns key: 'Extension'.
* @deprecated Please use {@see getExten()}.
*
* @return string
*/
Expand All @@ -75,6 +74,16 @@ public function getExtension()
return $this->getKey('Extension');
}

/**
* Returns key: 'Exten'.
*
* @return string
*/
public function getExten()
{
return $this->getKey('Exten') ?: $this->getKey('Extension');
}

/**
* Returns key: 'Context'.
*
Expand Down
186 changes: 176 additions & 10 deletions src/PAMI/Message/Event/ParkedCallEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
*/
namespace PAMI\Message\Event;

use PAMI\Message\Event\EventMessage;

/**
* Event triggered when a call is parked.
*
Expand Down Expand Up @@ -77,81 +75,249 @@ public function getFrom()

/**
* Returns key: 'Timeout'.
* @deprecated Deprecated since Asterisk 12. {@use ParkingTimeout()}.
*
* @return string
*/
public function getTimeout()
{
return $this->getKey('Timeout');
return $this->getParkingTimeout();
}

/**
* Returns key: 'ConnectedLineNum'.
* @deprecated Deprecated since Asterisk 12. {@use getParkeeConnectedLineNum()}.
*
* @return string
*/
public function getConnectedLineNum()
{
return $this->getKey('ConnectedLineNum');
return $this->getParkeeConnectedLineNum();
}

/**
* Returns key: 'ConnectedLineName'.
* @deprecated Deprecated since Asterisk 12. {@use getParkeeConnectedLineName()}.
*
* @return string
*/
public function getConnectedLineName()
{
return $this->getKey('ConnectedLineName');
return $this->getParkeeConnectedLineName();
}

/**
* Returns key: 'Channel'.
* @deprecated Deprecated since Asterisk 12. {@use getParkeeChannel()}.
*
* @return string
*/
public function getChannel()
{
return $this->getKey('Channel');
return $this->getParkeeChannel();
}

/**
* Returns key: 'CallerIDNum'.
* @deprecated Deprecated since Asterisk 12. {@use getParkeeCallerIDNum()}.
*
* @return string
*/
public function getCallerIDNum()
{
return $this->getKey('CallerIDNum');
return $this->getParkeeCallerIDNum();
}

/**
* Returns key: 'CallerIDName'.
* @deprecated Deprecated since Asterisk 12. {@use getParkeeCallerIDName()}.
*
* @return string
*/
public function getCallerIDName()
{
return $this->getKey('CallerIDName');
return $this->getParkeeCallerIDName();
}

/**
* Returns key: 'UniqueID'.
* @deprecated Deprecated since Asterisk 12. {@use getParkeeUniqueid()}.
*
* @return string
*/
public function getUniqueID()
{
return $this->getKey('UniqueID');
return $this->getParkeeUniqueid();
}

/**
* Returns key: 'Exten'.
* @deprecated Deprecated since Asterisk 12. {@use getParkingSpace()}.
*
* @return string
*/
public function getExtension()
{
return $this->getKey('Exten');
return $this->getParkingSpace();
}

/**
* Returns key: 'ParkeeChannel'.
*
* @return string
*/
public function getParkeeChannel()
{
return $this->getKey('ParkeeChannel') ?: $this->getKey('Channel');
}

/**
* Returns key: 'ParkeeChannelState'.
*
* @return string
*/
public function getParkeeChannelState()
{
return $this->getKey('ParkeeChannelState');
}

/**
* Returns key: 'ParkeeChannelStateDesc'.
*
* @return string
*/
public function getParkeeChannelStateDesc()
{
return $this->getKey('ParkeeChannelStateDesc');
}

/**
* Returns key: 'ParkeeCallerIDNum'.
*
* @return string
*/
public function getParkeeCallerIDNum()
{
return $this->getKey('ParkeeCallerIDNum') ?: $this->getKey('CallerIDNum');
}

/**
* Returns key: 'ParkeeCallerIDName'.
*
* @return string
*/
public function getParkeeCallerIDName()
{
return $this->getKey('ParkeeCallerIDName') ?: $this->getKey('CallerIDName');
}

/**
* Returns key: 'ParkeeConnectedLineNum'.
*
* @return string
*/
public function getParkeeConnectedLineNum()
{
return $this->getKey('ParkeeConnectedLineNum') ?: $this->getKey('ConnectedLineNum');
}

/**
* Returns key: 'ParkeeConnectedLineName'.
*
* @return string
*/
public function getParkeeConnectedLineName()
{
return $this->getKey('ParkeeConnectedLineName') ?: $this->getKey('ConnectedLineName');
}

/**
* Returns key: 'ParkeeAccountCode'.
*
* @return string
*/
public function getParkeeAccountCode()
{
return $this->getKey('ParkeeAccountCode');
}

/**
* Returns key: 'ParkeeContext'.
*
* @return string
*/
public function getParkeeContext()
{
return $this->getKey('ParkeeContext');
}

/**
* Returns key: 'ParkeeExten'.
*
* @return string
*/
public function getParkeeExten()
{
return $this->getKey('ParkeeExten');
}

/**
* Returns key: 'ParkeePriority'.
*
* @return string
*/
public function getParkeePriority()
{
return $this->getKey('ParkeePriority');
}

/**
* Returns key: 'ParkeeUniqueid'.
*
* @return string
*/
public function getParkeeUniqueid()
{
return $this->getKey('ParkeeUniqueid') ?: $this->getKey('UniqueId');
}

/**
* Returns key: 'ParkerDialString'.
*
* @return string
*/
public function getParkerDialString()
{
return $this->getKey('ParkerDialString');
}

/**
* Returns key: 'ParkingSpace'.
*
* @return string
*/
public function getParkingSpace()
{
return $this->getKey('ParkingSpace') ?: $this->getKey('Exten');
}

/**
* Returns key: 'ParkingTimeout'.
*
* @return string
*/
public function getParkingTimeout()
{
return $this->getKey('ParkingTimeout') ?: $this->getKey('Timeout');
}

/**
* Returns key: 'ParkingDuration'.
*
* @return string
*/
public function getParkingDuration()
{
return $this->getKey('ParkingDuration');
}
}
Loading

0 comments on commit 61e5860

Please sign in to comment.