Hi List,
I'm trying to use rest_append_hf function to append an extra header for my rest 
call. But it doesn't set it unless I call the same function twice.
How do I get around this ? I tried async() statement as well as per docs but it 
didn't work either.
I'm using opensips 2.3.3
route(xxxx);

route[xxxx] {
    rest_append_hf("Accept: application/vnd.xxx.vapi+json; version=2");
    $var(rc) = rest_post("http://{{ API_USER }}:{{ API_SECRET }}@{{ API_HOST 
}}/xx/xx/xx", "{ \"xx\": { \"xx\": [ \"$var(auth_user)\" ] }}", 
"application/json", "$var(body)", "$var(ct)", "$var(rcode)");
    $json(res) := $var(body);
    if($json(res/success) != 1 ) {
        xlog("L_ERR", "API: Failed to Blocked call request - M=$rm RURI=$ru 
F=$fu T=$tu IP=$si ID=$ci\n");
    } else {
        xlog("L_WARN", "API: Blocked call request - M=$rm RURI=$ru F=$fu T=$tu 
IP=$si ID=$ci\n");
    }
}

Accept header will only send if I call route(xxxx) twice :/.

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to