Received SIP subscribe for peer without mailbox: 9500xx

458 views
Skip to first unread message

Patrick Schaaf

unread,
Nov 10, 2010, 9:29:31 AM11/10/10
to Gemeinschaft Development
Hi all,

for some time now, we noticed annoying messages like in $subject,
under "asterisk -r", several per second, from some newer Grandstream
GXP phones, and only when they are configured for nobody users.

This makes using "asterisk -r" for debugging, a bit challenging...

I'm not sure what exactly is going wrong there; an older GXP firmware
01.01.06.46 does not show the phenomenon, phone with firmware
01.02.03.03 do...

I "solved" the problem by making a change to prov/grandstream/
settings.php - see diff below - making the "Subscribe for WMI" depend
on whether we are provisioning for a nobody user, or a real user.

Questions:

- is there a more suitable check for "nobodies", instead of looking at
6-digit $user_ext beginning in 9500?
- does it make sense to have Subscribe for WMI 1 for nobodies? If not,
could this change be put into a future gemeinschaft release?

best regards
Patrick

--- settings.php~ 2010-10-25 20:23:03.970602004 +0200
+++ settings.php 2010-11-10 15:06:51.880839998 +0100
@@ -762,7 +762,11 @@
psetting('P198', '100'); # Special Feature ( 100 =
standard | default 100 )
-psetting('P99', '1'); # Subscribe for MWI ( 0 = no,
1 = yes )
+if (strlen($user_ext) != 6 || substr($user_ext, 0, 4) != "9500") {
+ psetting('P99', '1'); # Subscribe for MWI ( 0 = no,
1 = yes )
+} else {
+ psetting('P99', '0'); # Subscribe for MWI ( 0 = no,
1 = yes )
+}
psetting('P52', '1'); # STUN NAT Traversal ( 0 =
yes, 1 = no )

Sebastian Ertz

unread,
Nov 10, 2010, 10:50:01 AM11/10/10
to gemeinsc...@googlegroups.com
Hi Patrick,

Am 10.11.2010 15:29, schrieb Patrick Schaaf:
> for some time now, we noticed annoying messages like in $subject,
> under "asterisk -r", several per second, from some newer Grandstream
> GXP phones, and only when they are configured for nobody users.
>
> This makes using "asterisk -r" for debugging, a bit challenging...
>
> I'm not sure what exactly is going wrong there; an older GXP firmware
> 01.01.06.46 does not show the phenomenon, phone with firmware
> 01.02.03.03 do...

This "problem" is also with Snom phones.

> I "solved" the problem by making a change to prov/grandstream/
> settings.php - see diff below - making the "Subscribe for WMI" depend
> on whether we are provisioning for a nobody user, or a real user.
>
> Questions:
>
> - is there a more suitable check for "nobodies", instead of looking at
> 6-digit $user_ext beginning in 9500?

The nobody-users are not always begins with 95xxxxx. You can change
$NOBODY_EXTEN_PATTERN in config file /etc/gemeinschaft/gemeinschaft.php.
Your changes are fixed at 9500.

> - does it make sense to have Subscribe for WMI 1 for nobodies? If not,
> could this change be put into a future gemeinschaft release?

This diff have no function, when $NOBODY_EXTEN_PATTERN != '95xxxx'

Sebastian

Patrick Schaaf

unread,
Nov 10, 2010, 11:19:10 AM11/10/10
to Gemeinschaft Development


> This "problem" is also with Snom phones.

Hast Du eine Idee, welches Setting da anders gesetzt werden möchte?

> > - is there a more suitable check for "nobodies", instead of looking at
> > 6-digit $user_ext beginning in 9500?
>
> The nobody-users are not always begins with 95xxxxx. You can change
> $NOBODY_EXTEN_PATTERN in config file /etc/gemeinschaft/gemeinschaft.php.
> Your changes are fixed at 9500.

Ok. Idealerweise sollte man wohl "user has mailbox" checken. Finde auf
die Schnelle aber keine fertige Funktion dafür? Gibt es eine?

Werde Morgen mal schauen wie ich das richtiger hinbekomme + dann einen
neuen diff posten.

Gruss
Patrick

Philipp Kempgen

unread,
Nov 10, 2010, 12:08:44 PM11/10/10
to gemeinsc...@googlegroups.com
Patrick Schaaf schrieb:
...

>> This "problem" is also with Snom phones.
>
> Hast Du eine Idee, welches Setting da anders gesetzt werden möchte?
>
>> > - is there a more suitable check for "nobodies", instead of looking at
>> > 6-digit $user_ext beginning in 9500?
>>
>> The nobody-users are not always begins with 95xxxxx. You can change
>> $NOBODY_EXTEN_PATTERN in config file /etc/gemeinschaft/gemeinschaft.php.
>> Your changes are fixed at 9500.
>
> Ok. Idealerweise sollte man wohl "user has mailbox" checken. Finde auf
> die Schnelle aber keine fertige Funktion dafür? Gibt es eine?

Ich glaube es gibt keine.
Könnte man entweder aus der Datenbank abfragen (ungetestet):

$is_nobody = (bool)$db->executeGetOne(
'SELECT `nobody_index` FROM `users` WHERE `id`='. (int)$user_id );

oder so bestimmen (bin grad nicht sicher was schöner ist):

$nbdy_ep = rtrim( gs_get_conf('NOBODY_EXTEN_PATTERN'), 'xX'); # e.g. "95"
$is_nobody = (substr($user_ext, 0, strlen($nbdy_ep)) == $nbdy_ep)

und dann entsprechend die mailbox/voicemail-Taste belegen und MWI-
Subscription anschalten oder eben nicht.

Wenn man das für Grandstream macht wäre es natürlich schön das auch
für die anderen Telefone zu haben.
Ist aber vielleicht kein Muß.

Evtl. könnte man den obigen Code in opt/gemeinschaft/inc/prov-fns.php
einbauen. Die Datei wird von allen Provisionings includet.

function gs_prov_is_nobody_user( $user_id )
{
//...
}


Philipp


Patrick Schaaf

unread,
Nov 11, 2010, 3:30:59 AM11/11/10
to Gemeinschaft Development
Die Lösung war einfacher, als ich dachte. Es gibt in settings.php
bereits ein array $user mit einem Element 'nobody_index', das direkt
geprüft werden kann.

Neuer diff hängt an, getestet mit GXP2010 + GXP2020.

Snomse habe ich zum Spielen leider gerade nicht zur Hand, die analoge
Änderung dafür sollte jemand machen + testen der sie hat.

Gruss
Patrick

--- settings.php~ 2010-10-25 20:23:03.970602004 +0200
+++ settings.php 2010-11-11 09:26:51.848837876 +0100
@@ -764,3 +764,7 @@
psetting('P198', '100'); # Special Feature ( 100 =
standard | default 100 )
-psetting('P99', '1'); # Subscribe for MWI ( 0 = no,
1 = yes )
+if ($user['nobody_index'] > 0) { # Subscribe for MWI ( 0 = no,
1 = yes )
+ psetting('P99', '0'); # no for nobodies
+} else {
+ psetting('P99', '1'); # yes for normal users

Sebastian Ertz

unread,
Nov 11, 2010, 6:26:26 AM11/11/10
to gemeinsc...@googlegroups.com
Am 11.11.2010 09:30, schrieb Patrick Schaaf:
> Die L�sung war einfacher, als ich dachte. Es gibt in settings.php

> bereits ein array $user mit einem Element 'nobody_index', das direkt
> gepr�ft werden kann.
>
> Neuer diff h�ngt an, getestet mit GXP2010 + GXP2020.

>
> Snomse habe ich zum Spielen leider gerade nicht zur Hand, die analoge
> �nderung daf�r sollte jemand machen + testen der sie hat.

Ich werde dies heute abend testen und dann commiten.
Bei Snoms bin ich gerade dran.

Sebastian

Reply all
Reply to author
Forward
0 new messages