85 | | The dialog's Contact URI is set initially when the dialog is created, from the account's Contact URI. While at the PJSIP level the {{{pjsip_inv_reinvite()}}} allows changing of Contact URI via the {{{new_contact}}} argument, currently this feature is not used by PJSUA-LIB, i.e. the {{{pjsua_call_reinvite()}}} does not allow the application to change the Contact URI. |
86 | | |
87 | | As a workaround, application may #include {{{<pjsua-lib/pjsua_internal.h>}}} and perform the reinvite manually, as the snippet below shows: |
88 | | {{{ |
89 | | pjsip_tx_data *tdata; |
90 | | pj_str_t new_contact; |
91 | | pjsip_inv_sessin *inv = pjsua_var.calls[call_id].inv; |
92 | | |
93 | | new_contact = pjsua_var.acc[account_id].contact; |
94 | | status = pjsip_inv_reinvite(inv, &new_contact, NULL, &tdata); |
95 | | if (status==PJ_SUCCESS) |
96 | | pjsip_inv_send_msg(inv, tdata); |
97 | | }}} |
98 | | |
99 | | Note that the usual caveats of including <pjsua_internal.h> apply (i.e. this is not public API and things may change in future releases). |
100 | | |
101 | | '''Update''': since 1.10 or 2.0, application using PJSUA can update dialog Contact URI by specifying {{{PJSUA_CALL_UPDATE_CONTACT}}} flag in option parameter of {{{pjsua_call_reinvite()}}}, the corresponding ticket is #1209. |
102 | | |
| 85 | To update the dialog's Contact URI, application can use the flag {{{PJSUA_CALL_UPDATE_CONTACT}}} when calling the API {{{pjsua_call_reinvite()}}}. |