Hello Zhan,
you need to also execute it also for the ACK request. I just tested it on a test setup, I
just placed it here for a quick test (refer to the default cfg):
...
uac_replace_from("","sip:batman@gotham.org"<mailto:sip:batman@gotham.org>);
uac_replace_to("","sip:robin@gotham.org"<mailto:sip:robin@gotham.org>);
# handle requests within SIP dialogs
route(WITHINDLG);
...
Works just fine:
2019/08/04 18:43:21.727990 XXX.XXX.178.27:5060 -> XXX.XXX.167.107:5060
ACK sip:customer-2@XXX.XXX.64.8:5096;ob<mailto:sip:customer-2@XXX.XXX.64.8:5096;ob>
SIP/2.0
Via: SIP/2.0/UDP XXX.XXX.178.27;branch=z9hG4bK8cfc.358f1178964b526f50452ba03db8ee3e.0
Via: SIP/2.0/UDP
XXX.XXX.167.107;rport=5060;branch=z9hG4bK8cfc.85decb742f8d4df6ca0216d3065be210.0
v: SIP/2.0/UDP
XXX.XXX.64.8:5095;received=XXX.XXX.64.8;rport=5095;branch=z9hG4bKPjpwl1uGwlM1NDPbYauTk6DazXWBA1yrzV
Max-Forwards: 68
f:
sip:batman@gotham.org;tag=TVDG0gI90HONs9GOc0dw7ykSYFgyWUWZ<mailto:sip:batman@gotham.org;tag=TVDG0gI90HONs9GOc0dw7ykSYFgyWUWZ>
t:
sip:robin@gotham.org;tag=ufPqkX.gDlvL.ammPR9QkQ6beeh4fbOL<mailto:sip:robin@gotham.org;tag=ufPqkX.gDlvL.ammPR9QkQ6beeh4fbOL>
i: E3JNM13kkWFd8gCbt0EAvbGRow6zU8OX
CSeq: 19753 ACK
Route: <sip:XXX.XXX.167.107;lr>
l: 0
Cheers,
Henning
Am 04.08.19 um 18:22 schrieb Zhan Bazarov:
Hello,
Thanks, I will try!
Should I add this into the same route?
I execute uac_replace into route[FROMASTERISK] if method is invite.
вс, 4 авг. 2019 г. в 19:15, Henning Westerholt
<hw@skalatan.de<mailto:hw@skalatan.de>>:
Hello Zhan,
I obvious don't know your cfg details. But I would try to just call the
uac_replace_from/ .._to in the main request_route and see if it works at all in your
routing logic. Also add some xlog messages to see that it is executed. You can also output
with $rm the SIP request method, with $ru the request URI etc.. (see the cookbook for
pseudo-variables for all that are available).
Cheers,
Henning
Am 03.08.19 um 22:40 schrieb Zhan Bazarov:
Hello,
It didn’t make any sense, unfortunately...
In additional - kamailio relay right 200 to Asterisk, and asterisk send ACK with wrong
from/to(initial values like it was before uac_replace) and then kamailio doesn’t change it
to right from/to values.
Any idea, please.
сб, 3 авг. 2019 г. в 19:17, Henning Westerholt
<hw@skalatan.de<mailto:hw@skalatan.de>>:
Hello Zhan,
there is no need to execute a branch_route on an ACK. The ACK should be just routed
"normally" through Kamailio. Have a look to the default cfg, for example. The
ACK in a normal call setup is just a "normal" request.
Cheers,
Henning
Am 02.08.19 um 19:27 schrieb Zhan Bazarov:
Thanks!
Rly appreciate your help!
So, I can try to execute the same branch_route for ACK method?
I have this branch route:
branch_route[MODIFY]{
uac_replace_from("","$avp(from)");
uac_replace_to($avp(to));
}
Now I execute this when request goes from asterisk through kamailio to carriers...
Should I execute this branch route into ACK method from asterisk too?
пт, 2 авг. 2019 г. в 20:11, Henning Westerholt
<hw@skalatan.de<mailto:hw@skalatan.de>>:
Hello Zhan,
possible reasons:
- the ACK is not routed through your proxy (missing record-route for the INVITE)
- the user agent mangles the Route header, therefore the uac module can't does it work
correctly (look to the kamailio error logs if you spot something)
Have a look to your SIP e.g. with "ngrep -qt -d any -W byline port 5060" on your
proxy.
Cheers,
Henning
Am 02.08.19 um 19:02 schrieb Zhan Bazarov:
Hello,
Thanks for reply! Yes I execute uac_replace_to/from in branch_route in INVITE method...
But it doesn't work for ACK method...
пт, 2 авг. 2019 г. в 18:11, Henning Westerholt
<hw@skalatan.de<mailto:hw@skalatan.de>>:
Hello Zhan,
have a look to the "uac" module, there are functions to rewrite the From and To
header for passing messages. It works together with the rr module.
Cheers,
Henning
Am 02.08.19 um 13:30 schrieb Zhan Bazarov:
Hello! Please, is it possible to change from/to headers in ACK message to provider? this
is exactly our case, please, look it when u get a chance.
http://sip-router.1086192.n5.nabble.com/Wrong-ACK-to-Provider-td130050.html…
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Henning Westerholt -
https://skalatan.de/blog/
Kamailio services -
https://skalatan.de/services
--
Henning Westerholt -
https://skalatan.de/blog/
Kamailio services -
https://skalatan.de/services
--
Henning Westerholt -
https://skalatan.de/blog/
Kamailio services -
https://skalatan.de/services
--
Henning Westerholt -
https://skalatan.de/blog/
Kamailio services -
https://skalatan.de/services
--
Henning Westerholt -
https://skalatan.de/blog/
Kamailio services -
https://skalatan.de/services