Autodialer and no proper "kick out of conference"

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

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

<<The actual context to local channel is set up to (with variable names in Dutch)>>

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(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”>

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
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 :frowning: . 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.

case ‘3’: /* Eject last user */
menu_active = 0;
usr = AST_LIST_LAST(&conf->userlist);
if ((usr->chan->name == chan->name)||(usr->userflags & CONFFLAG_ADMIN)) {
if(!ast_streamfile(chan, “conf-errormenu”, chan->language))
ast_waitstream(chan, “”);
} else
usr->adminflags |= ADMINFLAG_KICKME;

This seems to be the part of the source in app_meetme.c that runs when * -> 3 is choosen with admin mode. What should be changed to not just do a kick out of the conference but a hangup of the call so the loop can continue to the next number. I’m unfortunately not much of a C coder myself :frowning: