[asterisk-bugs] [Asterisk 0014592]: [patch] export the SIP peer username of the transferer

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Sep 21 14:50:40 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=14592 
====================================================================== 
Reported By:                klaus3000
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14592
Category:                   Channels/chan_sip/NewFeature
Reproducibility:            have not tried
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-03-03 09:42 CST
Last Modified:              2009-09-21 14:50 CDT
====================================================================== 
Summary:                    [patch] export the SIP peer username of the
transferer
Description: 
Hi!

When a blind transfer is initiated from a SIP, often the name of the
transferer is needed (e.g. billing, applying restrictions ...). Currently
there is a variable called SIPTRANSFER_REFERER which contains the value of
the Refered-By header - but this variable is not trustworthy, as the SIP
client can put anything into this variable.

Attached patch adds the variables SIPTRANSFERER_PEERNAME and
SIPTRANSFERER_USERNAME which contain the respective SIP username (peer or
user)
====================================================================== 

---------------------------------------------------------------------- 
 (0111094) klaus3000 (reporter) - 2009-09-21 14:50
 https://issues.asterisk.org/view.php?id=14592#c111094 
---------------------------------------------------------------------- 
Yes, forward and transfer are different - in their meaning and
implementation. Nevertheless, for billing purpose they might be identical
(it is a common practice that the party who does the forward or transfer
pays for the second call leg).

I needed the information of the transferer or forwarder for billing
purposes. Thus, I exported the information (the corresponding SIP peer) as
channel variables. 

If I got it right, BLINDTRANSFER only exports the channel name, not the
SIP peer.

Further, I also have some dialplan magic to find out if a certain peer is
actually allowed to do transfers or forwardings. Thus, I think it is very
useful to have this information in the dialplan.

There are already contexts which handle the transfer/fowarding:
TRANSFER_CONTEXT and FORWARD_CONTEXT.

Regarding multiple forwardings and transfers: No problem. The patch just
exports the relevant peer as channel variable and in the config you can
decide if you need both forwarders or only the last/first one.

Eg. Caller -> SIP/10 -> SIP/20 -> SIP/30. SIP/10 sends a redirect.
FORWARD_CONTEXT will be executed with FORWARDER_SIPPEER=SIP/10. Then SIP/20
sends a redirect. FORWARD_CONTEXT will be executed again with
FORWARDER_SIPPEER=SIP/20. Thus, in FORWARD_CONTEXT I read the
FORWARDER_SIPPEER and do the authorization and billing processing.

Regarding your patch. I think it only exports the channel-name, but not
the peer info. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-09-21 14:50 klaus3000      Note Added: 0111094                          
======================================================================




More information about the asterisk-bugs mailing list