<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<font face="monospace">Hi,<br>
<br>
you can consider using exec in async way, with launch() for
example:<br>
<a class="moz-txt-link-freetext" href="https://opensips.org/html/docs/modules/3.4.x/exec.html#afunc_exec">https://opensips.org/html/docs/modules/3.4.x/exec.html#afunc_exec</a><br>
<br>
But imho anything else (non-blocking) may be better than exec, to
avoid the penalty for forking new processes ; rest_client, in
async way is also an option, for example, raising events (with
external subscriber) too, message queue, etc.<br>
<br>
Regards<br>
</font>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
<a class="moz-txt-link-freetext" href="https://www.siphub.com">https://www.siphub.com</a></pre>
<div class="moz-cite-prefix">On 04.02.2024 12:22, Volkan Oransoy
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:c35b815c-ea5b-4381-a4ee-ba26c7b7aa90@Spark">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<div name="messageBodySection">
<div dir="auto">Hi Ronald<br>
<br>
For our case, we use exec on development environment too. For
the production, we will use rabbitmq and custom events to
decouple pn delivery from the script. </div>
</div>
<div name="messageSignatureSection"><br>
<div dir="auto">Volkan Oransoy</div>
</div>
<div name="messageReplySection">On 3 Feb 2024 at 20:54 +0000,
<a class="moz-txt-link-abbreviated" href="mailto:rvg@rvgeerligs.nl">rvg@rvgeerligs.nl</a>, wrote:<br>
<blockquote type="cite">
<div>Hi,</div>
<div><br>
</div>
<div>Currently experimenting with the EXEC module. Still all
advice is welcome.</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div>Ronald</div>
<div><br>
</div>
<p>February 3, 2024 at 4:39 PM, <a
href="mailto:rvg@rvgeerligs.nl" target="_blank"
tabindex="-1" moz-do-not-send="true"
class="moz-txt-link-freetext">rvg@rvgeerligs.nl</a> wrote:</p>
<blockquote>
<div>
<div>
<div>
<div>
<div>Hi,</div>
<div><br>
</div>
<div>I managed to integrate pn in opensips 3.4 as I
get as reply to register from my opensips server:</div>
<div><br>
</div>
<div>SIP/2.0 200 OK</div>
<div>Via: SIP/2.0/UDP
192.168.1.14:57993;received=x.x.x.x;branch=z9hG4bK.wxwvFfCSG;rport=57993</div>
<div>To:
<a class="moz-txt-link-freetext" href="sip:xx;tag=eeba.752562b862ac8bd9236fb7979b3044b6">sip:xx;tag=eeba.752562b862ac8bd9236fb7979b3044b6</a></div>
<div>From: <a class="moz-txt-link-rfc2396E" href="sip:xx"><sip:xx></a>;tag=mFddPGSw6</div>
<div>Call-ID: UFVVRWp5rN</div>
<div>CSeq: 23 REGISTER</div>
<div><b>Feature-Caps:
+sip.pns="apns";+sip.pnsreg="130";+sip.pnspurr="3fa.a1d4c.c3fbd0c8"</b></div>
<div>Server: OpenSIPS (3.4.0 (aarch64/linux))</div>
<div>Content-Length: 0</div>
<div><br>
</div>
<div><br>
</div>
<div>Also I have a bash script getting token and
sending pn to apns developement.</div>
<div>I have pn-prid, pn-param, pn-provider</div>
<div>I want to connect the in the function </div>
<div><br>
</div>
</div>
</div>
</div>
<p><span>route[pm_send]</span></p>
<p><span>{</span></p>
<p><span>exit;</span></p>
<p><span>}</span></p>
<div>
<div>
<p
style="outline: 0px; -webkit-tap-highlight-color: transparent; margin: 0.715em 0px; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</p>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">questions:</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">How
do I get opensips to call a bash script with
arguments? Arguments being pn-prid, pn-param,
pn-provider.</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Where
do I place the script?</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">would
that be in my module path?</div>
</div>
</div>
<p><span>mpath="/usr/local/lib64/opensips/modules/"</span></p>
<div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">I
tried a marg.sh doing:</div>
</div>
<p><span>#!/bin/bash</span></p>
<p><span>echo "The first argument is: $1"</span></p>
<p><span>echo "The second argument is: $2"</span></p>
<p><span>echo "The third argument is: $3"</span></p>
<div>
<div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">But
I got:</div>
</div>
</div>
<p><span>ERROR:core:parse_opensips_cfg: bad config file (4
errors)</span></p>
<div><br>
</div>
<div>Any advise appreciated.</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div
style="outline: 0px; -webkit-tap-highlight-color: transparent; box-sizing: border-box; color: rgb(0, 0, 0); font-family: Verdana, Geneva, "Bitstream Vera Sans", "DejaVu LGC Sans", Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div><br>
</div>
</div>
<div><br>
</div>
</div>
</blockquote>
<div><br>
</div>
_______________________________________________<br>
Users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>