1. Bicom Systems
  2. Solution home
  3. PBXware
  4. HOWTOs

General:: HOWTO Multiuser Extension - 'Register' method

Purpose of Multi User extension

    

    Multi User extension is a term we use to distinguish regular extensions and trunking services. Although we all are familiar with Trunks on PBXware and what their purpose is, for some of us it is not clear enough what exactly Multi User extension is and why it is being used if we have regular trunks available. Main purpose of the Multi User extension is providing a trunking service. It allows connecting remote, asterisk based systems (via trunk) to PBXware (via Multi User extension) in order to make and/or receive calls. On the remote side (in our example, we will use FreePBX) we will have an SIP extension that can make or receive calls. There will also be a trunk through which the extension will send or receive calls. For regular users, that is the whole story. As far as the person knows, he/she is a dialing number and it goes out through the trunk to the end user (the person whose number was dialed). However, there is more to it, such as, the call gets routed through another asterisk system (in our case PBXware) and then goes out through the regular trunk. Main purpose of this setup is money saving. Let me explain that. Imagine a reseller who is responsible for many asterisk based systems. For each one of them, he needs to provide trunking service (Voipinnovations, Telnyx, etc), which means each system needs to have a trunk. If we put a PBXware system in between, we are allowing all remote systems to connect to one PBXware system (each remote asterisk-based system will have a dedicated Multi User extension). On that single PBXware system with multiple Multi User extensions, we can have one trunk through which we can send all calls through all asterisk based systems.


Authentication methods

Before creating this kind of setup, Multi User is a feature in the PBXware license, so an Administrator who wishes to use it, has to contact Account Manager to enable it in the License. Once we have that enabled we can now consider which authentication method will work the best for us.

Two authentication methods can be used for a Multi User extension:

1. Registration Method

2. IP Authentication Method

Please note that not all asterisk-based platforms support both methods, so we need to choose a proper authentication method.


Registration Method Troubleshooting


This method uses the extension's username and secret for authentication with remote trunk. Following section described how that works and what are potential problems.



REGISTER and OPTIONS packets

On the PBXware side, the first thing we need to do is to create an extension. It will be a regular extension with a Username and Secret set, as per screenshot below:




Username: 200100 (extension 100 on tenant 200)

Secret: 63Z-eqV-%e2EvCeh


After we create extension, we can check pjsip.conf file in order to see how does extension looks like in backend (how it looks like when registration method based on username and secret looks like):

localhost ~ # cat /opt/pbxware/pw/etc/asterisk/200/pjsip.conf

; Automatically generated

[200100](endpoint-tpl,endpoint-user-tpl)

type=endpoint

aors=200100

accountcode=100

subscribe_context=t-200

moh_suggest=default

notify_early_inuse_ringing=yes

refer_blind_progress=yes

auth=200100-auth

outbound_auth=200100-auth

direct_media=no

force_rport=yes

rtp_symmetric=yes

rewrite_contact=yes

dtmf_mode=rfc4733

context=t-200

trust_id_inbound=yes

send_rpid=yes

mailboxes=100@t-200

allow=ulaw,alaw,g729

[200100](aor-tpl)

type=aor

qualify_frequency=60

qualify_timeout=8

[200100-auth]

type=auth

auth_type=userpass

username=200100

password=63Z-eqV-%e2EvCeh

Now, we need to create a trunk on a Third Party Asterisk based system (in our case FreePBX).

Trunk should have following settings:




As you can see we entered Username and Secret as well as the IP address of the PBXware system. Do not get confused with entering an IP address here. We can enter it here since the IP address of PBXware will most likely remain the same and the Third Party system needs to know where to send REGISTER packets. Now that we have Multi User extension created on PBXware side and we have trunk created on Remote PBX system, let’s see how REGISTER looks like on PBXware side:



Let’s break into pieces this REGISTER packets:

192.168.1.17 is an IP address of Remote system (trunk)

192.168.1.13 is an IP address of a PBXware system (where Multi User extension is)


Initial REGISTER request sent from trunk:


2022/05/14 16:19:38.569094 192.168.1.17:5060 -> 192.168.1.13:5060

REGISTER sip:192.168.1.13 SIP/2.0

Via: SIP/2.0/UDP

192.168.1.17:5060;rport;branch=z9hG4bKPj36ec52d8-2d19-4d60-bca9-7ebc303dc68e

From:<sip:200100@192.168.1.13>;tag=5a95a51a-23fb-4edb-ab6d-6dbc1fec512

To: <sip:200100@192.168.1.13>

Call-ID: 96786137-b6d0-45c7-80ea-d50bd8377448

CSeq: 20313 REGISTER

Contact: <sip:s@192.168.1.17:5060;line=dnzaaif>

Expires: 3600

Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL,

UPDATE, PRACK, MESSAGE, REFER

Max-Forwards: 70

User-Agent: FPBX-15.0.17.34(16.17.0)

Content-Length: 0

PBXware sends its regular 401 Unauthorized requesting for authentication:


2022/05/14 16:19:38.571344 192.168.1.13:5060 -> 192.168.1.17:5060

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP

192.168.1.17:5060;rport=5060;received=192.168.1.17;branch=z9hG4bKPj36ec52d8-2d19-4d60

-bca9-7ebc303dc68e

Call-ID: 96786137-b6d0-45c7-80ea-d50bd8377448

From: <sip:200100@192.168.1.13>;tag=5a95a51a-23fb-4edb-ab6d-6dbc1fec5127

To: <sip:200100@192.168.1.13>;tag=z9hG4bKPj36ec52d8-2d19-4d60-bca9-7ebc303dc68e

CSeq: 20313 REGISTER

WWW-Authenticate: Digest

realm="asterisk",nonce="1652537978/084a7152556e018fffc01084be7224e7",opaque="1db

8ace3609ee4f4",algorithm=md5,qop="auth"

Server: Asterisk

Content-Length: 0

Now PBXware system gets REGISTER with digest:


82022/05/14 16:19:38.585084 192.168.1.17:5060 -> 192.168.1.13:5060

REGISTER sip:192.168.1.13 SIP/2.0

Via: SIP/2.0/UDP

192.168.1.17:5060;rport;branch=z9hG4bKPj027154f9-c55d-44ee-9d3c-7cbf6656ee73

From:<sip:200100@192.168.1.13>;tag=5a95a51a-23fb-4edb-ab6d-6dbc1fec512

To: <sip:200100@192.168.1.13>

Call-ID: 96786137-b6d0-45c7-80ea-d50bd8377448

CSeq: 20314 REGISTER

Contact: <sip:s@192.168.1.17:5060;line=dnzaaif>

Expires: 3600

Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL,

UPDATE, PRACK, MESSAGE, REFER

Max-Forwards: 70

User-Agent: FPBX-15.0.17.34(16.17.0)

Authorization: Digest username="200100", realm="asterisk",

nonce="1652537978/084a7152556e018fffc01084be7224e7", uri="sip:192.168.1.13",

response="8df7152b79af4d1b2875ccadf1bb797b", algorithm=md5, cnonce="818f2d9

f9546949f0848d9395dbb71", opaque="1db8ace3609ee4f4", qop=auth, nc=00000001

Content-Length: 0

And finally PBXware responds with 200 OK:


2022/05/14 16:19:38.616161 192.168.1.13:5060 -> 192.168.1.17:5060

SIP/2.0 200 OK

Via: SIP/2.0/UDP

192.168.1.17:5060;rport=5060;received=192.168.1.17;branch=z9hG4bKPj027154f9-c55d-44ee-

9d3c-7cbf6656ee73

Call-ID: 96786137-b6d0-45c7-80ea-d50bd8377448

From:<sip:200100@192.168.1.13>;tag=5a95a51a-23fb-4edb-ab6d-6dbc1fec512

To:<sip:200100@192.168.1.13>;tag=z9hG4bKPj027154f9-c55d-44ee-9d3c-7cbf6656ee73

CSeq: 20314 REGISTER

Date: Sat, 14 May 2022 14:19:38 GMT

Contact: <sip:s@192.168.1.17:5060;line=dnzaaif>;expires=3599

Expires: 3600

Server: Asterisk

Content-Length: 0

Now, let’s check OPTIONS packets from/to the PBXware system:


OPTIONS packet from PBXware (multi user extension) to Remote system (trunk) looks like:


Let’s see the content:




Remote system (trunk) sends 200 OK with content:



Now let’s see how does OPTIONS packet look when sent from remote asterisk (FreePBX) and what does PBXware responds:





As we can see PBXware responds with 403 Forbidden, but why?

In order to determine that, we need to check the OPTIONS packet closer:



Here we can see that From and To do not match. The remote side is sending Trunk’s name in From header instead of the Username.

We can fix that by defining From User on the trunk’s side:




Now PBXware receives proper OPTIONS:





Let’s look at this OPTIONS closer:






Now we can see that proper data is sent in the From header as well as in Contact header.


Registration method - requirements


With this authentication method we need to be aware of the “From User” field that needs to be defined on the trunk's side.

“From User” needs to be filled in with a number of multi user extension from the PBXware system. To summarize, basically there are two reasons why this method might fail. One is missing “From User” and the second one that is actually very common and that is entering wrong secret. Please note that User Password is not something you will be entering under trunk’s settings, it is always secret and make sure you paste it properly.


Registration method - outgoing calls


In this section we will analyze calls made by SIP extension from remote system through Multi User extension.

Requirements for test call:

  • SIP extension registered on third party system
  • Trunk on remote side that is using registration method to register on Multi User
  • extension on PBXware
  • Multi User extension on PBXware
  • Trunk for routing outgoing/outbound calls

Let’s say we created and registered extension 101 on Remote system. Extension 101 will call number 12345678912 and call should be routed through multi user extension. Name of the multi user extension on PBXware system for this testing purpose is named Multi User and has username 200100. Extension 101 calls 12345678912

In asterisk CLI on the PBXware system we can see similar output:


== Setting global variable 'SIPDOMAIN' to '192.168.1.13'

== Using SIP RTP Audio TOS bits 184

== Using SIP RTP Audio TOS bits 184 in TCLASS field.

-- Executing [12345678912@t-200:1] AGI("PJSIP/200100-00000001", "agi://127.0.0.1") in

new stack

-- AGI Script Executing Application: (UserEvent) Options: (AGICallStarted,Call-ID:

b3128451-0b39-4a30-9bd9-a310819f51a8)

== agi://127.0.0.1: [1652539903.1] Found tenant '200' ...

== agi://127.0.0.1: [1652539903.1] Found context 'default' ...

-- AGI Script Executing Application: (UserEvent) Options: (AGISetTenant,Uniqueid:

1652539903.1,Tenant: 200)

-- AGI Script Executing Application: (Set) Options: (CHANNEL(musicclass)=m-200)

== agi://127.0.0.1: [1652539903.1] Detected accountcode '100' ...

== agi://127.0.0.1: [1652539903.1] '12345678912' is not in DID database, continuing ...

== agi://127.0.0.1: [1652539903.1] Set limit - 8

== agi://127.0.0.1: [1652539903.1] Limit not exceeded (1 < 8) for localextensions

== agi://127.0.0.1: [1652539903.1] Set limit - 1

== agi://127.0.0.1: [1652539903.1] Limit not exceeded (1 < 1) for 100_out

== agi://127.0.0.1: [1652539903.1] Starting 'Special Routes' detection ...

== agi://127.0.0.1: [1652539903.1] No 'Special Routes' detected ...

== agi://127.0.0.1: [1652539903.1] Simple Routing mode is enabled ...

== agi://127.0.0.1: [1652539903.1] Checking for 'Other Network' prefix ...

== agi://127.0.0.1: [1652539903.1] Other network thru Single Digit mode is turned off ...

== agi://127.0.0.1: [1652539903.1] Detecting destination for '12345678912' ...

== agi://127.0.0.1: [1652539903.1] Looking for range in Simple Routing table ...

== agi://127.0.0.1: [1652539903.1] Destination not found ... Aborting

> 0x7fbc01653000 -- Strict RTP learning after remote address set to: 192.168.1.17:18140

> 0x7fbc01653000 -- Strict RTP switching to RTP target address 192.168.1.17:18140 as

source

== agi://127.0.0.1: [1652539903.1] Playing macro 'destination_not_recognized' ...

-- AGI Script Executing Application: (wait) Options: (1)

-- <PJSIP/200100-00000001> Playing 'destination_not_recognized.gsm' (escape_digits=)

(sample_offset 0) (language 'en')

13> 0x7fbc01653000 -- Strict RTP learning complete - Locking on source address

192.168.1.17:18140

-- <PJSIP/200100-00000001>AGI Script agi://127.0.0.1 completed, returning 0

-- Auto fallthrough, channel 'PJSIP/200100-00000001' status is 'UNKNOWN



Call in SNGREP looks like:



Call in Reports page of PBXware system looks like:




Here we have two problems. One is obvious and can be solved by adding a new route or updating existing one on PBXware side, second one is caller id. When we fixed destinations and we make new call, we have following situation:



From remote side (third party PBX system- FreePBX) we receive:


2022/05/14 17:09:54.264423 192.168.1.17:5060 -> 192.168.1.13:5060
INVITE sip:12345678912@192.168.1.13 SIP/2.0
Via: SIP/2.0/UDP
192.168.1.17:5060;rport;branch=z9hG4bKPj0482e62b-fd64-4264-8766-11acdb2dec0a
From: <sip:200100@192.168.1.17>;tag=a7e3baea-ddd5-4bb9-aec3-9c0a2f206828
To: <sip:12345678912@192.168.1.13>
Contact: <sip:200100@192.168.1.17:5060>
Call-ID: 995b84cc-1bc5-479f-8d0a-acc4c389d125
CSeq: 23042 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL,
UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: FPBX-15.0.17.34(16.17.0)
Authorization: Digest username="200100", realm="asterisk",
nonce="1652540994/e03317ab58130e728adc0725ea89af9b",
uri="sip:12345678912@192.168.1.13", response="7e929e37ddf11bc34b698ef88688cf4d",
algorithm=md5, cno
e="3997b0d12a7747ba8aa5a9c7b5d6a24d", opaque="08f5a9f94b6f8ff8", qop=auth,
nc=00000001
Content-Type: application/sdp
Content-Length: 339
v=0
o=- 1078401409 1078401409 IN IP4 192.168.1.17
s=Asterisk
c=IN IP4 192.168.1.17
t=0 0
m=audio 11342 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv



This is what PBXware using Multi User extension outside:




2022/05/14 17:09:54.323307 192.168.1.13:5060 -> 192.168.1.12:5060
INVITE sip:12345678912@192.168.1.12:5060 SIP/2.0
Via: SIP/2.0/UDP
192.168.1.13:5060;rport;branch=z9hG4bKPjec5b23bf-609d-4e6c-bb62-269b799862bf
From: "Multi User" <sip:100@192.168.1.13>;tag=14812c84-3feb-408a-b846-6b77207e4c28
To: <sip:12345678912@192.168.1.12>
Contact: <sip:asterisk@192.168.1.13:5060>
Call-ID: 8b5e6596-5b74-4662-911b-7710b96b392c
CSeq: 4882 INVITE
16Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL,
UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk
Content-Type: application/sdp
Content-Length: 259
v=0
o=- 324436714 324436714 IN IP4 192.168.1.13
s=Asterisk
c=IN IP4 192.168.1.13
t=0 0
m=audio 13256 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv



We can see that PBXware sends Multi User extension’ name in From header which should not happen since extension that is making a call has Caller ID defined.





We need to make sure that PBXware system only forwards Caller ID. Solution to that problem is setting Trust Remote Party ID to Yes and Sending Remote-Party-ID header on both sides:

On trunk (Third party system):



On Multi User extension on PBXware side:




Once we done that and made a new call, SNGREP tool gives us following:



Remote system (side where the trunk is) is sending caller id in Remote-Party-ID header as on following picture:



This is what PBXware sends using MUlti User extension through regular trunk:


Received Caller ID in Remote-Party-ID header is not placed in From Header and with that person receiving call will see correct Caller ID displayed.

Finally, under Reports page of the PBXware system we can see this:





Now, let’s talk about one additional important option that should be configured on Multi User extension and that is “Only Allow Caller ID within DID range”. On Multi User extension, if option Only Allow Caller ID within DID range is set to Yes, caller ID will be set to anonymous one when it leaves PBXware system.


Example of CLIR and PCAP is below:


00:10:44 agi_network: yes

00:10:44 agi_request: agi://127.0.0.1

00:10:44 agi_channel: PJSIP/200100-00000030

00:10:44 agi_language: en

00:10:44 agi_type: PJSIP

00:10:44 agi_uniqueid: 1652566244.48

00:10:44 agi_version: 16.16.1-gc-06aea721

00:10:44 agi_callerid: 061643936

00:10:44 agi_calleridname: unknown

00:10:44 agi_callingpres: 0

1900:10:44 agi_callingani2: 0

00:10:44 agi_callington: 0

00:10:44 agi_callingtns: 0

00:10:44 agi_dnid: 12345678912

00:10:44 agi_rdnis: unknown

00:10:44 agi_context: t-200

00:10:44 agi_extension: 12345678912

00:10:44 agi_priority: 1

00:10:44 agi_enhanced: 0.0

00:10:44 agi_accountcode: 100

00:10:44 agi_threadid: 140174253995776

00:10:44 set variable CDR(agiuniqueid) "1652566244.48" 200 result=1

00:10:44 get variable CALLEDNUMBER 200 result=0

00:10:44 set variable __CALLEDNUMBER "061643936" 200 result=1

00:10:44 get variable CHANNEL(pjsip,remote_addr) 200 result=1 (192.168.1.17:5060)

00:10:44 verbose "Source IP address: 192.168.1.17:5060" 200 result=1

00:10:44 get variable PBX_LOOPS 200 result=0

00:10:44 set variable __PBX_LOOPS "1" 200 result=1

00:10:44 set variable __FIRST_PBX_EXTEN "12345678912" 200 result=1

00:10:44 get variable SIPCALLIDLOGGED 200 result=0

00:10:44 get variable CHANNEL(pjsip,call-id) 200 result=1 (ed81a9e5-100b-4f54-8f6d-1e2628b7e083)

00:10:44 set variable CDR(inboundsipcallid) "ed81a9e5-100b-4f54-8f6d-1e2628b7e083" 200 result=1

00:10:44 set variable __SIPCALLIDLOGGED "YES" 200 result=1

00:10:44 set variable __DISABLEFAXDETECTION "YES" 200 result=1

00:10:44 get variable TRANSFER_PARENT 200 result=0

00:10:44 get variable TRANSFER_PARENT_CHN 200 result=0

00:10:44 get variable DIDCALLED 200 result=0

00:10:44 get variable CHANNEL(pjsip,call-id) 200 result=1 (ed81a9e5-100b-4f54-8f6d-1e2628b7e083)

00:10:44 exec UserEvent "AGICallStarted,Call-ID: ed81a9e5-100b-4f54-8f6d-1e2628b7e083" 200

result=0

00:10:44 get full variable ${PJSIP_MEDIA_OFFER(video)} 200 result=1 ()

00:10:44 set variable __PJ_VIDEO_CODECS "" 200 result=1

00:10:44 set variable __TRANSFER_PARENT "1652566244.48" 200 result=1

00:10:44 set variable __TRANSFER_PARENT_CHN "PJSIP/200100-00000030" 200 result=1

00:10:44 get variable LANGUAGE_PARENT 200 result=0

00:10:44 set variable __LANGUAGE_PARENT "en" 200 result=1

00:10:44 get variable DID_RECORDING 200 result=0

00:10:44 verbose "Found tenant '200' ... " 200 result=1

00:10:44 verbose "Found context 'default' ... " 200 result=1

00:10:44 set variable CHANNEL(parkinglot) "parkinglot_t200" 200 result=1

00:10:44 set variable __PARKINGLOT "parkinglot_t200" 200 result=1

00:10:44 exec UserEvent "AGISetTenant,Uniqueid: 1652566244.48,Tenant: 200" 200 result=0

00:10:44 set variable CDR(odbctable) "pbxware_200.cdr" 200 result=1

00:10:44 set variable CDR(tenant) "200" 200 result=1

00:10:44 set variable __TRANSFER_CONTEXT "transfer-200" 200 result=1

00:10:44 set variable __FORWARD_CONTEXT "t-200/n" 200 result=1

00:10:44 exec Set CHANNEL(musicclass)="m-200" 200 result=0

00:10:44 get variable ECN_DEST 200 result=0

00:10:44 set variable DNID "12345678912" 200 result=1

2000:10:44 get variable ReferenceID 200 result=0

00:10:44 set variable MONITOR_GOSUB "" 200 result=1

00:10:44 get variable HOT_DESKING_LOGIN 200 result=0

00:10:44 get variable FORWARDED_FROM 200 result=0

00:10:44 verbose "Detected accountcode '100' ... " 200 result=1

00:10:44 get variable BLINDTRANSFER 200 result=0

00:10:44 get variable GLOCOM_ORIGINATE_COUNT 200 result=0

00:10:44 verbose "'12345678912' is not in DID database, continuing ... " 200 result=1

00:10:44 verbose "Set limit - 8" 200 result=1

00:10:44 verbose "Limit not exceeded (2 < 8) for localextensions" 200 result=1

00:10:44 set variable __DEST_OUTBOUND_GROUP "200.lmt_100_out" 200 result=1

00:10:44 verbose "Set limit - 1" 200 result=1

00:10:44 get variable GROUP_COUNT(200.lmt_100_out) 200 result=1 (0)

00:10:44 verbose "Limit not exceeded (1 < 1) for 100_out" 200 result=1

00:10:44 verbose "Starting 'Special Routes' detection ... " 200 result=1

00:10:44 verbose "No 'Special Routes' detected ... " 200 result=1

00:10:44 verbose "Simple Routing mode is enabled ... " 200 result=1

00:10:44 verbose "Checking for 'Other Network' prefix ... " 200 result=1

00:10:44 verbose "Other network thru Single Digit mode is turned off ... " 200 result=1

00:10:44 verbose "Detecting destination for '12345678912' ... " 200 result=1

00:10:44 verbose "Looking for range in Simple Routing table ... " 200 result=1

00:10:44 verbose "Found Destination 'MultiUser Route' (RouteID: 5) ... " 200 result=1

00:10:44 verbose "Loading Default Operation Times ... " 200 result=1

00:10:44 verbose "Skipped Operation Times ..." 200 result=1

00:10:44 verbose "Setting destination 'MultiUser Route' ... " 200 result=1

00:10:44 exec Set TIMEOUT(absolute)=14400 200 result=0

00:10:44 verbose "Setting AbsoluteTimeout to 14400 seconds ... " 200 result=1

00:10:44 get variable EMAIL2FAX_APP 200 result=0

00:10:44 get variable TRANSFERERNAME 200 result=0

00:10:44 get variable BLINDTRANSFER 200 result=0

00:10:44 verbose "Found primary trunk 'TrunkTo13' ... " 200 result=1

00:10:44 verbose "Secondary trunk set as '-- None --', skipping it ... " 200 result=1

00:10:44 verbose "Tertiary trunk set as '-- None --', skipping it ... " 200 result=1

00:10:44 verbose "Detecting LCR data ... " 200 result=1

00:10:44 verbose " trunk is not assigned to tenant, skipping it ..." 200 result=1

00:10:44 verbose " trunk is not assigned to tenant, skipping it ..." 200 result=1

00:10:44 verbose "Set limit - 8" 200 result=1

00:10:44 verbose "Limit not exceeded (2 < 8) for remote" 200 result=1

00:10:44 verbose "Set limit - 100" 200 result=1

00:10:44 verbose "Limit not exceeded (1 < 100) for TrunkTo13_out" 200 result=1

00:10:44 get full variable ${CHANNEL(checkhangup)} 200 result=1 (0)

00:10:44 get variable SIP_HEADER_KEY 200 result=0

00:10:44 get variable AGENTVARS 200 result=0

00:10:44 verbose "No DID match found for CallerID" 200 result=1

00:10:44 verbose "No tenant CallerID, forcing anonymous ... " 200 result=1

00:10:44 get variable EMERG_CID_DISABLED 200 result=0

00:10:44 get variable ES_CALLERID_LIST_INUSE 200 result=0

00:10:44 set variable CALLERID(num-pres) "prohib" 200 result=1

00:10:44 set variable CALLERID(name-pres) "prohib" 200 result=1

2100:10:44 set variable CDR(trunk) "TrunkTo13" 200 result=1

00:10:44 verbose "Dialing over PJSIP protocol ... " 200 result=1

00:10:44 get variable DID_TRUNK 200 result=0

00:10:44 get variable MONITOR_ID 200 result=0

00:10:44 set variable __TOUCH_MIXMONITOR_FORMAT "wav49" 200 result=1

00:10:44 set variable __TOUCH_MIXMONITOR "/var/spool/asterisk/monitor/200/1652566244.48" 200

result=1

00:10:44 set variable __TOUCH_MIXMONITOR_MESSAGE_START "recorded" 200 result=1

00:10:44 set variable __TOUCH_MIXMONITOR_MESSAGE_STOP "beep" 200 result=1

00:10:44 verbose "Setting variable 'dial_start' ... " 200 result=1

00:10:44 get variable REDIRECTING_SOURCE_EXT 200 result=0

00:10:44 get full variable ${DIALPLAN_EXISTS(trunk-gosub-TrunkTo13)} 200 result=1 (0)

00:10:44 get variable SIP_HEADER_KEY 200 result=0

00:10:44 get variable MONITOR_GOSUB 200 result=1 ()

00:10:44 get variable GROUP_TIMEOUT 200 result=0

00:10:44 get variable DEST_OUTBOUND_GROUP 200 result=1 (200.lmt_100_out)

00:10:44 set variable OUTBOUND_GROUP_ONCE "200.lmt_100_out" 200 result=1

00:10:44 verbose "Closing MySQL socket ... " 200 result=1

00:10:49 exec Dial PJSIP/12345678912@TrunkTo13,, 200 result=-1

00:10:49 verbose "Opening MySQL socket ... " 200 result=1

00:10:49 get variable SIP_HEADER_KEY 200 result=0

00:10:49 verbose "Setting variable 'dial_end' ... " 200 result=1

00:10:49 get variable INSTANT_REC_ACT_CHANNEL 200 result=0

00:10:49 get variable DIALSTATUS 200 result=1 (CANCEL)

00:10:49 get variable MASTER_CHANNEL(CF_LINE_UNAVAIL) 200 result=1 ()





This is what we receive from trunk (from remote system):



Remote-Party-ID: <sip:061643936@192.168.1.17>;party=calling;privacy=off;screen=no

And this is what PBXware sends through Multi User extension:




As we can see, Anonymous is set in the From header. So, after this test call, it is safe to say that option “Only Allow Caller ID within DID range” should be set to No. At the beginning of troubleshooting REGISTER and OPTIONS packets, we noticed how From User plays a significant role. When it comes to knowing if From User is set during an active call, we have following situations. When From User is set, call will most likely go through successfully:


2022/05/15 00:24:00.351816 192.168.1.17:5060 -> 192.168.1.13:5060
INVITE sip:12345678912@192.168.1.13 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.17:5060;rport;branch=z9hG4bKPjbd774ac8-b4e4-4c1c-9f56-18e838afafcd
From: <sip:200100@192.168.1.17>;tag=83bedee3-7b98-4943-806d-a59a458d0967
To: <sip:12345678912@192.168.1.13>
Contact: <sip:200100@192.168.1.17:5060>
Call-ID: 9f22f029-7ec8-4dfd-85de-61422f4df32c
CSeq: 16340 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE,
PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Remote-Party-ID: <sip:061643936@192.168.1.17>;party=calling;privacy=off;screen=no
Max-Forwards: 70
User-Agent: FPBX-15.0.17.34(16.17.0)
Content-Type: application/sdp
23Content-Length: 339
v=0
o=- 1477203974 1477203974 IN IP4 192.168.1.17
s=Asterisk
c=IN IP4 192.168.1.17
t=0 0
m=audio 11316 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv


If From User is not defined, call will most likely fail: 




2022/05/15 00:21:19.345843 192.168.1.17:5060 -> 192.168.1.13:5060
INVITE sip:12345678912@192.168.1.13 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.17:5060;rport;branch=z9hG4bKPj490449da-d551-485b-8c59-99161ad3f5cf
From: <sip:061643936@192.168.1.17>;tag=fac67540-8803-4fae-9d54-bd7fac1c8c57
To: <sip:12345678912@192.168.1.13>
Contact: <sip:asterisk@192.168.1.17:5060>
Call-ID: 6188ec43-b946-4d60-b19a-4c5964537a16
CSeq: 28185 INVITE
24Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE,
PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Remote-Party-ID: <sip:061643936@192.168.1.17>;party=calling;privacy=off;screen=no
Max-Forwards: 70
User-Agent: FPBX-15.0.17.34(16.17.0)
Content-Type: application/sdp
Content-Length: 337
v=0
o=- 989314319 989314319 IN IP4 192.168.1.17
s=Asterisk
c=IN IP4 192.168.1.17
t=0 0
m=audio 15540 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv



Registration method - incoming calls



If we want to route calls through a Multi User extension to a user, SIP extension on remote system, then we need to have DID created on PBXware system and point it to Multi User extension.




On the remote side (where extension is registered and should receive incoming calls) there can be route created whose Caller ID matches DID on PBXware.


CLIR for the incoming call looks like this:


23:52:14 agi_network: yes

23:52:14 agi_request: agi://127.0.0.1

23:52:14 agi_channel: PJSIP/TrunkTo13-00000015

23:52:14 agi_language: en

23:52:14 agi_type: PJSIP

23:52:14 agi_uniqueid: 1652565134.21

23:52:14 agi_version: 16.16.1-gc-06aea721

23:52:14 agi_callerid: 062136450

23:52:14 agi_calleridname: unknown

23:52:14 agi_callingpres: 0

23:52:14 agi_callingani2: 0

23:52:14 agi_callington: 0

23:52:14 agi_callingtns: 0

23:52:14 agi_dnid: 12345678998

23:52:14 agi_rdnis: unknown

23:52:14 agi_context: TrunkTo13

23:52:14 agi_extension: 12345678998

23:52:14 agi_priority: 1

23:52:14 agi_enhanced: 0.0

23:52:14 agi_accountcode: TrunkTo13

23:52:14 agi_threadid: 140174931011328

23:52:14 set variable CDR(agiuniqueid) "1652565134.21" 200 result=1

23:52:14 get variable CALLEDNUMBER 200 result=0

23:52:14 set variable __CALLEDNUMBER "062136450" 200 result=1

23:52:14 get variable PBX_LOOPS 200 result=0

23:52:14 set variable __PBX_LOOPS "1" 200 result=1

23:52:14 set variable __FIRST_PBX_EXTEN "12345678998" 200 result=1

23:52:14 get variable SIPCALLIDLOGGED 200 result=0

23:52:14 set variable __DISABLEFAXDETECTION "YES" 200 result=1

23:52:14 get variable TRANSFER_PARENT 200 result=0

23:52:14 get variable TRANSFER_PARENT_CHN 200 result=0

2623:52:14 get variable DIDCALLED 200 result=0

23:52:14 get variable CHANNEL(pjsip,call-id) 200 result=1

(44159193-e3f4-4541-b934-81e8fad21537)

23:52:14 exec UserEvent "AGICallStarted,Call-ID: 44159193-e3f4-4541-b934-81e8fad21537"

200 result=0

23:52:14 get full variable ${PJSIP_MEDIA_OFFER(video)} 200 result=1 ()

23:52:14 set variable __PJ_VIDEO_CODECS "" 200 result=1

23:52:14 set variable __TRANSFER_PARENT "1652565134.21" 200 result=1

23:52:14 set variable __TRANSFER_PARENT_CHN "PJSIP/TrunkTo13-00000015" 200

result=1

23:52:14 get variable LANGUAGE_PARENT 200 result=0

23:52:14 set variable __LANGUAGE_PARENT "en" 200 result=1

23:52:14 get variable DID_RECORDING 200 result=0

23:52:14 set variable DNID "12345678998" 200 result=1

23:52:14 get variable ReferenceID 200 result=0

23:52:14 set variable MONITOR_GOSUB "" 200 result=1

23:52:14 verbose "Detected protocol 'pjsip' ... " 200 result=1

23:52:14 verbose "Detected caller '062136450' ... " 200 result=1

23:52:14 get variable GLOCOM_ORIGINATE_COUNT 200 result=0

23:52:14 get variable DID_SIP_TO_MATCH 200 result=0

23:52:14 verbose "Set limit - 100" 200 result=1

23:52:14 verbose "Limit not exceeded (1 < 100) for TrunkTo13_in" 200 result=1

23:52:14 set variable __DID_CALL "1" 200 result=1

23:52:14 set variable __DID_ID "2" 200 result=1

23:52:14 set variable __DID_TRUNK "TrunkTo13" 200 result=1

23:52:14 get variable DIDNUMBER 200 result=0

23:52:14 set variable __DIDNUMBER "12345678998" 200 result=1

23:52:14 verbose "Set limit - 246" 200 result=1

23:52:14 verbose "Limit not exceeded (1 < 246) for remote" 200 result=1

23:52:14 exec Set TIMEOUT(absolute)=14400 200 result=0

23:52:14 verbose "Setting AbsoluteTimeout to 14400 seconds ... " 200 result=1

23:52:14 exec Set CHANNEL(hangup_handler_push)=dids-hangup-handler,s,1(args) 200

result=0

23:52:14 verbose "Found DID '12345678998' (2) ... " 200 result=1

23:52:14 set variable CDR(did) "12345678998" 200 result=1

23:52:14 set variable __DIDCALLED "12345678998" 200 result=1

23:52:14 verbose "Found tenant '200' ... " 200 result=1

23:52:14 verbose "Found context 'TrunkTo13' ... " 200 result=1

23:52:14 set variable CHANNEL(parkinglot) "parkinglot_t200" 200 result=1

23:52:14 set variable __PARKINGLOT "parkinglot_t200" 200 result=1

23:52:14 exec UserEvent "AGISetTenant,Uniqueid: 1652565134.21,Tenant: 200" 200 result=0

23:52:14 set variable CDR(odbctable) "pbxware_200.cdr" 200 result=1

23:52:14 set variable CDR(tenant) "200" 200 result=1

23:52:14 set variable __TRANSFER_CONTEXT "transfer-200" 200 result=1

2723:52:14 set variable __FORWARD_CONTEXT "t-200/n" 200 result=1

23:52:14 exec Set CHANNEL(musicclass)="m-200" 200 result=0

23:52:14 verbose "Checking if CNAM service is enabled..." 200 result=1

23:52:14 verbose "CNAM settings not found. Skipping ..." 200 result=1

23:52:14 verbose "Set limit - 8" 200 result=1

23:52:14 verbose "Limit not exceeded (1 < 8) for remote" 200 result=1

23:52:14 exec Set TIMEOUT(absolute)=14400 200 result=0

23:52:14 verbose "Setting AbsoluteTimeout to 14400 seconds ... " 200 result=1

23:52:14 verbose "Fetching Operation Times data ..." 200 result=1

23:52:14 verbose "Loading Default Operation Times ... " 200 result=1

23:52:14 verbose "Skipped Operation Times ..." 200 result=1

23:52:14 verbose "Starting 'Special Routes' detection ... " 200 result=1

23:52:14 verbose "No 'Special Routes' detected ... " 200 result=1

23:52:14 verbose "Simple Routing mode is enabled ... " 200 result=1

23:52:14 verbose "Detecting destination for '100' ... " 200 result=1

23:52:14 verbose "Looking up for system extension ... " 200 result=1

23:52:14 verbose "Found Destination localextensions (range 100 - 100)" 200 result=1

23:52:14 verbose "This is local extension, skipping Time Based Dialing/miniLCR ... " 200

result=1

23:52:14 verbose "Set limit - 8" 200 result=1

23:52:14 verbose "Limit not exceeded (1 < 8) for localextensions" 200 result=1

23:52:14 exec Set CDR(userfield)=100 200 result=0

23:52:14 verbose "Saving Last Caller '062136450' ... " 200 result=1

23:52:14 get variable DID_CALL 200 result=1 (1)

23:52:14 verbose "DID call, skipping local call ring tone ... " 200 result=1

23:52:14 verbose "Detecting Enhanced Services ... " 200 result=1

23:52:14 get variable ES_USER_SKIP 200 result=0

23:52:14 get full variable ${PJSIP_ENDPOINT(200100,allow)} 200 result=1 ((ulaw|alaw))

23:52:14 get variable RG_RINGTONE 200 result=0

23:52:14 verbose "Set limit - 1" 200 result=1

23:52:14 verbose "Limit not exceeded (1 < 1) for 100_in" 200 result=1

23:52:14 get variable DID_CALL 200 result=1 (1)

23:52:14 get variable NO_TRANSFER 200 result=0

23:52:14 set variable __PICKUPMARK "12345678998@200100" 200 result=1

23:52:14 get variable MONITOR_ID 200 result=0

23:52:14 set variable __TOUCH_MIXMONITOR_FORMAT "wav49" 200 result=1

23:52:14 set variable __TOUCH_MIXMONITOR

"/var/spool/asterisk/monitor/200/1652565134.21" 200 result=1

23:52:14 set variable __TOUCH_MIXMONITOR_MESSAGE_START "recorded" 200 result=1

23:52:14 set variable __TOUCH_MIXMONITOR_MESSAGE_STOP "beep" 200 result=1

23:52:14 get variable GROUP_HIDE_CDR 200 result=0

23:52:14 get variable PAI_HEADER 200 result=0

23:52:14 verbose "Checking for channel PJSIP/12345678998@200100 ... " 200 result=1

23:52:14 exec ChanIsAvail PJSIP/12345678998@200100 200 result=0

2823:52:14 get variable AVAILCHAN 200 result=1 (PJSIP/200100-00000016)

23:52:14 get variable DIAL_MOBILE 200 result=0

23:52:14 verbose "Dialing '12345678998@200100' ... " 200 result=1

23:52:14 get variable AGENTPOOL-DIAL 200 result=0

23:52:14 get variable NO_TRANSFER 200 result=0

23:52:14 exec Set TIMEOUT(absolute)=14400 200 result=0

23:52:14 verbose "Setting AbsoluteTimeout to 14400 seconds ... " 200 result=1

23:52:14 get variable SIP_HEADER_KEY 200 result=0

23:52:14 get variable MONITOR_GOSUB 200 result=1 ()

23:52:14 verbose "Setting variable 'dial_start' ... " 200 result=1

23:52:14 get variable QUEUE_RINGTIME_IGNORE 200 result=0

23:52:14 get variable GROUP_TIMEOUT 200 result=0

23:52:14 verbose "Closing MySQL socket ... " 200 result=1

23:52:24 exec Dial PJSIP/12345678998@200100,32,trij 200 result=-1

23:52:24 verbose "Opening MySQL socket ... " 200 result=1

23:52:24 verbose "Setting variable 'dial_end' ... " 200 result=1

23:52:24 get variable INSTANT_REC_ACT_CHANNEL 200 result=0

23:52:24 get variable DIALSTATUS 200 result=1 (ANSWER)

23:52:24 get variable GLOCOM_OUT_CALL 200 result=0

23:52:24 get variable PBD 200 result=0

23:52:24 get variable ANSWEREDTIME 200 result=1 (4)

23:52:24 verbose "Total time: 4" 200 result=1

23:52:24 verbose "Setting variable 'dial_billing_sec' ... " 200 result=1

23:52:24 verbose "Call Rating is set to 'Off', skipping ... " 200 result=1

23:52:24 verbose "Setting variable 'dial_billing_amount' ... " 200 result=1

23:52:24 verbose "Saving CDR ... " 200 result=1

23:52:24 get variable MASTER_CHANNEL(CF_LINE_UNAVAIL) 200 result=1 ()

23:52:24 agi_network: yes

23:52:24 agi_request: agi://127.0.0.1

23:52:24 agi_channel: PJSIP/TrunkTo13-00000015

23:52:24 agi_language: en

23:52:24 agi_type: PJSIP

23:52:24 agi_uniqueid: 1652565134.21

23:52:24 agi_version: 16.16.1-gc-06aea721

23:52:24 agi_callerid: 062136450

23:52:24 agi_calleridname: unknown

23:52:24 agi_callingpres: 0

23:52:24 agi_callingani2: 0

23:52:24 agi_callington: 0

23:52:24 agi_callingtns: 0

23:52:24 agi_dnid: 12345678998

23:52:24 agi_rdnis: unknown

23:52:24 agi_context: dids-hangup-handler

23:52:24 agi_extension: s

2923:52:24 agi_priority: 1

23:52:24 agi_enhanced: 0.0

23:52:24 agi_accountcode: TrunkTo13

23:52:24 agi_threadid: 140174931011328

23:52:24 set variable CDR(agiuniqueid) "1652565134.21" 200 result=1

23:52:24 get variable CALLEDNUMBER 200 result=1 (062136450)



In SNGREP tool, call looks like: