ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Setting up FreePBX to send a X-Tenant SIP header for Skyetel Tenant tracking

    Scheduled Pinned Locked Moved IT Discussion
    skyetelfreepbxtenantbilling
    14 Posts 5 Posters 2.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JaredBuschJ
      JaredBusch
      last edited by JaredBusch

      I used ExecIf for the outbound route logic because using GotoIf would be more lines of code getting written. But GotoIf would actually process fewer lines of code if you have more ExecIf than a few. It was a conscious decision/trade off.

      This is the logic for GotoIf instead.

      ; Change it if the call is on a Cape, Jeff City, or Quincy outbound route.
      exten => s,n,GotoIf($["${OUTBOUND_ROUTE_NAME:0:4}"=="Cape"]?tenant_cape)
      exten => s,n,GotoIf($["${OUTBOUND_ROUTE_NAME:0:9}"=="Jeff City"]?tenant_jeffcity)
      exten => s,n,GotoIf($["${OUTBOUND_ROUTE_NAME:0:6}"=="Quincy"]?tenant_quincy))
      ; Nothing match goto set_tenant
      exten => s,n,Goto(set_tenant)
      exten => s,n(tenant_cape),Set(x_tenant=tenant.cape)
      exten => s,n,Goto(set_tenant)
      exten => s,n(tenant_jeffcity),Set(x_tenant=tenant.jeffcity)
      exten => s,n,Goto(set_tenant)
      exten => s,n(tenant_quincy),Set(x_tenant=tenant.quincy)
      exten => s,n,Goto(set_tenant)
      exten => s,n(set_tenant),NoOp(Based on the outbound route name of ${OUTBOUND_ROUTE_NAME}, the X-Tenant is being set to ${x_tenant}.)
      exten => s,n,GoSub(func-set-sipheader,s,1(X-Tenant,${x_tenant}))
      exten => s,n(exit_macro),MacroExit()
      

      So ExecIf executes all three ExecIf statements, and if one is true, one of the Set statements. So always 3 and sometimes 4 operations everytime a call is placed.

      With the GotoIf it can execute 3 checks, then a Goto if nothing matches.
      Or 1 check, a gotoif, a set, and a goto for 4 operations. Both of these were 4 operations.
      If the second gotoif kicks, it means 5 total operations, and 6 total operations if the third one is applied.

      So if you apply the GotoIf logically based on how often they are called, with the most used ones at the beginning of the logic flow, you can drastically reduce the number of calls compared to ExecIfif there are a lot of routes.

      1 Reply Last reply Reply Quote 1
      • JaredBuschJ
        JaredBusch
        last edited by

        Also, it was my assumption that @Skyetel tracks all inbound and outbound if you choose to associate the endpoint group to a Tenant. The documenation was unclear.

        This is all still decently early in release for them though, so no complaints about documentation from me. Mine is far worse.

        1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch
          last edited by

          This is fully working now. I tested calls and saw all of the correct X-Tenant headers in the outbound INVITE messages
          2fa7d200-a790-4d42-bda6-e26628f30c19-image.png

          Outbound routing changed as of now, to give a short time of low call volume as a pseudo test.

          1 Reply Last reply Reply Quote 0
          • FATeknollogeeF
            FATeknollogee
            last edited by FATeknollogee

            Not trying to threadjack.
            Just an fyi, in FusionPBX, this is included by default.

            JaredBuschJ 1 Reply Last reply Reply Quote -1
            • AdamFA
              AdamF
              last edited by

              @JaredBusch nice! What tool are you using in that screenshot to look at call flow?

              FATeknollogeeF 1 Reply Last reply Reply Quote 0
              • FATeknollogeeF
                FATeknollogee @AdamF
                last edited by FATeknollogee

                @fuznutz04 said in Setting up FreePBX to send a X-Tenant SIP header for Skyetel Tenant tracking:

                @JaredBusch nice! What tool are you using in that screenshot to look at call flow?

                sngrep https://github.com/irontec/sngrep

                AdamFA 1 Reply Last reply Reply Quote 0
                • AdamFA
                  AdamF @FATeknollogee
                  last edited by

                  @FATeknollogee Thanks!

                  JaredBuschJ 1 Reply Last reply Reply Quote 0
                  • JaredBuschJ
                    JaredBusch @FATeknollogee
                    last edited by

                    @FATeknollogee said in Setting up FreePBX to send a X-Tenant SIP header for Skyetel Tenant tracking:

                    Not trying to threadjack.
                    Just an fyi, in FusionPBX, this is included by default.

                    That has nothing to do with anything as the thread was specifically about setting up FreePBX.

                    FusionPBX is not ever Asterisk based so nothing especially matters about what works in that.

                    1 Reply Last reply Reply Quote 0
                    • JaredBuschJ
                      JaredBusch @AdamF
                      last edited by

                      @fuznutz04 said in Setting up FreePBX to send a X-Tenant SIP header for Skyetel Tenant tracking:

                      @FATeknollogee Thanks!

                      Sangoma has included it by default since FreePBX 14. It was available via yum in FreePBX 13.

                      1 Reply Last reply Reply Quote 1
                      • JaredBuschJ
                        JaredBusch
                        last edited by

                        All outbound calls were routed out to @Skyetel for the entire day.

                        Users were completely unaware of any changes. This is how things are supposed to work.

                        535 minutes used.
                        61852163-fe13-44c9-94a3-b99ec02c0842-image.png

                        Only 5 simultaneous channels.
                        c987f00a-2f56-45d6-8b22-455a3bdc33bd-image.png

                        scottalanmillerS 1 Reply Last reply Reply Quote 1
                        • scottalanmillerS
                          scottalanmiller @JaredBusch
                          last edited by

                          @JaredBusch we did a port over to Skyetel for a busy utility today, too.

                          1 Reply Last reply Reply Quote 0
                          • C
                            cdbrush
                            last edited by

                            This is great. Thanks.

                            What is this significance to the numbers within the "{OUTBOUND_ROUTE_NAME:0:4}" preceding the route name?

                            JaredBuschJ 1 Reply Last reply Reply Quote 1
                            • JaredBuschJ
                              JaredBusch @cdbrush
                              last edited by

                              @cdbrush said in Setting up FreePBX to send a X-Tenant SIP header for Skyetel Tenant tracking:

                              This is great. Thanks.

                              What is this significance to the numbers within the "{OUTBOUND_ROUTE_NAME:0:4}" preceding the route name?

                              That’s a substring. Look at the route name, starting at character zero and going for 4 characters.

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post