[Asterisk-Users] Realtime does not work yet, ...

Ronald Wiplinger ronald at elmit.com
Sat Mar 12 08:27:16 MST 2005


Mark  & Matthew,

I know how frustrating it may be, ...
I can imagine your feelings, ...

HOWEVER, with all respect, it does not help me to fix my problem!

Can we come back to the subject, please?

I apologies for the missing words "for me" in the Subject!

I tried to follow (and may made some mistakes) all what was explained at 
the wiki.

I have taken out one of my sip phones chapter and put this one as one 
record into the database. I fixed to add that it uses the right sock. (I 
do not understand why it was looking in /tmp instead reading  
/etc/my.ini to find it)
Added in res_mysql.conf:
dbport = 3306
dbsock = =/var/lib/mysql/mysql.sock


I check if the record is in the mysql database:
mysql> select * from sip_buddies where name='621';
+----+------+-------------+----------+-----------+--------------+-------------+---------+-----------+----------+----------+------------+---------+---------------+---------------+----------+----------+-----------+-----------+-----+--------+------+------+-------------+------+---------+-------------+------------+----------------+-----------+--------+----------+-----------+----------+-------------+------------+--------+----------------+
| id | name | accountcode | amaflags | callgroup | callerid     | 
canreinvite | context | defaultip | dtmfmode | fromuser | fromdomain | 
host    | incominglimit | outgoinglimit | insecure | language | 
mailbox   | md5secret | nat | permit | deny | mask | pickupgroup | port 
| qualify | restrictcid | rtptimeout | rtpholdtimeout | secret    | 
type   | username | allow     | disallow | musiconhold | regseconds | 
ipaddr | cancallforward |
+----+------+-------------+----------+-----------+--------------+-------------+---------+-----------+----------+----------+------------+---------+---------------+---------------+----------+----------+-----------+-----------+-----+--------+------+------+-------------+------+---------+-------------+------------+----------------+-----------+--------+----------+-----------+----------+-------------+------------+--------+----------------+
|  1 | 621  | NULL        | NULL     | NULL      | "Demo" <621> | 
yes         | inhouse | NULL      | rfc2833  | NULL     | NULL       | 
dynamic |          NULL |          NULL | NULL     | NULL     | 
621 at other | NULL      |   1 | NULL   | NULL | NULL | 1           |      
| 999     | NULL        | NULL       | NULL           | Password | 
friend | 621      | ulaw;alaw | all      | NULL        |          0 
|        | yes            |
+----+------+-------------+----------+-----------+--------------+-------------+---------+-----------+----------+----------+------------+---------+---------------+---------------+----------+----------+-----------+-----------+-----+--------+------+------+-------------+------+---------+-------------+------------+----------------+-----------+--------+----------+-----------+----------+-------------+------------+--------+----------------+
1 row in set (0.00 sec)

I restarted (not just reloaded) Asterisk and the first message Asterisk 
tells me is:
The 'sipfriends' table is obsolete, update your config to use sipusers 
and sippeers, though they can point to the same table.

extconfig.conf:

sipfriends => mysql,astconf,sip_buddies
sipusers => mysql,astconf,sip_buddies
sippeers => mysql,astconf,sip_buddies

To remark the line sipfriends stopped the first line message!


"sip show users" and "sip show peers"   does not show the phone, but 
that maybe is normal, since as I understand the database concept it will 
only asked if there should be a phone! (Correct me if I am wrong, please)

To make a phone call from 601 to 621 gives me a "person .. is unavailable":
    -- Executing Dial("SIP/601-9e81", "SIP/621|60|Ttrm") in new stack
Mar 12 22:49:41 NOTICE[25640]: app_dial.c:927 dial_exec_full: Unable to 
create channel of type 'SIP' (cause 3)
  == Everyone is busy/congested at this time (1:0/1/0)


A call from 621 to 601, however, gives me a connection!!!
    -- Executing Dial("SIP/621-8cc5", "SIP/601|60|tr") in new stack
    -- Called 601
    -- SIP/601-c558 is ringing
  == Spawn extension (inhouse, 601, 1) exited non-zero on 'SIP/621-8cc5'

"sip show users" and "sip show peers" still do not show anything.

/var/log/astersisk/debug shows for the seconds of these events:


Mar 12 22:49:41 DEBUG[25640]: Check for res for 601
Mar 12 22:49:41 DEBUG[25640]: build_route: Contact hop: 
<sip:601 at 61.220.121.190:5060;user=phone;transport=udp>
Mar 12 22:49:41 DEBUG[25640]: Setting NAT on RTP to 524288
Mar 12 22:49:41 DEBUG[25640]: ##### Testing 61.220.121.190 with 192.168.0.0
Mar 12 22:49:41 DEBUG[25640]: Target address 61.220.121.190 is not 
local, substituting externip
Mar 12 22:49:41 DEBUG[25640]: Stopping retransmission on 
'770042f237a0503b54b0a15e65a561b3 at 61.220.121.200' of Request 102: Found
Mar 12 22:49:41 DEBUG[25640]: Stopping retransmission on 
'25e4f8d00a1cec07216e7eb6473a2a18 at 61.220.121.200' of Request 102: Found
Mar 12 22:49:41 DEBUG[25640]: MySQL RealTime: Retrieve SQL: SELECT * 
FROM sip_buddies WHERE name = '621'
Mar 12 22:49:41 DEBUG[25640]: MySQL RealTime: Everything is fine.
Mar 12 22:49:41 DEBUG[25640]: Unable to find key '621' in family 
'SIP/Registry'
Mar 12 22:49:41 DEBUG[25640]: Setting NAT on RTP to 524288
Mar 12 22:49:41 DEBUG[25640]: Exiting with DIALSTATUS=CONGESTION.
Mar 12 22:49:41 DEBUG[25640]: 
/var/spool/asterisk/voicemail/other/621/unavail doesn't exist, doing 
what we can



Mar 12 22:51:10 DEBUG[25640]: Check for res for 621
Mar 12 22:51:10 DEBUG[25640]: build_route: Contact hop: 
<sip:621 at 203.70.36.26:65188>
Mar 12 22:51:10 DEBUG[25640]: MySQL RealTime: Retrieve SQL: SELECT * 
FROM sip_buddies WHERE name = '621'
Mar 12 22:51:10 DEBUG[25640]: MySQL RealTime: Everything is fine.
Mar 12 22:51:10 DEBUG[25640]: Unable to find key '621' in family 
'SIP/Registry'
Mar 12 22:51:10 DEBUG[25640]: Setting NAT on RTP to 524288
Mar 12 22:51:10 DEBUG[25640]: ##### Testing 61.220.121.190 with 192.168.0.0
Mar 12 22:51:10 DEBUG[25640]: Target address 61.220.121.190 is not 
local, substituting externip
Mar 12 22:51:10 DEBUG[25640]: Outgoing Call for 601
Mar 12 22:51:10 DEBUG[25640]: (Provisional) Stopping retransmission (but 
retaining packet) on '11b7db9b3a80f3f42eee33f21068beb7 at 61.220.121.200' 
Request 102: Found
Mar 12 22:51:11 DEBUG[25640]: (Provisional) Stopping retransmission (but 
retaining packet) on '11b7db9b3a80f3f42eee33f21068beb7 at 61.220.121.200' 
Request 102: Found
Mar 12 22:51:11 DEBUG[25640]: ##### Testing 147.135.0.128 with 192.168.0.0
Mar 12 22:51:11 DEBUG[25640]: Target address 147.135.0.128 is not local, 
substituting externip
Mar 12 22:51:11 DEBUG[25640]: Scheduled a registration timeout # 35674
Mar 12 22:51:11 DEBUG[25640]: Stopping retransmission on 
'2230c8cf642d9ba77dc3d25c7f59b89b at 192.168.250.200' of Request 125: Found
Mar 12 22:51:11 DEBUG[25640]: Registration successful
Mar 12 22:51:11 DEBUG[25640]: Cancelling timeout 35674
Mar 12 22:51:12 DEBUG[25640]: ##### Testing 147.135.0.128 with 192.168.0.0
Mar 12 22:51:12 DEBUG[25640]: Target address 147.135.0.128 is not local, 
substituting externip
Mar 12 22:51:12 DEBUG[25640]: Stopping retransmission on 
'07b682335530583778edebf037709c59 at 61.220.121.200' of Request 102: Found
Mar 12 22:51:14 DEBUG[25640]: update_user_counter(601) - decrement 
outUse counter
Mar 12 22:51:14 DEBUG[25640]: Exiting with DIALSTATUS=CANCEL.
Mar 12 22:51:14 DEBUG[25640]: cdr_mysql: inserting a CDR record.
Mar 12 22:51:14 DEBUG[25640]: cdr_mysql: SQL command as follows:  INSERT 
INTO cdr 
(calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid) 
VALUES ('2005-03-12 22:51:10','\"Demo\" <621>','621','601','inhouse', 
'SIP/621-8cc5','SIP/601-c558','Dial','SIP/601|60|tr',4,0,'NO 
ANSWER',3,'','1110639070.32')



bye

Ronald




More information about the asterisk-users mailing list