FOOD FOR THOUGHT Modifying Lenny

Singing Dwarf

New Member
Joined
Aug 21, 2015
Messages
13
Reaction score
0
I am trying to modify the Lenny Blacklist Mod v0.0.8 module kindly provided by lgaetz

What I would like to do is add the line
Code:
exten => s,n,Set(TIMEOUT(absolute)=180)
in order to put a physical limt of 3 minutes on any call sent to Lenny (due to the problem I have been experiencing with calls not being dropped by my Fritz!Box).

I have modified the module files, but when installed, Incredible PBX gui becomes non-responsive - no errors are displayed.

PHP:
functions.inc.php
 
35d34
<      $var4 = $db->escapeSimple($post['timeout']);
40c39
<      if ($foo[0]['enable']!=$var1 || $foo[0]['record']!=$var2 || $foo[0]['destination']!=$var3 || $foo[0]['timeout']!=$var4) {
---
>      if ($foo[0]['enable']!=$var1 || $foo[0]['record']!=$var2 || $foo[0]['destination']!=$var3) {
50d48
<                      timeout = '$var4'
72d69
<                                      $ext->splice($context, $exten, "blacklisted", new ext_set('TIMEOUT(absolute)='$config[0]['timeout']);
77d73
<                                      $ext->splice($context, $exten, "blacklisted", new ext_set('TIMEOUT(absolute)='$config[0]['timeout']);
291c287
< }
---
> }

PHP:
install.php
 
41,42c41
<    destination VARCHAR(100) NOT NULL,
<    timeout INT(10) NOT NULL
---
>    destination VARCHAR(100) NOT NULL   
50c49
< $sql = "INSERT INTO lenny (id, enable, record, destination, timeout) VALUES (1 , '',  'CHECKED', 'SIP/[email protected]:5060', 240)";
---
> $sql = "INSERT INTO lenny (id, enable, record, destination) VALUES (1 , '',  'CHECKED', 'SIP/[email protected]:5060')";

PHP:
page.lenny.php
 
82,86d81
<
<        $html .= "</tr><tr>";
<        $html .= "<td><a href='#' class='info'>Timeout<span>Maximum permitted duration of call, before call is terminated automatically</span></a></td>";
<        $html .= "<td><input type='number' name='timeout' maxlength=10 value='".$lenconfig[0]['timeout']."' ></td>";
<
 
I started to reply in relation to the POSSA blacklist mod v 0.0.8 as below if that is what you had before your edit. as you see mine already has the TIMEOUT set at 600) . I haven't gone into the *.php files so not sure if this still applies.

Hi have you tried to edit the file /etc/asterisk/extensions_custom.conf
where it says ....=600)
[from-internal-custom]
;# // BEGIN Lenny Remake
; version 0.3.2 copyright: none claimed. Enjoy!
exten => 53669,1,Answer
exten => 53669,n,Set(TIMEOUT(absolute)=600)

Change the 600 to 180
save and close

then from the asterisk CLI
server*CLI>sip reload
or just *CLI>reload
to reload the asterisk dial plan (as if you didn't know already)

hope this helps
 
Sorry, I should of said that I don't have Lenny installed locally - I can't find the voice prompt files anywhere.

I point to a remote extension, so I don't have that entry within my /etc/asterisk/extensions_custom.conf

Perhaps the answer would be to create a local extension which points to the remote Lenny, then point the Lenny Blacklist Mod to the internal extension?
 
I started to reply in relation to the POSSA blacklist mod v 0.0.8 as below if that is what you had before your edit. as you see mine already has the TIMEOUT set at 600) . I haven't gone into the *.php files so not sure if this still applies.

Yes, its the POSSA Lenny Blacklist Mod v0.0.8 but I don't have those entries in my /etc/asterisk/extensions_custome.conf - nothing in there relating to Lenny in fact.
 
hi this thread has some code to download the dialplan installer from piaf server
http://pbxinaflash.com/community/index.php?threads/lenny-installer-please.17481/

In my box I have the lenny.sh script
BUT before the sed line to inject the lenny.txt ; you could edit lenny.txt to change the 600 =10minute TIMEOUT to the 180 you suggested. or if not here then edit the
/etc/asterisk/extensions_custom.conf file as my earlier post.

Code:
#!/bin/bash
 
mkdir /var/lib/asterisk/sounds/lenny
chown asterisk:asterisk /var/lib/asterisk/sounds/lenny
cd /var/lib/asterisk/sounds/lenny
wget http://pbxinaflash.com/Lenny.tgz
tar zxvf Lenny.tgz
rm Lenny.tgz
 
cd /tmp
wget http://pbxinaflash.com/lsupport.tgz
tar zxvf lsupport.tgz
## rm lsupport.tgz              ##uncomment to delete the tarball
sed -i '\:// BEGIN Lenny Remake:,\:// END Lenny Remake:d' /etc/asterisk/extensions_custom.conf
sed -i '/\[from-internal-custom\]/r /tmp/lenny.txt' /etc/asterisk/extensions_custom.conf
## rm lenny.txt                  ##uncomment to delete the tarball
mv 3.gsm /var/lib/asterisk/sounds/lenny
cd /var/lib/asterisk/sounds/lenny
chown asterisk:asterisk *
chmod 755 *
 
echo " " >> /etc/asterisk/extensions_custom.conf
echo "[bridgit]" >> /etc/asterisk/extensions_custom.conf
echo "exten => 4,1,Pickup(701@from-internal)" >> /etc/asterisk/extensions_custom.conf
echo "exten => 4,2,Pickup(777@from-internal)" >> /etc/asterisk/extensions_custom.conf
echo " " >> /etc/asterisk/extensions_custom.conf
 
asterisk -rx "dialplan reload"
 
echo "Try it out by dialing 53669 from any extension on your PBX."

After that you will need the ItsLenny sounds (lenny01 to lenny15 plus lenny16 =the ducks; 3.gsm =3 sec silence) I think most are still on github search for "itslenny" .

As an asside - don't forget if you use 'the ducks' lenny16 they should quieten down after dark.:arf:

Anyway you should be able to figure it out from that.
 
hi this thread has some code to download the dialplan installer...[snip]


Just wanted to say thanks for this - I haven't had a chance to try this yet, but will hopefully get a little time one evening this week to give it a go.
 

Members online

Forum statistics

Threads
26,689
Messages
174,413
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top