Browse Source

preform the registration lookup and set the socket in internal_to_external_relay (#100)

4.0
bitbashing 9 years ago
committed by lazedo
parent
commit
97c3d51df1
1 changed files with 13 additions and 7 deletions
  1. +13
    -7
      kamailio/default.cfg

+ 13
- 7
kamailio/default.cfg View File

@ -552,13 +552,6 @@ route[PREPARE_INITIAL_REQUESTS]
} }
} }
if ( is_method("INVITE|MESSAGE|NOTIFY") && isflagset(FLAG_INTERNALLY_SOURCED) && $hdr(X-KAZOO-AOR) != $null && registered("location", "$hdr(X-KAZOO-AOR)"))
{
$avp(kazoo_aor) = $hdr(X-KAZOO-AOR);
$avp(kazoo_du) = $xavp(ulrcd=>received);
xlog("L_INFO", "$ci|end|setting aor avp : AOR : $hdr(X-KAZOO-AOR)\n");
};
record_route(); record_route();
} }
@ -582,6 +575,19 @@ route[INTERNAL_TO_EXTERNAL_RELAY]
} }
#!endif #!endif
if ($hdr(X-KAZOO-AOR) != $null) {
xlog("L_INFO", "$ci|log|using AOR $hdr(X-KAZOO-AOR)\n");
if (reg_fetch_contacts("location", "$hdr(X-KAZOO-AOR)", "callee")) {
$du = $(ulc(callee=>received));
$fs = $(ulc(callee=>socket));
xlog("L_INFO", "$ci|log|routing $hdr(X-KAZOO-AOR) to $du via $fs\n");
} else {
xlog("L_INFO", "$ci|end|user is not registered\n");
sl_send_reply("404", "Not registered");
exit;
}
}
remove_hf_re("^X-.*"); remove_hf_re("^X-.*");
if( $avp(kazoo_aor) != $null) if( $avp(kazoo_aor) != $null)


Loading…
Cancel
Save