Lenny Not Working

You need to fully understand both the way asterisk implements the dialplan you tell it to, and if it doesn’t work the way you thought, you probably did it wrong. but all will be revealed in your log files, so look in /var/log/asterisk/full.

Anything otherwise anectdotal, will ONLY be anecdotal and nobody can help you

In your case yoiu keep on trying to go to a variation of [Ll]enny,[Tt]alk,n, this will ONLY work if that extension exists in that context, and that will only happen if you provide exactly that context and that extension, please read all TFM’s

Where did you put that script?

cd /etc/asterisk

extensions_customs.conf

OMG…I see the error of my ways…re saved to correct file name extensions_customs.conf and it now works

Thanks guys and sorry for waiting your time…can one of you take a look at my other open one…calls to an incoming sip trunk randomly fail. I can place 10 calls in a row and one of then will fail.

[2017-12-09 09:38:08] VERBOSE[9277][C-00001a4b] netsock2.c: == Using SIP RTP TOS bits 184
[2017-12-09 09:38:08] VERBOSE[9277][C-00001a4b] netsock2.c: == Using SIP RTP CoS mark 5
[2017-12-09 09:38:08] NOTICE[9277][C-00001a4b] chan_sip.c: Call from '54.172.60.2 ’ (54.172.60.2:5060) to extension ‘+16023627646’ rejected because extension not found in context ‘from-trunk-sip-54.172.60.2’.

Calls to DID randomly failing (probably something stupid on my end also)

I had a similar issue with my Custom Destination target. In my case I’ve got my own audio files and a slightly different issue. The first clip plays and then stops there. The code is fine as is the trunk and inbound routes look good too. It’s like it is not picking up the silence and just says ‘hello’.

Has anyone here had this issue?

logs? we always need logs.

2 [2022-10-04 02:07:54] VERBOSE[1506] pbx_variables.c: Setting global variable ‘SIPDOMAIN’ to ‘MY IP ADDRESS’
3 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:1] Set(PJSIP/Outbound-0000000b, __DIRECTION=INBOUND) in new stack
4 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:2] Gosub(PJSIP/Outbound-0000000b, sub-record-check,s,1(in,phonenumber,force)) in new stack
5 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:1] GotoIf(PJSIP/Outbound-0000000b, 0?initialized) in new stack
6 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:2] Set(PJSIP/Outbound-0000000b, __REC_STATUS=INITIALIZED) in new stack
7 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:3] Set(PJSIP/Outbound-0000000b, NOW=1664845674) in new stack
8 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:4] Set(PJSIP/Outbound-0000000b, __DAY=04) in new stack
9 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:5] Set(PJSIP/Outbound-0000000b, __MONTH=10) in new stack
10 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:6] Set(PJSIP/Outbound-0000000b, __YEAR=2022) in new stack
11 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:7] Set(PJSIP/Outbound-0000000b, __TIMESTR=20221004-020754) in new stack
12 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:8] Set(PJSIP/Outbound-0000000b, __FROMEXTEN=unknown) in new stack
13 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:9] Set(PJSIP/Outbound-0000000b, __MON_FMT=wav) in new stack
14 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:10] NoOp(PJSIP/Outbound-0000000b, Recordings initialized) in new stack
15 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:11] ExecIf(PJSIP/Outbound-0000000b, 0?Set(ARG3=dontcare)) in new stack
16 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:12] Set(PJSIP/Outbound-0000000b, REC_POLICY_MODE_SAVE=) in new stack
17 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:13] ExecIf(PJSIP/Outbound-0000000b, 0?Set(REC_STATUS=NO)) in new stack
18 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:14] GotoIf(PJSIP/Outbound-0000000b, 2?checkaction) in new stack
19 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx_builtins.c: Goto (sub-record-check,s,17)
20 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [s@sub-record-check:17] GotoIf(PJSIP/Outbound-0000000b, 1?sub-record-check,in,1) in new stack
21 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx_builtins.c: Goto (sub-record-check,in,1)
22 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [in@sub-record-check:1] NoOp(PJSIP/Outbound-0000000b, Inbound Recording Check to phonenumber) in new stack
23 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [in@sub-record-check:2] Set(PJSIP/Outbound-0000000b, FROMEXTEN=unknown) in new stack
24 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [in@sub-record-check:3] ExecIf(PJSIP/Outbound-0000000b, 12?Set(FROMEXTEN=+callernumber)) in new stack
25 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [in@sub-record-check:4] Gosub(PJSIP/Outbound-0000000b, recordcheck,1(force,in,phonenumber)) in new stack
26 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:1] NoOp(PJSIP/Outbound-0000000b, Starting recording check against force) in new stack
27 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:2] Goto(PJSIP/Outbound-0000000b, force) in new stack
28 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx_builtins.c: Goto (sub-record-check,recordcheck,5)
29 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:5] Set(PJSIP/Outbound-0000000b, __REC_POLICY_MODE=FORCE) in new stack
30 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:6] GotoIf(PJSIP/Outbound-0000000b, 1?startrec) in new stack
31 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx_builtins.c: Goto (sub-record-check,recordcheck,16)
32 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:16] NoOp(PJSIP/Outbound-0000000b, Starting recording: in, phonenumber) in new stack
33 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:17] Set(PJSIP/Outbound-0000000b, __CALLFILENAME=in-phonenumber-+callernumber-20221004-020754-1664845674.79) in new stack
34 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:18] MixMonitor(PJSIP/Outbound-0000000b, 2022/10/04/in-phonenumber-+callernumber-20221004-020754-1664845674.79.wav,abi(),) in new stack
35 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:19] Set(PJSIP/Outbound-0000000b, __MIXMON_ID=) in new stack
36 [2022-10-04 02:07:54] VERBOSE[6415][C-0000000b] app_mixmonitor.c: Begin MixMonitor Recording PJSIP/Outbound-0000000b
37 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:20] Set(PJSIP/Outbound-0000000b, __RECORD_ID=PJSIP/Outbound-0000000b) in new stack
38 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:21] Set(PJSIP/Outbound-0000000b, __REC_STATUS=RECORDING) in new stack
39 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:22] Set(PJSIP/Outbound-0000000b, CDR(recordingfile)=in-phonenumber-+callernumber-20221004-020754-1664845674.79.wav) in new stack
40 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [recordcheck@sub-record-check:23] Return(PJSIP/Outbound-0000000b, ) in new stack
41 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [in@sub-record-check:5] Return(PJSIP/Outbound-0000000b, ) in new stack
42 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:3] Set(PJSIP/Outbound-0000000b, CHANNEL(tonezone)=us) in new stack
43 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:4] Set(PJSIP/Outbound-0000000b, __FROM_DID=phonenumber) in new stack
44 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:5] Set(PJSIP/Outbound-0000000b, CDR(did)=phonenumber) in new stack
45 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:6] ExecIf(PJSIP/Outbound-0000000b, 0 ?Set(CALLERID(name)=+callernumber)) in new stack
46 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:7] Set(PJSIP/Outbound-0000000b, __MOHCLASS=) in new stack
47 [2022-10-04 02:07:54] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:8] Answer(PJSIP/Outbound-0000000b, ) in new stack
48 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:9] Set(PJSIP/Outbound-0000000b, __REVERSAL_REJECT=FALSE) in new stack
49 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:10] GotoIf(PJSIP/Outbound-0000000b, 1?post-reverse-charge) in new stack
50 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx_builtins.c: Goto (from-pstn,phonenumber,12)
51 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:12] NoOp(PJSIP/Outbound-0000000b, ) in new stack
52 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:13] Wait(PJSIP/Outbound-0000000b, -1) in new stack
53 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:14] Set(PJSIP/Outbound-0000000b, __CALLINGNAMEPRES_SV=allowed_not_screened) in new stack
54 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:15] Set(PJSIP/Outbound-0000000b, __CALLINGNUMPRES_SV=allowed_not_screened) in new stack
55 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:16] Set(PJSIP/Outbound-0000000b, CALLERID(name-pres)=allowed_not_screened) in new stack
56 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:17] Set(PJSIP/Outbound-0000000b, CALLERID(num-pres)=allowed_not_screened) in new stack
57 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:18] NoOp(PJSIP/Outbound-0000000b, CallerID Entry Point) in new stack
58 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:19] Set(PJSIP/Outbound-0000000b, FAX_DEST=) in new stack
59 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:20] Set(PJSIP/Outbound-0000000b, FAXOPT(faxdetect)=yes) in new stack
60 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:21] Answer(PJSIP/Outbound-0000000b, ) in new stack
61 [2022-10-04 02:07:55] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:22] Wait(PJSIP/Outbound-0000000b, 4) in new stack
62 [2022-10-04 02:07:59] VERBOSE[6414][C-0000000b] pbx.c: Executing [phonenumber@from-pstn:23] Goto(PJSIP/Outbound-0000000b, Beverly,talk,1) in new stack
63 [2022-10-04 02:07:59] VERBOSE[6414][C-0000000b] pbx_builtins.c: Goto (Beverly,talk,1)
64 [2022-10-04 02:07:59] VERBOSE[6414][C-0000000b] pbx.c: Executing [talk@Beverly:1] Set(PJSIP/Outbound-0000000b, i=1) in new stack
65 [2022-10-04 02:07:59] VERBOSE[6414][C-0000000b] pbx.c: Executing [talk@Beverly:2] ExecIf(PJSIP/Outbound-0000000b, 1?MixMonitor(1664845674.79.wav)) in new stack
66 [2022-10-04 02:07:59] VERBOSE[6414][C-0000000b] pbx.c: Executing [talk@Beverly:3] Playback(PJSIP/Outbound-0000000b, Beverly/Beverly1) in new stack
67 [2022-10-04 02:07:59] VERBOSE[6428][C-0000000b] app_mixmonitor.c: Begin MixMonitor Recording PJSIP/Outbound-0000000b
68 [2022-10-04 02:07:59] VERBOSE[6414][C-0000000b] file.c: <PJSIP/Outbound-0000000b> Playing ‘Beverly/Beverly1.slin’ (language ‘en’)
69 [2022-10-04 02:07:59] VERBOSE[6414][C-0000000b] pbx.c: Executing [talk@Beverly:4] BackgroundDetect(PJSIP/Outbound-0000000b, Beverly/backgroundnoise,1500) in new stack
70 [2022-10-04 02:07:59] VERBOSE[6414][C-0000000b] file.c: <PJSIP/Outbound-0000000b> Playing ‘Beverly/backgroundnoise.ulaw’ (language ‘en’)
71 [2022-10-04 02:08:22] VERBOSE[6414][C-0000000b] pbx.c: Spawn extension (Beverly, talk, 4) exited non-zero on ‘PJSIP/Outbound-0000000b’
72 [2022-10-04 02:08:23] VERBOSE[6428][C-0000000b] app_mixmonitor.c: MixMonitor close filestream (mixed)
73 [2022-10-04 02:08:23] VERBOSE[6415][C-0000000b] app_mixmonitor.c: MixMonitor close filestream (mixed)
74 [2022-10-04 02:08:23] VERBOSE[6428][C-0000000b] app_mixmonitor.c: End MixMonitor Recording PJSIP/Outbound-0000000b
75 [2022-10-04 02:08:23] VERBOSE[6415][C-0000000b] app_mixmonitor.c: End MixMonitor Recording PJSIP/Outbound-0000000b

Show us your ‘Beverly’ context

My bot is named Beverly - from The Snow Plow Show - so the code is modified to reflect the number of audio files as well as the name of the bot.

Custom Destination Target: Beverly,talk,1

extensions_custom.conf
[Beverly]
exten => talk,1,Set(i=${IF($[“0${i}”=“016”]?7:$[0${i}+1])})
same => n,ExecIf($[${i}=1]?MixMonitor(${UNIQUEID}.wav))
same => n,Playback(Beverly/Beverly${i})
same => n,BackgroundDetect(Beverly/backgroundnoise,1500)

After updating the conf file and the custom destination I tried: fwconsole r

They’re in the The audio files are all 8000hz mono ulaw. I’ve loaded them into the following folder
/var/lib/asterisk/sounds/en/Beverly
as well as
/var/lib/asterisk/sounds/Beverly

Does

work for you ?

1 Like

My source is worldofprankcalls{dot com}/2021/08/05/fool-your-friends-with-beverlybot/

I’ll try and setup this instance of Lenny…
I’ll see how it works. :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.