Hi ,
i want to oblige an extension example 400 to not be registered  .
so 
soft --------------------register--------------------------------> server

soft <-----------------unauthorized (first 401)----------------server

soft ---------------------register (with authorization header computed with the nonce of the 401)----------------------------------------------------->server

soft <--------------------unauthorized (with stale ==False) ---->server 

i did this in dialplan/default.xml:
<extension name="fail register">
    <condition field="caller_id_number" expression="^400$">
        <action application="respond" data="401"/>
        <action application="hangup"/>
    </condition>
</extension>
i have only one unauthorized then i have ok ,but how can i do to have this result .
thank you 
with best regards ,
amani