# Redirection

In release 2.8 and above, redirection contacts are obtained from the routing engine in the following format:

```
 contacts = params[ :contacts ]
 contacts = {
     :index=>"3",
     :list=>[
        {:called_number=>"6660", :priority=>"1000", :is_number_ported=>"0", :sip_uri=>"", :raw_data=>"", :expiration=>"3600"},
        {:called_number=>"6661", :priority=>"1000", :is_number_ported=>"0", :sip_uri=>"", :raw_data=>"<>", :expiration=>"3600"}
        {:called_number=>"6662", :priority=>"1000", :is_number_ported=>"0", :sip_uri=>"", :raw_data=>"<>", :expiration=>"3600"},
        {:called_number=>"6663", :priority=>"1000", :is_number_ported=>"0", :sip_uri=>"", :raw_data=>"<>", :expiration=>"3600"},
        {:called_number=>"6664", :priority=>"1000", :is_number_ported=>"0", :sip_uri=>"", :raw_data=>"<>", :expiration=>"3600"}
     ],
     :source_indexes=>"nil,0,0,0,2"
 }
```

* `params[:contacts][:list]` contains the contact log. Each contact within the list has the following fields:
  * `:called_number` - the called number
  * `:is_number_ported` - if the called number has been ported (for SIP: if the npdi parameter is present)
  * `:ported_number` - the called number that was ported (for SIP: the rn parameter value, if available)
  * `:sip_uri` - the SIP URI of the contact, without the contact-params section (without the expires and q contact parameters)
  * `:raw_data` - the raw data representing the contact in the signaling protocol. For SIP, this is the full SIP URI (including the expires and q contact parameters).
  * `:priority` - the priority of the contact \[0-1000]
  * `:expiration` - the expiration time in seconds of the contact
* `params[:contacts][:index]` contains the index of the contact that is currently being routed.
* `params[:contacts][:source_indexes]` contains a comma-separated list of indexes from `params[:contacts][:list]`. Each index represents the contact from which the contact in the list was obtained from.

\
To get more information, see:

* [SIP Redirection Contacts Parameters in a Call Flow](https://docs.telcobridges.com/wiki/Routing_script_tutorial:SIP_Redirection_Contacts)
