Asterisk::LCR::Dialer - Generic dialer object
use Asterisk::LCR::Dialer; my $dialer = Asterisk::LCR::Dialer::<CONCRETE_CLASS>->new ();
Represents a generic dialing strategy. The strategy is defined in the $self->process() method, which in this package is undefined.
Location (directory) of the lcr object tree.
An AGI object which can be used to grab some parameters from.
Limit dialing strategies to 'limit' cheapest routes. Optional.
Options to be appended to the dialstring. Example:
'120|HS(7200)'
Returns TRUE if this object validates, FALSE otherwise.
Returns TRUE if there is a 'lcr' attribute and it's an existing directory, FALSE otherwise.
Returns the 'lcr' attribute.
Sets the 'lcr' attribute to $lcr.
Returns the 'locale' attribute.
Sets the 'locale' attribute to $locale.
Returns TRUE if the 'agi' attribute exists, FALSE otherwise.
Returns the 'agi' attribute.
Sets the 'agi' attribute to $agi.
Returns the optional 'limit' attribute.
Returns 100000 if it's not defined (quasi-infinity)
Sets the optional 'limit' attribute to $limit.
Returns the optional 'opts' attribute.
If the 'opts' attribute is not TRUE, returns an empty string.
If the 'opts' attribute doesn't start with a pipe symbol, returns it prefixed with |.
Sets the optional 'opts' attribute to $opts.
Turns $number into a canonical, global number if $number if $self->locale() returns an Asterisk::LCR::Locale object.
Then calls $self->_process ($number). This method must be defined in subclasses.
Dials string $str, eventually with options $self->opts();
Returns a string from a variable template suitable for use within Dial()
Extract a string dial template from the asterisk config file.
For example, say $rate->{provider} = 'voipjet'. This method will look for an asterisk variable called 'ASTERISK_LCR_TMPL_VOIPJET'. The grammar to be used for this syntax is:
VARIABLE: [LOCALE] DIAL_STRING LOCALE: (scalar string, i.e. 'us' or 'fr' or even /var/mylocale.txt) DIAL_STRING: <whateverwhatever>REPLACEME<whateverwhatever>
Where REPLACEME will be replaced by the phone number to dial.
If LOCALE is defined and an Asterisk::LCR::Locale object can be created, then $num is assumed to be given as a canonical, international number.
For example, if LOCALE is 'fr' and the number is 33575874745, then 05175874745 will be dialled instead.
Otherwise the number is dialed "as is".
Returns an array of rates for $number, sorted cheapest first.
To install Asterisk::LCR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Asterisk::LCR
CPAN shell
perl -MCPAN -e shell install Asterisk::LCR
For more information on module installation, please visit the detailed CPAN module installation guide.