SIP Trunk Between Asterisk and IP Office

Hi Everyone,

Please find the attached screenshot for configured PJSIP.Conf for trunk registration with IP Office.
[mytrunk]
type=registration
transport=transport-udp
outbound_auth=mytrunk_auth
server_uri=sip:(IPO IP address)
client_uri=sip:3000@(IPO IP address) (sip extension registered on both ipo and astersik)
contact_user=3000
retry_interval=60
forbidden_retry_interval=600
expiration=3600
line=yes
endpoint=mytrunk

[mytrunk_auth]
type=auth
auth_type=userpass
password=123456
username=3000
realm=IPO IP address

Getting below error
Asterisk*CLI> pjsip show registrations

<Registration/ServerURI…> <Auth…> <Status…>

mytrunk/sip:192.68.100.160 mytrunk_auth Rejected (exp. 30s ago)

The remote side rejected it for some reason. You can provide a SIP trace using “pjsip set logger on” which can SOMETIMES provide more information, but otherwise there’s limited visibility into why something doesn’t work (on purpose).

Hi Jcolp,

Thank you for prompt response. Until the trunk is registered on asterisk and up how can i take sip trace any anotherway please advise.
If possible please help me with any template for registering trunk on asterisk my sip extension is 3000 and password is 123456 and ip for avaya ipo is 192.168.100.160

It doesn’t matter if it is registered or not. Invoking “pjsip set logger on” will show you SIP traffic regardless, and registration attempts.

Additionally, your output shows an IP address of “192.168.100.160” for what Asterisk is registering to, but your latest message says “192.168.100.180”.

1 Like

Sorry my type error please ignore it.
Asterisk ip: 192.168.100.163
Avaya ip office:192.168.100.191
<— Transmitting SIP request (613 bytes) to UDP:192.168.100.191:5060 —>
REGISTER sip:192.168.100.191 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.163:5060;rport;branch=z9hG4bKPj274a11d9-7c55-4cf5-aef1-bb6e8250d49b
From: sip:ipoffice@192.168.100.191;tag=a526770c-b919-47af-a68b-1f8c987d582b
To: sip:ipoffice@192.168.100.191
Call-ID: 9f01bc99-2925-4677-b362-f3e7c96fb8f3
CSeq: 53038 REGISTER
Contact: sip:ipoffice@192.168.100.163:5060;line=othwoou
Expires: 480
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Route: sip:192.168.100.191
Max-Forwards: 70
User-Agent: Asterisk PBX 22.2.0
Content-Length: 0

<— Received SIP response (449 bytes) from UDP:192.168.100.191:5060 —>
SIP/2.0 405 Method Not Allowed
Via: SIP/2.0/UDP 192.168.100.163:5060;rport;branch=z9hG4bKPj274a11d9-7c55-4cf5-aef1-bb6e8250d49b
From: sip:ipoffice@192.168.100.191;tag=a526770c-b919-47af-a68b-1f8c987d582b
Call-ID: 9f01bc99-2925-4677-b362-f3e7c96fb8f3
CSeq: 53038 REGISTER
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,INFO,NOTIFY,UPDATE
Supported: timer
Server: IP Office 11.1.0.2.0 build 14
Content-Length: 0
To: sip:ipoffice@192.168.100.191

[Feb 21 00:47:47] WARNING[3305]: res_pjsip_outbound_registration.c:1440 handle_registration_response: ‘405’ fatal response received from ‘sip:192.168.100.191’ on registration attempt to ‘sip:ipoffice@192.168.100.191’, retrying in ‘300’ seconds

You have configured Asterisk to register to 192.168.100.191. It doesn’t support registering to it.

Sorry i didn’t get it. Is there any compatibility to check

I can’t comment on the Avaya.

Just need to understand we cant have SIP trunk between asterisk to Avaya IPO, also if you can assist us from below SIP message and share inputs about the issue would be really appreciated and helpful.
<— Received SIP response (449 bytes) from UDP:192.168.100.191:5060 —>
SIP/2.0 405 Method Not Allowed
Via: SIP/2.0/UDP 192.168.100.163:5060;rport;branch=z9hG4bKPj274a11d9-7c55-4cf5-aef1-bb6e8250d49b
From: sip:ipoffice@192.168.100.191;tag=a526770c-b919-47af-a68b-1f8c987d582b
Call-ID: 9f01bc99-2925-4677-b362-f3e7c96fb8f3
CSeq: 53038 REGISTER
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,INFO,NOTIFY,UPDATE
Supported: timer
Server: IP Office 11.1.0.2.0 build 14
Content-Length: 0
To: sip:ipoffice@192.168.100.191

As I said, I can’t comment on the Avaya. I have no knowledge or information about it.

From an Asterisk perspective we tried to send a REGISTER to it. It says method not allowed and thus we couldn’t register. Why that is, I don’t know.

Your problem is really the Avaya and understanding what it is capable of and how to connect to it. Once that is known then configuring Asterisk can be done.

Thank you Jcolp got it. Is there anyway to register trunk without sip extension and password on asterisk

I don’t understand what this means. In particular “extension” has no meaning in SIP and has no relevant meaning in Asterisk.

If you are referring to the user part of a URI, the definition of address of record doesn’t require a user part, so you can register an address without as user part, and REGISTER doesn’t have to be authenticated.

It’s a long time ago, but I think we interfaced Avaya to Asterisk and treated Asterisk as a trunk, on the Avaya side, with no registration, on either side, just static IP addresses.

Any reference template to register trunk without authorization.

How to set the trunk up without registration or can i register IPO as client to the Asterisk for calls share inputs about the issue would be really helpful.
Tried multiple templates no luck.

PJSIP does not use the term “trunk”. Everything is an “endpoint”.

If you don’t want to SIP REGISTER with an endpoint (in your case the Avaya SIP server), then your pjsip.conf will not have a definition for an object of “type=register”.associated with that endpoint.

If you don’t want to authenticate with your endpoint, your pjsipi.conf will not have a definition for an object of “type=auth” associated with that endpoint. However, your 1st post indicated that you do authenticate to the Avaya SIP server using the username name of “3000” and the password of “123456”.

You still need to have a definition for an object of “type=endpoint” with all the setting necessary to communicate with the endpoint.

Your basic assumptions are:

  1. Avaya SIP server protocol/IPaddr/port: udp://192.168.100.191:5060
  2. Your credentials for authenticating with the Avaya SIP server are: 3000/123456 ;(userpass)
  3. When calls come from the Avaya SIP server, they will be trying to reach the extension “3000” within your Asterisk server.
  4. Your Asterisk protocol/IPaddr/port: udp://192.168.100.163:5060

Start with a definition of how Asterisk can use PJSIP to communicate:

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

Next define the Avaya SIP Server endpoint:

[avaya_office]
type=endpoint
transport=transport-udp-nonat
context=from-avaya_office ; context for inbound communication FROM avaya_office
outbound_auth=auth_avaya_office ; definition for how to authenticate communication sent to avaya_office
disallow=all ; Disallow all codec
allow=ulaw,alaw,gsm ; Only support codecs ulaw, alaw, and gsm
aors=avaya_office ; Assign any communication coming from this endpoint should be associated with the "avaya_office" Address of Record (AOR)

Define how to authenticate to Avaya SIP server:

[auth_avaya_office]
type=auth
auth_type=userpass
password=123456
username=3000

Define an Address of Record that can map communication from an IP address to a specific endpoint since I don’t think the Avaya SIP server will send authentication info along with any INVITE/OPTIONS to your Asterisk box:

[avaya_office]
type=aor
contact=sip:192.168.100.191:5060 ; Use this SIP URI to communicate with avaya_office

[avaya_office]
type=identity
endpoint=avaya_office
match=192.168.100.191 ; Any communication from 192.168.100.191 should be associated with the endpoint avaya_office

Now, if you do need to SIP REGISTER with the Avaya SIP server, you need to add a definition of the SIP REGISTER that will be sent to the Avaya SIP server:

[avaya_office]
type=registration
transport=transport-udp-nonat
outbound_auth=auth_avaya_office ; definition for how to authenticate communication sent to avaya_office
client_uri=sip:3000@192.168.100.163:5060
server_uri=sip:192.168.100.191:5060
contact_user=3000 ; Which extension to contact for communication coming FROM the avaya_office endpoint

Please note that all the above should be in the pjsip.conf.

In your extensions.conf, you should have the following context:

[from-avaya_office]
;;; Inbound call to extension 3000 will be answered, play the hello-world message, play goodbye message and then hangup the call.
exten => 3000,1,Verbose(3, Inbound call from avaya_office SIP server)
 same => n,Answer()
 same => n,Playback(hello-world)
 same => n,Playback(goodbye)
 same => n,Hangup()

For outbound calls from your Asterisk box to the Avaya SIP server, your extensions.conf should use the PJSIP method to Dial() out. For example, if you want to send a call to 1-800-555-1212 through the Avaya SIP server, your extensions.conf should use:

Dial(PJSIP/18005551212@avaya_office)

nishanth143, please try and define what you want to do and then do some research on how to do it. All I wrote above can be found on the mailing list, in the documentation, and many, many blog posts reachable through any web search. As a matter fact, I don’t even know if my example will work 100% for you. I don’t have your setup for me to test. That’s why it is imperative you understand what I wrote instead of cut/paste and assume it will work.

If you are not sure where to start, look up how SIP communication works. It will give you better undetrstanding of what everyone was saying while trying to help you.

See ya…

d.c.

Your registration is not being rejected because of anything to do with authentication. The Avaya hasn’t got has far as asking you for that, and if it had got that far, and wasn’t configured to require authentication, any authentication data provided to Asterisk would not be used.

If the Avaya doesn’t support registration, you will have to configure Asterisk’s address using its configuration interface. How to do that is an Avaya question, not an Asterisk one.