Apr 10 09:19:22 siprouter-testbed kamailio[20171]: ERROR: <script>: AVP CallerID-Name returned Joel's Phone Apr 10 09:19:22 siprouter-testbed kamailio[20171]: ERROR: <script>: AVP CallerID-Ext returned 13032190010
U 2014/04/10 09:32:55.564531 10.111.200.114:5060 -> 10.111.200.100:5060 INVITE sip:752321@10.111.200.100:5060;user=phone SIP/2.0. From: "57331" sip:57331@10.111.200.100;tag=7D08FD55-2FFAB73E.
U 2014/04/10 09:32:55.566521 10.111.200.100:5060 -> 10.111.200.100:5090 INVITE sip:752321@10.111.200.100:5060;user=phone SIP/2.0. From: Joel's Phone <13032190010>;tag=7D08FD55-2FFAB73E.
Your From is not a valid SIP URI after using uac_replace_from. You could do something like:
$avp(from)=$fu; avp_subst("$avp(from)", "/sip:.*@/sip:$avp(callerid-did)@/"); uac_replace_from("$avp(s:callerid-name)","$avp(from)");
to dynamically replace the userpart in the from uri. Or just fix your database records to contain a valid uri for callerid-did.