Asterisk connection to telekom router speedport

I use a Telekom Router Speedport smart. The router has IP telefony and is my gateway to the PSTN. I have configured an asterisk system with some internal softphones. The internal calls work based on my pjsip and the dialplan. I want to route calls from internal softphones to my speedport smart and thus to the PSTN. I have configured an IP telephone in the speedport smart. How can I connect my asterisk to the speedport smart as IP telephone. I thought to define an endpoint which registers at the speedport smart as IP phone. All internal calls to this endpoint then would be forwarded to the speedport router and from there to the PSTN.

How can I define an endpoint which registers outbound at the speedport router ? Is an endpoint the correct entity ? Or need I some kind of outbound SIP Trunk to be defined to the router

Outbound “trunks” are a type of endpoint. Neither SIP nor Asterisk uses the term trunk.

Without knowing the the specifics of your system, I think you want to configure the endpoint as though it were a VoIP provider.

I think yes. My speedport router has IP telephony and I want to use the SIP interface of my router for outbound connections.

The SIP interface of my router has an username/password, an authentication username and a Domain (speedport.ip)

I need to define an endpoint in asterisk, which can register at the speedport router’s SIP interface

This would be an endpoint with outbound registration. How would I define such an endpoint in asterisk 22?

The method hasn’t changed, since the introduction of chan_pjsip. See the second example in res_pjsip Configuration Examples - Asterisk Documentation

Thanks.

I have created a pjsip.conf according to the second example in the document

https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/res_pjsip-Configuration-Examples/#a-sip-trunk-to-your-service-provider-including-outbound-registration

my pjsip.conf

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060

; Basic templates, they will be copied for each user

[endpoint_basic](!)
type=endpoint         ; endpoint (phone/rpi/pc...)
context=internal      ; uses the dial plan defined in extensions.conf
disallow=all          ; disabling all audio codecs
allow=ulaw            ; except the ULAW codec
allow=alaw            ; and the ALAW codec
language=de

[authentication](!)
type=auth             ; type of section: authentication
auth_type=userpass    ; password authentication

[aor_template](!)
type=aor              ; find out where the endpoint can be contacted
max_contacts=1

; Definitions of user accounts associated with equipment


[zoiper](endpoint_basic)
auth=zoiper
aors=zoiper
callerid="Zoiper" <6002>
[zoiper](authentication)
password=zoiper
username=zoiper
[zoiper](aor_template)


[speedport]
type=registration
outbound_auth=speedport
server_uri=sip:**71@192.168.2.1
client_uri=sip:**71@192.168.2.1
retry_interval=60

[speedport]
type = auth
auth_type = userpass
username = nutzer-1@speedport.ip
password = 1234567890

[speedport]
type=aor
contact=sip:192.168.2.1:5060

[speedport]
type=endpoint
context=from-external
disallow=all
allow=ulaw
outbound_auth=speedport
aors=speedport

[speedport]
type = identify
match = 192.168.2.1
endpoint = speedport


my extension.conf

[internal]
;exten => _6XXX,1,Dial(PJSIP/${EXTEN},20)

exten => 6001,1,Dial(PJSIP/doorbird,20)
exten => 6001,2,Hangup
exten => 6002,1,Dial(PJSIP/zoiper,20)
exten => 6002,2,Hangup

[from-external]

; Deutschlandweite Nummern (z.B. 0301234567)
exten => _0[2-9]XXXXXXX,1,Dial(PJSIP/speedport/${EXTEN},20)
exten => _0[2-9]XXXXXXX,n,Hangup()

but the result is

    -- Executing [026421513@internal:1] Dial("PJSIP/zoiper-00000000", "PJSIP/speedport/026421513,20") in new stack
[Aug 17 12:51:47] ERROR[34819]: res_pjsip.c:993 ast_sip_create_dialog_uac: Endpoint 'speedport': Could not create dialog to invalid URI '026421513'.  Is endpoint registered and reachable?
[Aug 17 12:51:47] ERROR[34819]: chan_pjsip.c:2708 request: Failed to create outgoing session to endpoint 'speedport'
[Aug 17 12:51:47] NOTICE[34909][C-00000001]: app_dial.c:2720 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [026421513@internal:2] Hangup("PJSIP/zoiper-00000000", "") in new stack
  == Spawn extension (internal, 026421513, 2) exited non-zero on 'PJSIP/zoiper-00000000'

I think my speedport router is not a ITSP but SIP:192.168.2.1 is some kind of proxy. asterisk is registered at the router 192.168.2.1 as a SIP phone with the extension **71@192.168.2.1.

asterisk can register successfully

asterisk-PBX*CLI> pjsip show registrations

 <Registration/ServerURI..............................>  <Auth....................>  <Status.......>
==========================================================================================

 speedport/sip:**71@192.168.2.1                          speedport                   Registered        (exp. 159s)

Objects found: 1

asterisk-PBX*CLI> 

and the endpoint is there as well

asterisk-PBX*CLI> pjsip show endpoints

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================


 Endpoint:  speedport                                            Not in use    0 of inf
    OutAuth:  speedport/nutzer-1@speedport.ip
        Aor:  speedport                                          0
      Contact:  speedport/sip:192.168.2.1:5060             45977b638f NonQual         nan
   Identify:  speedport/speedport
        Match: 192.168.2.1/32

 Endpoint:  zoiper/6002                                          Not in use    0 of inf
     InAuth:  zoiper/zoiper
        Aor:  zoiper                                             1
      Contact:  zoiper/sip:zoiper@192.168.2.151:35037;tran 1c439b240c NonQual         nan


Objects found: 3

asterisk-PBX*CLI> 

Third or fourth examples in Dialing PJSIP Channels - Asterisk Documentation

I managed to use inbound and outbound telephony with a Smart 4 using these lines in the extensions.conf:

[from-speedport]
; Eingehende Anrufe an interne Nebenstelle weiterleiten
exten => **71,1,Dial(PJSIP/6001)
exten => s,1,Dial(PJSIP/6001)

[from-internal]
; Normale interne Anrufe (haben Priorität)
exten => 6001,1,Dial(PJSIP/6001)
exten => 6002,1,Dial(PJSIP/6002)

; Alle anderen Nummern automatisch über Speedport weiterleiten
; Diese Regel greift nur, wenn keine der oberen Regeln zutrifft
exten => _X.,1,Set(CALLERID(num)=**71)
 same => n,Dial(PJSIP/${EXTEN}@speedport)
 same => n,Hangup()

6001 is my softphone’s extension

This is a working config for testing. Certainly, it could be improved… :wink:

thanks,

how does your pjsip.conf look ?

I could manage an outgoing call with your extension.conf.

But ingoing calls dont’t work. They are not routed to my zoiper softphone

On Tuesday 26 August 2025 at 14:39:30, rebell21 via Asterisk Community wrote:

ingoing calls dont’t work. They are not routet to my zoiper softphone

Do they arrive at Asterisk at all and get processed in some way, rather than
going to your softphone?

Antony.


If you were ploughing a field, which would you rather use - two strong oxen or
1024 chickens?

  • Seymour Cray, pioneer of supercomputing

no the dont’t arrive at asterisk at all. They go to the DECT hardware phones only

This is the definition of the speedport in the pjsip.conf

[speedport]
type=registration
outbound_auth=speedport
server_uri=sip:**71@192.168.2.1
client_uri=sip:**71@192.168.2.1
retry_interval=60

[speedport]
type = auth
auth_type = userpass
username = nutzer-1@speedport.ip
password = XXXXXX


[speedport]
type=aor
contact=sip:192.168.2.1:5060

[speedport]
type=endpoint
context=internal
callerid="speedport" <**71>
disallow=all
allow=ulaw
outbound_auth=speedport
aors=speedport

[speedport]
type = identify
match = 192.168.2.1
endpoint = speedport


als incoming calls work now

This is my extension.conf

[internal]

exten => 6001,1,NoOp(Call Doorbird)
same => n,Dial(PJSIP/doorbird,20)
same => n,Hangup()

exten => 6002,1,Dial(PJSIP/zoiper,20)
exten => 6002,2,Hangup()    

exten => 6003,1,Dial(PJSIP/notebook,20)
exten => 6003,2,Hangup  

;
; abgehende Anrufe zum Speedport
;

exten => _0X.,1,NoOp(abgehender Anruf zu ${EXTEN})
 same => n,Set(CALLERID(num)=**71)
 same => n,Dial(PJSIP/${EXTEN}@speedport)
 same => n,Hangup()
 
;
; incoming call from speedport
;
 
exten => s,1,NoOp(incoming call )
 same => n,Dial(PJSIP/zoiper)
 same => n,Hangup()
 
 

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