[asterisk-users] Disable transfer on all calls

bee.beeep at gmail.com bee.beeep at gmail.com
Thu Apr 24 10:52:09 CDT 2008


Dinesh Nair пишет:
> On Tue, 22 Apr 2008 11:54:41 +0100, Grey Man wrote:
>   
>> The best option is to put a SIP Proxy in front of your Asterisk sever
>> and block REFER requests.
>>     
>
> or just comment out the block in chan_sip.c which handles the refers. 
>
>   

Thanks to your answers, but i found more beautiful way to do this - 
there is some system variable __TRANSFER_CONTEXT, which defines context 
to handle the transfered number, so you can create a new context and 
there you can do anything with transfered call - i just hang it up.

It's really strange that this is in fact undocumented function - you can 
find it only in comments on wiki at voip-info.org. Man there said that 
he found this variable while hacking source code of asterisk:

$ grep -R TRANSFER_CONTEXT /usr/src/asterisk-1.2.15/
/usr/src/asterisk-1.2.15/channels/chan_sip.c: *transfercontext = 
pbx_builtin_getvar_helper(sip_pvt->owner, "TRANSFER_CONTEXT");
/usr/src/asterisk-1.2.15/doc/README.variables:${TRANSFER_CONTEXT} 
Context for transferred calls
/usr/src/asterisk-1.2.15/ChangeLog: * channels/chan_sip.c: chan_sip did 
not use the TRANSFER_CONTEXT
/usr/src/asterisk-1.2.15/res/res_features.c: if 
(!(transferer_real_context = pbx_builtin_getvar_helper(transferee, 
"TRANSFER_CONTEXT")) &&
/usr/src/asterisk-1.2.15/res/res_features.c: !(transferer_real_context = 
pbx_builtin_getvar_helper(transferer, "TRANSFER_CONTEXT"))) {
/usr/src/asterisk-1.2.15/res/res_features.c: if 
(!(transferer_real_context=pbx_builtin_getvar_helper(transferee, 
"TRANSFER_CONTEXT")) &&
/usr/src/asterisk-1.2.15/res/res_features.c: 
!(transferer_real_context=pbx_builtin_getvar_helper(transferer, 
"TRANSFER_CONTEXT"))) {




More information about the asterisk-users mailing list