I have written an easy to use autodialler based on the meetme() app and some other smart asterisk options. I changed all the phonenumber but for the rest it is the code I’m running and the callfiles generated and used.
A call file starts a call to the agent and the call is routed into a context,extension,priority combination that the call routs into a conference room with admin privileges.
Channel: SIP/31211111111/0031611111111
MaxRetries: 4
RetryTime: 60
WaitTime: 30
Context: autodial
Extension: s
Priority: 1
SetVar: AGENT_NUMMER=0031621111111
SetVar: ACCOUNT=31621111111
[autodial]
exten => s,1,Answer()
exten => s,n, MeetMe(${ACCOUNT},xMaAs)
A couple of seconds later an other call file sets up a local channel and passes a variable containing the list of numbers that has to be called. The context the local channel is set up to is actually a loop that calls the numbers one by one using the g parameter that makes that, after the called channel hangs up, the execution of the context continues and the M() to execute a macro after connecting.
<>
Channel: Local/s@autodial_2
MaxRetries: 1
RetryTime: 60
WaitTime: 30
Context: autodial_fake
Extension: s
Priority: 1
SetVar: AGENT_NUMMER=0031611111111
SetVar: NUMMER_LIJST=00031111111111 0031222222222 0031333333333 0031444444444 0031555555555
SetVar: ACCOUNT=31611111111
SetVar: AANTAL_NUMMERS=5
<<The actual context to local channel is set up to (with variable names in Dutch)>>
[autodial_2]
exten => s,1,Answer()
exten => s,n,Set(LENGTE_STRING=${LEN(${NUMMER_LIJST})})
exten => s,n,Set(START_NUMMER=1)
exten => s,n,Set(POSITION=1)
exten => s,n,NoOp(Start loop)
exten => s,n(start_loop),Set(TEST_CHAR=${NUMMER_LIJST:${POSITION}:1})
exten => s,n,GotoIf($["${TEST_CHAR}" = " “]?spatie)
exten => s,n(verder),Set(POSITION=$[${POSITION} + 1])
exten => s,n,Set(TEST_VALUE=$[${POSITION} - ${LENGTE_STRING}])
exten => s,n,GotoIf($[”${TEST_VALUE}" = “0”]?stop)
exten => s,n,NoOp(eind van de loop)
exten => s,n,Goto(start_loop)
exten => s,n(spatie),NoOp(spatie op positie ${POSITION})
exten => s,n,NoOp(te bellen telefoon nummer ${NUMMER_LIJST:${START_NUMMER}:${POSITION}-${START_NUMMER}})
exten => s,n,Set(TE_BELLEN_NUMMER=${NUMMER_LIJST:$[${START_NUMMER}]:$[${POSITION}-${START_NUMMER}]})
exten => s,n(bellen),Dial(SIP/31208080652/$[${TE_BELLEN_NUMMER}],40,gM(enter_conference,${ACCOUNT}))
exten => s,n,NoOp(gesprek is afgerond en na script is na dial doorgegaan)
exten => s,n,Playback(silence/9) ; wrap up time
exten => s,n,Set(START_NUMMER=${POSITION})
exten => s,n,Goto(verder)
exten => s,n(stop),Hangup()
<<the fake context so the local channel got a “destination”>
[autodial_fake]
exten => s,1,Answer()
exten => s,1,NoOp(fake channel)
exten => s,n,Wait(30000)
exten => s,n,Hangup()
The macro routes the channel into the conference
[macro-enter_conference]
exten => s,1,NoOp(start macro enter_conference in kamer ${ARG1})
exten => s,n,Meetme(${ARG1})
When I run the script that generate the callfiles and move them to the /var/spool/asterisk/outgoing/ dir it works like a sharm. The agent phone rings and after picking up the conference room is entered. After a couple of seconds the first “to call” number rings and after picking up that phone the conversation can start. When the called party hangs up, because of the use of the g parameter, the dialplan continues and picks the next number out of the list to call etc. etc.
<>
The agent can’t disconnect the called number. Using * and then option 3 leads to the situation that the called party is kicked out of the conference (the line of the actual voiceprompt that is played) but the initial local channel is also disconnected so the whole routine stops and the agent hears moh forever . The actual call isn’t disconnected and as long as the called party doesn’t hang up the minutes are still counting. The next number is not processed. With all the Asterisk magic in place this makes the whole routine pretty useless.
I checked app_meetme.c to find out what code runs after pressing * 3 as admin of the conference but I couldn’t find it.
I tried with and without the /n parameter in the call file that sets up the local channel.
<>:
Does anybody knows a solutions for the problem that the agent can’t end a call with the called party without stopping the whole autodialing procedure/loop.
Does anybody knows where in the source code the code can be found that runs after pressing * 3 with Admin priviliges.
This last “to be solved issue” kind of drives me crazy. Thanks in advance for any help or suggestion.