|
| 1 | +[[intro]] |
| 2 | += Restcomm as a generic Proxy |
| 3 | + |
| 4 | +Restcomm can be configured to act as B2BUA and proxy out incoming calls (that didn't matched a registered application or a registered client) based on certain rules. |
| 5 | + |
| 6 | +On incoming call, the feature will be executed after Restcomm-Connect finish checking: |
| 7 | + |
| 8 | +1. Call to a registered Application/DID |
| 9 | +2. Call to a registered Client |
| 10 | + |
| 11 | +Restcomm-Connect will use Dial SIP RCML to proxy the call to the destination which means that media server will be in the call path. |
| 12 | + |
| 13 | +== Configuration |
| 14 | + |
| 15 | +To enable this feature you will need to modify the **restcomm.xml** configuation file, and edit the **ims-authentication** section: |
| 16 | + |
| 17 | +[source,xml] |
| 18 | +---- |
| 19 | + <acting-as-proxy> |
| 20 | + <enabled>false</enabled> |
| 21 | + <use-from-header>true</use-from-header> |
| 22 | + <proxy-rules> |
| 23 | + <rule> |
| 24 | + <from-uri></from-uri> |
| 25 | + <to-uri></to-uri> |
| 26 | + <!-- Optionally provide username --> |
| 27 | + <proxy-to-username></proxy-to-username> |
| 28 | + <proxy-to-password></proxy-to-password> |
| 29 | + </rule> |
| 30 | + <rule> |
| 31 | + <from-uri></from-uri> |
| 32 | + <to-uri></to-uri> |
| 33 | + <!-- Optionally provide username --> |
| 34 | + <proxy-to-username></proxy-to-username> |
| 35 | + <proxy-to-password></proxy-to-password> |
| 36 | + </rule> |
| 37 | + </proxy-rules> |
| 38 | + </acting-as-proxy> |
| 39 | +---- |
| 40 | + |
| 41 | + |
| 42 | +=== Options |
| 43 | + |
| 44 | +* `enabled` set to **true** to enable the feature |
| 45 | +* `use-from-header` if set to **true**, From header will be used to determine the From URI. If set to **false** the Contact header will be used to determine the From URI. Default **true** (use From header) |
| 46 | +* `proxy-rules` Define the rules to match incoming traffic. You can define as many rules as you need |
| 47 | +** `from-uri` Define the **From URI** that will be used to match the incoming traffic |
| 48 | +** `to-uri` Define the **To URI** which will be used to proxy out incoming traffic that matched the rule |
| 49 | +** `proxy-to-username` (Optional) Username for proxy |
| 50 | +** `proxy-to-password` (Optional) Password for proxy |
| 51 | + |
| 52 | + |
| 53 | +When enabled, the feature will try to match incoming traffic from **from-uri** and if matched will proxy it to **to-uri** |
| 54 | + |
| 55 | +=== Example configuration |
| 56 | + |
| 57 | +Given |
| 58 | + |
| 59 | +* ClientA: **192.168.100.10:5060** |
| 60 | +* Restcomm InstanceA: **192.168.100.11:5080** |
| 61 | +* Restcomm InstanceB: **192.168.200.11:5080** |
| 62 | + |
| 63 | +The configuration should be: |
| 64 | + |
| 65 | +[source,xml] |
| 66 | +---- |
| 67 | + <acting-as-proxy> |
| 68 | + <enabled>true</enabled> |
| 69 | + <use-from-header>true</use-from-header> |
| 70 | + <proxy-rules> |
| 71 | + <rule> |
| 72 | + <from-uri>192.168.100.10:5060</from-uri> |
| 73 | + <to-uri>192.168.200.11:5080</to-uri> |
| 74 | + <!-- Optionally provide username --> |
| 75 | + <proxy-to-username></proxy-to-username> |
| 76 | + <proxy-to-password></proxy-to-password> |
| 77 | + </rule> |
| 78 | + <rule> |
| 79 | + <from-uri>192.168.200.11:5080</from-uri> |
| 80 | + <to-uri>192.168.100.10:5060</to-uri> |
| 81 | + <!-- Optionally provide username --> |
| 82 | + <proxy-to-username></proxy-to-username> |
| 83 | + <proxy-to-password></proxy-to-password> |
| 84 | + </rule> |
| 85 | + </proxy-rules> |
| 86 | + </acting-as-proxy> |
| 87 | +---- |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +The first rule: |
| 92 | +[source,xml] |
| 93 | +---- |
| 94 | + <rule> |
| 95 | + <from-uri>192.168.100.10:5060</from-uri> |
| 96 | + <to-uri>192.168.200.11:5080</to-uri> |
| 97 | + <!-- Optionally provide username --> |
| 98 | + <proxy-to-username></proxy-to-username> |
| 99 | + <proxy-to-password></proxy-to-password> |
| 100 | + </rule> |
| 101 | +---- |
| 102 | + |
| 103 | +Will match traffic from **192.168.100.10:5060** (**ClientA**) and will proxy out to **192.168.200.11:5080** (**Restcomm InstanceB**) |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +The second rule: |
| 108 | +[source,xml] |
| 109 | +---- |
| 110 | + <rule> |
| 111 | + <from-uri>192.168.200.11:5080</from-uri> |
| 112 | + <to-uri>192.168.100.10:5060</to-uri> |
| 113 | + <!-- Optionally provide username --> |
| 114 | + <proxy-to-username></proxy-to-username> |
| 115 | + <proxy-to-password></proxy-to-password> |
| 116 | + </rule> |
| 117 | +---- |
| 118 | +Will match traffic from **192.168.200.11:5080** (**Restcomm InstanceB**) and will proxy out to **192.168.100.10:5060** (**ClientA**) |
| 119 | + |
| 120 | +== Call flows |
| 121 | + |
| 122 | +Following a call flow for how the feature is used |
| 123 | + |
| 124 | +image::images/RestcommB2BUA.png[Restcomm B2BUA] |
0 commit comments