Make registration and receive an incoming call - what is the proper way!?

60 views
Skip to first unread message

SIP Inspector

unread,
Nov 14, 2018, 11:50:52 AM11/14/18
to SIP Inspector
This topic comes a lot and it's good to discuss it here.

Q: How do I create an outgoing registration and then wait for an incoming call?

A: Many try to get this working by simply creating a scenario that goes like this:
     ---> REGISTER
     <--- 200
     <--- INVITE
     ...

This approach may not work cause REGISTER and INVITEs do belong to different
dialogs. And where logically you expect to receive an INVITE the program will
show an unexpected message since it expects it to be part of a dialog
established by REGISTER, yet the Call-ID in INVITE is different from REGISTER
and hence an unexpected message is reported.

The second iteration would be to add a "New Dialog". Something like this:
    ---> REGISTER
    <--- 200
    New Dialog
    <--- INVITE
    ...

There is a problem with this approach too. Usually, users want to register a
number to the server and then expect an incoming call. While "New Dialog"
addresses the concept of a new dialog which is good. The problem is that once the 
registration cycle is done, the program stops engaging in further SIP signaling. "New Dialog"
here simply indicates that mandatory dialog message exchange is over and therefore program
quits listening any new incoming messages.


Possible solutions to the problem:
a) 
    ---> REGISTER
    <--- 200
    New Dialog
    ---- Pause[ms]=30000
    <--- INVITE
    ...

By injecting a 30-second pause the program will wait for 30 seconds for an
incoming call to follow registration. During these 30 seconds, all new incoming
calls will be handled. Once 30 seconds expire the program will not handle
incoming call anymore. This may be acceptable in certain cases but not always.

b) The best solution is to write a scenario like this:

    start:
    ---> REGISTER
    <--- 200
    ---- Pause[ms]=60000
    goto start
    New Dialog
    <--- INVITE
    ...

The scenario like this will keep registering number every 600 seconds. The
registration will be happening periodically and within an infinite loop. That way a
real-life registration behavior is achieved and as long the program runs all new incoming
calls are handled. There is no time constraint with respect how quickly after
the registration an incoming call must be received. Nor, there is a time
restriction for how long the scenario will run.

SIP Inspector

unread,
Nov 14, 2018, 1:42:58 PM11/14/18
to SIP Inspector
One correction. The part under a) was supposed to look like this:

    ---> REGISTER
    <--- 200
    ---- Pause[ms]=30000

meihu...@gmail.com

unread,
Apr 22, 2019, 1:50:42 PM4/22/19
to SIP Inspector
But  SIP Inspector v3.22 does not have this probem.
Reply all
Reply to author
Forward
0 new messages