[Kamailio-Users] new feature: send sip requests from config file

Daniel-Constantin Mierla miconda at gmail.com
Fri Jan 16 13:42:26 CET 2009



On 01/16/2009 02:28 PM, Iñaki Baz Castillo wrote:
> 2009/1/16 Daniel-Constantin Mierla <miconda at gmail.com>:
>   
>> Hello,
>>
>> uac module provides a new function that allow sending sip requests from
>> configuration file:
>> - uac_send_req()
>> http://kamailio.org/docs/modules/devel/uac.html#id2467912
>>
>> It opens the door for a new bunch of things you can do now.
>>     
>
> How! This is becoming a B2BUA XD
>   

just 1UA so far...


>> I can think
>> of now:
>> 1) send IM alerts on special events
>>
>> route {
>>  $uac_req(method)="MESSAGE";
>>  $uac_req(ruri)="sip:alert at kamailio.org";
>>  $uac_req(furi)="sip:server at kamailio.org";
>>  $uac_req(hdrs)="Content-Type: text/plain\r\n";
>>  $uac_req(body)="SIP request from:" + $si + ":" + $sp;
>>  uac_send_req();
>> }
>>     
>
>
> Just a question: after sending the above MESSAGE, will the process
> wait for a reply to that MESSAGE?
no, the process will not wait. To get the insight, it is like msilo 
sending stored messages upon receiving the REGISTER. The reply will come 
in another process.

>  if so, could I access to the MESSAGE
> reply code and reason?
>   
You can, in default onreply route, with some trick (be carefully here) 
in local_route or sending the request to the proxy via $uac_req(ouri) 
and then process and arm onreply/failure route.

These for now, as the module has inside design for running onreply_route 
when reply is received, just that needs some fix for local timeout case 
(no reply received). To be added in the future.

>>  if(method=="ACCOUNTING" && $rU="store")
>>     
>
> method "ACCOUNTING" !!??  Hum, I should warn IETF people about it XD
>   
:-)

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com





More information about the sr-users mailing list