Forwarded Call does not call outside

Hello Folks,

i need some advice or someone who is putting me in the right direction:
Setup a Freepbx, everything is working, incoming and outgoin calls are working well. Now some people want to redirect incoming calls to their mobile device, so i told them to redirect the call via a setting on their Yealink T54W.
Unfortunalety the call does not get routed to my provider (i’ve asekd them if they send the originate CallerID and they said yes) and freepbx only shows me a
“TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks”) in new stack"
I don’t know what i did wrong. I also changed my outgoing Trunk and the dial pattern to only “.” so it won’t make any Problems at this Point.
Here is the Log from a Call:
https://pastebin.freepbx.org/view/19f9e63e

I hope someone can give me a hint.

Thanks in advance!

It’s a while since I dealt with this, but I suspect your VoIP provider is screening the CID you send - you are restricted to your registered numbers as outbound CID. Try changing CID Options on the trunk to Block Foreign CIDs.

If that works the forwarded calls will appear to be from your number. You might ask if they would stop screening CID, but this could be open to abuse so they may refuse - it would allow you to spoof any number.

Thanks for the idea.
But my provider does allow the outgoing CID to be the original caller id, i’ve asked them.
I am stuck now. Any suggestions?
The block foreign id doesn’t change anything unfortunatly.

Hello @Edge2020,

Your problem is that your dial pattern +4912345678 is not allowed in the outbound routes. Either tell your colleagues to enter a valid mobile number like they are dialling from their extensions, or strip the + sign from the dialed number.

It would be better if you attached a SIP trace of your forwarded call so we can check what the provider is returning.

Thank you,

Daniel Friedman
Trixton LTD.

Thanks for your Point.
But my outgoing Dialplan looks like this: ( I know this is a NOT RECOMMENDED one, but for testing purposes it is ok for me )


I thought the “.” wildcard matches everything even a “+”.
But the forward also does not work with “00”, so i think it can’t be the “+” .

1 Like

Hi @Edge2020,

It seems that your provider is rejecting you for some reason (wrong CLI or a missing header).
It would be best to attach a SIP trace.

– Executing [s@macro-outbound-callerid:39] Set(“Local/+4912345678@from-internal-000000a8;2”, “CDR(outbound_cnum)=012345678”) in new stack

– Called PJSIP/+4912345678@TRUNK

== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:25] NoOp(“Local/+4912345678@from-internal-000000a8;2”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21”) in new stack

Thank you,

Daniel Friedman
Trixton LTD.

Hey Daniel,

here is the SIP Trace from the log File:
https://pastebin.freepbx.org/view/f6f817ec
12345678 is the called number, 87654321 is the caller and the redirect target (didn’t had a third telephone around)
I can’t see something very obvious. It is really strange for me.
But thanks for trying to help me out!

Hello @Edge2020,

There is nothing wrong in the call diversion, the call is being answered:

[2020-09-21 16:07:33] VERBOSE[27235][C-00000265] app_dial.c: Local/87654321@from-internal-000000f7;1 answered PJSIP/EasybellTrunk-0000050d
[2020-09-21 16:07:33] VERBOSE[27238][C-00000265] bridge_channel.c: Channel PJSIP/EasybellTrunk-0000050f joined 'simple_bridge' basic-bridge <30af8c33-13d6-49cb-9170-3780ccff44af>

[2020-09-21 16:07:33] VERBOSE[19247] res_pjsip_logger.c: <--- Transmitting SIP response (973 bytes) to UDP:195.185.37.60:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 195.185.37.60;rport=5060;received=195.185.37.60;branch=z9hG4bKgwByEamCwxOE5
Call-ID: SBC5615e0000af5-5f68b3a3-4e7b1e67-5887160-2995685-01_b2b-1
From: <sip:[email protected]>;tag=76B94707-5F68B3A300030673-43561700
To: <sip:[email protected]>;tag=afbee358-98b0-4bbf-8c86-7a27519338cd
CSeq: 10 INVITE
Server: FPBX-15.0.16.73(16.11.1)
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Diversion: <sip:[email protected]>;reason=unconditional
Contact: <sip:87.79.93.116:5060>
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   275
 
v=0
o=- 367432548 3 IN IP4 87.79.93.116
s=Asterisk
c=IN IP4 87.79.93.116
t=0 0
m=audio 17424 RTP/AVP 9 8 0 100
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

Thank you,

Daniel Friedman
Trixton LTD.

Yes indeed, now the forward works, although i did not change anything. Maybe it was my provider.
Now i only need to figure out why i don’t have any audio. Firewall is open and the NAT Settings are correct. When i do FME with playing an announcement (e.g. silence1) then i have audio in both directions. But when i do a forward via phone or *72 i don’t have it.
This PBX is driving my crazy yet :slight_smile:

Hello @Edge2020,

Try to set RTP keepalive to 1 sec.

image

Thank you,

Daniel Friedman
Trixton LTD.

Hello Daniel,

already did that. Does not work either. It’s really strange, i have another PBX where the forward is working with. Seems to be firewall related i think. I don’t see anything obvious at the PBX for now. progressinband=yes did also not help.

Hello @Edge2020,

progressinband is a chan_sip setting. Did you cancel the SIP-ALG on your firewall?

Thank you,

Daniel Friedman
Trixton LTD.

It seems that my network department did a terrible job designing the network. we have there double NAT to the outside. Once i removed one of the NAT Routers, everything works more or less.
Thanks for the help and the effort @danielf
Always nice to have such people where are willing to help in such Forums!

Hello @Edge2020,

You’re welcome and I am glad that you sorted out your problems.

Thank you,

Daniel Friedman
Trixton LTD.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.