original_string: public function redirect($control_url, $app, $name, $new_adress, $new_clientid, $new_name, $type = 'publisher', $srv = null)
      {
          $query = [];
          $query['app'] = $app;
          $query['name'] = $name;
          $query['addr'] = $new_adress;
          $query['clientid'] = $new_clientid;
          $query['newname'] = $new_name;
  
          if ($srv) {
              $query['srv'] = $srv;
          }
  
          $client = new Client();
          try {
              $response = $client->request(
                  'GET',
                  $url .'/control/redirect/'.$type,
                  [
                      'query' => $query
                  ]
              );
          } catch (RequestException $e) {
              return false;
          }
          catch (Exception $e) {
              return false;
          }
  
          return true;
      }
code: public function redirect($control_url, $app, $name, $new_adress, $new_clientid, $new_name, $type = 'publisher', $srv = null)
      {
          $query = [];
          $query['app'] = $app;
          $query['name'] = $name;
          $query['addr'] = $new_adress;
          $query['clientid'] = $new_clientid;
          $query['newname'] = $new_name;
  
          if ($srv) {
              $query['srv'] = $srv;
          }
  
          $client = new Client();
          try {
              $response = $client->request(
                  'GET',
                  $url .'/control/redirect/'.$type,
                  [
                      'query' => $query
                  ]
              );
          } catch (RequestException $e) {
              return false;
          }
          catch (Exception $e) {
              return false;
          }
  
          return true;
      }
code_tokens: public function redirect ( $ control_url , $ app , $ name , $ new_adress , $ new_clientid , $ new_name , $ type = 'publisher' , $ srv = null ) { $ query = [ ] ; $ query [ 'app' ] = $ app ; $ query [ 'name' ] = $ name ; $ query [ 'addr' ] = $ new_adress ; $ query [ 'clientid' ] = $ new_clientid ; $ query [ 'newname' ] = $ new_name ; if ( $ srv ) { $ query [ 'srv' ] = $ srv ; } $ client = new Client ( ) ; try { $ response = $ client -> request ( 'GET' , $ url . '/control/redirect/' . $ type , [ 'query' => $ query ] ) ; } catch ( RequestException $ e ) { return false ; } catch ( Exception $ e ) { return false ; } return true ; }
docstring: sends a redirect command to the rtmp server
  @var app the rtmp app name
  @var name the streamkey
  @var new_adress the optional client adress
  @var clientId the optional nginx client id
  @var new_name new stream name to redirect to (streamkey)
  @var new_clientid optional nginx client id
docstring_tokens: sends a redirect command to the rtmp server