How to call USERNAME instead of NUMBER with Sip2Sip in PBX?


(Wasiq Cheema) #1

Hi,

I have a working Sip2Sip account set up on my PBX running on CentOS. My inbound calling is working fine, however it’s outbound calling which is confusing me a lot. SIP2SIP.info’s username is alphabetic, not numeric. You have to use ‘alias’ for that if you want to use anything numeric. The issue is, not everyone have set up aliases. Most guides address username as numeric in format of 223XXXXXXX which I don’t see it anywhere on Sip2Sip account panel.

I am looking to for a way where I can call via username (consisting of alphabets) instead of dialing DID or numbers. I’ve tried different settings, but I am unable to make it work. The only way I could work it out is by making a Custom Extension and Dial String SIP/<recipient's username>@sip2sip.info or SIP/sip2sip.info/<recipient's username>, however this way, I can only call one username everytime and will have to create individual custom extensions for each usernames.

Here is my working SIP2SIP Trunk set up with following configuration:

/etc/asterisk/sip_custom.conf

[sip2sip](!)
type=peer
canreinvite=no
nat=force_rport,comedia
qualify=yes
host=sip2sip.info
dtmfmode=rfc2833
fromdomain=sip2sip.info
outboundproxy=proxy.sipthor.net
fromuser=<username>
username=<username>
secret=<password>
insecure=invite,port
context=from-sip2sip

[sip2sip-0](sip2sip)
host=sip2sip.info

[sip2sip-1](sip2sip)
host=81.23.228.129

[sip2sip-2](sip2sip)
host=81.23.228.150

[sip2sip-3](sip2sip)
host=85.17.186.7`

/etc/asterisk/sip_registration_custom.conf

register=<username>:<password>@sip2sip.info/<username>

/etc/asterisk/extensions_custom.conf

[sip2sip]
exten => _X.,1,Dial(SIP/${EXTEN}@sip2sip-0)

[from-sip2sip]
exten => <username>,1,NoOp(--Incoming call from ${CALLERID(all)})
; Incoming call will go to Ring Group 1000
exten => <username>,n,Dial(local/1000@from-internal, 60)

TRUNK : I added Custom Trunk Manually using web-based GUI: Connectivity → Trunk → Add Trunk → Add Custom Trunk

Trunk Name : Sip2Sip
Outbound Caller ID : <username>
Custom Dial String : Local/$OUTNUM$@sip2sip


OUTBOUND: I added Outbound route using web-based GUI: Connectivity → Outbound Routes → Add Outbound Route

Route Settings
Route Name : Sip2Sip
Route ID : <username>
Custom Dial String : Local/$OUTNUM$@sip2sip
Trunk Sequence for Matched Routes : Sip2Sip

Dial Patterns

NNNN
NXXXXXXXXX

Did an outbound Test Call on 3333 and 4444. Working fine.


INBOUND : I added Inbound route using web-based GUI: Connectivity → Inbound Routes → Add Inbound Route
Note: I have added alias in format of 223XXXXXXX (all numbers) in Sip2Sip.info account and then use this alias to make incoming call to PBX.

General
Description : Sip2Sip
DID Number : 2231234567
Set Destination : Ring Groups → 1000


System :

Linux noreply.incrediblepbx.com 3.10.0-1062.12.1.el7.x86_64
Asterisk Version : 16.9.0
PHP Version : 5.6.40
OS : CentOS Linux Release 7.7.1908


I don’t know if URI Dialing is the answer, but I don’t know how to set it up. Following is an example of URI dialing I found, but I don’t know how to implement it:

Sip2Sip’s official wiki support setting is too basic and isn’t very helpful. There’s also an article where you can hardcode a DID of your own choice, but that’s only if you have inbound issues.

Help!