Re: [asterisk-users] FW: Ready to throw up my hands in defeat

2023-05-22 Thread Stefan Tichy
Am Mon, May 22, 2023 at 04:50:49PM + schrieb TTT:
> You don't say what happens when you start Asterisk, but I'll assume
> your registration with your provider is failing.


Some CLI commands are usefull to find out which part of the
configration is working.

*CLI> pjsip list endpoints

  the endpoint should be listed as "Not in use"



*CLI> pjsip list registrations




 sipgate/sip:sipgate.de sipgate   Registered (exp. 51s)


Here the provider is called sipgate.



> -Original Message-
> 
> From: Steve Matzura [mailto:s...@noisynotes.com] 
> Sent: Monday, May 22, 2023 12:15 PM


> [voipms-inbound]
> 
> exten => 3115552368,1,Answer() ; fake DID number

For a first test you may replace this by that line:

exten => _X.,1,Goto(from-internal,100,1)

(first test only. That call is not "from-internal")



> i.e., where's the routing from the system answering the inbound connect 
> request to the actions in the extension 100 statements?

"Goto" can be used to jump to another context, extension and priority.



-- 
Stefan Tichy  ( asterisk3 at pi4tel dot de )

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] FW: Ready to throw up my hands in defeat

2023-05-22 Thread TTT
You don't say what happens when you start Asterisk, but I'll assume your 
registration with your provider is failing.  If you turn on SIP debug from CLI 
you can watch your registration attempts, and see the exact reason for failure. 
 (eg: unreachable vs credentials).  Post that output into the list email if you 
aren’t sure what to make of it.

 

The numerous similar stanzas have to do with pjsip.  Many of the older 
examples/guides reference a simpler (deprecated) SIP stack, with slightly 
different syntax.  If you google PJSIP + Asterisk config you'll send the 
purpose of all of those stanza's.  PJSIP adds a lot of complexity for the 
outlier use cases (99% of people don't need all of PJSIP's capabilities) - but 
you have to fill it all in.  There are some nice diagrams here 
(https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Sections+and+Relationships)
 which explains it fairly well.

 

Please reply to the list only (so anyone can jump in and benefit from the 
discussion too)

 

 

 

-Original Message-

From: Steve Matzura [mailto:s...@noisynotes.com] 

Sent: Monday, May 22, 2023 12:15 PM

To: TTT 

Subject: Re: [asterisk-users] Ready to throw up my hands in defeat

 

Thanks. Further reading and digging did in fact prove out that the RTP is a lot 
of what's been throwing me. I won't bother with that any longer.

 

 

I did make the "hello world" example from the Asterisk wiki work. It was 

simple enough--lift the example right out of the book, paste it into the 

appropriate files, install and configure Zoipr, restart Asterisk,  and 

it just worked. Good.

 

 

So now I'm branching out, ready to add my DID provider info and actually 

be able to call in from outside.

 

 

The following file contents come from my DID provider, voip.ms. The only 

thing I added was my specific DID registration info, which has been 

redacted here:

 

 

pjsip.conf:

 

 

[transport-udp]

 

type = transport

protocol = udp

bind = 0.0.0.0

 

[voipms]

type = registration

transport = transport-udp

outbound_auth = voipms

client_uri = sip:**@newyork6.voip.ms:5060

server_uri = sip:newyork6.voip.ms:5060

 

[voipms]

type = auth

auth_type = userpass

username = **

password = **

 

[voipms]

type = aor

contact = sip:**@newyork6.voip.ms

 

[voipms]

type = endpoint

transport = transport-udp

context = mycontext

disallow = all

allow = ulaw

; allow=g729 ; uncomment if you support g729

from_user = **

auth = voipms

outbound_auth = voipms

aors = voipms

; NAT parameters:

rtp_symmetric = yes

rewrite_contact = yes

send_rpid = yes

 

 

*** NOTE: I left those lines in because I am after all behind a home 

router so I thought I'd need it. ***

 

 

[voipms]

type = identify

endpoint = voipms

match = newyork6.voip.ms

 

 

Why so many stanzas all called 'voipms'? I see that they all have 

different types, so why not have everything in the same stanza?

 

 

Here's extensions.conf:

 

 

[mycontext]

; Make sure to include inbound prior to outbound because the _NXXNXX 

handler will match the incoming call and create a loop

include => voipms-inbound

include => voipms-outbound

 

[voipms-outbound]

exten => _1NXXNXX,1,Dial(PJSIP/${EXTEN}@voipms)

exten => _1NXXNXX,n,Hangup()

exten => _NXXNXX,1,Dial(PJSIP/1${EXTEN}@voipms)

exten => _NXXNXX,n,Hangup()

exten => _011.,1,Dial(PJSIP/${EXTEN}@voipms)

exten => _011.,n,Hangup()

exten => _00.,1,Dial(PJSIP/${EXTEN}@voipms)

exten => _00.,n,Hangup()

 

; inbound context example for your DID numbers, do not add the number 1 

in front

 

[voipms-inbound]

exten => 3115552368,1,Answer() ; fake DID number

 

 

Now, I have the block of text from the hello-world wiki:

 

 

[from-internal]

exten = 100,1,Answer()

same = n,Wait(1)

same = n,Playback(hello-world)

same = n,Hangup()

 

 

That's certainly clear enough.

 

 

My question is, how do I connect the two extensions.conf fragments? 

i.e., where's the routing from the system answering the inbound connect 

request to the actions in the extension 100 statements?

 

 

The book talks a lot about registering phones through SQL. Looking at 

pjsip.conf is a little bewildering--all those '[6001]' examples. Which 

ones do I absolutely need? I have two kinds of phones to register--one 

on my own LAN and one remote, presumably coming in with NAT'ing and 

definitely behind its own firewall on its own LAN.

 

 

On 5/22/2023 10:59 AM, TTT wrote:

 

> There are lots of little tweaks/adjustments overlooked in most guides/books.  
> The examples work most of the time, but even a small difference in your 
> environment might break them.

> 

> I'm pretty sure the list will be able to answer questions to help you figure 
> it out.  If you break down your current problem into the basic step/task and 
> explain what's not working then you'll likely get a good explanation.

> 

> If you're not sure where to start, just add one