11.7 Safe access to headers
1 service boss_secretary {
processing {
dialog {
response outgoing INVITE(request rq) {
5 if (TO == 'sip:my.boss@big-corp.com') {
response x = forward;
select (x) {
case /ERROR:
when rq (#subject: string sub) {
10 rq = rq with {#subject: "The boss is unavailable ! - "+ sub};
}
when x (#contact: uri r_contact) {
if (r_contact != CONTACT) {
return forward r_contact;
15 }
}
return forward 'sip:boss.secretary@big-corp.com';
case /SUCCESS: return x;
20 }
}
else {
return forward;
} } } } }