This config from my earlier email. Do you want to see the entire config?
route[CNAM_DIPS] { # Check call direction. If we're outbound nothing to do here if ($avp(direction) == "in") { t_on_branch("CNAM_DIPS"); t_on_reply("CNAM_DIPS"); t_on_failure("CNAM_DIPS"); $avp(cnam_dip_authorized) = 0; sql_xquery("routing", "SELECT * FROM callRoute WHERE telephoneNumber = '$var(dest_tn)'", "callRoute_cnam_query"); $avp(cnam_dip_authorized) = $xavp(callRoute_cnam_query=>cnamDipAuthorized); append_branch("sip:8888888888@444.44.444.44:5060;trans-type=5", "0.5"); t_load_contacts(); t_next_contacts(); t_relay(); break; } }
branch_route[CNAM_DIPS] { $var(modified_from) = "sip:" + $fU + "@sip.core.com"; uac_replace_from("$var(modified_from)"); }
onreply_route[CNAM_DIPS] { if (t_check_status("380")) { xlog("L_INFO", "INFO: Received valid reply from TNSi (on_reply_route[CNAM_DIPS])"); $avp(cnam) = $(hdr(P-Asserted-Identity){nameaddr.name}); } else { xlog("L_ERROR", "INFO: Received bad reply from TNSi (on_reply_route[CNAM_DIPS])"); }; drop; }
failure_route[CNAM_DIPS] { if (!t_next_contacts()) { xlog("L_ERR", "ERROR: Gateway failure (failure_route[CNAM_DIPS])"); exit; } else { t_next_contacts(); t_relay(); }; }
And these are the corresponding logs I was referencing:
Kamailio log: https://gist.github.com/johnavp1989/92adb1b9461168b4e46ba8842f65dac9 Packet capture: https://gist.github.com/johnavp1989/1167391732307a8ec025a992b4cda79a Syslog: https://gist.github.com/johnavp1989/6ea392880a6fd9aaa4e4eded57819b6c