| 544 | |
| 545 | === What is the difference between proxy and outbound proxy setting? === #proxy-outbound |
| 546 | |
| 547 | The {{{--proxy}}} option in [http://www.pjsip.org/pjsua.htm pjsua] application corresponds to {{{pjsua_acc_config.proxy}}} setting in PJSUA-LIB. This specifies the route set that is specific for the particular SIP account. |
| 548 | |
| 549 | The {{{--outbound}}} option corresponds to {{{pjsua_config.outbound_proxy}}} setting in PJSUA-LIB. This specifies a global route set that is applicable for the whole endpoint (rather than a particular account), and will be used for all accounts in the application. |
| 550 | |
| 551 | When {{{--service-route}}} option (this option corresponds to {{{pjsua_acc_config.enable_service_route}}} setting in PJSUA-LIB) is enabled for the account (default is disabled), the {{{--proxy}}} settings will be updated with the content of {{{Service-Route}}} header in successful REGISTER response. In other words, if {{{Service-Route}}} header is not present in 2xx REGISTER response, the {{{--proxy}}} settings for the account will be cleared. |
| 552 | |
| 553 | Unlike {{{--proxy}}} option, the route settings in {{{--outbound}}} option are not be affected by {{{Service-Route}}} processing. |
| 554 | |
| 555 | Both {{{--proxy}}} and {{{--outbound}}} options can be specified multiple times in ''pjsua'' command line to specify more than one servers. |
| 556 | |
| 557 | When both settings are present, the initial total route set for a particular account is built by appending the servers in {{{--proxy}}} option '''to''' the servers in {{{--outbound}}} option. |
| 558 | |
| 559 | For example: |
| 560 | |
| 561 | Account A has the following {{{--proxy}}} setting: |
| 562 | {{{ |
| 563 | --proxy sip:PA1;lr |
| 564 | --proxy sip:PA2;lr |
| 565 | }}} |
| 566 | |
| 567 | Account B has the following {{{--proxy}}} setting: |
| 568 | {{{ |
| 569 | --proxy sip:PB;lr |
| 570 | }}} |
| 571 | |
| 572 | And the {{{--outbound}}} setting is the following: |
| 573 | {{{ |
| 574 | --outbound sip:PO;lr |
| 575 | }}} |
| 576 | |
| 577 | With the above settings, the initial route set for account A will be computed as: |
| 578 | {{{ |
| 579 | Route: <sip:PO;lr>, <sip:PA1;lr>, <sip:PA2;lr> |
| 580 | }}} |
| 581 | |
| 582 | While the initial route set for account B will be computed as: |
| 583 | {{{ |
| 584 | Route: <sip:PO;lr>, <sip:PB;lr> |
| 585 | }}} |
| 586 | |
| 587 | If {{{--service-route}}} option is enabled for both accounts, and suppose the 2xx REGISTER responses for both accounts do not have {{{Service-Route}}} header, then the route sets for both accounts will be updated to contain only the outbound proxy: |
| 588 | {{{ |
| 589 | Route: <sip:PO;lr> |
| 590 | }}} |
| 591 | |