[pjsip] Call between 2 accounts in the same pjsip application

Benny Prijono bennylp at pjsip.org
Tue Feb 19 09:16:18 EST 2008

On 2/19/08, jorge.amador at withus.pt <jorge.amador at withus.pt> wrote:
> Hi Benny,
> I've been looking at the output in this situation and I've noticed
> that when I make a call from account 0 to account 1 the URI isn't in
> fact, as you suggested, the same. I have the following accounts:
> Account list:
>    [ 0] sip:+351302013894 at myserver: 200/OK (expires=52)
>         Online status: Offline
>   *[ 1] sip:+351302007329 at myserver: 200/OK (expires=52)
>         Online status: Offline

Just not that from above output, account #1 is marked as the active
account (see the star / "*" character next to it), so if you make a
new call, the call will use that account instead. Effectively you're
making call from account #1 to itself, as the log below shows.

> When I make the call from account 0 to account 1 the following happens:
> 13:15:52.668    pjsua_app.c Call 1 state changed to INCOMING
> 13:15:52.668    pjsua_app.c Incoming call for account 0!
> From: <sip:+351302007329 at myserver>
> To: <sip:302007329 at myserver>
> Press a to answer or h to reject call
> What's missing is the country code in "To: <sip:302007329 at myserver>".
> This doesn't happen when I call this account via mobile or any other
> netmork because what appears in this cases is "To:
> <sip:+351302007329 at myserver>". Does pjsip strip off the country code
> when it makes a call? Thanks,

No, pjsip should never do that. In fact pjsip does not have any idea
what a country code is! So I would guess that your server must have
done it.

And when the incoming URI doesn't match any accounts, the matching
will be done on the domain part only, and the first domain that
matches (account #0 in this case) will be selected.

That's why having two accounts with the same domain generally is not a
good idea.


> Jorge
> P.S. Sorry about the Cc, I didn't noticed. Hope it doesn't happen this time.

More information about the pjsip mailing list