I found a solution. hex strings are reversed).
Thank you very much!
ср, 12 окт. 2022 г. в 12:59, Ryzhik Ivan <ryzhik.i...@gmail.com
<mailto:ryzhik.i...@gmail.com>>:
and one more research: $T_id returns hex encoded label.hashid
but my attempts failed:
got $T_id = 6545e285.3fe4
Send: {"jsonrpc": "2.0", "method": "t_reply", "id": 1,
"params": {"code": "487", "reason": "Terminating",
"trans_id": "16356:1699078789", "to_tag": "<null>"}}
Got:
b'{"jsonrpc":"2.0","error":{"code":404,"message":"Transaction
not found"},"id":1}'
ср, 12 окт. 2022 г. в 11:13, Ryzhik Ivan
<ryzhik.i...@gmail.com <mailto:ryzhik.i...@gmail.com>>:
Thank you, Bogdan.
I got stuck with tm documentation.
1) MI t_reply command has named parameters, ok, no
problem.
2) trans_id - transaction identifier (has the
hash_entry:label format) - what is this? if i use $T_id
i got reply "Invalid trans_id".
3) Where can I get to_tag from script level on initial
invite?
...
t_reply_with_body(183, "Session progress",
$(var(body){re.subst,$var(re)}) );
avp_db_query("insert into moh (callid, timeout,
tid,totag) values ('$ci', $var(wait_time), '$T_id',
'??????')");
...
Regards, Ivan.
вт, 11 окт. 2022 г. в 12:35, Bogdan-Andrei Iancu
<bog...@opensips.org <mailto:bog...@opensips.org>>:
Hi Ivan,
you can use timer_route, but as there is no way to
send a reply for a particular transaction from script
level (only to the currently processed request), you
will have to trigger the MI cmds from the timer
route, which is a bit hackish ....
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
https://www.opensips-solutions.com
<https://www.opensips-solutions.com>
OpenSIPS Summit 27-30 Sept 2022, Athens
https://www.opensips.org/events/Summit-2022Athens/
<https://www.opensips.org/events/Summit-2022Athens/>
On 10/11/22 11:47 AM, Ryzhik Ivan wrote:
Hi, Bogdan!
What d' you think, can we use timer_route instead of
an external script?
Regards, Ivan.
пн, 10 окт. 2022 г. в 17:04, Bogdan-Andrei Iancu
<bog...@opensips.org <mailto:bog...@opensips.org>>:
Hi Ryzhik,
Without a t_relay() it makes not much sense to
have an dialog structure at all - the dialog
module in opensips is actually design for
proxied calls, not for UAC calls.
IMO, you should keep it a transaction level, by
sending replies back only. When getting the
INVITE, put its call-id into a DB table (to keep
only the "active" session) together with a
lifetime / expiration time. When getting a
CANCEL, update the table (set lifetime to 0), to
know it is terminated. And use an simple
external script that keeps scanning the DB for
(1) sending 487 Terminated via MI if the record
has 0 lifetime or (2) send a 408 Timeout via MI
if the lifetime exceeded.
In a similar way you can handle the BYE - send
back 200OK for the BYE and set 0 in lifetime, to
send a 487 canceled back
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
https://www.opensips-solutions.com
<https://www.opensips-solutions.com>
OpenSIPS Summit 27-30 Sept 2022, Athens
https://www.opensips.org/events/Summit-2022Athens/
<https://www.opensips.org/events/Summit-2022Athens/>
On 10/10/22 4:33 PM, Ryzhik Ivan wrote:
Hello!
My opensips version is 3.1 with tm,dialog and
rtpengine modules.
On incoming INVITE i'm creating an early dialog
with 183 replies and i'm playing audio to
caller with rtpengine, no t_relay() on this
step, OS is acting as UAS endpoint.
If the caller cancels the invite with a CANCEL
message - all works great.
But some users terminate dialog with BYE message.
1) on BYE with to-tag OS can't find dialog with
match_dialog(), because to-tag presents.
2) if i use load_dialog_ctx($ci) - it is
possible to handle BYE.
3) in early dialog termination with BYE we also
need to send final response to the INVITE
transaction.
Maybe I did something wrong, but I can't handle
the final response to INVITE in this case.
_______________________________________________
Users mailing list
Users@lists.opensips.org <mailto:Users@lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>