Browse Source

accept token-reg from uri.params and tobody.params

drop_requests
lazedo 8 years ago
committed by GitHub
parent
commit
a670864dd3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 4 deletions
  1. +18
    -4
      kamailio/pusher-role.cfg

+ 18
- 4
kamailio/pusher-role.cfg View File

@ -30,11 +30,14 @@ route[PUSHER_TO_EXTERNAL_RELAY]
failure_route[PUSHER_EXTERNAL_FAULT] failure_route[PUSHER_EXTERNAL_FAULT]
{ {
xlog("L_INFO", "$ci|pusher|fault reply $T_reply_code\n");
if (!t_check_status("486|603") && $avp(push_sent) != 1) {
if (!t_check_status("486|487|603") && $avp(push_sent) != 1) {
send_reply(182, "waking the dead guy"); send_reply(182, "waking the dead guy");
route(PUSHER_SEND_PUSH_NOTIFICATION); route(PUSHER_SEND_PUSH_NOTIFICATION);
} else if (t_check_status("487")) {
xlog("L_INFO", "$ci|pusher|push transaction canceled\n");
t_reply("$T_reply_code", "Pusher Canceled");
} else { } else {
xlog("L_INFO", "$ci|pusher|push transaction result - $T_reply_code\n");
t_reply("$T_reply_code", "Pusher Failed"); t_reply("$T_reply_code", "Pusher Failed");
} }
} }
@ -114,10 +117,21 @@ route[PUSHER_ATTEMPT_REGISTRATION]
if($sht(push_cache=>$(sel(contact.uri){uri.param,x-token-reg})) != $null) { if($sht(push_cache=>$(sel(contact.uri){uri.param,x-token-reg})) != $null) {
$var(password) = $null; $var(password) = $null;
$sht(push_cache=>$(sel(contact.uri){uri.param,x-token-reg})) = $null; $sht(push_cache=>$(sel(contact.uri){uri.param,x-token-reg})) = $null;
xlog("L_INFO", "$ci|pusher|registration with x-token-reg\n");
xlog("L_INFO", "$ci|pusher|registration with x-token-reg $(sel(contact.uri){uri.param,x-token-reg})\n");
route(SAVE_LOCATION);
} else {
xlog("L_INFO", "$ci|pusher|registration x-token-reg from contact uri param '$(sel(contact.uri){uri.param,x-token-reg})' was not found\n");
}
}
if($(sel(contact){tobody.params}{param.value,x-token-reg}) != "") {
if($sht(push_cache=>$(sel(contact){tobody.params}{param.value,x-token-reg})) != $null) {
$var(password) = $null;
$sht(push_cache=>$(sel(contact){tobody.params}{param.value,x-token-reg})) = $null;
xlog("L_INFO", "$ci|pusher|registration with x-token-reg $(sel(contact){tobody.params}{param.value,x-token-reg})\n");
route(SAVE_LOCATION); route(SAVE_LOCATION);
} else { } else {
xlog("L_INFO", "$ci|pusher|registration x-token-reg from contact '$(sel(contact.uri){uri.param,x-token-reg})' was not found\n");
xlog("L_INFO", "$ci|pusher|registration x-token-reg from contact param '$(sel(contact){tobody.params}{param.value,x-token-reg})' was not found\n");
} }
} }


Loading…
Cancel
Save