No voice when I call the softphones on notebook with the smartphone

I have configured an asterisk pbx connected to my telekom speedport smart router. The asterisk pbx is a registered SIP phone at the router. Outgoing calls are routed from asterisk to the speedport router and can call external numbers. I have installed a zoiper softphone on my notebook and called the endpoint “notebook”. When I call with the zoiper softphone from the notebook my mobile, everything works perfect. The mobile is ringing, I accept and can hear the voice and sound. When I call with my mobile the number of the router, the call is routed to the softphone on my notebook and the softphone is ringing. When I accept the call, the connection is established. But I can not hear any voice . Is it a problem with the codecs ?

The output of the asterisk-cli (the endpoint zoiper is an endpoint which is on the tablet and currently is switched off)

   -- Executing [s@internal:1] NoOp("PJSIP/speedport-00000004", "incoming call ") in new stack
    -- Executing [s@internal:2] Dial("PJSIP/speedport-00000004", "PJSIP/zoiper&PJSIP/notebook,20") in new stack
[Sep  8 21:41:55] ERROR[4541]: res_pjsip.c:993 ast_sip_create_dialog_uac: Endpoint 'zoiper': Could not create dialog to invalid URI 'zoiper'.  Is endpoint registered and reachable?
[Sep  8 21:41:55] ERROR[4541]: chan_pjsip.c:2708 request: Failed to create outgoing session to endpoint 'zoiper'
[Sep  8 21:41:55] NOTICE[4627][C-00000003]: app_dial.c:2720 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
    -- Called PJSIP/notebook
    -- PJSIP/notebook-00000005 is ringing
       > 0x7f0580029960 -- Strict RTP learning after remote address set to: 192.168.2.185:59796
       > 0x7f0580029960 -- Strict RTP switching to RTP target address 192.168.2.185:59796 as source
    -- PJSIP/notebook-00000005 answered PJSIP/speedport-00000004
       > 0x7f058006e9b0 -- Strict RTP learning after remote address set to: 192.168.2.1:15086
    -- Channel PJSIP/notebook-00000005 joined 'simple_bridge' basic-bridge <32a38034-25bb-416c-b39b-b8578543398f>
    -- Channel PJSIP/speedport-00000004 joined 'simple_bridge' basic-bridge <32a38034-25bb-416c-b39b-b8578543398f>
       > Bridge 32a38034-25bb-416c-b39b-b8578543398f: switching from simple_bridge technology to native_rtp
       > Remotely bridged 'PJSIP/speedport-00000004' and 'PJSIP/notebook-00000005' - media will flow directly between them
    -- Channel PJSIP/speedport-00000004 left 'native_rtp' basic-bridge <32a38034-25bb-416c-b39b-b8578543398f>
  == Spawn extension (internal, s, 2) exited non-zero on 'PJSIP/speedport-00000004'
    -- Channel PJSIP/notebook-00000005 left 'native_rtp' basic-bridge <32a38034-25bb-416c-b39b-b8578543398f>
asterisk

my pjsip.conf



; basic Templates

[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
allow=gsm
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


[notebook](endpoint_basic)
auth=notebook
aors=notebook
callerid="Notebook" <6003>
[notebook](authentication)
password=notebook
username=notebook
[notebook](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 = C3,dLWE87bcEhTi

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

[speedport]
type=endpoint. I was often call
context=internal
callerid="speedport" <**71>
disallow=all
allow=ulaw
allow=alaw
allow=gsm
outbound_auth=speedport
aors=speedport

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

Other calls from fixed line phones (no smartphones) work perfect. I’m often call from external fixed line number and there is no problem with the voice sound. Only when calling from a mobile, I doesn’t hear the tone.

I don’t think it is codec related. I might be direct media related. I really need to see full pjsip set logger on output for both legs.

Also, is the the router a back to back user agent or a proxy. Especially in the latter case, you want to disable this, and talk directly to the remote user agent. Bad SIPALG implementations are a common cause of problems.

It’s easy to eliminate direct media as a possibility by setting “direct_media” to “no” on the endpoint.

ok, thanks. I have set direct_media on the endpoint to no. And now it works. I can hear the tone and the voice sound in both directions Could you explain the root cause and the meaning of direct_media, please.

I don’t know exactly the difference between B2BUA and a proxy.

My router has a SIP Server and I have configured asterisk as SIP fone for the router. asterisk registers at the router.

I have checked the router documentation and the SIP server of the router serves as B2BUA

Direct media means that Asterisk gives each party the other party’s media address, so that media flows between the two. That typically causes problems when NAT is involved, as there may be no direct route, using the addresses. At first sight the addresses you show are both on the same LAN, but I’m not sufficiently clear as whether it is quoting learned addresses, or those from SDP. I’m wondering if those differ, in your case.