<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
On 04/16/2015 10:27 AM, Dennis van der Vliet wrote:<br>
</div>
<blockquote
cite="mid:CAJe0b+UnPbOTt64KdbXDm6UCkLS+iT6XuPztLDDhUeaok3Az4Q@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Andrew,
<div><br>
</div>
<div>
<div>+----+-----------+------+-------+----------+--------------+</div>
<div>| id | ip | port | path | sip_port | description
|</div>
<div>+----+-----------+------+-------+----------+--------------+</div>
<div>| 1 | 127.0.0.1 | 8000 | /RPC2 | 5062 | Kamailio
|</div>
<div>| 2 | 127.0.0.1 | 8090 | / | NULL | Sems
|</div>
<div>| 3 | 127.0.0.1 | 5062 | / | NULL | Kamailio-SR
|</div>
<div>| 4 | 127.0.0.1 | 5060 | / | NULL | Loadbalancer
|</div>
<div>| 5 | 127.0.0.1 | 5582 | / | NULL | Prosody
|</div>
<div>+----+-----------+------+-------+----------+--------------+</div>
</div>
</div>
</blockquote>
This actually looks good.<br>
<blockquote
cite="mid:CAJe0b+UnPbOTt64KdbXDm6UCkLS+iT6XuPztLDDhUeaok3Az4Q@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>I tested a couple of things:</div>
<div><br>
</div>
<div>1. Trigger the xml request manually after creating a domain
from the API -> this works</div>
<div>2. Altering the codes as in the pull request (<a
moz-do-not-send="true"
href="https://github.com/sipwise/ngcp-panel/pull/1">https://github.com/sipwise/ngcp-panel/pull/1</a>
) -> this works</div>
</div>
</blockquote>
<br>
I think, now that you have all services up and running, domain
creation should also work in API and Webinterface without any
patches.<br>
<br>
<blockquote
cite="mid:CAJe0b+UnPbOTt64KdbXDm6UCkLS+iT6XuPztLDDhUeaok3Az4Q@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Also if you look how a domain is created through the
webinterface (<a moz-do-not-send="true"
href="https://github.com/sipwise/ngcp-panel/blob/master/lib/NGCP/Panel/Controller/Domain.pm#L99-L147">https://github.com/sipwise/ngcp-panel/blob/master/lib/NGCP/Panel/Controller/Domain.pm#L99-L147</a>)</div>
<div>I think we see that domain is created and committed to the
database (line 100-137) and after that the xml request is
triggered (line 147)</div>
<div><br>
</div>
<div>If you take a look at how it is done in the API this looks
different (<a moz-do-not-send="true"
href="https://github.com/sipwise/ngcp-panel/blob/master/lib/NGCP/Panel/Controller/API/Domains.pm#L156-L226">https://github.com/sipwise/ngcp-panel/blob/master/lib/NGCP/Panel/Controller/API/Domains.pm#L156-L226</a>).
In this case the transaction is only committed (line 226)
after the xml request is made (line 212). <br>
</div>
</div>
</blockquote>
<br>
This might look a bit misleading, but actually both parts behave in
the same way. The scope guard initialized by <br>
<br>
my $guard = $c->model('DB')->txn_scope_guard;<br>
<br>
creates a transaction, which is only committed after an explicit
call of commit. The transaction wrapper in the webinterface code
does the same thing, it just commits the whole transaction after the
block has successfully exited:<br>
<br>
$c->model('DB')->schema->txn_do( sub { ... } );<br>
<br>
<blockquote
cite="mid:CAJe0b+UnPbOTt64KdbXDm6UCkLS+iT6XuPztLDDhUeaok3Az4Q@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>So that is why I proposed the changes in the pull request (<a
moz-do-not-send="true"
href="https://github.com/sipwise/ngcp-panel/pull/1">https://github.com/sipwise/ngcp-panel/pull/1</a>)</div>
</div>
</blockquote>
<br>
Thanks anyway for your input. We will try to unify those ways in the
future.<br>
<br>
Gerhard<br>
<br>
<br>
<blockquote
cite="mid:CAJe0b+UnPbOTt64KdbXDm6UCkLS+iT6XuPztLDDhUeaok3Az4Q@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Dennis</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, helvetica, sans-serif"
size="2">Best from Amsterdam,</font></div>
<div><font face="arial, helvetica, sans-serif"
size="2"><br>
</font></div>
<div><font face="arial, helvetica, sans-serif"
size="2">Dennis van der Vliet | Senior
Engineer</font></div>
<div><font face="arial, helvetica, sans-serif"
size="2"><br>
</font></div>
<div><font face="arial, helvetica, sans-serif"
size="2">M: +31 6 53 47 44 96</font></div>
<div><font face="arial, helvetica, sans-serif"
size="2">E: <a moz-do-not-send="true"
href="mailto:dennis@messagebird.com"
target="_blank">dennis@messagebird.com</a></font></div>
<div>
<div style="font-size:12.8000001907349px"><font
face="arial, helvetica, sans-serif"
size="2">MessageBird</font></div>
</div>
<div><font face="arial, helvetica, sans-serif"
size="2"><a moz-do-not-send="true"
href="https://nl.linkedin.com/in/dennisvandervliet"
target="_blank">LinkedIn</a> | <a
moz-do-not-send="true"
href="https://twitter.com/dennisvdvliet"
target="_blank">Twitter</a></font></div>
<div><br>
</div>
<div>
<div style="margin:0px"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="gmail_quote">On 16 April 2015 at 09:53, Andrew
Pogrebennyk <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:apogrebennyk@sipwise.com" target="_blank">apogrebennyk@sipwise.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi Dennis,<br>
what do you have in your provisioning.xmlhosts table?<span
class=""><br>
<br>
Andrew<br>
<br>
On 04/13/2015 05:53 PM, Dennis van der Vliet wrote:<br>
</span></div>
<div>
<div class="h5">
<blockquote type="cite">
<div dir="ltr">
<div>
<p style="margin:1.2em 0px!important">Hi,</p>
<p style="margin:1.2em 0px!important">When
trying to create a subscriber through the API
we encounter the following issue. After
creating the user and entering the credentials
on a phone, registration is not possible.</p>
<p style="margin:1.2em 0px!important">Further
inspection of the log files
(kamailio-proxy.log) gives us the following
info:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">Apr 13 15:43:54 voip02-ams3-do proxy[4389]: NOTICE: <script>: New request on proxy - M=REGISTER R=sip:<a moz-do-not-send="true" href="http://sub.domain.co" target="_blank">sub.domain.co</a> F=<a moz-do-not-send="true" href="mailto:sip%3Ausername_3217@sub.domain.co" target="_blank">sip:username_3217@sub.domain.co</a> T=<a moz-do-not-send="true" href="mailto:sip%3Ausername_3217@sub.domain.co" target="_blank">sip:username_3217@sub.domain.co</a> IP={IP_ADDRESS} (<a mo
="" z-do-not-send="true" href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>) ID=b75aa40b-c9aa67f3@{IP_ADDRESS}
Apr 13 15:43:54 voip02-ams3-do proxy[4389]: WARNING: <script>: Domain not served here - R=sip:<a moz-do-not-send="true" href="http://sub.domain.co" target="_blank">sub.domain.co</a> ID=b75aa40b-c9aa67f3@{IP_ADDRESS}
</code></pre>
<p style="margin:1.2em 0px!important">The issue
is fixed once we restart kamailio-proxy
manually.</p>
<p style="margin:1.2em 0px!important">Is some
kind of “flush” triggered after creating a
subscriber through the webinterface that is
not triggered when you do the same through the
API?</p>
<p style="margin:1.2em 0px!important">Best from
Amsterdam,</p>
<p style="margin:1.2em 0px!important">Dennis van
der Vliet | Senior Engineer</p>
<br>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>