Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. my $message = shift;
  2.  
  3. my $proxy_address='129.241.208.234';
  4.  
  5. my $default_pizza = $pizza_abc;
  6.  
  7. my $pizza_abc = "sip:G2\@$proxy_address";
  8.  
  9. my $pizzaABC = "sip:G1\@$proxy_address";
  10.  
  11. my $pizzaMain = "sip:G2\@$proxy_address";
  12.  
  13. my $pizzaSat = "sip:G1\@$proxy_address";
  14. my $pizza = "sip:pizza\@$proxy_address";
  15.  
  16. my $to = $message->getHeader("To");
  17.  
  18. log(L_ALERT, "first\n");
  19.  
  20. log(L_ALERT, "second\n");
  21.  
  22. log(L_ALERT, $to);
  23.  
  24.  
  25. if(($message->getMethod() eq "INVITE") and ($to eq $pizza)){
  26. log(L_ALERT, "pizza\n");
  27.  
  28. if(rand() < 0.75){
  29.  
  30. $message->rewrite_ruri($pizzaMain);
  31.  
  32. log(L_ALERT, "main\n");
  33.  
  34. }
  35.  
  36. else{
  37.  
  38. $message->rewrite_ruri($pizzaSat);
  39.  
  40. log(L_ALERT, "Sat\n");
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement