Re: [SR-Users] controlling presence with new module `pua_json`

2019-08-30 Thread E. Schmidbauer
hi Bill,
The json body you send has to correspond with your SIP SUBSCRIBE data
(active_watchers table)
I'd be happy help out if you want to send me some data from your
active_watchers table.
Thanks,
E

On Thu, Aug 29, 2019 at 12:50 PM Henning Westerholt  wrote:

> Hello Bill,
>
> (please keep the list in CC)
>
> yes, this seems to be the case. Just looked briefly to the code, it does
> an assignment in some cases. E.g. if no Presentity* data is given it
> will just use the From* information. And then it should later output an
> error from pua_json_update_presentity(..) if there is not the necessary
> data. Do you see any error message like this?
>
> Another idea - does it works if you add more "missing" data in the curl
> requests?
>
> Cheers,
>
> Henning
>
>
> Am 28.08.19 um 21:16 schrieb b...@novatrope.us:
> > Henning: Good point.
> >
> > I do see a number of errors in the log. It looks like the json routine
> > is looking for data that is not in the http query as specified by the
> > author.
> >
> >
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > Event-Name: [update]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > Event-Package: [dialog]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c
> > error - failed to extract field [Presentity]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > Presentity: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c
> > error - failed to extract field [Presentity-User]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > Presentity-User: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c
> > error - failed to extract field [Presentity-Realm]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > Presentity-Realm: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): From:
> > [sip:1020101@]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > From-User: [1020101]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > From-Realm: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c
> > error - failed to extract field [From-URI]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > From-URI: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): To:
> > [sip:1020108@:50060]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > To-User: [1020108]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c
> > error - failed to extract field [To-URI]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): To-URI: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > Call-ID: [1020101@]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c
> > error - failed to extract field [From-Tag]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > From-Tag: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c
> > error - failed to extract field [To-Tag]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): To-Tag: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c
> > error - failed to extract field [Direction]
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field():
> > Direction: []
> > 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): State:
> > [Confirmed]
> > 17(125579) DEBUG: presence [event_list.c:348]: search_event(): start
> > event= [dialog/5]
> >
> > On 8/28/19 12:00 PM, Henning Westerholt wrote:
> >> Hello Bill,
> >>
> >> just giving some generic debug pointers here:
> >>
> >> - do you see any errors in the kamailio log file?
> >>
> >> - do you see any SIP traffic (e.g. by observing with ngrep, wireshark
> >> etc..) to the phone after your curl command?
> >>
> >> Cheers,
> >>
> >> Henning
> >>
> >> Am 28.08.19 um 19:04 schrieb b...@novatrope.us:
> >>> Hi all:
> >>>
> >>> I am trying to use the procedure for setting BLF lights described in
> >>>
> https://blog.voipxswitch.com/2018/02/22/kamailio-controlling-presence-with-new-module-pua_json/#comment-587
> >>>
> >>>
> >>> WIthout success.
> >>>
> >>> My configuration is 1 Grandstream GXP2130 phone behind a NAT on a
> >>> public IP. (IPP in example below)
> >>>
> >>> Kamailio is running on public IP (IPK in example) listening on port
> >>> 50060
> >>>
> >>> The command I am sending:
> >>>
> >>> curl -d
> >>> '{"Call-ID":"1020101@
> ","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@
> :50060","To-User":"1020108","To-Realm":":50060","From":"sip:1020101@","From-User":"1020101","From-Realm":"","State":"Confirmed"}'
>
> >>>
> >>> http://localhost:8080/presence/
> >>> {"Call-ID":"1020101@
> ","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@
> :50060","To

Re: [SR-Users] controlling presence with new module `pua_json`

2019-08-29 Thread Henning Westerholt
Hello Bill,

(please keep the list in CC)

yes, this seems to be the case. Just looked briefly to the code, it does 
an assignment in some cases. E.g. if no Presentity* data is given it 
will just use the From* information. And then it should later output an 
error from pua_json_update_presentity(..) if there is not the necessary 
data. Do you see any error message like this?

Another idea - does it works if you add more "missing" data in the curl 
requests?

Cheers,

Henning


Am 28.08.19 um 21:16 schrieb b...@novatrope.us:
> Henning: Good point.
>
> I do see a number of errors in the log. It looks like the json routine 
> is looking for data that is not in the http query as specified by the 
> author.
>
>
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> Event-Name: [update]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> Event-Package: [dialog]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c 
> error - failed to extract field [Presentity]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> Presentity: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c 
> error - failed to extract field [Presentity-User]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> Presentity-User: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c 
> error - failed to extract field [Presentity-Realm]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> Presentity-Realm: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): From: 
> [sip:1020101@]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> From-User: [1020101]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> From-Realm: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c 
> error - failed to extract field [From-URI]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> From-URI: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): To: 
> [sip:1020108@:50060]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> To-User: [1020108]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c 
> error - failed to extract field [To-URI]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): To-URI: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> Call-ID: [1020101@]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c 
> error - failed to extract field [From-Tag]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> From-Tag: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c 
> error - failed to extract field [To-Tag]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): To-Tag: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): Json-c 
> error - failed to extract field [Direction]
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): 
> Direction: []
> 17(125579) DEBUG: json [json_mod.c:70]: _json_extract_field(): State: 
> [Confirmed]
> 17(125579) DEBUG: presence [event_list.c:348]: search_event(): start 
> event= [dialog/5]
>
> On 8/28/19 12:00 PM, Henning Westerholt wrote:
>> Hello Bill,
>>
>> just giving some generic debug pointers here:
>>
>> - do you see any errors in the kamailio log file?
>>
>> - do you see any SIP traffic (e.g. by observing with ngrep, wireshark
>> etc..) to the phone after your curl command?
>>
>> Cheers,
>>
>> Henning
>>
>> Am 28.08.19 um 19:04 schrieb b...@novatrope.us:
>>> Hi all:
>>>
>>> I am trying to use the procedure for setting BLF lights described in
>>> https://blog.voipxswitch.com/2018/02/22/kamailio-controlling-presence-with-new-module-pua_json/#comment-587
>>>  
>>>
>>>
>>> WIthout success.
>>>
>>> My configuration is 1 Grandstream GXP2130 phone behind a NAT on a
>>> public IP. (IPP in example below)
>>>
>>> Kamailio is running on public IP (IPK in example) listening on port 
>>> 50060
>>>
>>> The command I am sending:
>>>
>>> curl -d
>>> '{"Call-ID":"1020101@","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@:50060","To-User":"1020108","To-Realm":":50060","From":"sip:1020101@","From-User":"1020101","From-Realm":"","State":"Confirmed"}'
>>>  
>>>
>>> http://localhost:8080/presence/
>>> {"Call-ID":"1020101@","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@:50060","To-User":"1020108","To-Realm":":50060","From":"sip:1020101@","From-User":"1020101","From-Realm":"","State":"Confirmed"}
>>>  
>>>
>>>
>>>
>>>
>>> Kamailio appears to be processing the command OK, so I think I am just
>>> not setting it up properly>
>>>
>>> Anybody having any luck with this procedure, let me know how you are
>>> getting it to work.
>>>
>>>
>>> Bill
>>>
>>>
>>>
>>> ___
>>> Kamailio (SER) - User

Re: [SR-Users] controlling presence with new module `pua_json`

2019-08-28 Thread Henning Westerholt
Hello Bill,

just giving some generic debug pointers here:

- do you see any errors in the kamailio log file?

- do you see any SIP traffic (e.g. by observing with ngrep, wireshark 
etc..) to the phone after your curl command?

Cheers,

Henning

Am 28.08.19 um 19:04 schrieb b...@novatrope.us:
> Hi all:
>
> I am trying to use the procedure for setting BLF lights described in 
> https://blog.voipxswitch.com/2018/02/22/kamailio-controlling-presence-with-new-module-pua_json/#comment-587
>
> WIthout success.
>
> My configuration is 1 Grandstream GXP2130 phone behind a NAT on a 
> public IP. (IPP in example below)
>
> Kamailio is running on public IP (IPK in example) listening on port 50060
>
> The command I am sending:
>
> curl -d 
> '{"Call-ID":"1020101@","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@:50060","To-User":"1020108","To-Realm":":50060","From":"sip:1020101@","From-User":"1020101","From-Realm":"","State":"Confirmed"}'
>  
> http://localhost:8080/presence/
> {"Call-ID":"1020101@","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@:50060","To-User":"1020108","To-Realm":":50060","From":"sip:1020101@","From-User":"1020101","From-Realm":"","State":"Confirmed"}
>  
>
>
>
> Kamailio appears to be processing the command OK, so I think I am just 
> not setting it up properly>
>
> Anybody having any luck with this procedure, let me know how you are 
> getting it to work.
>
>
> Bill
>
>
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] controlling presence with new module `pua_json`

2019-08-28 Thread b...@novatrope.us

Hi all:

I am trying to use the procedure for setting BLF lights described in 
https://blog.voipxswitch.com/2018/02/22/kamailio-controlling-presence-with-new-module-pua_json/#comment-587


WIthout success.

My configuration is 1 Grandstream GXP2130 phone behind a NAT on a public 
IP. (IPP in example below)


Kamailio is running on public IP (IPK in example) listening on port 50060

The command I am sending:

curl -d 
'{"Call-ID":"1020101@","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@:50060","To-User":"1020108","To-Realm":":50060","From":"sip:1020101@","From-User":"1020101","From-Realm":"","State":"Confirmed"}' 
http://localhost:8080/presence/

{"Call-ID":"1020101@","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@:50060","To-User":"1020108","To-Realm":":50060","From":"sip:1020101@","From-User":"1020101","From-Realm":"","State":"Confirmed"}


Kamailio appears to be processing the command OK, so I think I am just 
not setting it up properly>


Anybody having any luck with this procedure, let me know how you are 
getting it to work.



Bill



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users