Unable to bind contact

Once I put my Yealink sip phone on Subcribe yes I receive this:
ERROR[426415]: res_pjsip_registrar.c:764 in register_aor_core: Unable to bind contact ‘sip:FLapa@192.168.50.84:5060’ to AOR ‘FLapa’

AOR with contact = sip:FLapa@192.168.50.84:5060 or without is the same.

I have to put Subcribe to no on the Yealink voip phone then error disapear

CLI> pjsip show subscriptions
No such command ‘pjsip show subscriptions’ (type ‘core show help pjsip show subscriptions’ for other possible commands)

I guess the command works on the following way


CLI> pjsip show subscriptions inbound
Endpoint: <Endpoint/Caller-ID.............................................>
Resource: <Resource/Event.................................................>
  Expiry: <Expiry>  <Call-id..............................................>
===========================================================================

0 active subscriptions
   

CLI> pjsip show subscriptions outbound
Endpoint: <Endpoint/Caller-ID.............................................>
Resource: <Resource/Event.................................................>
  Expiry: <Expiry>  <Call-id..............................................>
===========================================================================

0 active subscriptions

Also

In order for presence subscriptions to work properly, some modules need to be loaded. Here is a list of the required modules:

  • res_pjsip.so : Core of PJSIP code in Asterisk.
  • res_pjsip_pubsub.so : The code that implements SUBSCRIBE/NOTIFY logic, on which individual event handlers are built.
  • res_pjsip_exten_state.so : Handles the “presence” and “dialog” events.
  • res_pjsip_pidf_body_generator.so : This module generates application/pidf+xml message bodies. Required for most subscriptions to the “presence” event.
  • res_pjsip_xpidf_body_generator.so : This module generates application/xpidf+xml message bodies. Required for some subscriptions to the “presence” event.
  • res_pjsip_dialog_info_body_generator.so : Required for subscriptions to the “dialog” event. This module generates application/dialog-info message bodies.

https://wiki.asterisk.org/wiki/display/AST/Configuring+res_pjsip+for+Presence+Subscriptions

Hi thanks for the help

I did not understand why TAB did not give up inbound and outbound on
CLI> pjsip show subscriptions

But if I finger add than ok.
Thank you

Anyway it does not give me any further on this

I do load all the modules you mention.
I do autoload = no in modules.conf
Here are all the res_pjsip* modules I load:

preload => res_pjsip.so
preload => res_pjsip_acl.so
load => res_pjsip_endpoint_identifier_ip.so
load => res_pjsip_endpoint_identifier_user.so
load => res_pjsip_authenticator_digest.so
load => res_pjsip_session.so
load => res_pjsip_sdp_rtp.so
load => res_pjsip_dtmf_info.so
load => res_pjsip_caller_id.so
load => res_pjsip_empty_info.so
load => res_pjsip_header_funcs.so
load => res_pjsip_history.so
load => res_pjsip_logger.so
load => res_pjsip_messaging.so
load => res_pjsip_one_touch_record_info.so
load => res_pjsip_path.so
load => res_pjsip_rfc3326.so
load => res_pjsip_send_to_voicemail.so
load => res_pjsip_registrar.so
load => res_pjsip_pubsub.so
load => res_pjsip_pidf_body_generator.so
load => res_pjsip_xpidf_body_generator.so
load => res_pjsip_pidf_digium_body_supplement.so
load => res_pjsip_pidf_eyebeam_body_supplement.so
load => res_pjsip_dialog_info_body_generator.so
load => res_pjsip_refer.so
load => res_pjsip_exten_state.so
load => res_pjsip_outbound_publish.so
load => res_pjsip_publish_asterisk.so
load => res_pjsip_mwi.so
load => res_pjsip_mwi_body_generator.so
load => chan_pjsip.so
load => func_pjsip_aor
load => func_pjsip_contact
load => func_pjsip_endpoint
load => res_pjsip_notify.so

In the response to subcribe Asterisk SIP replies with
SIP/2.0 401 Bad Event

ERROR[455289]: res_pjsip_registrar.c:764 in register_aor_core: Unable to bind contact ‘sip:FLapa@192.168.50.84:5060’ to AOR ‘FLapa’

WARNING[455289]: res_pjsip_pubsub.c:787 in subscription_get_handler_from_rdata: No registered subscribe handler for event reg from FLapa

I have already googled on the subject but no clues.

SIP/2.0 401 Bad Event typo, not 401 but 489

SIP/2.0 489 Bad Event

The messages are unrelated. The 489 is occurring because Asterisk does not support subscriptions for the given event type.

The “Unable to bind contact” is occurring because the inbound registration can’t be stored. Is res_sorcery_astdb loaded?

Hello again, thanks for reply

Yes is running

CLI> module show like res_sorcery
Module Description Use Count Status Support Level
res_sorcery_astdb.so Sorcery Astdb Object Wizard 2 Running core
res_sorcery_config.so Sorcery Configuration File Object Wizard 18 Running core
res_sorcery_memory.so Sorcery In-Memory Object Wizard 2 Running core
res_sorcery_memory_cache.so Sorcery Memory Cache Object Wizard 0 Running core
4 modules loaded

Does the system have permission for astdb? If you enable autoload does the registrar message go away?

with autoload = yes is the same

Or probably … does not work.

Anyway thanks for the help

After a week strugling for a migration from sip to pjsip still problems.
I have already tried all possible combinations I can imagine from the asterisk documentation.
Latest ver 18.8.0.
No way get rid of this:

ERROR[533728] res_pjsip_registrar.c: Unable to bind contact ‘sip:FLapa@192.168.50.84:5060’ to AOR ‘FLapa’

WARNING[533728] res_pjsip_pubsub.c: No registered subscribe handler for event reg from FLapa

And when I do an outside call from sip phone to trunk IAX:
NOTICE[533728] res_pjsip_exten_state.c: Endpoint ‘FLapa’ state subscription failed: Extension ‘0217995330’ does not exist in context ‘internal’ or has no associated hint

At least the call works.

Hi guys

I have found the solution for this:
ERROR[426415]: res_pjsip_registrar.c:764 in register_aor_core: Unable to bind contact ‘sip:FLapa@192.168.50.84:5060’ to AOR ‘FLapa’

I decided to follow the C code on this line and the C code for the function involved.
This was an error return that returns printf(…
After following a couple of C files the conclusion was that the problem was in sorcery.conf

So I read the very scarce things about sorcery and sorcery.conf.
Ended up on the tail of this page
https://wiki.asterisk.org/wiki/display/AST/Sorcery

=======
[res_pjsip]
auth=config,pjsip.conf,criteria=type=auth
domain_alias=config,pjsip.conf,criteria=type=domain_alias
global=config,pjsip.conf,criteria=type=global
system=config,pjsip.conf,criteria=type=system
transport=config,pjsip.conf,criteria=type=transport
aor=config,pjsip.conf,criteria=type=aor
endpoint=config,pjsip.conf,criteria=type=endpoint
contact=astdb,registrator

[res_pjsip_endpoint_identifier_ip]
identify=config,pjsip.conf,criteria=type=identify

[res_pjsip_outbound_publish]
outbound-publish=config,pjsip.conf,criteria=type=outbound-publish

[res_pjsip_outbound_registration]
registration=config,pjsip.conf,criteria=type=registration

What puzzled me was why was contact based on astdb and
not on config, in fact I was trying
contact=config,pjsip.conf,criteria=type=contact
hoping [contact] in pjsip.conf did someting, but no it did not.

With:
contact=astdb,registrator

IT DID WORK!!

Moral of story:

  • Higher complexity on pjsip overall
  • Confusing and scarce documentation
  • Books have little written or not at all material on pjsip and sorcery
  • Spider Net complexity interrelationship between modules
  • Hours and days of trial and error before putting this on track, even with
    all the remaining components like extensions.conf ready to roll for years on sip.conf.
  • Asterisk is becoming even more difficult that it was to put up, definitely
    not a thing for linux juniors.
  • As Tannebaum says, complexity bloat drives more problems and … more bugs

Lets see how it goes with thinks like parking, queues, transfer, etc.
In theory that is how stack and module programming should work, other components
of this BIG project should not be afected. Lets wait and see.

Sendmail used o be the most difficult of all, I think now Asterisk is riding the league.

Anyway I will keep going as it means a huge money saving from proprietary Voip
PBX. No doubt about it.

Pedro Guedes

1 Like

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