[OpenSIPS-Users] external applications

Ben Newlin Ben.Newlin at genesys.com
Fri Apr 5 01:29:55 UTC 2024


There is no generic answer to that question. It depends on your routing script and the way your system works. The code you posted before checking for INVITE could do it, but only if it is placed in the right location.

You may want to review the different types of routes used in OpenSIPS scripting [1], and what kind of message or processing is being performed in each. That may help you determine where to place your checks.

Routing of a SIP request always begins in the unnamed route block.

[1] - https://www.opensips.org/Documentation/Script-Routes-3-4

Ben Newlin

From: Users <users-bounces at lists.opensips.org> on behalf of Prathibha B <prathibhab.tvm at gmail.com>
Date: Thursday, April 4, 2024 at 8:21 PM
To: OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] external applications
 EXTERNAL EMAIL - Please use caution with links and attachments

________________________________
My question is not regarding exec command. How to capture the start of the call? I'm unable to get the start.

Sent from Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Users <users-bounces at lists.opensips.org> on behalf of Ben Newlin <Ben.Newlin at genesys.com>
Sent: Thursday, April 4, 2024 9:22:28 PM
To: OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] external applications


Per the documentation [1], input variables to the script are provided as a separate parameter to the exec command. It does not do a direct shell execution of the entire first parameter. So it should be:



exec(“script.sh”, “INVITE”);



Also, for a relative command I’m not entirely sure where OpenSIPS would look. It could be the working directory or it could be the directory from which opensips was launched. Have you tried using an absolute path? Are you setting the wdir [2] parameter?



[1] - https://opensips.org/docs/modules/3.4.x/exec.html#func_exec<https://opensips.org/docs/modules/3.4.x/exec.html#func_exec>

[2] - https://www.opensips.org/Documentation/Script-CoreParameters-3-4#wdir<https://www.opensips.org/Documentation/Script-CoreParameters-3-4#wdir>



Ben Newlin



From: Users <users-bounces at lists.opensips.org> on behalf of Prathibha B <prathibhab.tvm at gmail.com>
Date: Thursday, April 4, 2024 at 11:32 AM
To: OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] external applications

 EXTERNAL EMAIL - Please use caution with links and attachments



________________________________

I've used the above code inside the route block.



On Thu, 4 Apr 2024 at 12:02, Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>> wrote:

if($rm == "INVITE") {

xlog("Request method = $rm");

exec("script.sh \"INVITE\"");

}





With the above code , I am getting the Request method = INVITE twice in the log file. But the exec() is not getting executed.







On Wed, 3 Apr 2024 at 19:43, Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>> wrote:

Yes. I am canceling the call prior to dialog creation.



Sent from Outlook for Android<https://aka.ms/AAb9ysg>

________________________________

From: Users <users-bounces at lists.opensips.org<mailto:users-bounces at lists.opensips.org>> on behalf of Ben Newlin <Ben.Newlin at genesys.com<mailto:Ben.Newlin at genesys.com>>
Sent: Wednesday, April 3, 2024 7:03:33 PM
To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:users at lists.opensips.org>>
Subject: Re: [OpenSIPS-Users] external applications



If your script is cancelling the call then why wouldn’t you “capture it” in the same place? Send whatever you need to whatever external entity you are using directly. You don’t need a callback to trigger if you know you are taking the action.



A created dialog being cancelled should result in a state change event – to CANCELLED I think -  so I assume you mean you are cancelling it prior to dialog creation, in which case there won’t be any dialog callback.



Ben Newlin



From: Users <users-bounces at lists.opensips.org<mailto:users-bounces at lists.opensips.org>> on behalf of Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>>
Date: Wednesday, April 3, 2024 at 2:35 AM
To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:users at lists.opensips.org>>
Subject: Re: [OpenSIPS-Users] external applications



 EXTERNAL EMAIL - Please use caution with links and attachments



________________________________

I am capturing the dropped call after ringing in failure_route, but  If I cancelled during the start of the call, how to capture it.



On Tue, 2 Apr 2024 at 20:38, Ben Newlin <Ben.Newlin at genesys.com<mailto:Ben.Newlin at genesys.com>> wrote:

The start of the call would be when you call “create_dialog”. The dialog state for that is “UNCONFIRMED”. I’m not sure whether a dialog state change event is raised for creation. It may only be raised when the state changes after creation. But since you control the dialog creation, you can just take whatever action you desire at that time.



Ben Newlin



From: Users <users-bounces at lists.opensips.org<mailto:users-bounces at lists.opensips.org>> on behalf of Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>>
Date: Tuesday, April 2, 2024 at 8:05 AM
To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:users at lists.opensips.org>>
Subject: Re: [OpenSIPS-Users] external applications

 EXTERNAL EMAIL - Please use caution with links and attachments



________________________________

I tried is_method("INVITE"), but it is getting called only at the start of RINGING.



On Tue, 2 Apr 2024 at 15:09, Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>> wrote:

I am able to capture the trying status also. But not getting the START of the call...



On Tue, 2 Apr 2024 at 14:59, Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>> wrote:

How do I identify the START and TRYING state of the call?



 I am able to capture RINGING, ANSWER and TERMINATED states.



On Tue, 2 Apr 2024 at 14:51, Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>> wrote:

I tried

event_route[E_DLG_STATE_CHANGED] {

}



I am getting syntax error.



On Tue, 2 Apr 2024 at 14:45, Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>> wrote:

How to use  E_DLG_STATE_CHANGED to identify the start of the call?





On Wed, 20 Mar 2024 at 19:46, Ben Newlin <Ben.Newlin at genesys.com<mailto:Ben.Newlin at genesys.com>> wrote:

You can also use the REST client. And there are many other ways, as well.



There is no single correct answer to the vague question of connecting to any generic “external application”. You must understand your systems and decide the best approach depending on the needs and capabilities of both the external application and OpenSIPS.



Ben Newlin



From: Users <users-bounces at lists.opensips.org<mailto:users-bounces at lists.opensips.org>> on behalf of Bogdan-Andrei Iancu <bogdan at opensips.org<mailto:bogdan at opensips.org>>
Date: Wednesday, March 20, 2024 at 10:06 AM
To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:users at lists.opensips.org>>, Prathibha B <prathibhab.tvm at gmail.com<mailto:prathibhab.tvm at gmail.com>>
Subject: Re: [OpenSIPS-Users] external applications

 EXTERNAL EMAIL - Please use caution with links and attachments



________________________________

Use the dialog events:
    https://opensips.org/html/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED<https://opensips.org/html/docs/modules/3.4.x/dialog.html#event_E_DLG_STATE_CHANGED>

And you subscribe from outside OpenSIPS for such events:
    https://www.opensips.org/Documentation/Interface-Events-3-4<https://www.opensips.org/Documentation/Interface-Events-3-4>

Regards,

Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com<https://www.opensips-solutions.com>

  https://www.siphub.com<https://www.siphub.com>

On 20.03.2024 12:16, Prathibha B wrote:

No. I want to pass START, CONNECT, END messages from OpenSIPS to external application.



On Wed, 20 Mar 2024 at 15:42, Marcin Groszek <marcin at voipplus.net<mailto:marcin at voipplus.net>> wrote:

Well, to execute external command from opensips you may want to use EXEC module.

this is a manual for v3.2:

https://opensips.org/html/docs/modules/3.2.x/exec.html<https://opensips.org/html/docs/modules/3.2.x/exec.html>



On 3/20/2024 5:00 AM, Prathibha B wrote:

How to integrate OpenSIPS with external applications?



--

Regards,

B.Prathibha



_______________________________________________

Users mailing list

Users at lists.opensips.org<mailto:Users at lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>

--

Best Regards:

Marcin Groszek

Business Phone Service

https://www.voipplus.net<https://www.voipplus.net>

_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>




--

Regards,

B.Prathibha



_______________________________________________

Users mailing list

Users at lists.opensips.org<mailto:Users at lists.opensips.org>

http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>






--

Regards,

B.Prathibha




--

Regards,

B.Prathibha




--

Regards,

B.Prathibha




--

Regards,

B.Prathibha




--

Regards,

B.Prathibha

_______________________________________________
Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users<http://lists.opensips.org/cgi-bin/mailman/listinfo/users>




--

Regards,

B.Prathibha




--

Regards,

B.Prathibha




--

Regards,

B.Prathibha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20240405/1460f9b0/attachment-0001.html>


More information about the Users mailing list