Which extension into callback-custom

yes i 'now that this is a vey lame question, neverthless i am hunging on it :frowning:
be patient :slight_smile:

i am trying to customize callback
i need to check if cid has right to be called back, not everyone could be called back :slight_smile:
if called is authenticated, i go down with callback
so, i need some check before callback is called

i need to enter something into

[callback-custom]
exten => 1,1,Noop(callback-custom - test.)
exten => 1,n,Noop(callback-custom - starting)

i would know what should i use insted of 1 as extension

[callback-custom]
exten => x,1,Noop(callback-custom - test.)
exten => x,n,Noop(callback-custom - starting)

what should i put replacing ‘x’ ?

i have tried many soultions but none solves my issue

maybe /etc/asterisk/extensions_override_freepbx.conf
as in
http://www.freepbx.org/forum/freepbx/users/adding-custom-lines-to-extensions-additional-conf
can be the best solution

[callback-custom] should go into extensions_custom.conf . The only things that should go into extensions_override_freepbx.conf are replacement routines that exist in extensions.conf or are declared before you get to the include statement for extensions_custom.conf.

The way the asterisk dial plan works is first occurrence of context is what get’s loaded a second copy get’s ignored.

When you make a change you are reloading asterisk correct (@linux prompt asterisk -rx “reload”)? if not it does not know there is a change and will not load it to run it.

Usual practice is to use s (not x) when there is no specific extension, so try that first. But if that doesn’t work, you may need to use something like _[*#0-9]! which will match darn near anything that a user can dial, or just _X! if you are sure the pattern will always be numeric (this assumes you are using Asterisk 1.4 or later).

what i need is very simple

this is callback context

[callback]
include => callback-custom
exten => 1,1,Set(CALL=${CALLERID(number)})
exten => 1,n,Set(DESTINATION=ext-queues.150.1)
exten => 1,n,Set(SLEEP=20)
exten => 1,n,System(/var/lib/asterisk/bin/callback ${CALL} ${DESTINATION} ${SLEEP} &)
exten => 1,n,Hangup

; end of [callback]

what i need is to execute some dialplan line before
exten => 1,1,Set(CALL=${CALLERID(number)})

what i think natural to do is to use
include => callback-custom

[callback-custom]
exten => 1,1,Noop(callback-custom starting)
exten => 1,n,GotoIf($[ “${CALLERID(number)}” != “anonymous” ] ?cidnumok)
exten => 1,n,Hangup
exten => 1,n(cidnumok),Noop(CallerID is ${CALLERID(num)})

; end of [callback-custom]

what i would know is: if callback extension is -> 1
which extension can i use into callback-custom to get callback-custom executed before
calback lines of dialplan?

tia

You should mirror whatever the original context is using, in this case 1, which makes me wonder why your context isn’t working.

Questions:

Did you put you callback-custom context into extensions_custom.conf?

Are the permissions and ownership correct on extensions_custom.conf (they SHOULD be, but I’d check anyway)?

Did you watch the CLI to see if your Noop(CallerID is ${CALLERID(num)}) statement was executed?

Also, I’m thinking your line exten => 1,n,Hangup may not work - Asterisk has a real issue with Hangup not necessarily meaning what you think it does, especially in includes. But if it fails, it should still show your Noop(CallerID is ${CALLERID(num)}) statement in the CLI and continue on. So the big thing now is to watch the CLI and see if your NoOp is being reached.

If the Hangup turns out to be the issue, try something like Goto(app-blackhole,congestion,1) instead, and see what happens.

nothing of all you said :slight_smile:
here is the issue

everything into callback-custom comes after callback, not before;

the only way to see my noop is this:

File: extensions_additional.conf
[callback]
include => callback-custom
exten => 1,1,Set(CALL=${CALLERID(number)})
exten => 1,n,Set(DESTINATION=ext-queues.150.1)
exten => 1,n,Set(SLEEP=20)
exten => 1,n,System(/var/lib/asterisk/bin/callback ${CALL} ${DESTINATION} ${SLEEP} &)

; exten => 1,n,Playtones(busy)
; exten => 1,n,Busy
; exten => 1,n,Goto(app-blackhole,congestion,1)
; exten => 1,n,Hangup
; end of [callback]

File: extensions_custom.conf
[callback-custom]
exten => _.,1,Noop(callback-custom - this my test)

if i use exten => 1 priority must n
[callback-custom]
exten => 1,n,Noop(callback-custom - this my test)

[Mar 13 08:56:23] WARNING[629]: rtp.c:1997 ast_rtp_settos: Unable to set TOS to 184
– Executing [0117701907@from-pstn:1] NoOp(“SIP/patton01-08b3afd8”, “Catch-All DID Match - Found 0117701907 - You probably want a DID for this.”) in new stack
– Executing [0117701907@from-pstn:2] Goto(“SIP/patton01-08b3afd8”, “ext-did|s|1”) in new stack
– Goto (ext-did,s,1)
– Executing [s@ext-did:1] Set(“SIP/patton01-08b3afd8”, “__FROM_DID=s”) in new stack
– Executing [s@ext-did:2] GotoIf(“SIP/patton01-08b3afd8”, “0 ?cidok”) in new stack
– Executing [s@ext-did:3] Set(“SIP/patton01-08b3afd8”, “CALLERID(name)=0721950396”) in new stack
– Executing [s@ext-did:4] NoOp(“SIP/patton01-08b3afd8”, “CallerID is “0721950396” <0721950396>”) in new stack
– Executing [s@ext-did:5] Set(“SIP/patton01-08b3afd8”, “FAX_RX=disabled”) in new stack
– Executing [s@ext-did:6] Goto(“SIP/patton01-08b3afd8”, “callback|1|1”) in new stack
– Goto (callback,1,1)
– Executing [1@callback:1] Set(“SIP/patton01-08b3afd8”, “CALL=0721950396”) in new stack
– Executing [1@callback:2] Set(“SIP/patton01-08b3afd8”, “DESTINATION=ext-queues.150.1”) in new stack
– Executing [1@callback:3] Set(“SIP/patton01-08b3afd8”, “SLEEP=20”) in new stack
– Executing [1@callback:4] System(“SIP/patton01-08b3afd8”, “/var/lib/asterisk/bin/callback 0721950396 ext-queues.150.1 20 &”) in new stack
– Executing [1@callback:5] NoOp(“SIP/patton01-08b3afd8”, “callback-custom - this my test”) in new stack
== Auto fallthrough, channel ‘SIP/patton01-08b3afd8’ status is ‘UNKNOWN’
IDSRack05*CLI>

according to all my tests there no way to get something executed before callbak statements :frowning:

maumar,

I have not been following this thread past my initial reply and noticing that wiseoldowl was helping you and only now noticed that this thread was still going on.

You never said what version of FreePBX you are running. But for most of the 2.4.x versions and all versions going forward there is a statement at the top of all of the system generated and maintained files like this:

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make    ;
; custom modifications, details at: http://freepbx.org/configuration_files       ;
;--------------------------------------------------------------------------------;
;

I point this out as you should NEVER EVER edit the extensions_additional.conf file and that link has a lot of information that would help you with this.

If you read the notes on that page about the extensions*.conf files you’d see where you need to place it and why.

i am using freepbx 2.4, sir
i know very well that i have to use custom files, i am using file extension_custom.conf where i inserted
[callback_custom]
lines of dialplan.

I need these line to be executed before entering callback, and position of includes seems to be the right position.
Sadly i have verified that everything i put into [callback_custom] is executed after callback context;
try to issue
CLI > show dialplan:

[ Context ‘callback’ created by ‘pbx_config’ ]
‘1’ => 1. Set(CALL=${CALLERID(number)}) [pbx_config]
2. Set(DESTINATION=ext-queues.150.1) [pbx_config]
3. Set(SLEEP=20) [pbx_config]
4. System(/var/lib/asterisk/bin/callback ${CALL} ${DESTINATION} ${SLEEP} &) [pbx_config]
5. Goto(app-blackhole|congestion|1) [pbx_config]
Include => ‘callback-custom’ [pbx_config]

thnx for your help
m.

Ok, depending on which version of 2.4 it might or might not have that note at the top as it was placed into the files during the development cycle of 2.4

so maybe know to read this part:

"extensions_override_freepbx.conf

  1. If extensions.conf (or extensions_additional.conf) has a context or macro that you NEED to modify, you place that code here as asterisk will only execute the first occurrence of that code and ignores other occurrences. This file will not be overwritten. Be very careful as replacing an existing piece of code this way is the fastest possible way to break your system. If you are doing this you should probably think about filing for a feature request or bug fix to get it addressed properly."