Hangup not registered while audio playback is in progress

Hello!

Short overview about my scenario:

  • user1 is logged into my server (Asterisk 14.7.6. on CentOS 7.6)
  • user2 is called from the server
  • both users are put into a MeetMe-conference
  • via shell script a .call file is created and moved to the conference folder. This .call file starts an audio playback of a .sln file which is hearable for both users

Problem:
As far as the audio playback is in progress, Asterisk does not notify a hangup of the callee (user2). Before and after finishing the playback the hangup is working. I read that “Playback” gives back the commands to Asterisk not before the playback has ended. That’s why I also tried to replace “Playback” with “BAckground”. But here the same problem.
Has someone an idea where the problem is?

[separator]
exten => s,1,Goto(fun1,s,1)
exten => s,2,Goto(fun2,s,1)


[fun1]
exten => s,1,NoOp(Data 1: CONF=${CONF} INIT_CHANNEL=${INIT_CHANNEL})
exten => s,n,MeetMe(${CONF},Akmqd)
exten => s,n,Hangup

[fun2]
exten => s,1,NoOp(Data 2: CONF=${CONF} INIT_CHANNEL=${INIT_CHANNEL})
exten => s,n,Wait(0.5)
exten => s,n,MeetMe(${CONF},kxqd)
exten => s,n,AGI(kill_channel.sh,${INIT_CHANNEL})
exten => s,n,NoOp("NOT_IN_THE_MEETME")
exten => s,n,Hangup

[inject-sound]
exten => s,1,MeetMe(${CONF},qd)
exten => s,n,NoOp("AFTER MEETME")
exec('echo "Channel: Local/s@inject-sound" > /tempcids/'.$cidf);
exec('echo "Application: Background" >> /tempcids/'.$cidf);
exec('echo "Data: /var/lib/asterisk/sounds/en/'.$ac.'" >> /tempcids/'.$cidf);
exec('echo "Archive: Yes" >> /tempcids/'.$cidf);
exec('echo "Set: CONF='.$cid.'" >> /tempcids/'.$cidf);
exec('mv /tempcids/'.$cidf.' /var/spool/asterisk/outgoing');

Best regards
Marc

Not sure what your problem is. Guess you want to notify the other parties the user has left. Try using h: Hangup Extension

[like_this]
exten => s,1,MeetMe()
 same => n,Hangup()
exten => h,1,Playback('has_left_the_meeting')

Background() and Playback() are going to progress until the audio has finished.
You should see this in your logs:

utils.c:1440 in ast_careful_fwrite: fwrite() returned error: Broken pipe

Meaning the audio continued while the channel went away.

What he seems to be saying is that the Playback application doesn’t poll for the channel hanging up. If that really is the case, using the h extension won’t help, as the h extension will only be run when the current application returns to “the pbx”, the dialplan interpreter.

You’re going to need to show the actual console output and what is going on at the time. In your case the Background/Playback aren’t talking to a normal channel but really talking to a conference bridge itself, so they shouldn’t have anything to do with hangup.

Thank you very much, mates! Thanks to your suggestions I indeed could solve my problem with the ‘h’ tag, although I didn’t explain clear enough what exactly my problem was. It was not to inform the other party that user 1 has left the conference. It was to cancel the conference/session at all when user 1 (the callee) left the conference. Anyway, using ‘h’ in

[fun2]
exten => s,1,NoOp(Data 2: CONF=${CONF} INIT_CHANNEL=${INIT_CHANNEL})
exten => s,n,Wait(0.5)
exten => s,n,MeetMe(${CONF},kxqd)
exten => s,n,AGI(kill_channel.sh,${INIT_CHANNEL})
exten => s,n,NoOp("NOT_IN_THE_MEETME")
exten => s,n,Hangup
exten => h,1,AGI(kill_channel.sh,${INIT_CHANNEL})

did the trick. Thanks again!
Marc

Doesn’t the x option to MeetMe do this for you automatically?

It should if they are the only marked user.