Earlier we discussed about setting specific SIP headers in calls generated by API.
Some voice carriers set specific requirements of how SIP sessions should be set and maintained. For example, there might be requirement to update call state information every given number of minutes during active call to indicate that the call is still alive. If the caller party does not issue call update every at predetermined time frames, the session is considered closed, and call is disconnected.
To update call status, SIP method UPDATE
is used. Here is an example of SIP INVITE
with subsequent UPDATE
sent later within call:
And later, in the call:
To which the other party replies with:
Important to note, that in order for other party to properly identify the call which is being updated, it is essential to send proper request URI
and Call-ID
header value.
Now, in the context of API, the call request send a voice call callback request with update every 15 minutes on both call legs, the request will look like this:
The attribute sip_update
takes integer value in seconds and asks to send SIP UPDATE
every 900 seconds to the both parties.
Finally, let's look at slightly more complex example: SIP UPDATE
and Privacy
headers request:
The above example will set privacy headers to their proper, E.164 formatted values for call routing and rating purposes, while keeping their shorter, informal IDs in “from” fields, as well as send SIP UPDATE
every 15 minutes to both call legs.