| 72 | == Create Media Transport On-Demand == |
| 73 | |
| 74 | Media transport (including SRTP) will be created before call. |
| 75 | |
| 76 | == Distinguish Between Fresh Call and UPDATE/re-INVITE == |
| 77 | |
| 78 | {{{ |
| 79 | pjsua_call_make_call(): |
| 80 | pjsua_call_on_incoming(): |
| 81 | { |
| 82 | pjsua_media_channel_init(); |
| 83 | pjsua_media_channel_create_sdp(); |
| 84 | } |
| 85 | |
| 86 | pjsua_call_update(): |
| 87 | pjsua_call_reinvite(): |
| 88 | pjsua_call_on_rx_offer(): |
| 89 | pjsua_call_on_create_offer(): |
| 90 | { |
| 91 | if (media==NULL) |
| 92 | pjsua_media_channel_init(); |
| 93 | pjsua_media_channel_create_sdp(); |
| 94 | } |
| 95 | |
| 96 | pjsua_call_on_media_update(): |
| 97 | { |
| 98 | pjsua_media_channel_update(); |
| 99 | } |
| 100 | |
| 101 | pjsua_call_on_state_changed(DISCONNECTED): |
| 102 | pjsua_call_on_media_update(HOLD): |
| 103 | { |
| 104 | pjsua_media_channel_deinit(); |
| 105 | } |
| 106 | }}} |