Billsec is set in reporting state, after you are out of dial plan.   What are you trying to do based on that, I can suggest a few approaches

On Monday, April 11, 2016, Joel Serrano <joel@gogii.net> wrote:
Hi, 

Is it possible to access ${billsec} in the dialplan after the bridge application (having hangup_after_bridge=false)??

I want to log the billsec but currently it is always empty.

I have a workaround in a test server using api_hangup_hook to call a lua script with session_in_hangup_hook=true, and inside the lua script I can access the billsec variable and thus write it to the logs.

Is there no way to do this within the XML dialplan?

Thanks!

Best regards, 
Joel.