Анализировать ответ, вычитывая через функцию SIP_HEADER
*CLI> core show function SIP_HEADER
-= Info about function 'SIP_HEADER' =-
[Synopsis]
Gets the specified SIP header from an incoming INVITE message.
[Description]
Since there are several headers (such as Via) which can occur multiple times,
SIP_HEADER takes an optional second argument to specify which header with
that name to retrieve. Headers start at offset '1'.
[Syntax]
SIP_HEADER(name[,number])
[Arguments]
number
If not specified, defaults to '1'.
и отправляя в Hangup через какую-то конструкцию типа
ExecIf(${foo}=183)?Hangup(16)