[asterisk-app-dev] Migrating ast_call_feature from Asterisk 11 to Asterisk 16

Joshua C. Colp jcolp at digium.com
Mon Aug 5 06:54:32 CDT 2019


On Mon, Aug 5, 2019, at 8:35 AM, Fernando Pardo wrote:
> Hello, everybody. I'm migrating a module I've developed for Asterisk 11 
> to use it on Asterisk 16. One of the trickiest parts I haven't found a 
> way around is the removal of the ast_call_feature struct, which I used 
> to execute a function on transfers.
> 
> This is what I do on Asterisk 11:
> 
> - Define a global 'ast_call_feature *my_feature_transfer'
> - Define a callback function 'int 
> TransferFromFeatureOperation(ast_channel *chan, ast_channel *peer, 
> ast_bridge_config*, const char*, int sense, void*)'
> - On module load, I initialize my_feature_transfer with:
>  - feature_mask = AST_FEATURE_REDIRECT
>  - fname = ast_strdup("Attended Transfer")
>  - sname = "my_att_transfer"
>  - exten = 'T'
>  - default_exten = 'T'
>  - operation = &TransferFromFeatureOperation
>  - flags = AST_FEATURE_FLAG_NEEDSDTMF
>  ... and register it with 'ast_register_feature(icc_feature_transfer);'
> - On module unload, I call 
> 'ast_unregister_feature(icc_feature_transfer)' and free fname.
> 
> What would be the way to migrate this to Asterisk 16? I think it has 
> something to do with aco_option_register, but I'm not sure.

The aco_option_register function is used by modules to register some configuration handling logic.

The bridge feature API is defined in bridge_features.h[1] but I'm not sure functionality you require (arbitrary adding of features) was ever added to it.

[1] https://github.com/asterisk/asterisk/blob/master/include/asterisk/bridge_features.h

-- 
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-app-dev mailing list