[SR-Users] controlling presence with new module `pua_json`
Henning Westerholt
hw at skalatan.de
Thu Aug 29 18:50:14 CEST 2019
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 bill at 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@<IP of phone>]
> 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: [<IP of phone>]
> 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@<IP of server>: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@<IP of phone>]
> 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 bill at 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@<IPP>","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@<IPK>:50060","To-User":"1020108","To-Realm":"<IPK>:50060","From":"sip:1020101@<IPP>","From-User":"1020101","From-Realm":"<IPP>","State":"Confirmed"}'
>>>
>>> http://localhost:8080/presence/
>>> {"Call-ID":"1020101@<IPP>","Event-Category":"presence","Event-Name":"update","Event-Package":"dialog","Expires":"3600","To":"sip:1020108@<IPK>:50060","To-User":"1020108","To-Realm":"<IPK>:50060","From":"sip:1020101@<IPP>","From-User":"1020101","From-Realm":"<IPP>","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 at 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
More information about the sr-users
mailing list