[SR-Users] uac_req: pseudovariables, avps
Jon Bonilla (Manwe)
manwe at aholab.ehu.es
Tue Aug 23 17:28:26 CEST 2011
Hi all
I'm trying to generate a request using uac_req in a failure route when the call
has been canceled. (Kamailio 3.1.3)
Here's the code:
failure_route[FAILURE_ROUTE_LALA]
{
if t_is_canceled()
{
$uac_req(method) = "INVITE";
$uac_req(ouri) = "sip:127.0.0.1:5090";
$uac_req(ruri) = $ru;
$uac_req(furi) = $fu;
$uac_req(turi) = $tu;
$uac_req(hdrs) = "X-PUSH-Type: mytype\r\nX-PUSH-CLI:
$avp(s:first_caller_cli)\r\nX-PUSH-DST: $rU\r\n";
uac_req_send(); route(ROUTE_STOP_RTPPROXY);
exit;
}
...
}
The problem here is that the headers X-PUSH-CLI and X-PUSH-DST have literal
'$avp(s:first_caller_cli)' and '$rU' values. Here's the INVITE I send:
U 2011/08/23 17:07:09.467666 127.0.0.1:5062 -> 127.0.0.1:5090
INVITE sip:ngcptest1 at domain.com SIP/2.0'
Via: SIP/2.0/UDP
127.0.0.1:5062;branch=z9hG4bK925.85ac80a2000000000000000000000000.0'
To: sip:ngcptest1 at domain.com'
From: sip:sipwise1 at domain.com;tag=cf3b49e60a035342e3af7df009437068-9f9a'
CSeq: 10 INVITE'
Call-ID: 25f2b3a34ed8488c-3417 at 127.0.0.1'
Content-Length: 0'
User-Agent: Sipwise NGCP Proxy 2.X'
X-PUSH-Type: mytype'
X-PUSH-CLI: $avp(s:first_caller_cli)'
X-PUSH-DST: $rU'
I also tried to put the headers in a $var and in a $avp and set the value like:
$var(cancel_push_request)="X-PUSH-Type: missed_call\r\nX-PUSH-CLI:
$avp(s:first_caller_cli)\r\nX-PUSH-DST: $rU\r\n";
$uac_req(hdrs) = $var(cancel_push_request);
If I xlog the values like this:
xlog("L_INFO", "-------- Comprobando valores '$avp(s:first_caller_cli)' ------
'$rU');
The kamailio log show the correct value:
INFO: <script>: -------- Comprobando valores '4312345' ------ 'ngcptest1'
How could I use my stored values in the INVITE generation?
cheers,
Jon
More information about the sr-users
mailing list