Destination number problems

My problem is that in the invite value I get the username from the sip provider, and in the “To” field I get the numbers purchased from the provider. Naturally routing by DID does not work. Incoming I need to distribute to different clients.

Hello @AlexZah ,
Which call type are you using while forwarding the DID?

CDR says outbound

@AlexZah what you were dialling? DID or outbound number. If DID then what is added in DID forwarding ?
Please share screenshot if possible.

All these are incoming calls

Gateway config

rtp-ip localipastpp
dialplan XML
user-agent-string ASTPP
debug 0
sip-trace no
tls false
inbound-reg-force-matching-username true
disable-transcoding true
all-reg-options-ping false
unregister-on-options-fail true
log-auth-failures true
status 0
inbound-bypass-media false
inbound-proxy-media false
disable-transfer true
enable-100rel false
rtp-timeout-sec 60
dtmf-duration 2000
manual-redirect false
aggressive-nat-detection false
enable-timer false
minimum-session-expires 120
session-timeout-pt 1800
auth-calls true
apply-inbound-acl default
inbound-codec-prefs PCMU,PCMA,G729
outbound-codec-prefs PCMU,PCMA,G729
inbound-late-negotiation false
rtp-start-port 12001
rtp-end-port 13000
ext-sip-ip extipastpp
ext-rtp-ip extipastpp
caller-id-type pid
context default

Hello @AlexZah ,
The screenshots says its an outbound call. Is it?
Please explain call flow is it sip → destination number.
or PSTN → DID → forwarding to somewhere.
As its an confusion here. DID to PSTN is that?

Hello @palak
I’m making a call to a number we’re renting from a telephony provider. From the provider’s sip server, the call goes to my astpp server. But astpp for some reason processes this incoming call as an outgoing call. And for some reason, the called number has the trunk login, and not the number specified in the TO field and in the PAI field. The DID for the number is specified in ASTPP.

inside ASTPP DID is routed via SIP-DID

it seems that the problem is that the called number is the login and the “pai” field is not taken into account in any way. Prompt, how it is possible to force to route a call on the field “to” or on the field “pai”?

Hello @AlexZah ,
It seems you are dialling inbound calls but it is routing as outbound call.

Hello @AlexZah ,
It seems you are dialling inbound calls but it is routing as outbound call.
Please log your issue here-

Thanks for the help. my problem was that the call was routed by the invite header, and this is the trunk login, not the phone number, since there was no suitable route in the incoming context, the call fell into the outgoing context. By changing the value of the variable destination_number = params:getHeader(“variable_sip_to_user”), I was able to get the correct incoming flow.
You can fix this variable in /opt/ASTPP/freeswitch/scripts/astpp/scripts

Hello @AlexZah ,
Do you want us to change this? Please let us know.

Oh no, thanks =) I wrote this for those who will be looking for an answer in a similar situation

Okay @AlexZah ,

1 Like

Hi hope this post is still alive, I have the same issue, but I can’t fine where to change teh variable you are refering too, I set my DID when I call the DID number, my server treated as a outbound call and tehn ome ring and busy signal, outbount calls work fine, I have it set it up for DOD-local I even name the xtensionas the DID number. in conclusion I’m unable to recieve calls using my DID

ASTPP is considering ‘Caller-Destination-Number’ Info Channel Variable as destination number and logic is comparing whatever value got from DID provider in that variable with system wide DID numbers and further checking