[PATCH] SMSC cluster

"Lamasuta, Franck, Vodafone Automotive" <[email protected]> Tue, 25 Jun 2019 16:20:07 +0000
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <AM0PR05MB58742EB5033050540C16A3D284E30@AM0PR05MB5874.eurprd05.prod.outlook.com>
--_004_AM0PR05MB58742EB5033050540C16A3D284E30AM0PR05MB5874eurp_
Content-Type: multipart/alternative;
	boundary="_000_AM0PR05MB58742EB5033050540C16A3D284E30AM0PR05MB5874eurp_"

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

Hi list,

We have implemented many patches along the way and I can finally take some =
time to submit them.
They are running on our staging and production platforms since years for th=
e oldest ones.
I will submit them one by one in the next days/weeks.
Let's start with the first one...   :)

This patch allows Kannel to retrieve a pending DLRs in its database when 2 =
(or more) SMSC binds are established (with different IPs and/or ports).
It is required when a MT-SMS is submitted to SMSC A and its DLR is sent bac=
k by SMSC B.
Done for CIMD2 and SMPP.

Example of configuration where the patch is required:

#
# Primary server
#
group =3D smsc
smsc =3D cimd2
smsc-id =3D SMSC-A
host =3D 123.1.2.3
port =3D 6001
smsc-username =3D user
smsc-password =3D xxxxxxxx
allowed-smsc-id =3D id1
preferred-smsc-id =3D id1

#
# Secondary server
#
group =3D smsc
smsc =3D cimd2
smsc-id =3D SMSC-B
host =3D 123.1.2.3
port =3D 6002
smsc-username =3D user
smsc-password =3D xxxxxxxx
allowed-smsc-id =3D id1


Regards,
Franck

--_000_AM0PR05MB58742EB5033050540C16A3D284E30AM0PR05MB5874eurp_
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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
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;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></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 lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span lang=3D"FR">Hi list,<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"FR"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal">We have implemented many patches along the way and I=
 can finally take some time to submit them.<br>
They are running on our staging and production platforms since years for th=
e oldest ones.<o:p></o:p></p>
<p class=3D"MsoNormal">I will submit them one by one in the next days/weeks=
.<o:p></o:p></p>
<p class=3D"MsoNormal">Let&#8217;s start with the first one&#8230;&nbsp;&nb=
sp; <span style=3D"font-family:Wingdings">
J</span><o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">This patch allows Kannel to retrieve a pending DLRs =
in its database when 2 (or more) SMSC binds are established (with different=
 IPs and/or ports).<o:p></o:p></p>
<p class=3D"MsoNormal">It is required when a MT-SMS is submitted to SMSC A =
and its DLR is sent back by SMSC B.<o:p></o:p></p>
<p class=3D"MsoNormal">Done for CIMD2 and SMPP.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Example of configuration where the patch is required=
:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">#<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4"># Primary server<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">#<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">group =3D smsc<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">smsc =3D cimd2<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">smsc-id =3D SMSC-A<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">host =3D 123.1.2.3<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">port =3D 6001<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">smsc-username =3D user<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">smsc-password =3D xxxxxxxx<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">allowed-smsc-id =3D id1<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">preferred-smsc-id =3D id1<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">#<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4"># Secondary server<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">#<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">group =3D smsc<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">smsc =3D cimd2<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">smsc-id =3D SMSC-B<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">host =3D 123.1.2.3<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">port =3D 6002<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">smsc-username =3D user<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">smsc-password =3D xxxxxxxx<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Courier New&quot;;c=
olor:#4472C4">allowed-smsc-id =3D id1<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Regards,<o:p></o:p></p>
<p class=3D"MsoNormal">Franck<o:p></o:p></p>
</div>
</body>
</html>

--_000_AM0PR05MB58742EB5033050540C16A3D284E30AM0PR05MB5874eurp_--

--_004_AM0PR05MB58742EB5033050540C16A3D284E30AM0PR05MB5874eurp_
Content-Type: application/octet-stream; name="smsc_cluster.patch"
Content-Description: smsc_cluster.patch
Content-Disposition: attachment; filename="smsc_cluster.patch"; size=3258;
	creation-date="Tue, 25 Jun 2019 09:11:44 GMT";
	modification-date="Tue, 25 Jun 2019 09:11:44 GMT"
Content-Transfer-Encoding: base64

SW5kZXg6IGd3L3Ntc2Mvc21zY19jaW1kMi5jDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0gZ3cvc21zYy9zbXNj
X2NpbWQyLmMJKHJldmlzaW9uIDUyNzYpDQorKysgZ3cvc21zYy9zbXNjX2NpbWQyLmMJKHdvcmtp
bmcgY29weSkNCkBAIC0yMzgzLDEyICsyMzgzLDExIEBADQogICAgICAgICByZXR1cm4gLTE7CiAg
ICAgfQogCi0gICAgY29ubi0+bmFtZSA9IG9jdHN0cl9mb3JtYXQoIkNJTUQyOiVzOiVkOiVzIiwK
LSAgICAgICAgICAgICAgICAgICAgIG9jdHN0cl9nZXRfY3N0cihwZGF0YS0+aG9zdCksCi0gICAg
ICAgICAgICAgICAgICAgICBwZGF0YS0+cG9ydCwKLSAgICAgICAgICAgICAgICAgICAgIG9jdHN0
cl9nZXRfY3N0cihwZGF0YS0+dXNlcm5hbWUpKTsKKyAgICAvK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