Raspbx wrong trunk on outbound with multiple disjunct numbers and corresponding extensions

Hi All,

I’m new to Asterisk, running FreePBX with Asterisk 13.15.0 on raspberry. I hope You might give me a push to solve my problem.

I have several disjunct numbers and corresponding inbound /outbound routes mapped to extensions like
01234 5678 > ext 10
01234 6789 > ext 11
When dialing out on ext 10 call reaches recpient with 01234 5678 displayed.
Dialing with ext 11, the display number is the same, but I want it to be 01234 6789.

I have defined two separate trunks and two separate outbound routes, each pointing to “their” trunk. Extensions are mapped via inbound CID, which works ok, but I can’t find a way for outbound mapping.
What I found in wikis and forums is all about one number only or about trunk number with DID extensions (not sure if this a goog translation).

Since it’s a little confusing to me, viewing conf files and matching them to freepbx gui, I used sql for displaying some basic settings:

mysql> select r.route_id, r.`name`, r.outcid ,
    ->        rts.trunk_id, rts.seq,
    ->        t.`name`, t.outcid, t.channelid, t.usercontext, t.disabled,
    ->        if(t.disabled="off", "is online", "is offline") as TrunkState
    ->   from outbound_routes r
    ->   join outbound_route_trunks rts on r.route_id = rts.route_id
    ->   join trunks t on rts.trunk_id = t.trunkid
    ->  where r.route_id !=1
    ->  order by r.route_id, rts.seq;
| route_id | name         | outcid        | trunk_id | seq | name            | outcid      | channelid      | usercontext | disabled | TrunkState |
|        2 | Amt 5678     | 5678          |        3 |   0 | 5678DTAG_SIP    | 012345678   | 012345678OUT   | 012345678   | off      | is online  |
|        3 | Amt 6789     | 6789          |        1 |   0 | 6789DTAG_SIP    | 012346789   | 012346789OUT   | 012346789   | off      | is online  |
2 rows in set (0.00 sec)

Off course I would provide config files or logs, if I’m getting told so.

I appriciate any hint!
Thanks in advance.

In general, you should ask FreePBX people how to configure FreePBX, however, your problem here is likely to be the ITSP identifies you via your IP address, so is unable to distinguish between the accounts, and also does not allow you to specify your own caller ID.

It is also possible that they do accept caller ID but you are not specifying it in a form that the ITSP recognizes.

Thank You david551!
Well, I thought selecting this forum is better choice, since here is the best knowledge about asterisk itself. I’m afraid I didn’t understand some basic concepts and these come from asterisk, right? Hopefully later on I’ll find the right place in FreePbx to change configuration.

‘Identification by IP’ how would I know from logfiles?
What seems contradictory to me: I can change order of outbound routes (route sequence) and then behaviour/displayed numbers get reversed. Independent from caller, the other number gets displayed. This behaviour looks like an outbound priority to me, which isn’t intended to solve my problem, but at least it shows that ITSP could handle/identify different trunks.
And You are right, I have to check correct format of CID (also it should be just the plain number itself).
Anyway if CID would be accepted, I could use a single trunk and control displayed number by extensions CID setting. Is that correct?

You need the ITSP’s log files.

What seems contradictory to me: I can change order of outbound routes (route sequence) and then

Outbound routes are an abstraction created by FreePBX.

Thanks david551

Your answers don’t look promising.
Greetings to the community and goodbye!