[asterisk-users] How to send a SIP MESSAGE outside a call

Tiago Vasconcelos tiago.o.vasconcelos at gmail.com
Sat Jul 28 10:38:42 CDT 2012


Hello

My provider allows to activate/deactivate a forwarding rule by sending a 
SIP MESSAGE. This is done outside a call. That is, while there is no 
ongoing call, a SIP client just sends the following message:

    MESSAGE sip:543951354657 at callfwd.sip.providerx.com SIP/2.0
    Call-ID: b9ba106e-613a-46b9-8a4d-0efb4dc0a0f2
    CSeq: 1 MESSAGE
    To: <sip:543951354657 at callfwd.sip.providerx.com>
    From: "543951354657" <sip:543951354657 at sip.providerx.com>;tag=...
    Max-Forwards: 70
    Supported: 100rel
    User-Agent: ProviderX-SoftPhone
    Accept: text/plain
    X-Movial-Content: application/x-movial-control;forwarding=true
    Content-Length: 0
    Via: SIP/2.0/UDP 192.168.8.72:5062;branch=z9hG4bK-.....


If successful, the server will respond with a message like the following:

    SIP/2.0 200 OK
    Call-ID: b9ba106e-613a-46b9-8a4d-0efb4dc0a0f2
    CSeq: 1 MESSAGE
    To: <sip:543951354657 at callfwd.sip.optimus.pt>;tag=0f315726
    From: "543951354657"<sip:543951354657 at sip.optimus.pt>;tag=...
    Via: SIP/2.0/UDP 192.168.8.72:5062;branch=z9hG4bK...
    Content-Length: 0
    P-Charging-Vector: icid-value=2ad48aa502d9e80240a5da2efac9029e
    X-Movial-DisplayError: false


Basically, to activate the forwarding I need to send a MESSAGE with the 
header:

    X-Movial-Content: application/x-movial-control;forwarding=true

while to deactivate the forwarding the MESSAGE header must be:

    X-Movial-Content: application/x-movial-control;forwarding=false


I have very little experience with AMI and AGI but, from what I've read 
so far, neither of them seem to provide any function to send a SIP 
MESSAGE with custom headers...
How can I send a MESSAGE like this from Asterisk?


Thanks,
--
Tiago




More information about the asterisk-users mailing list