Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] store sofia profile_name and hostname in


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
leon at scarlet-intern...
Guest





PostPosted: Tue Sep 23, 2008 11:24 am    Post subject: [Freeswitch-users] store sofia profile_name and hostname in Reply with quote

Hi all,

I'd like to keep track of on what switch and sofia profile_name a UA
is registered. By default, FS automatically creates a table
sip_registrations without these fields, so I started looking in
mod_sofia to see whether the fields could be added, and to my
surprise, I saw they should already be inserted (along with
presence_hosts) !

sofia_reg.c in function sofia_reg_handle_register at line 774:

sql = switch_mprintf("insert into sip_registrations "

"(call_id
,sip_user
,sip_host
,presence_hosts
,contact
,status
,rpid
,expires,user_agent,server_user,server_host,profile_name,hostname) "
"values ('%q','%q', '%q','%q','%q','%q', '%q', %ld,
'%q', '%q', '%q', '%q', '%q')",
call_id, to_user, reg_host, profile->presence_hosts ?
profile->presence_hosts : reg_host,
contact_str, reg_desc, rpid, (long)
switch_timestamp(NULL) + (long) exptime * 2,
agent, from_user, guess_ip4, profile->name,
mod_sofia_globals.hostname);

(Is that the right spot ?)

So I tried just adding the fields as VARCHAR(255)'s to the table, and
restarted the switch. It coredumped (for the first time btw), so I
guessed the NULL values for the already present registrations were to
blame, so I emptied the sip_registrations table and restarted. It
started alright, but then gave errors on registrations this:

2008-09-23 17:57:26 [ERR] sofia_glue.c:2880
sofia_glue_actually_execute_sql() ERR: [insert into sip_registrations
values ('446BD213B8D1111@172.16.42.124',
'00A0C5D4C03A-1','scarlet.nl','"user" <sip:
00A0C5D4C03A-1@213.204.223.35:63747;fs_nat=yes>','Registered(UDP-
NAT)', 'unknown', 1222192646, 'dunno', '00A0C5D4C03A-1',
'213.204.232.18')]
[STATE: HY000 CODE 1136 ERROR: [unixODBC][MySQL][ODBC 3.51 Driver]
[mysqld-5.0.51a-3ubuntu5.1]Column count doesn't match value count at
row 1
]

How can this be ? This query is very different from the one before...

Is it already possible to save the hostname and sip_registrations (and
presence_hosts) somehow ?

thanks,

Leon de Rooij
leon@scarlet-internet.nl

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services