Dear Aaron,
It would be nice if you invoked a script upon the end of a call (incoming and outgoing). Currently you have two dialplans assigned to every SIP account: "In" and "Out". I'm suggesting yet another script, "Call ended".
Ideally, I'd like to get the call direction in sys.In / sys.Out and other details in req.Header and req.User, as it was at the time the call was established. If it's not possible, it would be enough to get some call-id, I'd save whatever parameters I need using Marshal.dump / DBWrite and restored them later with DBRead / Marshal.load.
Sincerely,
Mike
"Call ended" Ruby script
Re: "Call ended" Ruby script
What is Marshal.dump ?
And if you want the connection data, the bridgeID gives you access to the incoming & outgoing account info, call length, ring time, etc. Well, through the REST api, at least.
And if you want the connection data, the bridgeID gives you access to the incoming & outgoing account info, call length, ring time, etc. Well, through the REST api, at least.
Help document SIP Sorcery on the wiki!
If you solved an issue you were having or figured out how to do something, please share on the wiki! It will save everyone lots of time and frustration.
If you solved an issue you were having or figured out how to do something, please share on the wiki! It will save everyone lots of time and frustration.
Re: "Call ended" Ruby script
Look for the Marshal module description on the net. Note that _load and _dump hook methods have been replaced with marshal_dump and marshal_load (starting from Ruby 1.8, if I'm not wrong).
I know of several methods of retrieving of the call-id (guess that yours works only if called from ensure or rescue because call-id doesn't exist when you initiate the call with sys.Dial). Anyway, I need something I could use to identify the call which has just ended and if Aaron's willing to implement all this, he'll need to document the way of doing it.
I know of several methods of retrieving of the call-id (guess that yours works only if called from ensure or rescue because call-id doesn't exist when you initiate the call with sys.Dial). Anyway, I need something I could use to identify the call which has just ended and if Aaron's willing to implement all this, he'll need to document the way of doing it.