Outbound route

Hi,

I ve 5 SIP trunks in my system and i want for each extension ring group to be able to call from a specific trunk or from all, also i need each extension to ve a specific call id and not getting from the trunk

What is the best way to do it ?

Setup 5 outbound routes or only one which will have all the SIP trunks ?

Thanks

Hi,

Do you ve any ideas how can i achieve this ?

Thanks

We don’t understand what you are trying to accomplish.

If each extension has its own caller ID (the called party sees the same number regardless of which trunk is used), why do you want to select a specific trunk? If the trunks have limited capacity and you only need to select one which is not busy, listing them all in one Outbound Route is simplest and should work fine.

It it matters which trunk is used (for example, because they are billed to different departments), please explain your situation in more detail.

What kind of trunks are these? Same or different providers?

Sorry for not giving too much info.

What i want to accomplish is each extension to 've its own caller id.

I dont ve any limitations on channels.

The problem is that it gets the trunk caller id regardless if ve configured specific caller-id for each extension.

This is Freepbx problem or it has something to do with the SIP provider ?

Yes

There are a few places that could be causing this:

  1. You have “override extension” set on the outbound trunk or route.
  2. You are not setting up specific trunks for your outbounds based on the 4th field in the Outbound Number Manipulator.
  3. Your provider may be overriding your Caller ID in the trunk configuration because they don’t allow foreign CID information.

You might also be running up against the problem that Asterisk has where it will use the first trunk available to a destination whenever it makes an outbound call.

A look in /var/log/asterisk/full should give you some more information about why the route is getting chosen and what CID is being used.

Please explain why/how you have five trunks. Many providers will only allow outbound caller ID from numbers associated with the trunk account, or which have been verified from the trunk account. If that’s your case, each extension will have to use the corresponding trunk. This can be done by having an Outbound Route for each trunk that matches the associated extension number(s). It is usually more flexible and convenient to have only one trunk with all your numbers, though people often do otherwise e.g. because they need separate billing, or the provider has a pricing policy where multiple trunks cost less.

It the above is not your issue, check that you are sending caller ID in the correct format and in the proper header. For example, depending on provider, a New York number may need to be sent as 2123456789, 12123456789 or +12123456789. If the wrong format is used, many providers will still accept the call, but use the main company number as caller ID. Nearly all providers will accept caller ID in the same format that they use to send you caller ID on an incoming call, so what you send out should match that format. Also, check an incoming call for a P-Asserted-Identity header or a Remote-Party-ID header. Send out the same header that they send you on incoming.

HI,

@cynjut what do you mean on 3 where can i find this outbound number manipulator

What exactly i ve to look in logs ?

Thanks

On the Outbound Route screen, you select the various outbound routes you are going to use. If you choose one of these, you will see a Dial Patterns tab. On that tab, you will find the Outbound Number manipulation box. This is the box where you change your phone numbers so that they meet the requirements of your trunks. The fourth field in that box is the “Caller ID” box. This allows you to match the caller ID for your extensions (along with the rest of fields) to determine if this Outbound Route is the correct one for your needs. Along with the rest of the requirements, match the Caller ID of your extensions to the field and this rule will be applied. If the Caller ID doesn’t match, the number is not manipulated.

My provider instead of one SIP trunk with 20 channels and 20 numbers, i 'll have to configure 20 SIP trunks for each number.

That’s why i am confused and i dont know how to configure caller id on extension level, because if the trunk caller id is always prefered than the extension then i want be able to select extension caller-id am I right ?

Here is some logs from a call although i ve set up caller-id in extension level it is always getting the trunk number

   το προ-διαμορφωμένο κείμενο να μπει σε εσοχή με 4 κενά

Asterisk 16.3.0, Copyright © 1999 - 2018, Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 16.3.0 currently running on freepbx (pid = 11889)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
== Extension Changed 735[ext-local] new state InUse for Notify User 701
== Extension Changed 735[ext-local] new state InUse for Notify User 711
== Extension Changed 735[ext-local] new state InUse for Notify User 704
== Extension Changed 735[ext-local] new state InUse for Notify User 705
– Executing [[email protected]:1] Macro(“SIP/735-000001a8”, “user-callerid,LIMIT”) in new stack
– Executing [[email protected]:1] Set(“SIP/735-000001a8”, “TOUCH_MONITOR=1564821796.561”) in new stack
– Executing [[email protected]:2] Set(“SIP/735-000001a8”, “AMPUSER=735”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/735-000001a8”, “0?report”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/735-000001a8”, “1?Set(REALCALLERIDNUM=735)”) in new stack
– Executing [[email protected]:5] Set(“SIP/735-000001a8”, “AMPUSER=735”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/735-000001a8”, “0?limit”) in new stack
– Executing [[email protected]:7] Set(“SIP/735-000001a8”, “AMPUSERCIDNAME=Antonis Ntaragiannis”) in new stack
– Executing [[email protected]:8] ExecIf(“SIP/735-000001a8”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
– Executing [[email protected]:9] GotoIf(“SIP/735-000001a8”, “0?report”) in new stack
– Executing [[email protected]:10] Set(“SIP/735-000001a8”, “AMPUSERCID=735”) in new stack
– Executing [[email protected]:11] Set(“SIP/735-000001a8”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [[email protected]:12] Set(“SIP/735-000001a8”, “CALLERID(all)=“Antonis Ntaragiannis” <735>”) in new stack
– Executing [[email protected]:13] GotoIf(“SIP/735-000001a8”, “0?limit”) in new stack
– Executing [[email protected]:14] ExecIf(“SIP/735-000001a8”, “1?Set(GROUP(concurrency_limit)=735)”) in new stack
– Executing [[email protected]:15] ExecIf(“SIP/735-000001a8”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [[email protected]:16] NoOp(“SIP/735-000001a8”, “Macro Depth is 1”) in new stack
– Executing [[email protected]:17] GotoIf(“SIP/735-000001a8”, “1?report2:macroerror”) in new stack
– Goto (macro-user-callerid,s,18)
– Executing [[email protected]:18] GotoIf(“SIP/735-000001a8”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,37)
– Executing [[email protected]:37] Set(“SIP/735-000001a8”, “CALLERID(number)=735”) in new stack
– Executing [[email protected]:38] Set(“SIP/735-000001a8”, “CALLERID(name)=Antonis Ntaragiannis”) in new stack
– Executing [[email protected]:39] GotoIf(“SIP/735-000001a8”, “0?cnum”) in new stack
– Executing [[email protected]:40] Set(“SIP/735-000001a8”, “CDR(cnam)=Antonis Ntaragiannis”) in new stack
– Executing [[email protected]:41] Set(“SIP/735-000001a8”, “CDR(cnum)=735”) in new stack
– Executing [[email protected]:42] Set(“SIP/735-000001a8”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:2] Set(“SIP/735-000001a8”, “ROUTEUSER=735”) in new stack
– Executing [[email protected]:3] Set(“SIP/735-000001a8”, “ROUTEUSER=735”) in new stack
– Executing [[email protected]:4] GotoIf(“SIP/735-000001a8”, “1?notblind”) in new stack
– Goto (from-internal,6979988513,7)
– Executing [[email protected]:7] GotoIf(“SIP/735-000001a8”, “1?restrictedroute-c4ca4238a0b923820dcc509a6f75849b,6979988513,2:outbound-allroutes,6979988513,2”) in new stack
– Goto (restrictedroute-c4ca4238a0b923820dcc509a6f75849b,6979988513,2)
– Executing [[email protected]estrictedroute-c4ca4238a0b923820dcc509a6f75849b:2] Gosub(“SIP/735-000001a8”, “sub-record-check,s,1(out,6979988513,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/735-000001a8”, “0?initialized”) in new stack
– Executing [[email protected]:2] Set(“SIP/735-000001a8”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:3] Set(“SIP/735-000001a8”, “NOW=1564821796”) in new stack
– Executing [[email protected]:4] Set(“SIP/735-000001a8”, “__DAY=03”) in new stack
– Executing [[email protected]:5] Set(“SIP/735-000001a8”, “__MONTH=08”) in new stack
– Executing [[email protected]:6] Set(“SIP/735-000001a8”, “__YEAR=2019”) in new stack
– Executing [[email protected]:7] Set(“SIP/735-000001a8”, “__TIMESTR=20190803-114316”) in new stack
– Executing [[email protected]:8] Set(“SIP/735-000001a8”, “__FROMEXTEN=735”) in new stack
– Executing [[email protected]:9] Set(“SIP/735-000001a8”, “__MON_FMT=wav”) in new stack
– Executing [[email protected]:10] NoOp(“SIP/735-000001a8”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“SIP/735-000001a8”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“SIP/735-000001a8”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“SIP/735-000001a8”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“SIP/735-000001a8”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“SIP/735-000001a8”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [[email protected]:1] NoOp(“SIP/735-000001a8”, “Outbound Recording Check from 735 to 6979988513”) in new stack
– Executing [[email protected]:2] Set(“SIP/735-000001a8”, “RECMODE=dontcare”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/735-000001a8”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [[email protected]:7] Gosub(“SIP/735-000001a8”, “recordcheck,1(dontcare,out,6979988513)”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/735-000001a8”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“SIP/735-000001a8”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“SIP/735-000001a8”, “”) in new stack
– Executing [[email protected]:8] Return(“SIP/735-000001a8”, “”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/735-000001a8”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [[email protected]:4] Set(“SIP/735-000001a8”, “MOHCLASS=default”) in new stack
– Executing [[email protected]:5] Set(“SIP/735-000001a8”, “_NODEST=”) in new stack
– Executing [[email protected]:6] Macro(“SIP/735-000001a8”, “dialout-trunk,2,6979988513,off”) in new stack
– Executing [[email protected]:1] Set(“SIP/735-000001a8”, “DIAL_TRUNK=2”) in new stack
– Executing [[email protected]:2] UserEvent(“SIP/735-000001a8”, “zulu-outbound-call,from:735,to:6979988513”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/735-000001a8”, “0?Set(DIAL_OPTIONS=tr)”) in new stack
– Executing [[email protected]:4] GosubIf(“SIP/735-000001a8”, “0?sub-pincheck,s,1()”) in new stack
– Executing [[email protected]:5] ExecIf(“SIP/735-000001a8”, “0?Set(CALLERID(num)=735)”) in new stack
– Executing [[email protected]:6] GotoIf(“SIP/735-000001a8”, “0?disabletrunk,1”) in new stack
– Executing [[email protected]:7] Set(“SIP/735-000001a8”, “DIAL_NUMBER=6979988513”) in new stack
– Executing [[email protected]:8] Set(“SIP/735-000001a8”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [[email protected]:9] Set(“SIP/735-000001a8”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [[email protected]:10] Set(“SIP/735-000001a8”, “DIAL_TRUNK_OPTIONS=T”) in new stack
– Executing [[email protected]:11] GotoIf(“SIP/735-000001a8”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,13)
– Executing [[email protected]:13] GotoIf(“SIP/735-000001a8”, “0?skipoutcid”) in new stack
– Executing [[email protected]:14] Macro(“SIP/735-000001a8”, “outbound-callerid,2”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/735-000001a8”, “735”) in new stack
– Executing [[email protected]:2] NoOp(“SIP/735-000001a8”, “”) in new stack
– Executing [[email protected]:3] NoOp(“SIP/735-000001a8”, “off”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/735-000001a8”, “0?Set(CALLERPRES(name-pres)=)”) in new stack
– Executing [[email protected]:5] ExecIf(“SIP/735-000001a8”, “0?Set(CALLERPRES(num-pres)=)”) in new stack
– Executing [[email protected]:6] ExecIf(“SIP/735-000001a8”, “0?Set(REALCALLERIDNUM=735)”) in new stack
– Executing [[email protected]:7] ExecIf(“SIP/735-000001a8”, “0?Set(AMPUSER=735)”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/735-000001a8”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [[email protected]:12] Set(“SIP/735-000001a8”, “USEROUTCID=“Antonis Ntaragiannis”<+302351100637>”) in new stack
– Executing [[email protected]:13] Set(“SIP/735-000001a8”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:14] Set(“SIP/735-000001a8”, “TRUNKOUTCID=”) in new stack
– Executing [[email protected]:15] GotoIf(“SIP/735-000001a8”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,21)
– Executing [[email protected]:21] ExecIf(“SIP/735-000001a8”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:22] ExecIf(“SIP/735-000001a8”, “1?Set(CALLERID(all)=“Antonis Ntaragiannis”<+302351100637>)”) in new stack
– Executing [[email protected]:23] ExecIf(“SIP/735-000001a8”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:24] ExecIf(“SIP/735-000001a8”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack
– Executing [[email protected]:25] ExecIf(“SIP/735-000001a8”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack
– Executing [[email protected]:26] Set(“SIP/735-000001a8”, “CDR(outbound_cnum)=+302351100637”) in new stack
– Executing [[email protected]:27] Set(“SIP/735-000001a8”, “CDR(outbound_cnam)=Antonis Ntaragiannis”) in new stack
– Executing [[email protected]:15] GosubIf(“SIP/735-000001a8”, “0?sub-flp-2,s,1()”) in new stack
– Executing [[email protected]:16] Set(“SIP/735-000001a8”, “OUTNUM=6979988513”) in new stack
– Executing [[email protected]:17] Set(“SIP/735-000001a8”, “custom=DAHDI/g0”) in new stack
– Executing [[email protected]:18] ExecIf(“SIP/735-000001a8”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)”) in new stack
– Executing [[email protected]:19] ExecIf(“SIP/735-000001a8”, “0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))”) in new stack
– Executing [[email protected]:20] Macro(“SIP/735-000001a8”, “dialout-trunk-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“SIP/735-000001a8”, “”) in new stack
– Executing [[email protected]:21] GotoIf(“SIP/735-000001a8”, “0?skipcrm”) in new stack
– Executing [[email protected]:22] Set(“SIP/735-000001a8”, “__CRM_DIRECTION=OUTBOUND”) in new stack
– Executing [[email protected]:23] Set(“SIP/735-000001a8”, “__CRM_DESTINATION=6979988513”) in new stack
– Executing [[email protected]:24] Set(“SIP/735-000001a8”, “__CRM_SOURCE=735”) in new stack
– Executing [[email protected]:25] AGI(“SIP/735-000001a8”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <SIP/735-000001a8>AGI Script sangomacrm.agi completed, returning 0
– Executing [[email protected]:26] Set(“SIP/735-000001a8”, “CHANNEL(hangup_handler_push)=crm-hangup,s,1”) in new stack
– Executing [[email protected]:27] NoOp(“SIP/735-000001a8”, “CRM Finished”) in new stack
– Executing [[email protected]:28] GotoIf(“SIP/735-000001a8”, “0?bypass,1”) in new stack
– Executing [[email protected]:29] ExecIf(“SIP/735-000001a8”, “1?Set(CONNECTEDLINE(num,i)=6979988513)”) in new stack
– Executing [[email protected]:30] ExecIf(“SIP/735-000001a8”, “1?Set(CONNECTEDLINE(name,i)=CID:+302351100637)”) in new stack
– Executing [[email protected]:31] ExecIf(“SIP/735-000001a8”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)+302351100637)”) in new stack
– Executing [[email protected]:32] GotoIf(“SIP/735-000001a8”, “0?customtrunk”) in new stack
– Executing [[email protected]:33] Dial(“SIP/735-000001a8”, “DAHDI/g0/6979988513,300,Tb(func-apply-sipheaders^s^1,(2))”) in new stack
– DAHDI/i1/6979988513-7d Internal Gosub(func-apply-sipheaders,s,1(2)) start
– Executing [[email protected]:1] ExecIf(“DAHDI/i1/6979988513-7d”, “0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)”) in new stack
– Executing [[email protected]:2] NoOp(“DAHDI/i1/6979988513-7d”, “Applying SIP Headers to channel DAHDI/i1/6979988513-7d”) in new stack
– Executing [[email protected]:3] Set(“DAHDI/i1/6979988513-7d”, “TECH=DAHDI”) in new stack
– Executing [[email protected]:4] Set(“DAHDI/i1/6979988513-7d”, “SIPHEADERKEYS=”) in new stack
– Executing [[email protected]:5] While(“DAHDI/i1/6979988513-7d”, “0”) in new stack
– Jumping to priority 10
– Executing [[email protected]:11] Return(“DAHDI/i1/6979988513-7d”, “”) in new stack
== Spawn extension (from-digital, 6979988513, 1) exited non-zero on ‘DAHDI/i1/6979988513-7d’
– DAHDI/i1/6979988513-7d Internal Gosub(func-apply-sipheaders,s,1(2)) complete GOSUB_RETVAL=
– Requested transfer capability: 0x00 - SPEECH
– Called DAHDI/g0/6979988513
– DAHDI/i1/6979988513-7d is proceeding passing it to SIP/735-000001a8
– DAHDI/i1/6979988513-7d is making progress passing it to SIP/735-000001a8
– DAHDI/i1/6979988513-7d is ringing
== Extension Changed 735[ext-local] new state Idle for Notify User 701
== Extension Changed 735[ext-local] new state Idle for Notify User 711
== Extension Changed 735[ext-local] new state Idle for Notify User 704
– Hungup ‘DAHDI/i1/6979988513-7d’
== Extension Changed 735[ext-local] new state Idle for Notify User 705
== Spawn extension (macro-dialout-trunk, s, 33) exited non-zero on ‘SIP/735-000001a8’ in macro ‘dialout-trunk’
== Spawn extension (restrictedroute-c4ca4238a0b923820dcc509a6f75849b, 6979988513, 6) exited non-zero on ‘SIP/735-000001a8’
– Executing [[email protected]:1] Hangup(“SIP/735-000001a8”, “”) in new stack
== Spawn extension (restrictedroute-c4ca4238a0b923820dcc509a6f75849b, h, 1) exited non-zero on ‘SIP/735-000001a8’
– SIP/735-000001a8 Internal Gosub(crm-hangup,s,1) start
– Executing [[email protected]:1] NoOp(“SIP/735-000001a8”, “Sending Hangup to CRM”) in new stack
– Executing [[email protected]:2] NoOp(“SIP/735-000001a8”, “HANGUP CAUSE: 16”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/735-000001a8”, “0?Set(__CRM_VOICEMAIL=)”) in new stack
– Executing [[email protected]:4] NoOp(“SIP/735-000001a8”, “MASTER CHANNEL: 1564821796.561 = 1564821796.561”) in new stack
– Executing [[email protected]:5] GotoIf(“SIP/735-000001a8”, “0?return”) in new stack
– Executing [[email protected]:6] Set(“SIP/735-000001a8”, “__CRM_HANGUP=1”) in new stack
– Executing [[email protected]:7] AGI(“SIP/735-000001a8”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <SIP/735-000001a8>AGI Script sangomacrm.agi completed, returning 0
– Executing [[email protected]:8] Return(“SIP/735-000001a8”, “”) in new stack
== Spawn extension (restrictedroute-c4ca4238a0b923820dcc509a6f75849b, h, 1) exited non-zero on ‘SIP/735-000001a8’
– SIP/735-000001a8 Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
freepbx*CLI>

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