|  | @@ -21,16 +21,18 @@ func (s *Client) Originate(req *OriginateRequest) (*Originate, error) {
 | 
											
												
													
														|  |  		timeout = req.Timeout + time.Millisecond*500
 |  |  		timeout = req.Timeout + time.Millisecond*500
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +	res := initOriginate(req, s)
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  	resp, check := s.Request(req.Request(), timeout)
 |  |  	resp, check := s.Request(req.Request(), timeout)
 | 
											
												
													
														|  |  	if !check {
 |  |  	if !check {
 | 
											
												
													
														|  | 
 |  | +		s.removeEventListener(req.uuid)
 | 
											
												
													
														|  |  		return nil, errors.New("Originate request timeout")
 |  |  		return nil, errors.New("Originate request timeout")
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	if resp.IsError() {
 |  |  	if resp.IsError() {
 | 
											
												
													
														|  | 
 |  | +		s.removeEventListener(req.uuid)
 | 
											
												
													
														|  |  		return nil, fmt.Errorf("Originate error: %v", resp.ErrorMessage())
 |  |  		return nil, fmt.Errorf("Originate error: %v", resp.ErrorMessage())
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -	res := initOriginate(req, s)
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |  	return res, nil
 |  |  	return res, nil
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 |