Custom Call-back functionality

Hello everyone,

I was wondering if it is possible to put line like Local/some-number@some-context to specific position in the queue.

So it should work something like this:
[ul]- Caller gets in the queue[/ul]
[ul]- Caller presses some button to to jump to different context[/ul]
[ul]- That context will use ${QUEUEPOSITION} and ${CALLERID(num)} to generate Local/some-number@some-context line. Question is if it possible to sent some extra value to Queue() that will tell Asterisk the position where to put this channel. I want to use it as a trigger for custom call back context.[/ul]

I was not able to find confirmation yet, so I’m hoping some one will tell me if it’s even possible. Or maybe there is better way to achieve the goal.

Thanks a lot!

Hello again,

My friend told that Queue() has option called position:

Going to try this first thing tomorrow morning.


I have some progress on this. Turned out it is pretty simple. I’ll reply with configuration examples when will have time to finish and test this.

Hello. So here is my solution. Hope it will help someone.

My queue name is 120. It includes context=break.

Than there is next in dial plan:
exten => 6,1,Goto(go-ofline-queue-120,s,1)

Next context generates Asterisk call file. Than initiates call by moving it to /var/spool/asterisk/outgoing/:
exten => s,1,Answer()
exten => s,n,Set(timestamp=${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)})
exten => s,n,NoOp(${timestamp})
exten => s,n, System(/bin/echo “Channel: Local/"${queueposition}"@get-to-the-queue-120-with-defined-position” > /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call) ;Generates channel that will be putted to the queue 120 with rules from get-to-the-queue-120-with-defined-position context.
exten => s,n, System(/bin/echo “MaxRetries: 1” >> /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call)
exten => s,n, System(/bin/echo “WaitTime: 30” >> /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call)
exten => s,n, System(/bin/echo “CallerID: “Offline queue 120” <”${CALLERID(num)}">" >> /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call)
exten => s,n, System(/bin/echo “Context: agent-confirmation-to-accept-offline-caller-from-queue-120” >> /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call)
exten => s,n, System(/bin/echo “Extension: 100” >> /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call)
exten => s,n, System(/bin/echo “Priority: 1” >> /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call)
exten => s,n, System(/bin/echo “Set: number-position=”${CALLERID(num)}"-"${QUEUEPOSITION} >> /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call) ;Sends variable with callers number and original queue position information (end up not using second)
;Makes loop on channel that will ask agent to press 1 over and over again.
exten => s,n, System(/bin/mv /usr/src/asterisk_call_files/queue_120_offline_${timestamp}.call /var/spool/asterisk/outgoing/)
exten => s,n,Hangup

This context is used by call file described above. It puts channel to appropriate queue position by using “EXTEN” variable:
exten => _X,1,Answer()
exten => _X,n,Set(CHANNEL(language)=ua)
exten => _X,n,Queue(120,t,${EXTEN})
exten => _X,n,Hangup
exten => _X.,1,Answer()
exten => _X.,n,Set(CHANNEL(language)=ua)
exten => _X.,n,Queue(120,t,${EXTEN})
exten => _X.,n,Hangup

And here is what will be going on on “callers” channel in the queue:
exten => 100,1,Answer()
exten => 100,n,Set(EXT=0)
exten => 100,n(noinput),Read(EXT,ua/offline-caller-press-1-to-confirm,1)
exten => 100,n,GotoIf($["${EXT}" = “1”]?proceed:noinput)
exten => 100,n(proceed),Playback(ua/will-connect-right-now)
exten => 100,n,Dial(Local/${CUT(number-position,1)}@from-internal)
exten => 100,n,Hangup

Next step will be to add couple more of voice prompts, caller ID number check just in case and few lines to write logs here and there.

I’ll appreciate any suggestion and ideas.