Deskphone with multiple extensions


i have tried to get this problem solved in other asterisk forums so fare, so i hope there is one person that might be the help i need

My setup is

Trunk A that have inbound route with no. 12121212 that goes in to Queue A + have outbound route A with same number in outbound CID
Trunk B that have inbound route with no. 13131313 that goes in to Queue B + have outbound route B with same number in outbound CID
*Note i the future I will have more trunks that would have more then one number on

chan_sip extention:
Ext. 12011(account 1) are agent in Queue A
Ext. 12012(account 2) are agent in Queue B

In my EndPoint manager i have made a template that set Line 01 to account 1 and Line 02 to account 2.
and line03 to speedial *45 account 01 så ext 12011 log in/out to queue A and line04 to speeddial *45, account 2 so that log in/out in queue B for ext 12012

Under Ext. 12011 i have set Outbound CID to mactch Trunk A number and on 12012 to macth trunk B number

Both outbound dial pattern are set thise valus under matching values

How do I make my set up when i activate line 01 so it use trunk A and when i activete line 02 it use trunk B

Old setup
In my old set up have made a 1* and 2* prefix in outbound to tricker the diffrent outbounds. but when i want to make redails i cant get out as the number in the desk phone dosent have 1* or 2* in front of it.

Endpoint manager, trunk and route are not Asterisk concepts. Trunk and route, at least are used by FreePBX. Peer support for FreePBX can be obtained from

I know, but there is no one at community that have responded to my post on this matter

create different contexts and set your endpoints to use those contexts.



exten => _nxxnxxxxxx,1,Set(CALLERID(NUM)=12121212)
same => n,Dial(PJSIP/TrunkA/${EXTEN})

exten => _nxxnxxxxxx,1,Set(CALLERID(NUM)=13131313)
same => n,Dial(PJSIP/TrunkB/${EXTEN})

Thx, and where do i add this lines?

You’d add them to your extensions.conf and pjsip.conf

Those lines are only examples to lead you in the right direction.

Here is a document describing how to configure res_pjsip

And one for your dialplan

I got the problem solved after i changed the ext. to PJSIP account. every thing works very fine