get expires from REGISTER

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

get expires from REGISTER

Dragomir Haralambiev
Hello,

I try to get expires from REGISTER.
xlog("Expires=$hdr(expires)\n");

I receive this:
Expires=<null>

Here is REGISTER

Session Initiation Protocol (SIP as raw text)
    REGISTER sip:sip-server.com:5060 SIP/2.0\r\n
    Accept: application/reginfo+xml, application/sdp, application/simple-message-summary, message/sipfrag, multipart/mixed, multipart/related\r\n
    Via: SIP/2.0/UDP 10.152.220.38:5062;branch=z9hG4bKde569c7a0f7678fe1;rport\r\n
    Max-Forwards: 70\r\n
    From: "55555555" <sip:55555555@...:5060>;tag=026b9b8a13\r\n
    To: "55555555" <sip:55555555@...:5060>\r\n
    Call-ID: de52071eacc30295\r\n
    CSeq: 448743846 REGISTER\r\n
    Allow: ACK, BYE, CANCEL, INVITE, MESSAGE, NOTIFY, OPTIONS, REFER, SUBSCRIBE, UPDATE\r\n
    Contact: <sip:55555555@10.152.220.38:5062>;audio;expires=120\r\n
    User-Agent: Media5-fone/4.25.4.13060 Android/8.0.0\r\n
    Content-Length: 0\r\n
    \r\n

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: get expires from REGISTER

Liviu Chircu

Hi Dragomir,

There is no "Expires" in REGISTER, so $hdr(expires) prints "<null>". Try $(hdr(Contact){uri.param,expires}).

Regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 27.11.2017 13:46, Dragomir Haralambiev wrote:
Hello,

I try to get expires from REGISTER.
xlog("Expires=$hdr(expires)\n");

I receive this:
Expires=<null>

Here is REGISTER

Session Initiation Protocol (SIP as raw text)
    REGISTER sip:sip-server.com:5060 SIP/2.0\r\n
    Accept: application/reginfo+xml, application/sdp, application/simple-message-summary, message/sipfrag, multipart/mixed, multipart/related\r\n
    Via: SIP/2.0/UDP 10.152.220.38:5062;branch=z9hG4bKde569c7a0f7678fe1;rport\r\n
    Max-Forwards: 70\r\n
    From: "55555555" <sip:55555555@...:5060>;tag=026b9b8a13\r\n
    To: "55555555" <sip:55555555@...:5060>\r\n
    Call-ID: de52071eacc30295\r\n
    CSeq: 448743846 REGISTER\r\n
    Allow: ACK, BYE, CANCEL, INVITE, MESSAGE, NOTIFY, OPTIONS, REFER, SUBSCRIBE, UPDATE\r\n
    Contact: <sip:55555555@10.152.220.38:5062>;audio;expires=120\r\n
    User-Agent: Media5-fone/4.25.4.13060 Android/8.0.0\r\n
    Content-Length: 0\r\n
    \r\n


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: get expires from REGISTER

Dragomir Haralambiev
I try this:
xlog("Expires= $(hdr(Contact){uri.param,expires}) \n");

Here is ERRORS:
Nov 27 14:53:07 /usr/local/sbin/opensips[28413]: ERROR:core:parse_uri: bad uri, state 0 parsed: <<sip> (4) / <<sip:555555555@192.168.178.21:5060>;audio;expires=120> (57)
Nov 27 14:53:07 /usr/local/sbin/opensips[28413]: ERROR:core:tr_eval_uri: invalid uri [<sip:555555555@192.168.178.21:5060>;audio;expires=120]


2017-11-27 14:14 GMT+02:00 Liviu Chircu <[hidden email]>:

Hi Dragomir,

There is no "Expires" in REGISTER, so $hdr(expires) prints "<null>". Try $(hdr(Contact){uri.param,expires}).

Regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 27.11.2017 13:46, Dragomir Haralambiev wrote:
Hello,

I try to get expires from REGISTER.
xlog("Expires=$hdr(expires)\n");

I receive this:
Expires=<null>

Here is REGISTER

Session Initiation Protocol (SIP as raw text)
    REGISTER sip:sip-server.com:5060 SIP/2.0\r\n
    Accept: application/reginfo+xml, application/sdp, application/simple-message-summary, message/sipfrag, multipart/mixed, multipart/related\r\n
    Via: SIP/2.0/UDP 10.152.220.38:5062;branch=z9hG4bKde569c7a0f7678fe1;rport\r\n
    Max-Forwards: 70\r\n
    From: "55555555" <sip:55555555@...:5060>;tag=026b9b8a13\r\n
    To: "55555555" <sip:55555555@...:5060>\r\n
    Call-ID: de52071eacc30295\r\n
    CSeq: 448743846 REGISTER\r\n
    Allow: ACK, BYE, CANCEL, INVITE, MESSAGE, NOTIFY, OPTIONS, REFER, SUBSCRIBE, UPDATE\r\n
    Contact: <sip:55555555@10.152.220.38:5062>;audio;expires=120\r\n
    User-Agent: Media5-fone/4.25.4.13060 Android/8.0.0\r\n
    Content-Length: 0\r\n
    \r\n


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: get expires from REGISTER

Bogdan-Andrei Iancu-2
$hdr(Contact) return the whole Contact header which is a name-addr spec (according to the RFC3261 grammar).

You should try: $(hdr(Contact){nameaddr.param,expires})

See : http://www.opensips.org/Documentation/Script-Tran-2-3#toc68

Regards,

Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
On 11/27/2017 02:56 PM, Dragomir Haralambiev wrote:
I try this:
xlog("Expires= $(hdr(Contact){uri.param,expires}) \n");

Here is ERRORS:
Nov 27 14:53:07 /usr/local/sbin/opensips[28413]: ERROR:core:parse_uri: bad uri, state 0 parsed: <<sip> (4) / <<sip:555555555@192.168.178.21:5060>;audio;expires=120> (57)
Nov 27 14:53:07 /usr/local/sbin/opensips[28413]: ERROR:core:tr_eval_uri: invalid uri [<sip:555555555@192.168.178.21:5060>;audio;expires=120]


2017-11-27 14:14 GMT+02:00 Liviu Chircu <[hidden email]>:

Hi Dragomir,

There is no "Expires" in REGISTER, so $hdr(expires) prints "<null>". Try $(hdr(Contact){uri.param,expires}).

Regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 27.11.2017 13:46, Dragomir Haralambiev wrote:
Hello,

I try to get expires from REGISTER.
xlog("Expires=$hdr(expires)\n");

I receive this:
Expires=<null>

Here is REGISTER

Session Initiation Protocol (SIP as raw text)
    REGISTER sip:sip-server.com:5060 SIP/2.0\r\n
    Accept: application/reginfo+xml, application/sdp, application/simple-message-summary, message/sipfrag, multipart/mixed, multipart/related\r\n
    Via: SIP/2.0/UDP 10.152.220.38:5062;branch=z9hG4bKde569c7a0f7678fe1;rport\r\n
    Max-Forwards: 70\r\n
    From: "55555555" <sip:55555555@...:5060>;tag=026b9b8a13\r\n
    To: "55555555" <sip:55555555@...:5060>\r\n
    Call-ID: de52071eacc30295\r\n
    CSeq: 448743846 REGISTER\r\n
    Allow: ACK, BYE, CANCEL, INVITE, MESSAGE, NOTIFY, OPTIONS, REFER, SUBSCRIBE, UPDATE\r\n
    Contact: <sip:55555555@10.152.220.38:5062>;audio;expires=120\r\n
    User-Agent: Media5-fone/4.25.4.13060 Android/8.0.0\r\n
    Content-Length: 0\r\n
    \r\n


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users