Forwarding call to external number is rejected if call comes from extern

Status
Not open for further replies.

rasos

New Member
Mar 15, 2022
2
0
1
60
When trying to set call forwards to an external number, the call gets rejected and I hear a message that this is not a valid extension. I could verify that call routing to external number does not work only if call comes from extern. Redirect works when calling from an internal extension.

The problem is similar to the one described here with a ring group and external numbers and I also followed the advice to talk to the SIP provider to activate more than one channel. But even with an extra SIP account for outgoing calls only and registering it as an outgoing gateway and an outbound route, we get a 403 and the call is rejected when trying to reach a forwarded external number from extern.

Code:
a4d729bc-0894-48eb-9ecf-bb345eea64a5 EXECUTE sofia/external/+435572310455@192.133.109.67 hash(insert/sip.fairkom.net-last_dial/+431234567890/+436641234567)
a4d729bc-0894-48eb-9ecf-bb345eea64a5 EXECUTE sofia/external/+435572310455@192.133.109.67 set(sip_h_X-accountcode=)
a4d729bc-0894-48eb-9ecf-bb345eea64a5 2022-03-23 19:00:57.031136 [DEBUG] mod_dptools.c:1548 SET sofia/external/+431234567890@192.133.109.67 [sip_h_X-accountcode]=[UNDEF]
a4d729bc-0894-48eb-9ecf-bb345eea64a5 EXECUTE sofia/external/+431234567890@192.133.109.67 set(call_direction=outbound)
...
e2f0c1df-2f01-44d3-acb5-3fc43367602c 2022-03-23 19:01:07.111152 [DEBUG] sofia.c:7084 Channel sofia/external/+436641547588 entering state [terminated][403]
e2f0c1df-2f01-44d3-acb5-3fc43367602c 2022-03-23 19:01:07.111152 [NOTICE] sofia.c:8273 Hangup sofia/external/+436641547588 [CS_CONSUME_MEDIA] [CALL_REJECTED]
e2f0c1df-2f01-44d3-acb5-3fc43367602c 2022-03-23 19:01:07.111152 [DEBUG] switch_core_state_machine.c:584 (sofia/external/+436641234567) Running State Change CS_HANGUP (Cur 2 Tot 693186)
a4d729bc-0894-48eb-9ecf-bb345eea64a5 2022-03-23 19:01:07.111152 [DEBUG] switch_ivr_originate.c:3848 Originate Resulted in Error Cause: 21 [CALL_REJECTED]
e2f0c1df-2f01-44d3-acb5-3fc43367602c 2022-03-23 19:01:07.111152 [DEBUG] switch_core_state_machine.c:850 (sofia/external/+436641234567) Callstate Change DOWN -> HANGUP
e2f0c1df-2f01-44d3-acb5-3fc43367602c 2022-03-23 19:01:07.111152 [DEBUG] switch_core_state_machine.c:852 (sofia/external/+436641234567) State HANGUP

Any idea how to debug this further?
 

ad5ou

Active Member
Jun 12, 2018
891
204
43
You probably need to check with your provider to see why the call is rejected. Could be limits to your trunk, or caller id related.
Another option you can try is "follow-me" instead of forward to see if the behavior changes
 
  • Like
Reactions: rasos

modcar

Member
Jun 9, 2017
83
5
8
44
I second the caller id part - we had to add a p_asserted_id header in with a number belonging to our trunk before we could forward calls out - apparently "it looked like we were spoofing caller id"
 

rasos

New Member
Mar 15, 2022
2
0
1
60
Thank you @modcar and @ad5ou for the hints. I tried:
  1. talking with the provider - they assigned me an extra trunk for outgoing calls and I could verify that it is (probably always was) possible to have an incoming and outgoing call simultaneously
  2. adding a p_asserted_id header by adding sip into the SIP CID type field of the FusionPBX gateway extended settings - I could verify that this header is sent with sngrep
  3. applied follow-me instead of call forwarding
Still no luck. Any call from extern to extern is always being REJECTED. Here is a screenshot with sngrep:

ScreenshotRedirectInternic.png
Same behaviour with Asserted-ID header.
 
Status
Not open for further replies.