My setup is as follows:
- Asterisk 13.38.1 (PJSIP) behind a router
- SIP from Telekom Germany
- IP desk phone (Snom D375) connected to the Asterisk that does call forwarding
In certain cases, call forwarding does not work: the call is signalled as successfully established, but no audio is transferred.
This depends on to which (public) number number the call is forwarded.
I did a packet trace, here you can see the (quite different) course of actions between the Asterisk (0.0.0.0) and the public telephony gateway of Telekom Germany:
On the left hand side, you see the working case, on the right hand side there is the non-working case.
Target numbers where call forwarding does work:
- Mobile number from T-Mobile Germany
- A PBX working at a real ISDN PtP line from vodafone Germany
Target numbers where call forwarding does not work:
- SIP number of sipgate
- PBX behind a SIP trunk provider (Deutsche Telefon Standard)
- Telekom Germany’s customer hotline (0800/3301000)
I can further tell that:
- Regular calls between the Asterisk and all affected numbers work totally fine
- Actually, no RTP packets are sent in the non-working case. On my router’s WAN interface, no packets are received and on the LAN interface, no packets are transferred by Asterisk either
- Setting
strictrtp=no
inrtp.conf
didn’t make any difference
When reading what Asterisk prints on the CLI, I found out that the following happens in the working case:
Channel PJSIP/OriginatingCall joined 'simple_bridge' basic-bridge <ONE>
Channel Local/CallForwardTarget;2 joined 'simple_bridge' basic-bridge <ONE>
Channel Local/CallForwardTarget;1 joined 'simple_bridge' basic-bridge <TWO>
Channel PJSIP/IncomingCall joined 'simple_bridge' basic-bridge <TWO>
> Strict RTP switching to RTP target address (...) as source
> Move-swap optimizing Local/CallForwardTarget;2 <-- PJSIP/IncomingCall
Channel PJSIP/IncomingCall left 'simple_bridge' basic-bridge <TWO>
Channel Local/CallForwardTarget;2 left 'simple_bridge' basic-bridge <ONE>
Channel PJSIP/IncomingCall swapped with Local/CallForwardTarget;2 into 'simple_bridge' basic-bridge <ONE>
Channel Local/CallForwardTarget;1 left 'simple_bridge' basic-bridge <TWO>
So, Asterisk has first the two calls in two bridges and then swaps the members of the bridges so that only one bridge is used, connecting the PJSIP channel from the incoming and the outgoing call, which makes sense to me.
However, in the non-working case, this does not happen.
Sometimes, as you can also tell by the call flow screen shot, the call is terminated actively by the Asterisk. Sadly, in the CLI, now reason is given.
So, as far as I can tell, there does not seem to be a networking (i.e. routing, firewall, NAT) problem, but a “logical” problem. It seems as if both sides seem to wait for each other to do something, maybe sending the first RTP packet?
Does anyone know that problem?
What can I do to further trace that problem down?