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 (sending out opensips). It means we will have 2 "from" headers (in 200 OK) to caller, if 2nd forwarded callee answer.
Caller ---> Invite ---> opensips ----> UA 0, no answer ----> UA 1, no answer ---->UA 2, answer <----200 OK <---200OK<---
this 200ok will have 2 "from" header.
Most of UA just ignore redundant from header, but some can not. I think it should be UAC modules issue, anyone can help me?
best regards KK
2009/4/21 Gentrice's kaiser kaiser@gentrice.net:
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 (sending out opensips). It means we will have 2 "from" headers (in 200 OK) to caller, if 2nd forwarded callee answer.
Caller ---> Invite ---> opensips ----> UA 0, no answer ----> UA 1, no answer ---->UA 2, answer <----200 OK <---200OK<---
this 200ok will have 2 "from" header.
Are you sending these calls to a SIP/PSTN gateway? if so, it easier to add a P-Asserted-Identity or Remote-Party-Id header containing the callerid you want to show to the remote.
see, you have gave me a new direction to think about this, I think it is work for carrier, so some small ITSP, most of them use "From" for identification.
Thanks for your answer. kaiser
在 2009/4/21 下午 11:05 時,Iñaki Baz Castillo 寫到:
2009/4/21 Gentrice's kaiser kaiser@gentrice.net:
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 (sending out opensips). It means we will have 2 "from" headers (in 200 OK) to caller, if 2nd forwarded callee answer.
Caller ---> Invite ---> opensips ----> UA 0, no answer ----> UA 1, no answer ---->UA 2, answer <----200 OK <---200OK<---
this 200ok will have 2 "from" header.
Are you sending these calls to a SIP/PSTN gateway? if so, it easier to add a P-Asserted-Identity or Remote-Party-Id header containing the callerid you want to show to the remote.
-- Iñaki Baz Castillo ibc@aliax.net
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
2009/4/21 Gentrice's kaiser kaiser@gentrice.net:
see, you have gave me a new direction to think about this, I think it is work for carrier, so some small ITSP, most of them use "From" for identification.
They will use "From" if there is no PAI or RPID headers. Just ask your carrier which header it requires (PAI is standar why RPID is not).
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
Daniel,
Thanks for your suggest, the code has run for years, it's time to update ... thank again.
I try the code with latest 1.4x
I used to test uac_replace_from in request route then failure_route, it makes two from hdr connect together. That's totally wrong.
If I have no replace_from in route, only in failure_route, and this faiure route repeat 2+ time (for serial call) , the from get "repeated"...
best regards kk
在 2009/4/21 下午 11:29 時,Daniel-Constantin Mierla 寫到:
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_first_branch
Cheers, Daniel
-- Daniel-Constantin Mierla http://www.asipto.com/
Hello,
On 04/21/2009 05:40 PM, Gentrice's kaiser wrote:
Daniel,
Thanks for your suggest, the code has run for years, it's time to update ... thank again.
I try the code with latest 1.4x
I used to test uac_replace_from in request route then failure_route, it makes two from hdr connect together. That's totally wrong.
If I have no replace_from in route, only in failure_route, and this faiure route repeat 2+ time (for serial call) , the from get "repeated"...
can you put some xlog for each uac_replace_from() you have in the config and then watch the debug? Maybe by missing some return/exit the function is called twice.
Make sure you use it only on branch_route, to be safe.
Cheers, Daniel
best regards kk
在 2009/4/21 下午 11:29 時,Daniel-Constantin Mierla 寫到:
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_first_branch
Cheers, Daniel
-- Daniel-Constantin Mierla http://www.asipto.com/
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
daniel,
I have tried use it in branch_route only too and xlog to see the value, xlog shows everything fine, but still no good result, from is still redundant.. I even try to write a simple script just to verify this feature, but the same result ...
I will paste the script later. kk
在 2009/4/27 下午 9:08 時,Daniel-Constantin Mierla 寫到:
Hello,
On 04/21/2009 05:40 PM, Gentrice's kaiser wrote:
Daniel,
Thanks for your suggest, the code has run for years, it's time to update ... thank again.
I try the code with latest 1.4x
I used to test uac_replace_from in request route then failure_route, it makes two from hdr connect together. That's totally wrong.
If I have no replace_from in route, only in failure_route, and this faiure route repeat 2+ time (for serial call) , the from get "repeated"...
can you put some xlog for each uac_replace_from() you have in the config and then watch the debug? Maybe by missing some return/exit the function is called twice.
Make sure you use it only on branch_route, to be safe.
Cheers, Daniel
best regards kk
在 2009/4/21 下午 11:29 時,Daniel-Constantin Mierla 寫到:
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_first_branch
Cheers, Daniel
-- Daniel-Constantin Mierla http://www.asipto.com/
Kamailio (OpenSER) - Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
-- Daniel-Constantin Mierla http://www.asipto.com/