Asterisk inbound calls forwarding

Hello,
I have asterisk installed on the ubuntu server. everything works great.
I have two different registered providers in my sip.conf and they both can receive inbound calls and works great.
let’s say first provider is ‘A’ and the second provider is ‘B’
the ‘A’ provider gives me some flexible rates and multiple phone numbers.
the ‘B’ provider only gives me one inbound number but on their website, I get to see all the statistics when i receive the call through them.
what I want is:
I need to receive the calls at ‘A’ provider and forward them to ‘B’ provider so I can see statistics.
what i tried:

---------- sip.conf ----------

register => 100:password@host-A/100 ; <---- provider A – these are just examples not the real providers I have
register => 200:password@host-B/200 ; <---- provider B these are just examples not the real providers I have

[Provider-A]
type = peer
context = incoming
qualify = yes
secret = password <---- original password is hidden for security
host = host <---- original host is hidden for security
nat = force_rport,comedian

[Provider-B]
type = peer
context = incoming
qualify = yes
secret = password <---- original password is hidden for security
host = host <---- original host is hidden for security
nat = force_rport,comedia

---------------------- extension.conf ---------------------
[incoming]
exten => 100,1,NoOp( – provider ‘A’ --)
same => n,Answer()
same => n,Playback(/var/lib/asterisk/sounds/intro/501)
same => n,Goto(incoming,200,1)

exten => 200,1,NoOp( – provider ‘B’ --)
same => n,Answer()
same => n,Playback(/var/lib/asterisk/sounds/intro/501)
same => n,Hangup( BYE 1)

-If you need any other info i will answer in few minutes.
Thanking you in advance.

You shouldn’t use the same host for two different providers.

There is no way of reaching extension 100, as both providers have 200 as the call back extension.

There is nothing in the dialplan which would modify the routing of or forward the incoming call in any way,

I don’t understand why you would want to incur higher call charges by routing a call from your cheap supplier through your expensive one. In fact, you would probably incur two incoming call charges and one outgoing one.

There is no option called “comedian”.

I don’t understand why you need the nat= setting. Are both providers broken in terms of the addresses they include in in INVITEs?

yes, that was a typo mistake, I have edited the question.

I’m obliged to do it that way, becuz the ‘A’ provider gives me great flexibilities and multiple numbers, while ‘B’ only gives one number. but you would ask why i need ‘B’ provider then? well for the sake of their own statistics system. as i really need to see what is going on my callcenter through their platform.

to be honest i didn’t even notice it as i was focused on my problem

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