Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - smbakhtiar

Pages: [1]
1
Yate users hangout place / Send SIP call to gsm mobile
« on: April 12, 2013, 11:58:58 AM »
Dear All,

How do i send sip call to gsm mobile.

Bakhtiar

2
Yate users hangout place / Problem Implementing call fork rotate
« on: April 07, 2013, 03:32:55 AM »
Dear All,

I am facing problem to implementing "fork rotate" funcation in register.conf file.Here is my sql statement how do i implement

SELECT 'fork rotate sip/sip:1@host1 h323/2@host2 | sip/sip:3@host3' AS location

is i do any mistake

Bakhtiar






3
Hi All,

I want to configure user from database and the using that user i have to call on a another user and the user have a call expire time.After a duration of call the call will be disconnected automatically.Here is the design what i making of this.

1.using SIP protocol
2.Mysql Database


Bakhtiar

4
Yate users hangout place / Yate client cannot connect to the server
« on: March 11, 2013, 05:48:11 AM »
Hi all,

I am unable to connect using Yate client to my server using SIP .

Thanks
Bakhtiar

5
Other Yate server issues / Cann't Store cdr information in MySql database
« on: February 18, 2013, 12:07:37 PM »
Hi

For testing i have to configure two test account using sip protocol with my 127.0.0.1. What is happening when i call to account1 to account2 then the call information is generating but i cannot store it in mysql db . So here is my configuration what i made in below:

1.create 2 account in regfile.conf
2.in register.conf changes are
     [general]
    expires=30
   stoperror=busy
   user.auth=on
   user.register=on
  user.unregister=on
  engine.timer=on
call.preroute=on
call.route=on
call.cdr=om

[default]
priority=50
account=yate   
[call.cdr]
 -- Usage of the function in register.conf, only difference in cdr_insert/update and cdr_finalize is the last value for "ended"
cdr_insert=SELECT cdr_upsert(${time}, '${billid}', '${chan}', '${address}', '${caller}', '${callername}', '${called}', ${billtime}, ${ringtime}, ${duration}, '${direction}', '${status}', '${reason}', false);
cdr_update=SELECT cdr_upsert(${time}, '${billid}', '${chan}', '${address}', '${caller}', '${callername}', '${called}', ${billtime}, ${ringtime}, ${duration}, '${direction}', '${status}', '${reason}', false);
cdr_finalize=SELECT cdr_upsert(${time}, '${billid}', '${chan}', '${address}', '${caller}', '${callername}', '${called}', ${billtime}, ${ringtime}, ${duration}, '${direction}', '${status}', '${reason}', true);

also create mysql table using below way

CREATE  TABLE IF NOT EXISTS `cdr` (
  `idcdr` BIGINT NULL AUTO_INCREMENT,
  `sqltime` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
  `yatetime` INT(11) NULL,
  `billid` VARCHAR(55) NOT NULL,
  `chan` VARCHAR(20) NULL,
  `address` CHAR(15) NULL,
  `addressport` CHAR(5) NULL,
  `caller` VARCHAR(55) NULL,
  `callername` VARCHAR(255) NULL,
  `called` VARCHAR(55) NULL,
  `billtime` FLOAT NULL,
  `ringtime` FLOAT NULL,
  `duration` FLOAT NULL,
  `direction` ENUM('incoming','outgoing') NULL,
  `status` VARCHAR(11) NULL,
  `reason` VARCHAR(55) NULL,
  `ended` TINYINT(1) NULL,
PRIMARY KEY (`idcdr`),
INDEX `ix_cdr_sqltime` (`sqltime` ASC))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;


-- A primary key to prevent duplicates on billid and chan
CREATE UNIQUE INDEX uq_cdr_billid_chan ON cdr (billid, chan);


-- A function to use for CDR operations
delimiter $$
CREATE FUNCTION  cdr_upsert (p_yatetime INT(11), p_billid varchar(20), p_chan varchar(20), p_address varchar(21), p_caller varchar(55), p_callername varchar(255), p_called varchar(55), p_billtime float, p_ringtime float,
  p_duration float, p_direction enum('incoming','outgoing'), p_status varchar(11), p_reason varchar(55), p_ended tinyint(1))  RETURNS SMALLINT(1)
BEGIN

  DECLARE i_ended TINYINT(1);
  DECLARE i_address_port VARCHAR(5);

  -- extracting IP and Port
  SET i_address_port = (SUBSTRING(p_address, POSITION(':' IN p_address) + 1));
  SET p_address = (SUBSTRING(p_address, 1, POSITION(':' IN p_address) - 1));

  -- Checking current CDR state, when ended is true, then no update should be done, because cdr_finalize was already called
  SELECT ended INTO i_ended FROM cdr WHERE billid = p_billid AND chan = p_chan FOR UPDATE;

  IF i_ended IS NULL OR i_ended = 0 THEN

    -- perform an UPSERT meaning: try to INSERT the data, if there is a DUPLICATE KEY (uq_cdr_billid_chan which we created ealiert) then do an update on that record instead
    INSERT INTO cdr (sqltime, yatetime, billid, chan, address, addressport, caller, callername, called, billtime, ringtime, duration, direction, status ,reason, ended)
    VALUES (FROM_UNIXTIME(p_yatetime), p_yatetime, p_billid, p_chan, p_address, i_address_port, p_caller, p_callername, p_called, p_billtime, p_ringtime, p_duration,
    p_direction, p_status, p_reason, p_ended) ON DUPLICATE KEY UPDATE sqltime = VALUES(sqltime), yatetime = VALUES(yatetime), address = VALUES(address), addressport = VALUES(addressport),
    caller = VALUES(caller), callername = VALUES(callername), called = VALUES(called), billtime = VALUES(billtime), ringtime = VALUES(ringtime), duration = VALUES(duration),
    direction = VALUES(direction), status = VALUES(status), reason = VALUES(reason),
    ended = VALUES(ended);   

  END IF;

  RETURN 1;
END;
$$
delimiter ;

------------

3. in mysqldb.conf changes are

[yate]
host=localhost
database=test
user=root
password=
port=87

4. in yate.conf  changes

[module]
mysqldb.yate=true
register.yate=true

so here is my configuration . Please help me .if done any mistake.

THANKS

Pages: [1]