[Freeswitch-users] Call Forwarding Problem

Mike motosota at gmail.com
Wed Sep 22 05:59:59 PDT 2010


Here's a problem I posted about on the IRC some time ago - I said I'd
do some traces and put them in pastebin, which I've done here:


A brief description of the problem and the calls involved in the pastebin.

Incoming calls are delivered to the Freeswitch from a SIP trunking
provider who are also used to route outgoing calls. This is not via a

The SIP trunking provider insists that for outgoing calls, the data in
the "From" field in the INVITE message contains a PSTN number that
they have 'associated' with the SIP trunking service,
From: "Zoltan" <sip:02031375892 at> is OK.
From: "Zoltan" <sip:anonymous at> would be rejected by
them, as would
From: "Zoltan" <sip:01344299800 at> as 01344299800 is
'someone elses' number, not one of theirs that they have allocated to

The first call in the pastebin shows a Polycom phone making an
outgoing call that works / is allowed as the
effective_caller_id_number is set to an "allowed" number 02031375892.

The second call, starting at line 871 shows a call originating in the
PSTN from number 01344299800 to the Polycom. The SIP provider delivers
the call to the FreeSwitch which in turn sends the call to the
Polycom. The Polycom has been set to divert all incoming calls to
number 07770380800 and replies with a "SIP/2.0 302 Moved Temporarily"
with the forwarded to number as the contact. This in turn causes the
FreeSwitch to generate an INVITE message which is sent to the trunk
provider with:
From: "01344299800" <sip:01344299800 at> and
To: <sip:07770380800 at>

Since 01344299800 is not an "allowed" number according to the
provider, the call is rejected.

Putting aside the argument for now of whether the SIP provider should
be carrying out this rather brutal form of "CLI screening" (the data
in the 'From' field appears as the A Party Number  / CLI once the call
hits the PSTN / mobile networks), is there any way to modify the
behaviour of this call so that in response to the "SIP/2.0 302 Moved
Temporarily" message, the INVITE which is sent out has the number from
the effective_caller_id_number variable for the forwarding extension,
rather than the number from the "From" field of the incoming invite?

Hope this makes sense,


More information about the FreeSWITCH-users mailing list