#1825 closed enhancement (fixed)
New on_reg_started2 callback
Reported by: | riza | Owned by: | bennylp |
---|---|---|---|
Priority: | normal | Milestone: | release-2.4 |
Component: | pjsua-lib | Version: | trunk |
Keywords: | Cc: | ||
Backport to 1.x milestone: | Backported: | no |
Description (last modified by nanang)
On IP Address change case, app might want to close the transport before connecting state, however it is not possible to get the transport instance before registration process is finished.
This ticket is mainly for getting registration transport instance before getting the registration result (via pjsua callback on_reg_state).
Example scenario:
- Connecting to network A (3G)
- Check if a transport is saved. Finding None so go on.
- Register requested (and account created)
- Transport created in PJSIP
- Connecting to network B (WIFI)
- Register request on network B (old account destroyed and new one created)
- Check if a transport is saved. Finding None so go on.
- Transport A and transport B connect (may happen in an iphone since the 3G connection is never really lost).
- Transport A is saved and then transport B is saved in its stead
- If on transport connect we also check if there is already a transport connected and then release the old one (which we are doing at the time), then if by chance transport B connects first, then network A would actually cause a release of transport B which is the latest one
- Otherwise, transport A is never released.
on_reg_started callback can be used for getting registration transport instance, but we need to include pjsua_internal.h to get account's pjsip_regc instance (to eventually get the registration transport). With this ticket, it can be done as follow:
static void on_reg_started2(pjsua_acc_id acc_id, pjsua_reg_info *info) { pjsip_regc_info regc_info; pjsip_regc_get_info(info->regc, ®c_info); // transport instance is in 'regc_info.transport' ... }
Change History (4)
comment:1 Changed 10 years ago by riza
- Type changed from defect to enhancement
comment:2 Changed 10 years ago by riza
comment:3 Changed 10 years ago by riza
- Resolution set to fixed
- Status changed from new to closed
comment:4 Changed 9 years ago by nanang
- Description modified (diff)
In 4999: