ikq / subscribe_notify_test

2 stars 0 forks source link

I have enabled SIP PRESENCE on Asterisk server, still getting error #1

Open haisamMH opened 3 years ago

haisamMH commented 3 years ago

client dialog: terminated (SUBSCRIBE non-OK response)

ikq commented 3 years ago

It's JsSIP subscriber/notifier API test, not presence client.

To use the code as presence client, you should modify it and create SUBSCRIBE with appropriate for your server :

  1. event_name ( probably 'presence' ?)
  2. accept - list of content-type that will be used in NOTIFY
  3. content-type - content-type of your SUBSCRIBE
  4. set some body (if need) to subscriber.subscribe(). (in my test I send without body)

In such cases, I take a SIP trace for some client working with my server and learn how to build SUBSCRIBE request..

The SUBSCRIBE sent by this test should simulate the SUBSCRIBE from other working clients.

E.g. I don't think your server will send NOTIFY with text/plain format, as I set in my test 'accept'.

   subscriber = jssipUA.subscriber(target, {
            event_name: eventName, // event name with optional ;id=xxx
            accept: 'application/pidf+xml,text/json,text/plain',
            expires: expires,
            content_type: 'text/plain',
            params: params,
            credential: credential,

Please attach JsSIP console log.