PDA

Voir la version complète : Structure base de donnée asterisk 1.8...



abcinfo
20/05/2012, 22h24
Bonjour,

Je recherche la structure exacte de la base de donnée requise par asterisk 1.8 pour les tables peers et reg

J'ai beaucoup de difficultés a trouver la bonne structure, même celle du wiki ne semble pas fonctionner correctement.

On trouve de tout sur google et parfois même des structures contradictoires.

Si quelqu’un sait me donner une piste ou même la structure exact je lui en serait éternellement reconnaissant ! :)

Cordialement

Reaper
21/05/2012, 00h09
Bonjour,
1: Télécharge asterisk
2: Cherche dans le dossier contrib/realtime/mysql

abcinfo
21/05/2012, 00h16
Bonjour,
1: Télécharge asterisk
2: Cherche dans le dossier contrib/realtime/mysql

Merci pour ta réponse. J'ai fait celà mais hélas ça ne fonctionne pas pour mes lignes entrantes.

De plus si je compare la structure donné pour mysql et la celle pour postgresql c'est différent au niveau des champs (sic!)

Je ne trouve pas non plus de structure 'officiel' pour sipreg

YBDOMO
21/05/2012, 09h32
Merci pour ta réponse. J'ai fait celà mais hélas ça ne fonctionne pas pour mes lignes entrantes.

De plus si je compare la structure donné pour mysql et la celle pour postgresql c'est différent au niveau des champs (sic!)

Je ne trouve pas non plus de structure 'officiel' pour sipreg

Bonjour,

Essayer de voir http://www.voip-info.org/wiki/view/Asterisk+sip+mysql+peers

A+

abcinfo
21/05/2012, 15h50
Merci! C'est bien cette table que j'ai... et qui ne semble pas fonctionner...

J'ai l'impression que c'est vraiment ma structure de base sippers qui ne va pas, voici ce que j'ai :


CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(13) NOT NULL,
`ipaddr` varchar(15) DEFAULT NULL,
`port` int(5) DEFAULT NULL,
`regseconds` int(11) DEFAULT NULL,
`defaultuser` varchar(13) DEFAULT NULL,
`fullcontact` varchar(35) DEFAULT NULL,
`regserver` varchar(30) DEFAULT NULL,
`useragent` varchar(20) DEFAULT NULL,
`lastms` int(11) DEFAULT NULL,
`host` varchar(40) DEFAULT NULL,
`type` enum('friend','user','peer') DEFAULT NULL,
`username` varchar(80) NOT NULL,
`context` varchar(40) DEFAULT NULL,
`permit` varchar(40) DEFAULT NULL,
`deny` varchar(40) DEFAULT NULL,
`secret` varchar(40) DEFAULT NULL,
`md5secret` varchar(40) DEFAULT NULL,
`remotesecret` varchar(40) DEFAULT NULL,
`transport` enum('udp','tcp','udp,tcp','tcp,udp') DEFAULT NULL,
`dtmfmode` enum('rfc2833','info','shortinfo','inband','auto') DEFAULT NULL,
`directmedia` enum('yes','no','nonat','update') DEFAULT NULL,
`nat` enum('yes','no','never','route') DEFAULT NULL,
`callgroup` varchar(40) DEFAULT NULL,
`pickupgroup` varchar(40) DEFAULT NULL,
`language` varchar(40) DEFAULT NULL,
`allow` varchar(40) DEFAULT NULL,
`disallow` varchar(40) DEFAULT NULL,
`insecure` varchar(40) DEFAULT NULL,
`trustrpid` enum('yes','no') DEFAULT NULL,
`progressinband` enum('yes','no','never') DEFAULT NULL,
`promiscredir` enum('yes','no') DEFAULT NULL,
`useclientcode` enum('yes','no') DEFAULT NULL,
`accountcode` varchar(40) DEFAULT NULL,
`setvar` varchar(40) DEFAULT NULL,
`callerid` varchar(40) DEFAULT NULL,
`amaflags` varchar(40) DEFAULT NULL,
`callcounter` enum('yes','no') DEFAULT NULL,
`busylevel` int(11) DEFAULT NULL,
`allowoverlap` enum('yes','no') DEFAULT NULL,
`allowsubscribe` enum('yes','no') DEFAULT NULL,
`videosupport` enum('yes','no') DEFAULT NULL,
`maxcallbitrate` int(11) DEFAULT NULL,
`rfc2833compensate` enum('yes','no') DEFAULT NULL,
`mailbox` varchar(40) DEFAULT NULL,
`session-timers` enum('accept','refuse','originate') DEFAULT NULL,
`session-expires` int(11) DEFAULT NULL,
`session-minse` int(11) DEFAULT NULL,
`session-refresher` enum('uac','uas') DEFAULT NULL,
`t38pt_usertpsource` varchar(40) DEFAULT NULL,
`regexten` varchar(40) DEFAULT NULL,
`fromdomain` varchar(40) DEFAULT NULL,
`fromuser` varchar(40) DEFAULT NULL,
`qualify` varchar(40) DEFAULT NULL,
`defaultip` varchar(40) DEFAULT NULL,
`rtptimeout` int(11) DEFAULT NULL,
`rtpholdtimeout` int(11) DEFAULT NULL,
`sendrpid` enum('yes','no') DEFAULT NULL,
`outboundproxy` varchar(40) DEFAULT NULL,
`callbackextension` varchar(40) DEFAULT NULL,
`registertrying` enum('yes','no') DEFAULT NULL,
`timert1` int(11) DEFAULT NULL,
`timerb` int(11) DEFAULT NULL,
`qualifyfreq` int(11) DEFAULT NULL,
`constantssrc` enum('yes','no') DEFAULT NULL,
`contactpermit` varchar(40) DEFAULT NULL,
`contactdeny` varchar(40) DEFAULT NULL,
`usereqphone` enum('yes','no') DEFAULT NULL,
`textsupport` enum('yes','no') DEFAULT NULL,
`faxdetect` enum('yes','no') DEFAULT NULL,
`buggymwi` enum('yes','no') DEFAULT NULL,
`auth` varchar(40) DEFAULT NULL,
`fullname` varchar(40) DEFAULT NULL,
`trunkname` varchar(40) DEFAULT NULL,
`cid_number` varchar(40) DEFAULT NULL,
`callingpres` enum('allowed_not_screened','allowed_passed_screen ','allowed_failed_screen','allowed','prohib_not_sc reened','prohib_passed_screen','prohib_failed_scre en','prohib') DEFAULT NULL,
`mohinterpret` varchar(40) DEFAULT NULL,
`mohsuggest` varchar(40) DEFAULT NULL,
`parkinglot` varchar(40) DEFAULT NULL,
`hasvoicemail` enum('yes','no') DEFAULT NULL,
`subscribemwi` enum('yes','no') DEFAULT NULL,
`vmexten` varchar(40) DEFAULT NULL,
`autoframing` enum('yes','no') DEFAULT NULL,
`rtpkeepalive` int(11) DEFAULT NULL,
`call-limit` int(11) DEFAULT NULL,
`g726nonstandard` enum('yes','no') DEFAULT NULL,
`ignoresdpversion` enum('yes','no') DEFAULT NULL,
`allowtransfer` enum('yes','no') DEFAULT NULL,
`dynamic` enum('yes','no') DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `ipaddr` (`ipaddr`,`port`),
KEY `host` (`host`,`port`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;

YBDOMO
21/05/2012, 15h59
Re,

Voir http://www.voip-info.org/wiki/view/Asterisk+RealTime+Sip

Attention il semble que l'ordre des champs de la table soient importants

j'ai deux install utilisant Mysql et realtime avec sip_buddies avec asterisk 1.8.4.2 j'ai n'ai eu de souci

A+

abcinfo
21/05/2012, 17h27
Cette table ne semble pas correspondre à la version 1.8, ce qui est etrange c'est que allow et avant deny, si je change l'ordre en mettant deny avant allow (ce qui devrais etre le cas normalement) mon fournisseur sip me reponds :

[May 21 17:34:01] ERROR[19854]: tcptls.c:397 ast_tcptls_client_start: Unable to connect SIP socket to 91.121.129.20:5060: Connection refused

abcinfo
21/05/2012, 22h01
Re,

Voir http://www.voip-info.org/wiki/view/Asterisk+RealTime+Sip


A+

Je viens de tester et cette jolie table me renvois cette erreur :

chan_sip.c:20569 handle_response_invite: Failed to authenticate on INVITE to XXX ...

abcinfo
21/05/2012, 23h54
Désolé pour ce double post mais avec la structure de table ci-dessous j'obtiens cette erreur :

[May 21 23:56:54] WARNING[23235]: chan_sip.c:5392 sip_call: No audio format found to offer. Cancelling call to xxxxxxxxxx

CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(13) NOT NULL,
`ipaddr` varchar(15) DEFAULT NULL,
`port` int(5) DEFAULT NULL,
`regseconds` int(11) DEFAULT NULL,
`defaultuser` varchar(13) DEFAULT NULL,
`fullcontact` varchar(35) DEFAULT NULL,
`regserver` varchar(30) DEFAULT NULL,
`useragent` varchar(20) DEFAULT NULL,
`lastms` int(11) DEFAULT NULL,
`host` varchar(40) DEFAULT NULL,
`type` enum('friend','user','peer') DEFAULT NULL,
`username` varchar(80) NOT NULL,
`context` varchar(40) DEFAULT NULL,
`permit` varchar(40) DEFAULT NULL,
`deny` varchar(40) DEFAULT NULL,
`secret` varchar(40) DEFAULT NULL,
`md5secret` varchar(40) DEFAULT NULL,
`remotesecret` varchar(40) DEFAULT NULL,
`transport` enum('udp','tcp','udp,tcp','tcp,udp') DEFAULT NULL,
`dtmfmode` enum('rfc2833','info','shortinfo','inband','auto') DEFAULT NULL,
`directmedia` enum('yes','no','nonat','update') DEFAULT NULL,
`nat` enum('yes','no','never','route') DEFAULT NULL,
`callgroup` varchar(40) DEFAULT NULL,
`pickupgroup` varchar(40) DEFAULT NULL,
`language` varchar(40) DEFAULT NULL,
`allow` varchar(40) DEFAULT NULL,
`disallow` varchar(40) DEFAULT NULL,
`insecure` varchar(40) DEFAULT NULL,
`trustrpid` enum('yes','no') DEFAULT NULL,
`progressinband` enum('yes','no','never') DEFAULT NULL,
`promiscredir` enum('yes','no') DEFAULT NULL,
`useclientcode` enum('yes','no') DEFAULT NULL,
`accountcode` varchar(40) DEFAULT NULL,
`setvar` varchar(40) DEFAULT NULL,
`callerid` varchar(40) DEFAULT NULL,
`amaflags` varchar(40) DEFAULT NULL,
`callcounter` enum('yes','no') DEFAULT NULL,
`busylevel` int(11) DEFAULT NULL,
`allowoverlap` enum('yes','no') DEFAULT NULL,
`allowsubscribe` enum('yes','no') DEFAULT NULL,
`videosupport` enum('yes','no') DEFAULT NULL,
`maxcallbitrate` int(11) DEFAULT NULL,
`rfc2833compensate` enum('yes','no') DEFAULT NULL,
`mailbox` varchar(40) DEFAULT NULL,
`session-timers` enum('accept','refuse','originate') DEFAULT NULL,
`session-expires` int(11) DEFAULT NULL,
`session-minse` int(11) DEFAULT NULL,
`session-refresher` enum('uac','uas') DEFAULT NULL,
`t38pt_usertpsource` varchar(40) DEFAULT NULL,
`regexten` varchar(40) DEFAULT NULL,
`fromdomain` varchar(40) DEFAULT NULL,
`fromuser` varchar(40) DEFAULT NULL,
`qualify` varchar(40) DEFAULT NULL,
`defaultip` varchar(40) DEFAULT NULL,
`rtptimeout` int(11) DEFAULT NULL,
`rtpholdtimeout` int(11) DEFAULT NULL,
`sendrpid` enum('yes','no') DEFAULT NULL,
`outboundproxy` varchar(40) DEFAULT NULL,
`callbackextension` varchar(40) DEFAULT NULL,
`registertrying` enum('yes','no') DEFAULT NULL,
`timert1` int(11) DEFAULT NULL,
`timerb` int(11) DEFAULT NULL,
`qualifyfreq` int(11) DEFAULT NULL,
`constantssrc` enum('yes','no') DEFAULT NULL,
`contactpermit` varchar(40) DEFAULT NULL,
`contactdeny` varchar(40) DEFAULT NULL,
`usereqphone` enum('yes','no') DEFAULT NULL,
`textsupport` enum('yes','no') DEFAULT NULL,
`faxdetect` enum('yes','no') DEFAULT NULL,
`buggymwi` enum('yes','no') DEFAULT NULL,
`auth` varchar(40) DEFAULT NULL,
`fullname` varchar(40) DEFAULT NULL,
`trunkname` varchar(40) DEFAULT NULL,
`cid_number` varchar(40) DEFAULT NULL,
`callingpres` enum('allowed_not_screened','allowed_passed_screen ','allowed_failed_screen','allowed','prohib_not_sc reened','prohib_passed_screen','prohib_failed_scre en','prohib') DEFAULT NULL,
`mohinterpret` varchar(40) DEFAULT NULL,
`mohsuggest` varchar(40) DEFAULT NULL,
`parkinglot` varchar(40) DEFAULT NULL,
`hasvoicemail` enum('yes','no') DEFAULT NULL,
`subscribemwi` enum('yes','no') DEFAULT NULL,
`vmexten` varchar(40) DEFAULT NULL,
`autoframing` enum('yes','no') DEFAULT NULL,
`rtpkeepalive` int(11) DEFAULT NULL,
`call-limit` int(11) DEFAULT NULL,
`g726nonstandard` enum('yes','no') DEFAULT NULL,
`ignoresdpversion` enum('yes','no') DEFAULT NULL,
`allowtransfer` enum('yes','no') DEFAULT NULL,
`dynamic` enum('yes','no') DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `ipaddr` (`ipaddr`,`port`),
KEY `host` (`host`,`port`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;


(12, '5', NULL, NULL, NULL, 'COMPTE_SIP', NULL, NULL, NULL, NULL, 'sip.ovh.fr', 'peer', 'COMPTE_SIP', '5', NULL, NULL, 'MDP_SIP', NULL, NULL, 'tcp,udp', 'rfc2833', NULL, 'no', NULL, NULL, NULL, 'g729;ilbc;gsm;ulaw;alaw', 'all', 'port,invite', NULL, NULL, NULL, NULL, NULL, NULL, 'COMPTE_SIP', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'sip.ovh.fr', 'COMPTE_SIP', 'yes', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);


On dirais que le serveur sip ne reçoit aucun codec en allow, en effet allow et avant disallow... mais si j’inverse alors je reçoit :

[May 21 17:34:01] ERROR[19854]: tcptls.c:397 ast_tcptls_client_start: Unable to connect SIP socket to 91.121.129.20:5060: Connection refused


J'ai beau changer de version, de structure de table ou tout ce que je veut je n'arrive pas a me connecter sur le trunk en realtime....

abcinfo
26/05/2012, 10h56
Personne n'a d'idée?

Reaper
26/05/2012, 22h36
Active le debug max, er regarde les traces.

abcinfo
27/05/2012, 03h56
J'ai fait un test avec une config en realtime, et une config en static, voici ce qui est retourné en realtime :


* Name : 5
Realtime peer: Yes, cached
Secret : <Set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : 5
Subscr.Cont. : <Not set>
Language : fr
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
Callgroup :
Pickupgroup :
Mailbox :
VM Extension : asterisk
LastMsgsSent : 32767/65535
Call limit : 0
Dynamic : No
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : -1
Insecure : no
Nat : Always
ACL : No
T.38 support : No
T.38 EC mode : Unknown
T.38 MaxDtgrm: -1
DirectMedia : Yes
PromiscRedir : No
User=Phone : No
Video Support: No
Text Support : No
Ign SDP ver : No
Trust RPID : No
Send RPID : No
Subscriptions: Yes
Overlap dial : Yes
Forward Loop : Yes
DTMFmode : info
Timer T1 : 500
Timer B : 32000
ToHost : sip.ovh.fr
Addr->IP : 91.121.129.20 Port 5060
Defaddr->IP : 0.0.0.0 Port 5060
Prim.Transp. : UDP
Allowed.Trsp : UDP
Def. Username:
SIP Options : (none)
Codecs : 0x8000e (gsm|ulaw|alaw|h263)
Codec Order : (none)
Auto-Framing : No
100 on REG : No
Status : UNKNOWN
Useragent :
Reg. Contact :
Qualify Freq : 60000 ms
Sess-Timers : Accept
Sess-Refresh : uas
Sess-Expires : 1800 secs
Min-Sess : 90 secs
Parkinglot :


en static :


* Name : 2
Realtime peer: No
Secret : <Set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : 2
Subscr.Cont. : <Not set>
Language : fr
AMA flags : Unknown
Transfer mode: open
CallingPres : Presentation Allowed, Not Screened
FromDomain : sip.ovh.fr
Callgroup :
Pickupgroup :
Mailbox :
VM Extension : asterisk
LastMsgsSent : 32767/65535
Call limit : 0
Dynamic : No
Callerid : "" <>
MaxCallBR : 384 kbps
Expire : -1
Insecure : port,invite
Nat : Always
ACL : No
T.38 support : No
T.38 EC mode : Unknown
T.38 MaxDtgrm: -1
DirectMedia : No
PromiscRedir : No
User=Phone : No
Video Support: No
Text Support : No
Ign SDP ver : No
Trust RPID : No
Send RPID : No
Subscriptions: Yes
Overlap dial : Yes
Forward Loop : Yes
DTMFmode : rfc2833
Timer T1 : 500
Timer B : 32000
ToHost : sip.ovh.fr
Addr->IP : 91.121.129.20 Port 5060
Defaddr->IP : 0.0.0.0 Port 5060
Prim.Transp. : UDP
Allowed.Trsp : UDP
Def. Username: 003xxxxxxxxxxx
SIP Options : (none)
Codecs : 0x100 (g729)
Codec Order : (g729:20)
Auto-Framing : No
100 on REG : No
Status : OK (5 ms)
Useragent :
Reg. Contact :
Qualify Freq : 60000 ms
Sess-Timers : Accept
Sess-Refresh : uas
Sess-Expires : 1800 secs
Min-Sess : 90 secs
Parkinglot :


Le Def. Username n'est pas rempli, je pense que c'est a cause de ça que ma config en realtime ne fonctionne pas, j'ai tenté de remplir de nombreux champs de ma bdd, mais rien n'y fait....

Je suis redescendu en version 1.6.12. aucune amelioration

je suis au bord de la depression :/

abcinfo
27/05/2012, 15h45
J'ai trouvé !!!!!

Il suffisait tout simplement de renseigner le champ username de la table sipregs, vraiment tout bete....

etann38
06/01/2013, 21h41
Bonjour,
Je cherche aussi à utiliser realtime pour stocker mes comptes sip et mes trunks sip en base de donnée mysql...
Et je suis aussi un peu en galère pour trouver la bonne structure qui fonctionne.
si vous avez réussi à résoudre votre problème, pourriez vous m'en faire part ?
Merci !