Lua script for call forwarding to external number

Status
Not open for further replies.

Sipharmony

New Member
May 4, 2023
5
0
1
37
Hey everyone!

I am trying to write a lua script that I plan to use with dialplan tools. The script is a simple call forward to an external phone number.

The issues I am having is "UNALLOCATED_NUMBER" error. I know what it means, just don't know how to fix it!

Any help would be awesome :)

*EDIT*
I do pay for FusionPBX support, but I thought this would be a good topic for google/seo!

Code:
    local cache = require"resources.functions.cache";
    local log = require"resources.functions.log"["call_block"];
    local SipharmonyApi = require "resources.functions.sipharmony_api"
    local json json = require "resources.functions.lunajson";

    require "resources.functions.trim";
    require "resources.functions.explode";
    require "resources.functions.file_exists";

    if (session:ready()) then
        domain_uuid = session:getVariable("domain_uuid");
        call_direction = session:getVariable("call_direction");
        caller_id_name = session:getVariable("caller_id_name");
        caller_id_number = session:getVariable("caller_id_number");
        destination_number = session:getVariable("destination_number");
        context = session:getVariable("context");
        check_balance = session:getVariable("check_balance");
        extension_uuid = session:getVariable("extension_uuid");
        sip_to_user = session:getVariable("sip_to_user");

        sip_to_user = string.gsub(sip_to_user, "+", "");

        local external_number = "XXXXXXXXXX" -- eventually get value from db

        -- Send caller to an external number
        freeswitch.consoleLog("DEBUG", "[IVR External Number] Sending caller to an external number\n");
        freeswitch.consoleLog("DEBUG", "[IVR External Number] sip_to_user: " .. sip_to_user .. "\n");

        session:execute("set", "call_destination=outbound");

        session:execute("set", "outbound_caller_id_name=" .. sip_to_user);
        session:execute("set", "outbound_caller_id_number=" .. sip_to_user);
        session:execute("set", "origination_caller_id_number=" .. sip_to_user);
        session:execute("set", "origination_caller_id_name=" .. sip_to_user);
        session:execute("set", "effective_caller_id_number=" .. sip_to_user);
        session:execute("set", "origination_callee_id_name=" .. sip_to_user);

        session:execute("set", "caller_destination=" .. external_number);
        session:execute("set", "destination_number=" .. external_number);
        session:execute("set", "callee_id_number=" .. external_number);

        session:execute("bridge", "sofia/gateway/2544a86b-2a1d-474a-b33b-6da9fcfd8210/" .. external_number);
        session:execute("bridge", "sofia/gateway/e9ff8727-eed3-45ee-b8c6-f6d555c17e6e/" .. external_number);
        session:hangup("NORMAL_CLEARING");
    end
 
Last edited:

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,417
376
83
Your lua looks pretty much OK to me.
A couple of points:
1. Make sure that "resources.functions.sipharmony_api" actually exists and compiles OK, comment it out for now and re-test.
2. To make debugging easier, comment out the second bridge statement.

If you log in to your box and run fs_cli, you will see any errors there when you call your script.

If you are not familiar with fs_cli it is /quit to end the session.
 

Sipharmony

New Member
May 4, 2023
5
0
1
37
Thanks for the reply :)

The sipharmony_api lua is fine. It's just a simple script that I punt events and data to my rest api. I have a lot of scripts working. Just wrapped up adding the option to send an SMS as a configurable IVR option to the web app a couple of days ago.

Here is a snippet from the cli. Again, thanks for taking a look!!

Context: I have this being called from an IVR when pressing 2

Code:
2024-01-23 04:15:33.029039 97.97% [DEBUG] switch_rtp.c:7756 RTP RECV DTMF 2:1280
2024-01-23 04:15:33.029039 97.97% [INFO] switch_channel.c:527 RECV DTMF 2:1280
2024-01-23 04:15:33.029039 97.97% [DEBUG] switch_ivr_play_say.c:2015 done playing file /var/lib/freeswitch/recordings/aatestdomain.sipharmony.com/day_ivr.mp3
2024-01-23 04:15:33.029039 97.97% [DEBUG] switch_ivr_menu.c:378 waiting for 4/5 digits t/o 20002024-01-23 04:15:35.029044 98.00% [DEBUG] switch_ivr_menu.c:425 digits '2'
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_ivr_menu.c:580 IVR action on menu 'f006b8fa-531b-4a3e-b079-11d9e54c7b10' matched '2' param 'lua app.lua ivr_external_number'
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_ivr_menu.c:584 switch_ivr_menu_execute todo=[2]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 lua(app.lua ivr_external_number)
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 set(call_direction=outbound)
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_dptools.c:1673 SET sofia/external/16827306133@64.136.173.31 [call_direction]=[outbound]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 set(outbound_caller_id_name=18177174595)
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_dptools.c:1673 SET sofia/external/16827306133@64.136.173.31 [outbound_caller_id_name]=[18177174595]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 set(outbound_caller_id_number=18177174595)
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_dptools.c:1673 SET sofia/external/16827306133@64.136.173.31 [outbound_caller_id_number]=[18177174595]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 set(effective_caller_id_number=18177174595)
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_dptools.c:1673 SET sofia/external/16827306133@64.136.173.31 [effective_caller_id_number]=[18177174595]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 set(origination_callee_id_name=4695149600)
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_dptools.c:1673 SET sofia/external/16827306133@64.136.173.31 [origination_callee_id_name]=[4695149600]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 set(caller_destination=4695149600)
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_dptools.c:1673 SET sofia/external/16827306133@64.136.173.31 [caller_destination]=[4695149600]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 set(destination_number=4695149600)
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_dptools.c:1673 SET sofia/external/16827306133@64.136.173.31 [destination_number]=[4695149600]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 set(callee_id_number=4695149600)
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_dptools.c:1673 SET sofia/external/16827306133@64.136.173.31 [callee_id_number]=[4695149600]
EXECUTE [depth=0] sofia/external/16827306133@64.136.173.31 bridge(sofia/gateway/2544a86b-2a1d-474a-b33b-6da9fcfd8210/4695149600)
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_channel.c:1954 (sofia/external/16827306133@64.136.173.31) Callstate Change ACTIVE -> RING_WAIT
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_channel.c:1269 sofia/external/16827306133@64.136.173.31 EXPORTING[export_vars] [call_direction]=[outbound] to event
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_channel.c:1269 sofia/external/16827306133@64.136.173.31 EXPORTING[export_vars] [call_direction]=[outbound] to event
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_channel.c:1269 sofia/external/16827306133@64.136.173.31 EXPORTING[export_vars] [origination_callee_id_name]=[4695149600] to event
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_ivr_originate.c:2291 Parsing global variables
2024-01-23 04:15:35.029044 98.00% [NOTICE] switch_channel.c:1123 New Channel sofia/external/4695149600 [9abbccff-8479-40f8-99d8-37a153c87278]
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_sofia.c:5117 (sofia/external/4695149600) State Change CS_NEW -> CS_INIT
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:581 (sofia/external/4695149600) Running State Change CS_INIT (Cur 2 Tot 47082)
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:624 (sofia/external/4695149600) State INIT
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_sofia.c:97 sofia/external/4695149600 SOFIA INIT
2024-01-23 04:15:35.029044 98.00% [INFO] sofia_glue.c:1654 sofia/external/4695149600 sending invite call-id: (null)
2024-01-23 04:15:35.029044 98.00% [DEBUG] sofia_glue.c:1657 sofia/external/4695149600 sending invite version: 1.10.9 -release 64bit
Local SDP:
v=0
o=FreeSWITCH 1705954525 1705954526 IN IP4 149.28.242.141
s=FreeSWITCH
c=IN IP4 149.28.242.141
t=0 0
m=audio 28810 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:40 sofia/external/4695149600 Standard INIT
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:48 (sofia/external/4695149600) State Change CS_INIT -> CS_ROUTING
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:624 (sofia/external/4695149600) State INIT going to sleep
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:581 (sofia/external/4695149600) Running State Change CS_ROUTING (Cur 2 Tot 47082)
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:640 (sofia/external/4695149600) State ROUTING
2024-01-23 04:15:35.029044 98.00% [DEBUG] mod_sofia.c:158 sofia/external/4695149600 SOFIA ROUTING
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_ivr_originate.c:67 (sofia/external/4695149600) State Change CS_ROUTING -> CS_CONSUME_MEDIA
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:640 (sofia/external/4695149600) State ROUTING going to sleep
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:581 (sofia/external/4695149600) Running State Change CS_CONSUME_MEDIA (Cur 2 Tot 47082)
2024-01-23 04:15:35.029044 98.00% [DEBUG] sofia.c:7487 Channel sofia/external/4695149600 entering state [calling][0]
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:659 (sofia/external/4695149600) State CONSUME_MEDIA
2024-01-23 04:15:35.029044 98.00% [DEBUG] switch_core_state_machine.c:659 (sofia/external/4695149600) State CONSUME_MEDIA going to sleep
2024-01-23 04:15:35.289034 98.00% [DEBUG] sofia.c:7487 Channel sofia/external/4695149600 entering state [terminated][404]
2024-01-23 04:15:35.289034 98.00% [NOTICE] sofia.c:8729 Hangup sofia/external/4695149600 [CS_CONSUME_MEDIA] [UNALLOCATED_NUMBER]
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:581 (sofia/external/4695149600) Running State Change CS_HANGUP (Cur 2 Tot 47082)
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:844 (sofia/external/4695149600) Callstate Change DOWN -> HANGUP
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:846 (sofia/external/4695149600) State HANGUP
2024-01-23 04:15:35.289034 98.00% [DEBUG] mod_sofia.c:468 Channel sofia/external/4695149600 hanging up, cause: UNALLOCATED_NUMBER
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:59 sofia/external/4695149600 Standard HANGUP, cause: UNALLOCATED_NUMBER
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:846 (sofia/external/4695149600) State HANGUP going to sleep
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:616 (sofia/external/4695149600) State Change CS_HANGUP -> CS_REPORTING
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:581 (sofia/external/4695149600) Running State Change CS_REPORTING (Cur 2 Tot 47082)
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:932 (sofia/external/4695149600) State REPORTING
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:168 sofia/external/4695149600 Standard REPORTING, cause: UNALLOCATED_NUMBER
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:932 (sofia/external/4695149600) State REPORTING going to sleep
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:607 (sofia/external/4695149600) State Change CS_REPORTING -> CS_DESTROY
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_session.c:1743 Session 47082 (sofia/external/4695149600) Locked, Waiting on external entities
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_ivr_originate.c:4045 Originate Resulted in Error Cause: 1 [UNALLOCATED_NUMBER]
2024-01-23 04:15:35.289034 98.00% [NOTICE] switch_core_session.c:1761 Session 47082 (sofia/external/4695149600) Ended
2024-01-23 04:15:35.289034 98.00% [NOTICE] switch_core_session.c:1765 Close Channel sofia/external/4695149600 [CS_DESTROY]
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:735 (sofia/external/4695149600) Running State Change CS_DESTROY (Cur 1 Tot 47082)
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:745 (sofia/external/4695149600) State DESTROY
2024-01-23 04:15:35.289034 98.00% [DEBUG] mod_sofia.c:379 sofia/external/4695149600 SOFIA DESTROY
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:175 sofia/external/4695149600 Standard DESTROY
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:745 (sofia/external/4695149600) State DESTROY going to sleep
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_channel.c:2178 (sofia/external/16827306133@64.136.173.31) Callstate Change RING_WAIT -> ACTIVE
2024-01-23 04:15:35.289034 98.00% [INFO] mod_dptools.c:3637 Originate Failed.  Cause: UNALLOCATED_NUMBER
2024-01-23 04:15:35.289034 98.00% [NOTICE] switch_channel.c:4993 Hangup sofia/external/16827306133@64.136.173.31 [CS_EXECUTE] [UNALLOCATED_NUMBER]
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_session.c:2973 sofia/external/16827306133@64.136.173.31 skip receive message [PHONE_EVENT] (channel is hungup already)
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_session.c:2748 sofia/external/16827306133@64.136.173.31 Channel is hungup and application 'bridge' does not have the zombie_exec flag.
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_cpp.cpp:749 CoreSession::hangup
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_cpp.cpp:1209 sofia/external/16827306133@64.136.173.31 destroy/unlink session from object
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_session.c:2973 sofia/external/16827306133@64.136.173.31 skip receive message [PHONE_EVENT] (channel is hungup already)
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_ivr_menu.c:676 exit-sound '(null)'
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_session.c:2973 sofia/external/16827306133@64.136.173.31 skip receive message [PHONE_EVENT] (channel is hungup already)
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:647 (sofia/external/16827306133@64.136.173.31) State EXECUTE going to sleep
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:581 (sofia/external/16827306133@64.136.173.31) Running State Change CS_HANGUP (Cur 1 Tot 47082)
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:844 (sofia/external/16827306133@64.136.173.31) Callstate Change ACTIVE -> HANGUP
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:846 (sofia/external/16827306133@64.136.173.31) State HANGUP
2024-01-23 04:15:35.289034 98.00% [DEBUG] mod_sofia.c:462 sofia/external/16827306133@64.136.173.31 Overriding SIP cause 404 with 404 from the other leg
2024-01-23 04:15:35.289034 98.00% [DEBUG] mod_sofia.c:468 Channel sofia/external/16827306133@64.136.173.31 hanging up, cause: UNALLOCATED_NUMBER
2024-01-23 04:15:35.289034 98.00% [DEBUG] mod_sofia.c:522 Sending BYE to sofia/external/16827306133@64.136.173.31
2024-01-23 04:15:35.289034 98.00% [DEBUG] switch_core_state_machine.c:59 sofia/external/16827306133@64.136.173.31 Standard HANGUP, cause: UNALLOCATED_NUMBER
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,417
376
83
It looks like you are recieving the 404 from your SIP provider:
Code:
2024-01-23 04:15:35.289034 98.00% [DEBUG] sofia.c:7487 Channel sofia/external/4695149600 entering state [terminated][404]
2024-01-23 04:15:35.289034 98.00% [NOTICE] sofia.c:8729 Hangup sofia/external/4695149600 [CS_CONSUME_MEDIA] [UNALLOCATED_NUMBER]
 

Sipharmony

New Member
May 4, 2023
5
0
1
37
Indeed. It's a 404 because of the UNALLOCATED_NUMBER error. I've set all the required info to convert this to an outbound call, but I just can't drop that error!

Somehow, somewhere, the number I am calling in on, is being sent out as the effective caller id number. Any thoughts?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,417
376
83
So are you saying that your SIP Provider is rejecting the call because they don't like the CID you are sending?
You control the effective caller id number in your lua script.
 

Sipharmony

New Member
May 4, 2023
5
0
1
37
Yea I know... I think there is something set from DID -> IVR -> LUA that is conflicting when trying to send the call back out.

Here are some CDR logs for some more leads. Thanks a lot for helping :) I am trying to avoid creating Ring Groups and filtering them for external call forwards.

export​
call_direction=inbound​
set​
caller_destination= 18177174595​
set​
caller_id_name=16827306133​
set​
domain_uuid=​
set​
effective_caller_id_name=FORT WORTH TX​
export​
call_direction=inbound​
set​
domain_uuid=04684a61-9bcb-40cb-856f-0645585ef8c6​
set​
domain_name=aatestdomain.sipharmony.com​
set​
caller_id_number= 16827306133​
transfer​
6005 XML aatestdomain.sipharmony.com​
set​
user_exists=false​
set​
from_user_exists=false​
set​
timezone=America/New_York​
set​
operator=1000​
set​
RFC2822_DATE=Tue, 23 Jan 2024 04:39:09 0000​
export​
origination_callee_id_name= 18177174595​
lua​
app.lua check_balance​
set​
can_call=true​
lua​
app.lua call_block​
hash​
insert/aatestdomain.sipharmony.com-last_dial/ 16827306133/6005​
ring_ready​
answer​
sleep​
1000​
set​
hangup_after_bridge=true​
set​
ringback=local_stream://default​
set​
transfer_ringback=local_stream://default​
set​
ivr_menu_uuid=f006b8fa-531b-4a3e-b079-11d9e54c7b10​
ivr​
f006b8fa-531b-4a3e-b079-11d9e54c7b10​
lua​
app.lua ivr_external_number​
set​
call_direction=outbound​
set​
caller_id_name=8177174595​
set​
caller_id_number=8177174595​
set​
outbound_caller_id_name=8177174595​
set​
outbound_caller_id_number=8177174595​
set​
effective_caller_id_number=8177174595​
set​
origination_callee_id_name=4695149600​
set​
caller_destination=4695149600​
set​
destination_number=4695149600​
set​
callee_id_number=4695149600​
bridge​
sofia/gateway/2544a86b-2a1d-474a-b33b-6da9fcfd8210/4695149600​

NameValue
uuid​
80203ff9-20f0-47a7-887c-1b9e1b5f4ffa​
billsec​
5​
waitsec​
0​
DP_MATCH​
inboundinbound​
billmsec​
5340​
billusec​
5339998​
can_call​
true​
duration​
6​
last_app​
bridge​
last_arg​
sofia/gateway/2544a86b-2a1d-474a-b33b-6da9fcfd8210/4695149600​
operator​
1000​
ringback​
local_stream://default​
sip_cseq​
1​
timezone​
America/New_York​
waitmsec​
0​
waitusec​
0​
answersec​
1​
call_uuid​
80203ff9-20f0-47a7-887c-1b9e1b5f4ffa​
caller_id​
"16827306133" <+16827306133>​
direction​
inbound​
dtmf_type​
rfc2833​
end_epoch​
1705984321​
end_stamp​
2024-01-23 04:32:01​
mduration​
6620​
read_rate​
8000​
tts_voice​
rms​
uduration​
6619996​
DIALSTATUS​
UNALLOCATED_NUMBER​
answermsec​
1280​
answerusec​
1279998​
end_uepoch​
1705984321629034​
read_codec​
PCMU​
rtp_use_pt​
0​
session_id​
47083​
sip_to_tag​
4357ggp14Zeam​
sip_to_uri​
+18177174595@149.28.242.141​
tts_engine​
flite​
write_rate​
8000​
domain_name​
aatestdomain.sipharmony.com​
domain_uuid​
04684a61-9bcb-40cb-856f-0645585ef8c6​
export_vars​
call_direction,call_direction,origination_callee_id_name​
playback_ms​
2048​
progresssec​
0​
sip_call_id​
1324259382-0-1310422504@64.136.173.225​
sip_full_to​
<sip:+18177174595@149.28.242.141>;tag=4357ggp14Zeam​
sip_req_uri​
+18177174595@149.28.242.141:5080​
sip_to_host​
149.28.242.141​
sip_to_user​
+18177174595​
start_epoch​
1705984315​
start_stamp​
2024-01-23 04:31:55​
user_exists​
false​
write_codec​
PCMU​
RFC2822_DATE​
Tue, 23 Jan 2024 04:31:55 +0000​
answer_epoch​
1705984316​
answer_stamp​
2024-01-23 04:31:56​
bridge_epoch​
0​
channel_name​
sofia/external/16827306133@64.136.173.31​
flow_billsec​
6​
hangup_cause​
UNALLOCATED_NUMBER​
max_forwards​
67​
progressmsec​
260​
progressusec​
260002​
rtp_use_ssrc​
96376467​
sip_cid_type​
pid​
sip_from_tag​
sansay380750169rdb16550​
sip_from_uri​
16827306133@64.136.173.31​
sip_full_via​
SIP/2.0/UDP 64.136.173.31:5060;branch=z9hG4bK1sansay380750169rdb16550-200​
sip_req_host​
149.28.242.141​
sip_req_port​
5080​
sip_req_user​
+18177174595​
sip_via_host​
64.136.173.31​
sip_via_port​
5060​
start_uepoch​
1705984315009038​
switch_r_sdp​
v=0 o=Sansay-VSXi 188 1 IN IP4 64.136.173.31 s=Session Controller c=IN IP4 4.55.9.198 t=0 0 m=audio 24676 RTP/AVP 0 8 18 101 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:18 G729/8000 a=fmtp:18 annexb=no a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=maxptime:20​
answer_uepoch​
1705984316289036​
bridge_uepoch​
0​
flow_billmsec​
6620​
flow_billusec​
6619996​
hold_accum_ms​
0​
ivr_menu_uuid​
f006b8fa-531b-4a3e-b079-11d9e54c7b10​
sip_from_host​
64.136.173.31​
sip_from_user​
16827306133​
sip_full_from​
<sip:16827306133@64.136.173.31>;tag=sansay380750169rdb16550​
call_direction​
outbound​
caller_id_name​
18177174595​
local_media_ip​
149.28.242.141​
progress_epoch​
1705984315​
progress_stamp​
2024-01-23 04:31:55​
sip_authorized​
true​
sip_network_ip​
64.136.173.31​
ep_codec_string​
CORE_PCM_MODULE.PCMU@8000h@20i@64000b,CORE_PCM_MODULE.PCMA@8000h@20i@64000b​
hold_accum_usec​
0​
ivr_menu_status​
success​
last_hold_epoch​
0​
originated_legs​
31c9ce66-071c-4f2b-aa21-fe50f8846264;4695149600;4695149600​
progress_uepoch​
1705984315269040​
remote_media_ip​
4.55.9.198​
resurrect_epoch​
0​
sip_contact_uri​
16827306133@64.136.173.31:5060​
sip_name_params​
verstat=TN-Validation-Passed​
sip_received_ip​
64.136.173.31​
text_media_flow​
disabled​
transfer_source​
1705984315:715da52e-405b-407b-8ff4-a099bca2e5d5:bl_xfer:6005/aatestdomain.s ipharmony.com/XML​
audio_media_flow​
sendrecv​
callee_id_number​
4695149600​
caller_id_number​
18177174595​
from_user_exists​
false​
last_hold_uepoch​
0​
local_media_port​
29338​
originate_causes​
31c9ce66-071c-4f2b-aa21-fe50f8846264;UNALLOCATED_NUMBER​
playback_samples​
16384​
playback_seconds​
2​
resurrect_uepoch​
0​
rtp_audio_in_mos​
4.50​
sip_contact_host​
64.136.173.31​
sip_contact_port​
5060​
sip_contact_user​
16827306133​
sip_invite_stamp​
1705984315009038​
sip_network_port​
5060​
sip_via_protocol​
udp​
transfer_history​
1705984315:715da52e-405b-407b-8ff4-a099bca2e5d5:bl_xfer:6005/aatestdomain.s ipharmony.com/XML​
video_media_flow​
disabled​
hangup_cause_q850​
1​
progress_mediasec​
1​
remote_media_port​
24676​
rtp_audio_recv_pt​
0​
rtp_local_sdp_str​
v=0 o=FreeSWITCH 1705954978 1705954979 IN IP4 149.28.242.141 s=FreeSWITCH c=IN IP4 149.28.242.141 t=0 0 m=audio 29338 RTP/AVP 0 101 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=silenceSupp:eek:ff - - - - a=ptime:20 a=sendrecv​
sip_acl_authed_by​
providers​
sip_hangup_phrase​
ERS:No Route Available​
sip_received_port​
5060​
sofia_profile_url​
sip:mod_sofia@149.28.242.141:5080​
transfer_ringback​
local_stream://default​
caller_destination​
4695149600​
destination_number​
4695149600​
hold_accum_seconds​
0​
original_read_rate​
8000​
progress_mediamsec​
1280​
progress_mediausec​
1279998​
rtp_use_codec_name​
PCMU​
rtp_use_codec_rate​
8000​
rtp_use_timer_name​
soft​
sofia_profile_name​
external​
advertised_media_ip​
149.28.242.141​
current_application​
bridge​
hangup_after_bridge​
true​
original_read_codec​
PCMU​
profile_start_epoch​
1705984315​
profile_start_stamp​
2024-01-23 04:31:55​
rtp_use_codec_ptime​
20​
endpoint_disposition​
ANSWER​
profile_start_uepoch​
1705984315229038​
progress_media_epoch​
1705984316​
progress_media_stamp​
2024-01-23 04:31:56​
rtp_use_codec_string​
G7221@32000h,G7221@16000h,G722,PCMU,PCMA​
sip_invite_route_uri​
<sip:sansay380750169rdb16550@64.136.173.31:5060;lr;transport=udp>​
originate_disposition​
UNALLOCATED_NUMBER​
originate_signal_bond​
31c9ce66-071c-4f2b-aa21-fe50f8846264​
progress_media_uepoch​
1705984316289036​
recovery_profile_name​
external​
rtp_2833_recv_payload​
101​
rtp_2833_send_payload​
101​
originate_failed_cause​
UNALLOCATED_NUMBER​
remote_text_media_flow​
inactive​
rtp_audio_in_raw_bytes​
44364​
rtp_use_codec_channels​
1​
sip_from_user_stripped​
16827306133​
sip_hangup_disposition​
send_bye​
sip_local_network_addr​
149.28.242.141​
outbound_caller_id_name​
18177174595​
remote_audio_media_flow​
sendrecv​
remote_video_media_flow​
inactive​
rtp_audio_in_flaw_total​
0​
rtp_audio_out_raw_bytes​
17372​
sip_P-Asserted-Identity​
+16827306133;verstat=TN-Validation-Passed​
sip_invite_record_route​
<sip:sansay380750169rdb16550@64.136.173.31:5060;lr;transport=udp>​
current_application_data​
sofia/gateway/2544a86b-2a1d-474a-b33b-6da9fcfd8210/4695149600​
effective_caller_id_name​
FORT WORTH TX​
last_bridge_hangup_cause​
UNALLOCATED_NUMBER​
playback_last_offset_pos​
16160​
rtp_audio_in_media_bytes​
44204​
outbound_caller_id_number​
18177174595​
rtp_audio_in_packet_count​
267​
rtp_audio_out_media_bytes​
17372​
sip_invite_failure_phrase​
ERS:No Route Available​
sip_invite_failure_status​
404​
effective_caller_id_number​
18177174595​
origination_callee_id_name​
4695149600​
rtp_audio_in_mean_interval​
20.00​
rtp_audio_out_packet_count​
101​
rtp_audio_rtcp_octet_count​
0​
rtp_audio_rtcp_packet_count​
0​
rtp_last_audio_codec_string​
PCMU@8000h@20i@1c​
rtp_audio_in_largest_jb_size​
0​
rtp_audio_in_cng_packet_count​
0​
rtp_audio_in_jitter_loss_rate​
0.00​
rtp_audio_in_dtmf_packet_count​
10​
rtp_audio_in_jitter_burst_rate​
0.00​
rtp_audio_in_skip_packet_count​
13​
rtp_audio_out_cng_packet_count​
0​
rtp_audio_in_flush_packet_count​
0​
rtp_audio_in_media_packet_count​
257​
rtp_audio_in_quality_percentage​
100.00​
rtp_audio_out_dtmf_packet_count​
0​
rtp_audio_out_skip_packet_count​
0​
rtp_audio_in_jitter_max_variance​
0.00​
rtp_audio_in_jitter_min_variance​
0.00​
rtp_audio_in_jitter_packet_count​
0​
rtp_audio_out_media_packet_count​
101​
last_bridge_proto_specific_hangup_cause​
sip:404​
 
Last edited:

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,417
376
83
Hmm...
I think you may need to get a packet capture of the conversation between your gateway and supplier, it's the only way we will see what is really going on.
If your box is not too busy, sngrep will be the easiest way, otherwise use tcpdump and filter on your suppliers IP and ports.
 
Status
Not open for further replies.