No subject


Wed Jan 27 21:05:54 CET 2016


be done in 2.1 version.
Is it possible to change in asynchronous mode in 1.11 version?
If not, is there a way to achieve asynchronous REST calls for the version o=
f opensips what we are using?

Also I see from documentation,

The following functions may also be called asynchronously:

  *   avp_db_query<http://www.opensips.org/html/docs/modules/2.1.x/avpops.h=
tml#id294986>
  *   rest_get<http://www.opensips.org/html/docs/modules/2.1.x/rest_client.=
html#id293741>
  *   rest_post<http://www.opensips.org/html/docs/modules/2.1.x/rest_client=
.html#id293886>
  *   exec<http://www.opensips.org/html/docs/modules/2.1.x/exec#id294052>
Can rest_put can also be called asynchronously if we use 2.1 version ?
Please clarify.

Regards,
Agalya


_______________________________________________

Users mailing list

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

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


--_000_99a79810857c45078538a12eb0230bf9COPDCEX28cablecomcastco_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
	{font-family:"Trebuchet MS \,sans-serif";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	color:black;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;
	color:black;}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";
	color:black;}
tt
	{mso-style-priority:99;
	font-family:"Courier New";}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:Consolas;
	color:black;}
span.EmailStyle21
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.EmailStyle22
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}
span.EmailStyle23
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.EmailStyle24
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}
span.EmailStyle25
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.EmailStyle26
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.EmailStyle27
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}
span.EmailStyle28
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
/* List Definitions */
@list l0
	{mso-list-id:920869609;
	mso-list-template-ids:-1225891966;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l0:level2
	{mso-level-number-format:bullet;
	mso-level-text:o;
	mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:"Courier New";
	mso-bidi-font-family:"Times New Roman";}
@list l0:level3
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Wingdings;}
@list l0:level4
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Wingdings;}
@list l0:level5
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Wingdings;}
@list l0:level6
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Wingdings;}
@list l0:level7
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Wingdings;}
@list l0:level8
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Wingdings;}
@list l0:level9
	{mso-level-number-format:bullet;
	mso-level-text:\F0A7;
	mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Wingdings;}
@list l1
	{mso-list-id:2045445876;
	mso-list-template-ids:-635782842;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level2
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level3
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:1.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level4
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:2.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level5
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:2.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level6
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:3.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level7
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:3.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level8
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:4.0in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1:level9
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:4.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=3D"white" lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"color:blue">Hi Bogdan/Liviu,<o:p></o:=
p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Further debugging I got s=
ome info that I can share with you so that you can help me out easily.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Instead of calling <b>res=
t_put asynchronously</b> I have tried to call
<b>rest_post async</b> . I could able to see that HTTP request went out(fro=
m wireshark traces) and I got 4xx response for the same.<o:p></o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">With my code changes in p=
lace and when I call rest_put, am not seeing HTTP request sent out.<o:p></o=
:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Assuming <b>rest_put</b> =
only is not working, there should be some libcurl stuffs not handled proper=
ly in &#8216;<b>start_async_http_req</b>&#8217; for &#8216;<b>REST_CLIENT_P=
UT</b>&#8217; case.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Am attaching the files I =
have modified. Can you please take a look guide me here.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">And regarding the below e=
rror, am not seeing it every time now. It&#8217;s coming now and then. Some=
times in my debug I could able to see the async_start and async_resume has =
executed for rest_put as well.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">But the HTTP request neve=
r went to the destination.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Please let me know if you=
 need more information on this.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Regards,<br>
Agalya<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<div>
<div style=3D"border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in =
0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"color:windowtext">From:</span></b>=
<span style=3D"color:windowtext"> users-bounces at lists.opensips.org [mailto:=
users-bounces at lists.opensips.org]
<b>On Behalf Of </b>Ramachandran, Agalya (Contractor)<br>
<b>Sent:</b> Monday, August 15, 2016 9:32 AM<br>
<b>To:</b> OpenSIPS users mailling list &lt;users at lists.opensips.org&gt;<br=
>
<b>Subject:</b> Re: [OpenSIPS-Users] Asynchronous operation for REST querie=
s<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Hi Bogdan/Liviu,<o:p></o:=
p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Please help on this async=
() to get worked at config file.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Am using rest_put() and I=
 have added the needed functions and declarations for the same as like rest=
_post().<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue"><o:p>&nbsp;</o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Am getting the below erro=
r if I enable debug logs.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Seems, w_async_rest_put f=
unction is called and after that it didn&#8217;t process the async(rest_put=
)).<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Do we need to configure a=
nything specific when async() is called in config file?<o:p></o:p></span></=
p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:red">Aug 11 19:49:52 DBG:tm:_re=
ply_light: finished<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:red">Aug 11 19:49:52 DBG:rest_c=
lient:w_async_rest_put: async rest put 'http://***URL***?' 0x7f3df7848538 0=
x7f3df78485d0 0x7f3df7848650<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:red">Aug 11 19:50:12 DBG:rest_c=
lient:start_async_http_req: done, no need for async!<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:red">Aug 11 19:50:12 DBG:rest_c=
lient:set_output_pv_params: Last response code: 0<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:red">Aug 11 19:50:12 DBG:core:f=
m_free: free(0) called<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:red">Aug 11 19:50:12 DBG:core:c=
omp_scriptvar: int 26 : -4 / 0<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:red">Aug 11 19:50:12 Return cod=
e is -4<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:red">Aug 11 19:50:12 Error code=
 0 in HTTP PUT!<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:red"><o:p>&nbsp;</o:p></span></=
p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Regards,<o:p></o:p></span=
></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Agalya<o:p></o:p></span><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<div>
<div style=3D"border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in =
0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"color:windowtext">From:</span></b>=
<span style=3D"color:windowtext"> Ramachandran, Agalya (Contractor)
<br>
<b>Sent:</b> Tuesday, August 09, 2016 3:47 PM<br>
<b>To:</b> <a href=3D"mailto:users at lists.opensips.org">users at lists.opensips=
.org</a><br>
<b>Subject:</b> RE: [OpenSIPS-Users] Asynchronous operation for REST querie=
s<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Hi Liviu,<o:p></o:p></=
span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">I have downloaded 2.1.=
4 version if opensips and trying to use rest_put call in async mode.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">I have added the neces=
sary code for rest_put () similar to rest_post() in rest_methods.c, rest_me=
thods.h and rest_client.c
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">If I just call, rest_p=
ut from config file, without async it works fine. I could see rest_put() is=
 called and do the necessary steps.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">And am trying to call =
async from config file as,
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">&nbsp;async(rest_put(&=
quot;</span><a href=3D"http://***url***%20">http://***url***
</a><span style=3D"color:#1F497D">&quot;, &quot;$fU,$tU,$ci &quot;, &quot;a=
pplication/json&quot;, &quot;$var(body)&quot;, &quot;$var(ct)&quot;, &quot;=
$var(rcode)&quot;),resume_put);<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">But I never see rest_p=
ut() is called. Rather am getting below error continuously.
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Aug&nbsp; 9 17:27:47 s=
turn-test /usr/local/sbin/opensips[18525]: WARNING:core:handle_timer_job: u=
timer job &lt;tm-utimer&gt; has a 403840000 us delay in execution<o:p></o:p=
></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Aug&nbsp; 9 17:27:47 s=
turn-test /usr/local/sbin/opensips[18525]: WARNING:core:handle_timer_job: u=
timer job &lt;tm-utimer&gt; has a 403840000 us delay in execution<o:p></o:p=
></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Aug&nbsp; 9 17:27:47 s=
turn-test /usr/local/sbin/opensips[18525]: WARNING:core:handle_timer_job: u=
timer job &lt;tm-utimer&gt; has a 403840000 us delay in execution<o:p></o:p=
></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Aug&nbsp; 9 17:27:47 s=
turn-test /usr/local/sbin/opensips[18525]: WARNING:core:handle_timer_job: u=
timer job &lt;tm-utimer&gt; has a 403840000 us delay in execution<o:p></o:p=
></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Am I missing something=
 here? I am sure it is a small thing. Do we need to do anything else before=
 calling async in the script?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Regards,<o:p></o:p></s=
pan></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D">Agalya<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<div>
<div style=3D"border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in =
0in 0in">
<p class=3D"MsoNormal"><b><span style=3D"color:windowtext">From:</span></b>=
<span style=3D"color:windowtext">
</span><a href=3D"mailto:users-bounces at lists.opensips.org">users-bounces at li=
sts.opensips.org</a><span style=3D"color:windowtext"> [</span><a href=3D"ma=
ilto:users-bounces at lists.opensips.org">mailto:users-bounces at lists.opensips.=
org</a><span style=3D"color:windowtext">]
<b>On Behalf Of </b>Liviu Chircu<br>
<b>Sent:</b> Friday, August 05, 2016 4:47 AM<br>
<b>To:</b> </span><a href=3D"mailto:users at lists.opensips.org">users at lists.o=
pensips.org</a><span style=3D"color:windowtext"><br>
<b>Subject:</b> Re: [OpenSIPS-Users] Asynchronous operation for REST querie=
s<o:p></o:p></span></p>
</div>
</div>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt"><tt><span style=3D"fo=
nt-size:10.0pt">Hi Agalya,</span></tt><span style=3D"font-size:10.0pt;font-=
family:&quot;Courier New&quot;"><br>
<br>
<tt>1.11 has no async support at core level. If you need that, you will hav=
e to use 2.1&#43;</tt><br>
<br>
<tt>Async rest_put() is currently not implemented, but its logic would be f=
airly similar to the GET and POST counterparts.</tt></span><span style=3D"f=
ont-size:12.0pt"><o:p></o:p></span></p>
<pre>Liviu Chircu<o:p></o:p></pre>
<pre>OpenSIPS Developer<o:p></o:p></pre>
<pre><a href=3D"http://www.opensips-solutions.com">http://www.opensips-solu=
tions.com</a><o:p></o:p></pre>
<div>
<p class=3D"MsoNormal">On 04.08.2016 23:14, Ramachandran, Agalya (Contracto=
r) wrote:<o:p></o:p></p>
</div>
<blockquote style=3D"margin-top:5.0pt;margin-bottom:5.0pt">
<p class=3D"MsoNormal"><span style=3D"color:blue">Hi team,</span><o:p></o:p=
></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">&nbsp;</span><o:p></o:p><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">We are using opensips1.11=
.3 version for our project.
</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">I have a question here. R=
ight now we are using a REST API call from config file for our project requ=
irement and it is in synchronous mode currently.</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">From the opensips documen=
t, I see asynchronous support at script level can be done in 2.1 version.</=
span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Is it possible to change =
in asynchronous mode in 1.11 version?</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">If not, is there a way to=
 achieve asynchronous REST calls for the version of opensips what we are us=
ing?
</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">&nbsp;</span><o:p></o:p><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Also I see from documenta=
tion,</span><o:p></o:p></p>
<p style=3D"margin:0in;margin-bottom:.0001pt;line-height:16.2pt;background:=
white"><span style=3D"font-size:10.0pt">The following functions may also be=
 called asynchronously:</span><o:p></o:p></p>
<ul type=3D"disc">
<li class=3D"MsoNormal" style=3D"color:#666666;mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto;line-height:16.2pt;mso-list:l0 level1 lfo3;backgroun=
d:white">
<a href=3D"http://www.opensips.org/html/docs/modules/2.1.x/avpops.html#id29=
4986"><b><span style=3D"font-size:10.0pt;font-family:&quot;Trebuchet MS \,s=
ans-serif&quot;;color:#185662;text-decoration:none">avp_db_query</span></b>=
</a><o:p></o:p></li><li class=3D"MsoNormal" style=3D"color:#666666;mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto;line-height:16.2pt;mso-list:l0 l=
evel1 lfo3;background:white">
<a href=3D"http://www.opensips.org/html/docs/modules/2.1.x/rest_client.html=
#id293741"><b><span style=3D"font-size:10.0pt;font-family:&quot;Trebuchet M=
S \,sans-serif&quot;;color:#185662;text-decoration:none">rest_get</span></b=
></a><o:p></o:p></li><li class=3D"MsoNormal" style=3D"color:#666666;mso-mar=
gin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:16.2pt;mso-list:l0 =
level1 lfo3;background:white">
<a href=3D"http://www.opensips.org/html/docs/modules/2.1.x/rest_client.html=
#id293886"><b><span style=3D"font-size:10.0pt;font-family:&quot;Trebuchet M=
S \,sans-serif&quot;;color:#185662;text-decoration:none">rest_post</span></=
b></a><o:p></o:p></li><li class=3D"MsoNormal" style=3D"color:#666666;mso-ma=
rgin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:16.2pt;mso-list:l0=
 level1 lfo3;background:white">
<a href=3D"http://www.opensips.org/html/docs/modules/2.1.x/exec#id294052"><=
b><span style=3D"font-size:10.0pt;font-family:&quot;Trebuchet MS \,sans-ser=
if&quot;;color:#185662;text-decoration:none">exec</span></b></a><o:p></o:p>=
</li></ul>
<p class=3D"MsoNormal"><span style=3D"color:blue">Can rest_put can also be =
called asynchronously if we use 2.1 version ?
</span><o:p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Please clarify.</span><o:=
p></o:p></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">&nbsp;</span><o:p></o:p><=
/p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Regards,</span><o:p></o:p=
></p>
<p class=3D"MsoNormal"><span style=3D"color:blue">Agalya</span><o:p></o:p><=
/p>
<p class=3D"MsoNormal" style=3D"margin-bottom:12.0pt"><span style=3D"font-s=
ize:12.0pt;font-family:&quot;Times New Roman&quot;,serif"><o:p>&nbsp;</o:p>=
</span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Users mailing list<o:p></o:p></pre>
<pre><a href=3D"mailto:Users at lists.opensips.org">Users at lists.opensips.org</=
a><o:p></o:p></pre>
<pre><a href=3D"http://lists.opensips.org/cgi-bin/mailman/listinfo/users">h=
ttp://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre=
>
</blockquote>
<p class=3D"MsoNormal"><span style=3D"font-size:12.0pt;font-family:&quot;Ti=
mes New Roman&quot;,serif"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>

--_000_99a79810857c45078538a12eb0230bf9COPDCEX28cablecomcastco_--

--_006_99a79810857c45078538a12eb0230bf9COPDCEX28cablecomcastco_
Content-Type: text/plain; name="rest_client.c"
Content-Description: rest_client.c
Content-Disposition: attachment; filename="rest_client.c"; size=17445;
	creation-date="Mon, 15 Aug 2016 20:27:58 GMT";
	modification-date="Mon, 15 Aug 2016 20:27:58 GMT"
Content-Transfer-Encoding: base64

LyoKICogQ29weXJpZ2h0IChDKSAyMDEzLTIwMTUgT3BlblNJUFMgU29sdXRpb25zCiAqCiAqIFRo
aXMgZmlsZSBpcyBwYXJ0IG9mIG9wZW5zaXBzLCBhIGZyZWUgU0lQIHNlcnZlci4KICoKICogb3Bl
bnNpcHMgaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1v
ZGlmeQogKiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNl
bnNlIGFzIHB1Ymxpc2hlZCBieQogKiB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRo
ZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvcgogKiAoYXQgeW91ciBvcHRpb24pIGFueSBs
YXRlciB2ZXJzaW9uCiAqCiAqIG9wZW5zaXBzIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRo
YXQgaXQgd2lsbCBiZSB1c2VmdWwsCiAqIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91
dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mCiAqIE1FUkNIQU5UQUJJTElUWSBvciBGSVRO
RVNTIEZ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gMCkgewogICAgICAgICAgICAgICAgTE1fRVJSKCJJbnZh
bGlkIEhUVFAgUE9TVCBjb250ZW50IHR5cGUgcHNldWRvIHZhcmlhYmxlIVxuIik7CiAgICAgICAg
ICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgfQoKICAgICAgICBMTV9EQkcoImFzeW5jIHJlc3Qg
cHV0ICclLipzJyAlcCAlcCAlcFxuIiwgdXJsLmxlbiwgdXJsLnMsIGJvZHlfcHYsIGN0eXBlX3B2
LCBjb2RlX3B2KTsKCSBwYXJhbSA9IHBrZ19tYWxsb2Moc2l6ZW9mICpwYXJhbSk7CiAgICAgICAg
aWYgKCFwYXJhbSkgewogICAgICAgICAgICAgICAgTE1fRVJSKCJubyBtb3JlIHNobVxuIik7CiAg
ICAgICAgICAgICAgICByZXR1cm4gLTE7CiAgICAgICAgfQogICAgICAgIG1lbXNldChwYXJhbSwg
J1wwJywgc2l6ZW9mICpwYXJhbSk7CgogICAgICAgIHJlYWRfZmQgPSBzdGFydF9hc3luY19odHRw
X3JlcShtc2csIFJFU1RfQ0xJRU5UX1BVVCwgdXJsLnMsIGJvZHkucywgY3R5cGUucywKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAmcGFyYW0tPmhhbmRsZSwgJnBhcmFtLT5ib2R5LCBj
dHlwZV9wdiA/ICZwYXJhbS0+Y3R5cGUgOiBOVUxMKTsKCiAgICAgICAgLyogZXJyb3Igb2NjdXJy
ZWQ7IG5vIHRyYW5zZmVyIGRvbmUgKi8KICAgICAgICBpZiAocmVhZF9mZCA9PSBBU1lOQ19OT19J
TykgewogICAgICAgICAgICAgICAgKnJlc3VtZV9wYXJhbSA9IE5VTEw7CiAgICAgICAgICAgICAg
ICAqcmVzdW1lX2YgPSBOVUxMOwogICAgICAgICAgICAgICAgLyoga2VlcCBkZWZhdWx0IGFzeW5j
IHN0YXR1cyBvZiBOT19JTyAqLwogICAgICAgICAgICAgICAgcmV0dXJuIC0xOwoKICAgICAgICAv
KiBubyBuZWVkIGZvciBhc3luYyAtIHRyYW5zZmVyIGFscmVhZHkgY29tcGxldGVkISAqLwogICAg
ICAgIH0gZWxzZSBpZiAocmVhZF9mZCA9PSBBU1lOQ19TWU5DKSB7CiAgICAgICAgICAgICAgICBz
ZXRfb3V0cHV0X3B2X3BhcmFtcyhtc2csICZwYXJhbS0+Ym9keSwgKHB2X3NwZWNfcClib2R5X3B2
LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAmcGFyYW0tPmN0eXBlLCAocHZfc3BlY19wKWN0eXBlX3B2LAogICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS0+aGFuZGxlLCAocHZf
c3BlY19wKWNvZGVfcHYpOwoKICAgICAgICAgICAgICAgIHBrZ19mcmVlKHBhcmFtLT5ib2R5LnMp
OwogICAgICAgICAgICAgICAgaWYgKGN0eXBlX3B2ICYmIHBhcmFtLT5jdHlwZS5zKQogICAgICAg
ICAgICAgICAgICAgICAgICBwa2dfZnJlZShwYXJhbS0+Y3R5cGUucyk7CiAgICAgICAgICAgICAg
ICBjdXJsX2Vhc3lfY2xlYW51cChwYXJhbS0+aGFuZGxlKTsKICAgICAgICAgICAgICAgIHBrZ19m
cmVlKHBhcmFtKTsKCiAgICAgICAgICAgICAgICByZXR1cm4gQVNZTkNfU1lOQzsKICAgICAgICB9
CgogICAgICAgICpyZXN1bWVfZiA9IHJlc3VtZV9hc3luY19odHRwX3JlcTsKCiAgICAgICAgcGFy
YW0tPm1ldGhvZCA9IFJFU1RfQ0xJRU5UX1BVVDsKICAgICAgICBwYXJhbS0+Ym9keV9wdiA9IChw
dl9zcGVjX3ApYm9keV9wdjsKICAgICAgICBwYXJhbS0+Y3R5cGVfcHYgPSAocHZfc3BlY19wKWN0
eXBlX3B2OwoKCXBhcmFtLT5jb2RlX3B2ID0gKHB2X3NwZWNfcCljb2RlX3B2OwogICAgICAgICpy
ZXN1bWVfcGFyYW0gPSBwYXJhbTsKICAgICAgICAvKiBhc3luYyBzdGFydGVkIHdpdGggc3VjY2Vz
cyAqLwogICAgICAgIGFzeW5jX3N0YXR1cyA9IHJlYWRfZmQ7CgogICAgICAgIHJldHVybiAxOwp9
CgoK

--_006_99a79810857c45078538a12eb0230bf9COPDCEX28cablecomcastco_
Content-Type: text/plain; name="rest_methods.c"
Content-Description: rest_methods.c
Content-Disposition: attachment; filename="rest_methods.c"; size=23485;
	creation-date="Mon, 15 Aug 2016 20:27:57 GMT";
	modification-date="Mon, 15 Aug 2016 20:27:57 GMT"
Content-Transfer-Encoding: base64

LyoKICogQ29weXJpZ2h0IChDKSAyMDEzIE9wZW5TSVBTIFNvbHV0aW9ucwogKgogKiBUaGlzIGZp
bGUgaXMgcGFydCBvZiBvcGVuc2lwcywgYSBmcmVlIFNJUCBzZXJ2ZXIuCiAqCiAqIG9wZW5zaXBz
IGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkK
ICogaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBh
cyBwdWJsaXNoZWQgYnkKICogdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZl
cnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IKICogKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIg
dmVyc2lvbgogKgogKiBvcGVuc2lwcyBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0
IHdpbGwgYmUgdXNlZnVsLAogKiBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZl
biB0aGUgaW1wbGllZCB3YXJyYW50eSBvZgogKiBNRVJDSEFOVEFCSUxJVFkgb3IgRklUTkVTUyBG
T1IgQSBQQVJUSUNVTEFSIF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AhPSAwKSB7CiAgICAgICAgICAgICAgICBMTV9F
UlIoIlNldCBib2R5IHB2IHZhbHVlIGZhaWxlZCFcbiIpOwogICAgICAgICAgICAgICAgZ290byBj
bGVhbnVwOwogICAgICAgIH0KCiAgICAgICAgaWYgKHJlc19ib2R5LnMpIHsKICAgICAgICAgICAg
ICAgIHBrZ19mcmVlKHJlc19ib2R5LnMpOwogICAgICAgIH0KCiAgICAgICAgaWYgKGN0eXBlX3B2
KSB7CiAgICAgICAgICAgICAgICBwdl92YWwucnMgPSBzdDsKCiAgICAgICAgICAgICAgICBpZiAo
cHZfc2V0X3ZhbHVlKG1zZywgY3R5cGVfcHYsIDAsICZwdl92YWwpICE9IDApIHsKICAgICAgICAg
ICAgICAgICAgICAgICAgTE1fRVJSKCJTZXQgY29udGVudCB0eXBlIHB2IHZhbHVlIGZhaWxlZCFc
biIpOwogICAgICAgICAgICAgICAgICAgICAgICBnb3RvIGNsZWFudXA7CiAgICAgICAgICAgICAg
ICB9CgogICAgICAgICAgICAgICAgaWYgKHN0LnMpCiAgICAgICAgICAgICAgICAgICAgICAgIHBr
Z19mcmVlKHN0LnMpOwogICAgICAgIH0KCiAgICAgICAgY3VybF9lYXN5X2NsZWFudXAoaGFuZGxl
KTsKICAgICAgICByZXR1cm4gMTsKCmNsZWFudXA6CiAgICAgICAgY2xlYW5faGVhZGVyX2xpc3Qo
bGlzdCk7CgkgIGN1cmxfZWFzeV9jbGVhbnVwKGhhbmRsZSk7CiAgICAgICAgcmV0dXJuIC0xOwp9
Cg==

--_006_99a79810857c45078538a12eb0230bf9COPDCEX28cablecomcastco_
Content-Type: text/plain; name="rest_methods.h"
Content-Description: rest_methods.h
Content-Disposition: attachment; filename="rest_methods.h"; size=2283;
	creation-date="Mon, 15 Aug 2016 20:27:59 GMT";
	modification-date="Mon, 15 Aug 2016 20:27:59 GMT"
Content-Transfer-Encoding: base64

LyoKICogQ29weXJpZ2h0IChDKSAyMDEzIE9wZW5TSVBTIFNvbHV0aW9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lY19wIGJvZHlfcHYsIHB2X3NwZWNfcCBjdHlwZV9wdiwgcHZfc3Bl
Y19wIGNvZGVfcHYpOwppbnQgcmVzdF9wb3N0X21ldGhvZChzdHJ1Y3Qgc2lwX21zZyAqbXNnLCBj
aGFyICp1cmwsIGNoYXIgKmJvZHksIGNoYXIgKmN0eXBlLAogICAgICAgICAgICAgICAgICAgICBw
dl9zcGVjX3AgYm9keV9wdiwgcHZfc3BlY19wIGN0eXBlX3B2LCBwdl9zcGVjX3AgY29kZV9wdik7
CmludCByZXN0X3B1dF9tZXRob2Qoc3RydWN0IHNpcF9tc2cgKm1zZywgY2hhciAqdXJsLCBjaGFy
ICpib2R5LCBjaGFyICpjdHlwZSwKICAgICAgICAgICAgICAgICAgICAgcHZfc3BlY19wIGJvZHlf
cHYsIHB2X3NwZWNfcCBjdHlwZV9wdiwgcHZfc3BlY19wIGNvZGVfcHYpOwoKaW50IHN0YXJ0X2Fz
eW5jX2h0dHBfcmVxKHN0cnVjdCBzaXBfbXNnICptc2csIGVudW0gcmVzdF9jbGllbnRfbWV0aG9k
IG1ldGhvZCwKCQkJCQkgICAgIGNoYXIgKnVybCwgY2hhciAqcmVxX2JvZHksIGNoYXIgKnJlcV9j
dHlwZSwKCQkJCQkgICAgIENVUkwgKipvdXRfaGFuZGxlLCBzdHIgKmJvZHksIHN0ciAqY3R5cGUp
OwplbnVtIGFzeW5jX3JldF9jb2RlIHJlc3VtZV9hc3luY19odHRwX3JlcShpbnQgZmQsIHN0cnVj
dCBzaXBfbXNnICptc2csIHZvaWQgKnBhcmFtKTsKCiNlbmRpZiAvKiBfUkVTVF9NRVRIT0RTXyAq
LwoK

--_006_99a79810857c45078538a12eb0230bf9COPDCEX28cablecomcastco_--



More information about the Users mailing list