On 04/21/2009 04:31 PM, Gentrice's kaiser wrote:
Dear Sir:
I wrote a failure route for serial call mechanism, it help for no answer call ... but all these serial calls need to have a new CallerID, so I use replace_from for this purpose.
modparam("uac","from_restore_mode","auto")
failure_route[3] { log(1,"******* I'm failure_route[3] *******\n");
if (avp_pushto("$ru", "$avp(forward)")) { append_branch(); avp_delete("$avp(forward)"); uac_replace_from("sip:1234@$fd"); # change from
header t_on_failure("3"); # try next , recursive
t_relay(); }
}
If only one forward number in AVP array , this code working fine, the issue will happen if multiple forward number trying, ( forward 2nd,3rd ...number) the UAC module will restore from header in 200 OK of its following message when a UA answered, we will have a duplicated "from header" in 200 OK
can you paste here the sip trace? Do you call uac_replace_from() in main route as well?
It is strange that you have two From headers.
Also, note that with latest Kamailio (OpenSER) you can do directly script operations instead of using avpops module:
$ru = $avp(forward); $avp(forward) = null; uac_replace_from("sip:1234@$fd"); append_branch();
Also, you can write URI directly to the branch:
$br = $avp(forward);
instead of:
$ru = $avp(forward); append_branch();
See docs about PVs: http://www.kamailio.org/dokuwiki/doku.php/pseudovariables:1.5.x#request_s_fi...
Cheers, Daniel