[asterisk-bugs] [Asterisk 0011322]: Respect the original "From" header in "Dial" application

noreply at bugs.digium.com noreply at bugs.digium.com
Tue Nov 20 16:26:56 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11322 
====================================================================== 
Reported By:                ibc
Assigned To:                oej
====================================================================== 
Project:                    Asterisk
Issue ID:                   11322
Category:                   Channels/chan_sip/Interoperability
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.14  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             11-20-2007 05:57 CST
Last Modified:              11-20-2007 16:26 CST
====================================================================== 
Summary:                    Respect the original "From" header in "Dial"
application
Description: 
If Asterisk receives an incoming SIP call from an **external** SIP account,
and during the dialplan it must call to an internal SIP user, the INVITE
from Asterisk has a modified "From" header (the fromdomain is changed by
Asterisk). Why?

This is not needed and it's very anti-RFC ("From" shouldn't be changed).

And in fact it can cause problems, as this example:

- Our Asterisk domain is "asterisk_domain.org".

- We have two internal users:
  - "Bob" <200>
  - "Pepe" <201>

- We receive an external SIP incoming call with this From header:
  From: "EXTERNAL <sip:201 at external_domain.com>"

- During the dialplan Asterisk finally does:
  Dial(SIP/200)

- This new INVITE generated by Asterisk will contain this header:
  From: "EXTERNAL" <sip:201 at asterisk_domain.org>   <--- DOMAIN CHANGED
!!!!


So our internal user "Bob" <200> will receive a call and will think that
it's a call from our internal user "Pepe" <201>. If, for example, the call
is not answered and later Bob open him "missed calls" he will see a call
from 201, and if he calls he will call in fact to "Pepe <201>".

This is IMHO a wrong behaviour. Asterisk shoudn't change the "From"
header, there is no reason for that. Why a internal user can't know from
which domain he recives a call vía Asterisk?

For the established dialog the "From" domain is not important at all, the
only the called needs to know if the Call-ID, From/To tags and Contact
header to send in-dialog requests, no more.

I attach a debug example that shows how the "From" header is changed in
the INVITE generated by Asterisk.
====================================================================== 

---------------------------------------------------------------------- 
 ibc - 11-20-07 16:26  
---------------------------------------------------------------------- 
> when we have an inbound SIP call from external domain being sent to
another
> channel than SIP - how do we make sure the call can be returned?

IMHO there is not solution for that, of course. There is for now some
protection when using PSTN because the incoming numbers are pre-defined
(and others are just not allowed).

In calls with a SIP channel and H323 channel there is not a good solution,
of course. Handing domains maybe not possible for H323 (is it?), so if
sip:200 at domainA or sip:200 at domainB calls Asterisk and a H323 channel is
created (or any other not SIP), then there is no way to pass the domain
info.

But in SIP, sip:200 at domainA is perfectly valid as sip:200 at domainB is (and
they are completely different). And Asterisk can easily respect the From
domain.

Would be very complex to add a test before creating a SIP channel?
something like:

  if (caller_channel == SIP && called_channel == SIP)
    from_header = caller_from_header
  else
    from_header = ...

XD

Regards. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-20-07 16:26  ibc            Note Added: 0074113                          
======================================================================




More information about the asterisk-bugs mailing list