Several Numbers with one Sipgate Basic account

I have a Sipgate basic account with several numbers. I have the configuration working, so that all telephones ring when any of my sipgate numbers is called from external.
I now want that different telephones ring, when different sipgate numbers are called from external.

I changed the inbound route DID from ANY to the sipgate number :
inbound routes -> sipgate > DID 1234 (sipgate number)
and the user context on incoming to from-pstn-toheader:
trunk -> sipgate -> sipsettings -> incoming -> User context : from-pstn-toheader

The settings in the webinterface:
Trunk -> sipsettings -> incoming
User Context: from-pstn-toheader

User Details:
type=user
secrect=
host=sipgate.de
fromdomain=sipgate.de

register string: :<[email protected]/

Trunk -> sipsettings -> outgoing
TrunkName: Sipgate
Peer details:
username=
type=friend
context=from-trunk
trustrpid=yes
sendrpid=yes
secret=
registertimeout=300
qualify=yes
nat=force_rport,comedia
insecure=port,invite
host=sipgate.de
fromuser=
fromdomain=sipgate.de
dtmfmode=rfc2833
disallow=all
canreinvite=no
allow=ulaw

In the log I can see the different external sipgate numbers in the header, for example:
To: Here is a sip and than a colon and then the external number and then an at and then sipgate.de

But it doesn’t match for the inbound route and no phone rings, just the voice: “this number is not assigned” or so.

Here is the complete log:
https://pastebin.com/yqqNxS7p

I hope you can help me
Cheers

P.S. I was not able to put the log here, since the forum software is bugging new users too much or I am too stupid; important information was complained about or just removed.

You shouldn’t have to worry about the context at all for this…

On Inbound Routes, create a route with CID = Any, DID = 1234
Set the destination of this route to a specific phone, or a ring group of multiple phones, and that should be it.

1 Like

I tried with different contexts, the User-Number from Sipgate and also the telephone number. It doesn’t work either. The thing with the “from-pstn-toheader” I got from this thread:


But probably this is a different issue.
The last thing my log sais is:

<— SIP read from UDP:217.10.79.9:5060 —>
BYE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 217.10.79.9;branch=z9hG4bKdfb8.67780014ebcc16559e8a334cdf20ad69.0
Via: SIP/2.0/UDP 172.20.40.8;branch=z9hG4bKdfb8.920ab6c44e7a47f18bf6abb2a6cfeca4.0
Via: SIP/2.0/UDP 217.10.68.137;branch=z9hG4bKdfb8.4b7ac01b71fb9bffadabb36846718c08.0
Via: SIP/2.0/UDP 212.9.44.14:5060;branch=z9hG4bK626138fe
Max-Forwards: 67
From: “01634554321” sip:[email protected];tag=as72fa6572
To: sip:[email protected];tag=as4e4efbc3
Call-ID: [email protected]
CSeq: 104 BYE
Reason: Q.850;cause=16
Content-Length: 0
X-hint: rr-enforced

I don’t really understand all these log-messages.

As @Overkill said, don’t worry about different contexts.

What you want to achieve you can do so within the regular from-trunk context.
What matters is the destination for each of your incoming Sipgate calls. For each DID you would have a different inbound route with a different destination.

Have some phones in one ring group, others in another. Or queues for that matter.
And set the inbound route destinations to those.

I see, the problem lies somewhere else.
A soon as I enter the DID in the inbound route settings, no call comes through, only the voice “not available” or something. The telephone ring if I put ALL in the DID field though. Maybe there is something wrong with the format? I put the DID it exactly as seen in the log (004975711234).

Try other format.
E.g. 075711234

Be sure to always have an “Any/any” inbound route (No DID, no CID). This way, you calls will at least complete. Also then, make your calls and watch the logfile output. In there will be a note about “Maybe you should set up a route for this DID”, or something similar.

I have now created 2 inbound routes, one with DID ANY and one with DID 075711234 (I also tried different formats). One is connected to a Telephone, the other one to a terminate call (for testing). It always chooses the ANY route, the 1234 route isn’t matched at any time :frowning: .

In the log there is indeed this “should set up a route”-message:
[2017-06-22 16:47:24] VERBOSE[3363][C-00000005] pbx.c: Executing [2458671@from-trunk:1] NoOp(“SIP/sipgate-00000005”, “Catch-All DID Match - Found 2458671 - You probably want a DID for this.”) in new stack

Not sure how this message could be any clearer… The DID for the call you placed was 2458671. It is neither 1234 or any other combination of digits like that.

Ok, I was overlooking that. This is actually the customer number of the Sipgate-Account. It is the same for all telephone numbers I got from sipgate.
This is why I cannot really create different routes for different numbers.
If I look at the logs, I can see the correct number 004975711234 in the “to” of the header:

SIP/2.0 200 OK
Via: SIP/2.0/UDP 217.10.79.9;branch=z9hG4bK9b8f.261f2b87074bc03fc930e321cc93b620.0;received=217.10.79.9;rport=5060
Via: SIP/2.0/UDP 172.20.40.8;branch=z9hG4bK9b8f.724043195edfd88220c64394519e12f9.0
Via: SIP/2.0/UDP 217.10.68.137;branch=z9hG4bK9b8f.707f6edd9c40e26d551d5e266fc9de39.0
Via: SIP/2.0/UDP 217.10.77.45:5060;branch=z9hG4bK41c8df16
Record-Route: sip:217.10.79.9;lr;ftag=as6721849f
Record-Route: sip:172.20.40.8;lr
Record-Route: sip:217.10.68.137;lr;ftag=as6721849f
From: “1234567” sip:[email protected];tag=as6721849f
To: sip:[email protected];tag=as43993e84
Call-ID: [email protected]
CSeq: 103 INVITE
Server: FPBX-13.0.191.11(13.13.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:[email protected]:5060
Content-Type: application/sdp
Content-Length: 252

I have to somehow manage that he tries to match the “header to” with the route. This is why I thought I need the “User Context= from-pstn-toheader” thing.

Since you are using a register string, you don’t need the “USER Context” or “USER Details” fields populated, remove whatever you have there. Then locate the context line in the PEER Details field and make it look like this

context=from-pstn-toheader

submit, apply config and retest.

Thanks, that was it :slight_smile:

1 Like

There is another problem:
I just found out, when I call from another sipgate account, the "To: " field in the header is the sipgate account number of the receiving account. When I call from my mobile the "To: " field is the correct number that is called.

Here the log from calling from another sipgate account:

<------------->
[2017-07-10 20:37:45] VERBOSE[1930] chan_sip.c:
<— SIP read from UDP:217.10.79.9:5060 —>
INVITE sip:[email protected]:5060 SIP/2.0
Record-Route: sip:217.10.79.9;lr;ftag=as645f32ca
Record-Route: sip:172.20.40.8;lr
Record-Route: sip:217.10.68.137;lr;ftag=as645f32ca
Via: SIP/2.0/UDP 217.10.79.9;branch=z9hG4bKe177.e204d47ba1a40f6b77af878603711feb.0
Via: SIP/2.0/UDP 172.20.40.8;branch=z9hG4bKe177.2adbafc03893e0166c7d92e92b006221.0
Via: SIP/2.0/UDP 217.10.68.137;branch=z9hG4bKe177.c1f6cb19a9f290099ce39d5db5a466b6.0
Via: SIP/2.0/UDP 212.9.44.142:5060;branch=z9hG4bK3fd9d5fa
Max-Forwards: 67
From: “004975711234” sip:[email protected];tag=as645f32ca
To: sip:[email protected]
Contact: sip:[email protected]:5060
Call-ID: [email protected]
CSeq: 103 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Type: application/sdp
Content-Length: 416

And here from calling from my mobile:

<------------->
[2017-07-10 20:39:57] VERBOSE[1930] chan_sip.c:
<— SIP read from UDP:217.10.79.9:5060 —>
INVITE sip:[email protected]:5060 SIP/2.0
Record-Route: sip:217.10.79.9;lr;ftag=as746dadf9
Record-Route: sip:172.20.40.8;lr
Record-Route: sip:217.10.68.137;lr;ftag=as746dadf9
Via: SIP/2.0/UDP 217.10.79.9;branch=z9hG4bK46c9.4230f236e37031ed7cf5e91d692c8c73.0
Via: SIP/2.0/UDP 172.20.40.8;branch=z9hG4bK46c9.2d9e467facc931c5623395ca6aca6f3b.0
Via: SIP/2.0/UDP 217.10.68.137;branch=z9hG4bK46c9.5ebc729b4d24dfd4a7fe23788913de2b.0
Via: SIP/2.0/UDP 217.116.117.12:5060;branch=z9hG4bK32ef26bb
Max-Forwards: 67
From: “1234567” sip:[email protected];tag=as746dadf9
To: sip:[email protected]
Contact: sip:[email protected]:5060
Call-ID: [email protected]
CSeq: 103 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces
Content-Type: application/sdp
Content-Length: 445

The 1111111e0 is the sipgate account number and the 0049757155555 is the number that is called. For some reason Sipgate is messing something up for calls that are happening inside sipgate’s network. Is there anything that can be done? The 004975715555 is not appearing at all int the logs when I call from the other sipgate account.