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 [2] - https://www.opensips.org/Documentation/Script-CoreParameters-3-4#wdir Ben Newlin From: Users <users-boun...@lists.opensips.org> on behalf of Prathibha B <prathibhab....@gmail.com> Date: Thursday, April 4, 2024 at 11:32 AM To: OpenSIPS users mailling list <users@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....@gmail.com<mailto:prathibhab....@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....@gmail.com<mailto:prathibhab....@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org>> on behalf of Ben Newlin <ben.new...@genesys.com<mailto:ben.new...@genesys.com>> Sent: Wednesday, April 3, 2024 7:03:33 PM To: OpenSIPS users mailling list <users@lists.opensips.org<mailto:users@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org>> on behalf of Prathibha B <prathibhab....@gmail.com<mailto:prathibhab....@gmail.com>> Date: Wednesday, April 3, 2024 at 2:35 AM To: OpenSIPS users mailling list <users@lists.opensips.org<mailto:users@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.new...@genesys.com<mailto:ben.new...@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org>> on behalf of Prathibha B <prathibhab....@gmail.com<mailto:prathibhab....@gmail.com>> Date: Tuesday, April 2, 2024 at 8:05 AM To: OpenSIPS users mailling list <users@lists.opensips.org<mailto:users@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....@gmail.com<mailto:prathibhab....@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....@gmail.com<mailto:prathibhab....@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....@gmail.com<mailto:prathibhab....@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....@gmail.com<mailto:prathibhab....@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.new...@genesys.com<mailto:ben.new...@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-boun...@lists.opensips.org<mailto:users-boun...@lists.opensips.org>> on behalf of Bogdan-Andrei Iancu <bog...@opensips.org<mailto:bog...@opensips.org>> Date: Wednesday, March 20, 2024 at 10:06 AM To: OpenSIPS users mailling list <users@lists.opensips.org<mailto:users@lists.opensips.org>>, Prathibha B <prathibhab....@gmail.com<mailto:prathibhab....@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 <mar...@voipplus.net<mailto:mar...@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@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> -- Best Regards: Marcin Groszek Business Phone Service https://www.voipplus.net<https://www.voipplus.net> _______________________________________________ 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> -- Regards, B.Prathibha _______________________________________________ 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> -- Regards, B.Prathibha -- Regards, B.Prathibha -- Regards, B.Prathibha -- Regards, B.Prathibha -- Regards, B.Prathibha _______________________________________________ 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> -- Regards, B.Prathibha -- Regards, B.Prathibha -- Regards, B.Prathibha
_______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users